Struct rosella::coverage::coverage_table::CoverageTable
source · pub struct CoverageTable {
pub table: Array2<f64>,
pub average_depths: Vec<f64>,
pub contig_names: Vec<String>,
pub contig_lengths: Vec<usize>,
pub sample_names: Vec<String>,
pub output_path: String,
}Fields§
§table: Array2<f64>§average_depths: Vec<f64>§contig_names: Vec<String>§contig_lengths: Vec<usize>§sample_names: Vec<String>§output_path: StringImplementations§
source§impl CoverageTable
impl CoverageTable
pub fn new( table: Array2<f64>, average_depths: Vec<f64>, contig_names: Vec<String>, contig_lengths: Vec<usize>, sample_names: Vec<String>, output_path: String ) -> Self
pub fn filter_by_length( &mut self, min_contig_size: usize ) -> Result<HashSet<String>>
pub fn get_contig_names(&self, indices: &HashSet<usize>) -> HashSet<String>
pub fn filter_by_index( &mut self, indices_to_remove: &HashSet<usize> ) -> Result<HashSet<String>>
sourcepub fn from_file<P: AsRef<Path>>(
file_path: P,
mode: MappingMode
) -> Result<Self>
pub fn from_file<P: AsRef<Path>>( file_path: P, mode: MappingMode ) -> Result<Self>
read a coverage table from a file we specify the mode as a parameter as coverm has different output formats for different modes depending on short/long read inputs
pub fn merge(&mut self, other: Self) -> Result<()>
sourcepub fn merge_many(coverage_tables: Vec<CoverageTable>) -> Result<Self>
pub fn merge_many(coverage_tables: Vec<CoverageTable>) -> Result<Self>
merge multiple coverage tables into one Make sure that the tables have the same contig names in the same order. We also want to be aware of sample name order. We will also need to recalculate average depths
sourcepub fn write<P: AsRef<Path>>(&mut self, output_path: P) -> Result<()>
pub fn write<P: AsRef<Path>>(&mut self, output_path: P) -> Result<()>
Write the coverage table to a file The file will be a tab delimited file with the following columns: contig_name, contig_length, sample1_coverage, sample1_variance, sample2_coverage, sample2_variance, … The first row will be a header row with the sample names
pub fn set_output_path(&mut self, output_path: String)
Auto Trait Implementations§
impl RefUnwindSafe for CoverageTable
impl Send for CoverageTable
impl Sync for CoverageTable
impl Unpin for CoverageTable
impl UnwindSafe for CoverageTable
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.