pub struct Genome {
pub names: Vec<String>,
pub starts: Vec<usize>,
pub ends: Vec<usize>,
pub seq: Vec<u8>,
pub length: usize,
}
Fields
names: Vec<String>
starts: Vec<usize>
ends: Vec<usize>
seq: Vec<u8>
length: usize
Implementations
sourceimpl Genome
impl Genome
pub fn new(records: Records<BufReader<File>>) -> Genome
sourcepub fn from_file(fastafile: &str) -> Genome
pub fn from_file(fastafile: &str) -> Genome
Example
use rustybam::suns::*;
let genome = Genome::from_file(".test/test.fa");
sourcepub fn get_shortest_subseq_size(text: &[u8]) -> Vec<Option<usize>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_shortest_subseq_size(text: &[u8]) -> Vec<Option<usize>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
make an array of the shortest shared substring at each position in the text
Example
use rustybam::suns::*;
let text = b"GCTGCTA$";
let sus = Genome::get_shortest_subseq_size(text);
assert_eq!(
sus,
[Some(4),Some(3),Some(2),Some(4),Some(3),
Some(2),Some(1),Some(1)]
);
sourcepub fn get_longest_perfect_repeats(
&self,
min_length: usize
) -> Vec<(&String, usize, usize)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_longest_perfect_repeats(
&self,
min_length: usize
) -> Vec<(&String, usize, usize)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Example
use rustybam::suns::*;
let genome = Genome::from_file(".test/test.fa");
genome.get_longest_perfect_repeats(5);
sourcepub fn find_intervals(
&self,
sus: Vec<Option<usize>>,
kmer_size: usize
) -> Vec<(usize, usize)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn find_intervals(
&self,
sus: Vec<Option<usize>>,
kmer_size: usize
) -> Vec<(usize, usize)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns a vector of start and end coordiantes that are 100% made of SUNs Coordinates are bed style [). this is raw intervals in Genome.seq
sourcepub fn convert_from_idx(&self, idx: usize) -> Option<(&String, usize)>
pub fn convert_from_idx(&self, idx: usize) -> Option<(&String, usize)>
Example
use rustybam::suns::*;
let genome = Genome::from_file(".test/test.fa");
eprintln!("{:?}", genome.seq);
let rtn = genome.convert_from_idx(20).unwrap();
assert_eq!((&"chr2".to_string(), 0), rtn);
pub fn find_sun_intervals(
&self,
kmer_size: usize
) -> Vec<(&String, usize, usize, &[u8])>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Auto Trait Implementations
impl RefUnwindSafe for Genome
impl Send for Genome
impl Sync for Genome
impl Unpin for Genome
impl UnwindSafe for Genome
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub unsafe fn to_subset_unchecked(&self) -> SS
pub unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.