pub struct Alignment<Kind> {
pub sequence_data: Vec<u8>,
pub rows: usize,
pub cols: usize,
pub ids: Vec<String>,
pub id_to_index: HashMap<String, usize>,
pub _marker: PhantomData<Kind>,
}Fields§
§sequence_data: Vec<u8>§rows: usize§cols: usize§ids: Vec<String>§id_to_index: HashMap<String, usize>§_marker: PhantomData<Kind>Implementations§
Source§impl<Kind> Alignment<Kind>
impl<Kind> Alignment<Kind>
pub fn new(sequence_data: Vec<u8>, rows: usize, ids: Vec<String>) -> Self
pub fn get_row_by_id(&self, id: &str) -> Option<&[u8]>
pub fn remove_columns(&mut self, start: usize, end: usize)
pub fn remove_row_by_number(&mut self, row_idx: usize)
pub fn remove_row_by_id(&mut self, id: &str)
pub fn column_counts(&self, col_idx: usize) -> HashMap<u8, usize>
pub fn all_column_counts(&self) -> Vec<HashMap<u8, usize>>
pub fn is_gap_heavy(&self, col_idx: usize, cutoff: f32) -> bool
pub fn identify_gappy_columns(&self, cutoff: f32) -> Vec<usize>
pub fn purge_gappy_columns(&mut self, cutoff: f32)
pub fn display( &self, row_range: Option<Range<usize>>, col_range: Option<Range<usize>>, ) -> Result<()>
pub fn display_interleaved( &self, row_range: Option<Range<usize>>, col_range: Option<Range<usize>>, block_width: usize, ) -> Result<()>
pub fn subset(&self, rows: Range<usize>, cols: Range<usize>) -> Self
pub fn write_fasta_part<P: AsRef<Path>>( &self, path: P, row_range: Option<Range<usize>>, col_range: Option<Range<usize>>, wrap: Option<usize>, ) -> Result<()>
pub fn write_fasta<P: AsRef<Path>>( &self, path: P, wrap: Option<usize>, ) -> Result<()>
Source§impl Alignment<DNA>
impl Alignment<DNA>
pub fn gc_content_at_col(&self, col_idx: usize) -> f32
pub fn most_frequent_base(&self, column: &[u8]) -> char
pub fn consensus_sequence(&self) -> String
pub fn is_degenerate_site(&self, col_idx: usize, threshold: f32) -> bool
Trait Implementations§
impl<Kind: PartialEq> StructuralPartialEq for Alignment<Kind>
Auto Trait Implementations§
impl<Kind> Freeze for Alignment<Kind>where
PhantomData<Kind>: Freeze,
impl<Kind> RefUnwindSafe for Alignment<Kind>where
PhantomData<Kind>: RefUnwindSafe,
impl<Kind> Send for Alignment<Kind>where
PhantomData<Kind>: Send,
impl<Kind> Sync for Alignment<Kind>where
PhantomData<Kind>: Sync,
impl<Kind> Unpin for Alignment<Kind>where
PhantomData<Kind>: Unpin,
impl<Kind> UnsafeUnpin for Alignment<Kind>where
PhantomData<Kind>: UnsafeUnpin,
impl<Kind> UnwindSafe for Alignment<Kind>where
PhantomData<Kind>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.