pub struct ReferenceReader {
pub current_sequence: Vec<u8>,
pub genomes_and_contigs: GenomesAndContigs,
pub target_lens: HashMap<usize, u64>,
/* private fields */
}Expand description
Struct handling methods to read and handle information for references
indexed_reader represents the #IndexedReader
Fields§
§current_sequence: Vec<u8>§genomes_and_contigs: GenomesAndContigs§target_lens: HashMap<usize, u64>Implementations§
Source§impl ReferenceReader
impl ReferenceReader
pub fn new( concatenated_genomes: &Option<String>, genomes_and_contigs: GenomesAndContigs, _number_of_contigs: usize, ) -> ReferenceReader
pub fn new_with_target_names( concatenated_genomes: &Option<String>, genomes_and_contigs: GenomesAndContigs, target_names: Vec<&[u8]>, ) -> Self
Sourcepub fn new_from_reader_with_reference_index(
reader: &Self,
ref_idx: usize,
) -> Self
pub fn new_from_reader_with_reference_index( reader: &Self, ref_idx: usize, ) -> Self
Somewhat efficient cloning function. Only takes the info needed for a given ref idx
pub fn new_from_reader_with_tid_and_rid( reader: &ReferenceReader, ref_idx: usize, tid: usize, ) -> Self
pub fn get_target_name(&self, tid: usize) -> &[u8] ⓘ
pub fn add_target(&mut self, target: &[u8], tid: usize)
pub fn update_ref_index_tids(&mut self, ref_index: usize, tid: usize) -> usize
pub fn retrieve_tids_for_ref_index( &self, ref_index: usize, ) -> Option<&LinkedHashSet<usize>>
pub fn add_length(&mut self, tid: usize, length: u64)
pub fn add_lengths(&mut self, target_lengths: HashMap<usize, u64>)
pub fn get_contig_length(&self, tid: usize) -> u64
pub fn retrieve_reference_stem(&self, ref_idx: usize) -> String
pub fn update_current_sequence_capacity(&mut self, size: usize)
pub fn update_current_sequence_without_capacity(&mut self)
pub fn retrieve_contig_name_from_tid(&self, tid: usize) -> Option<&Vec<u8>>
pub fn fetch_contig_from_reference_by_contig_name( &mut self, contig_name: &[u8], ref_idx: usize, )
pub fn fetch_contig_from_reference_by_tid( &mut self, tid: usize, ref_idx: usize, ) -> Result<(), Error>
Sourcepub fn fetch_reference_context(
&mut self,
ref_idx: usize,
interval: &SimpleInterval,
)
pub fn fetch_reference_context( &mut self, ref_idx: usize, interval: &SimpleInterval, )
Fetches the reference sequence from a given SimpleInterval The return position is 0-base start and stop inclusive
pub fn read_sequence_to_vec(&mut self)
Trait Implementations§
Source§impl Clone for ReferenceReader
impl Clone for ReferenceReader
Auto Trait Implementations§
impl Freeze for ReferenceReader
impl RefUnwindSafe for ReferenceReader
impl Send for ReferenceReader
impl Sync for ReferenceReader
impl Unpin for ReferenceReader
impl UnwindSafe for ReferenceReader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.