pub struct ReferenceWriter<'a> { /* private fields */ }Expand description
Struct housing methods for writing out genomes when given specific variant information Basically a wrapper for reference reader
Implementations§
Source§impl<'a> ReferenceWriter<'a>
impl<'a> ReferenceWriter<'a>
pub fn new( reference_reader: ReferenceReader, output_prefix: &'a str, ) -> ReferenceWriter<'a>
Sourcepub fn generate_strains(
&mut self,
variant_contexts: Vec<VariantContext>,
ref_idx: usize,
strain_ids_present: Vec<usize>,
)
pub fn generate_strains( &mut self, variant_contexts: Vec<VariantContext>, ref_idx: usize, strain_ids_present: Vec<usize>, )
Generates the potential strain genomes calculated by Lorikeet. The VariantContexts are expected
To be tagged with one or more strain genomes in their attributes with VariantAnnotation::Strain
tag
Sourcepub fn generate_consensus(
&mut self,
variant_contexts: Vec<VariantContext>,
ref_idx: usize,
samples: &[&str],
)
pub fn generate_consensus( &mut self, variant_contexts: Vec<VariantContext>, ref_idx: usize, samples: &[&str], )
Generates the per sample consensus genomes based on the provided variant contexts. The consensus is defined as the most dominant variant at a given position on the reference genome measured by read depth.
pub fn modify_reference_bases_based_on_variant_type( new_bases: &mut Vec<u8>, consensus_allele: ByteArrayAllele, vc: &mut VariantContext, variant_type: VariantType, offset: &mut i64, )
Auto Trait Implementations§
impl<'a> Freeze for ReferenceWriter<'a>
impl<'a> RefUnwindSafe for ReferenceWriter<'a>
impl<'a> Send for ReferenceWriter<'a>
impl<'a> Sync for ReferenceWriter<'a>
impl<'a> Unpin for ReferenceWriter<'a>
impl<'a> UnwindSafe for ReferenceWriter<'a>
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<T> Pointable for T
impl<T> Pointable for T
Source§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.