pub struct Reads<D> { /* private fields */ }Expand description
Store many DNA sequences together with an Exts and data each compactly packed together
§fields:
storage:Vecwith 2-bit encoded DNA bases of all sequencesends:Vecwith the ends (exclusive) of the separate sequences in theReadsexts:Option<Vec>with one Exts for each sequencedata:Vecwith data for each sequencelen: length of all sequences togetherstranded: [Stranded] conveying the strandedness and direction of the reads
Implementations§
Source§impl<D: Clone + Copy> Reads<D>
impl<D: Clone + Copy> Reads<D>
Sourcepub fn new(stranded: Strandedness) -> Self
pub fn new(stranded: Strandedness) -> Self
Returns a new Reads
pub fn new_with_quality(stranded: Strandedness) -> Self
pub fn stranded(&self) -> Strandedness
Sourcepub fn set_stranded(&mut self, stranded: Strandedness)
pub fn set_stranded(&mut self, stranded: Strandedness)
set the strandedness and the direction of the reads
Sourcepub fn set_custom_quality_bins(&mut self, quality_bins: QualityBins)
pub fn set_custom_quality_bins(&mut self, quality_bins: QualityBins)
set custom quality bins
Sourcepub fn add_read<V: Vmer>(
&mut self,
seq: V,
exts: Option<Exts>,
data: D,
quality_scores: Option<&[u8]>,
)
pub fn add_read<V: Vmer>( &mut self, seq: V, exts: Option<Exts>, data: D, quality_scores: Option<&[u8]>, )
Adds a new read to the Reads
Sourcepub fn from_vmer_vec<V: Vmer, S: IntoIterator<Item = (V, Exts, D)>>(
vec_iter: S,
stranded: Strandedness,
) -> Self
pub fn from_vmer_vec<V: Vmer, S: IntoIterator<Item = (V, Exts, D)>>( vec_iter: S, stranded: Strandedness, ) -> Self
Transforms a [(vmer, exts, data)] into a Reads - watch for memory usage
Sourcepub fn add_from_bytes(&mut self, bytes: &[u8], exts: Option<Exts>, data: D)
pub fn add_from_bytes(&mut self, bytes: &[u8], exts: Option<Exts>, data: D)
add ASCII encoded bases to the Reads
will transform all ascii characters outside of ACGTacgt into A
if Reads previously contained no exts, no new exts will be added
see also: Reads::add_from_bytes_checked
Sourcepub fn add_from_bytes_checked(
&mut self,
bytes: &[u8],
exts: Option<Exts>,
data: D,
) -> bool
pub fn add_from_bytes_checked( &mut self, bytes: &[u8], exts: Option<Exts>, data: D, ) -> bool
add ASCII encoded bases to the Reads
will return false if the bytes contained characters outside of ACGTacgt, otherwise return true and add the bases
see also: Reads::add_from_bytes
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
shrink the vectors’ capacity to fit the length
use sparsely
Sourcepub fn partial_iter(&self, range: Range<usize>) -> ReadsIter<'_, D> ⓘ
pub fn partial_iter(&self, range: Range<usize>) -> ReadsIter<'_, D> ⓘ
Iterate over a range start reads as (DnaString, Exts, D).
pub fn info(&self) -> String
Trait Implementations§
Source§impl<'de, D> Deserialize<'de> for Reads<D>where
D: Deserialize<'de>,
impl<'de, D> Deserialize<'de> for Reads<D>where
D: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<D: Ord> Ord for Reads<D>
impl<D: Ord> Ord for Reads<D>
Source§impl<D: PartialOrd> PartialOrd for Reads<D>
impl<D: PartialOrd> PartialOrd for Reads<D>
impl<D: Eq> Eq for Reads<D>
impl<D> StructuralPartialEq for Reads<D>
Auto Trait Implementations§
impl<D> Freeze for Reads<D>
impl<D> RefUnwindSafe for Reads<D>where
D: RefUnwindSafe,
impl<D> Send for Reads<D>where
D: Send,
impl<D> Sync for Reads<D>where
D: Sync,
impl<D> Unpin for Reads<D>where
D: Unpin,
impl<D> UnsafeUnpin for Reads<D>
impl<D> UnwindSafe for Reads<D>where
D: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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 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>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.