pub struct FastxRecords<T> { /* private fields */ }Expand description
Generic collection of sequence records, indexed by name.
Implementations§
Source§impl<T: FastxRecord> FastxRecords<T>
impl<T: FastxRecord> FastxRecords<T>
Sourcepub fn num_records(&self) -> usize
pub fn num_records(&self) -> usize
Return record count.
Sourcepub fn get_max_length(&self) -> usize
pub fn get_max_length(&self) -> usize
Return length of the longest sequence
Sourcepub fn records_by_name(&self, names: Vec<String>) -> (FastxRecords<T>, String)
pub fn records_by_name(&self, names: Vec<String>) -> (FastxRecords<T>, String)
Return a subset of records from a list of names.
§Arguments
names- A list of record names, not necessarily all present in the current object.
§Returns
A tuple containing a FastxRecords object with any records present in the input list
and a list of names not found. An empty list returns an empty object. Record indexes
still refer to the original file. Duplicate record names are removed in the
FastxRecords object but not in the list of absent records.
Sourcepub fn subsequences(&self, start: usize, end: usize) -> FastxRecords<T>
pub fn subsequences(&self, start: usize, end: usize) -> FastxRecords<T>
Sourcepub fn subsequences_by_name(
&self,
names_ranges: Vec<NameWithRange>,
) -> (FastxRecords<T>, String)
pub fn subsequences_by_name( &self, names_ranges: Vec<NameWithRange>, ) -> (FastxRecords<T>, String)
Return subsequences of named records.
§Arguments
names_ranges- Record names and ranges.
§Returns
A tuple containing a FastxRecords object with subsets of any records present in the input list
and a list of names not found. An empty list returns an empty object. Record indexes
still refer to the original file. Duplicate record names are removed in the
FastxRecords object but not in the list of absent records.
Sourcepub fn merge(&mut self, from: FastxRecords<T>)
pub fn merge(&mut self, from: FastxRecords<T>)
Merge in a FastxRecords object.
Any records also present in the current object are overwritten by new values.
§Arguments
from- an object to merge