pub struct PackedSeqBase<'s, const B: usize>where
Bits<B>: SupportedBits,{ /* private fields */ }Expand description
A variable-bit-width packed non-owned slice of DNA bases.
Implementations§
Source§impl<'s, const B: usize> PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
impl<'s, const B: usize> PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
Sourcepub fn from_raw_parts(seq: &'s [u8], offset: usize, len: usize) -> Self
pub fn from_raw_parts(seq: &'s [u8], offset: usize, len: usize) -> Self
Creates a Seq from a slice of packed bytes, an offset in bp and a length in bp.
The slice should have at least 48 bytes of padding after offset + len.
Otherwise, the function will panic.
Source§impl<'s, const B: usize> PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
impl<'s, const B: usize> PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
pub fn par_iter_bp_with_buf<BUF: DerefMut<Target = [S; 8]>>( self, context: usize, buf: BUF, ) -> PaddedIt<impl ChunkIt<S> + use<'s, B, BUF>>
pub fn par_iter_bp_delayed_with_factor( self, context: usize, delay: Delay, factor: usize, ) -> PaddedIt<impl ChunkIt<(S, S)> + use<'s, B>>
pub fn par_iter_bp_delayed_with_buf<BUF: DerefMut<Target = Vec<S>>>( self, context: usize, delay: Delay, buf: BUF, ) -> PaddedIt<impl ChunkIt<(S, S)> + use<'s, B, BUF>>
pub fn par_iter_bp_delayed_with_factor_and_buf<BUF: DerefMut<Target = Vec<S>>>( self, context: usize, Delay: Delay, factor: usize, buf: BUF, ) -> PaddedIt<impl ChunkIt<(S, S)> + use<'s, B, BUF>>
pub fn par_iter_bp_delayed_2_with_factor( self, context: usize, delay1: Delay, delay2: Delay, factor: usize, ) -> PaddedIt<impl ChunkIt<(S, S, S)> + use<'s, B>>
pub fn par_iter_bp_delayed_2_with_buf<BUF: DerefMut<Target = Vec<S>>>( self, context: usize, delay1: Delay, delay2: Delay, buf: BUF, ) -> PaddedIt<impl ChunkIt<(S, S, S)> + use<'s, B, BUF>>
Sourcepub fn par_iter_bp_delayed_2_with_factor_and_buf<BUF: DerefMut<Target = Vec<S>>>(
self,
context: usize,
Delay: Delay,
Delay: Delay,
factor: usize,
buf: BUF,
) -> PaddedIt<impl ChunkIt<(S, S, S)> + use<'s, B, BUF>>
pub fn par_iter_bp_delayed_2_with_factor_and_buf<BUF: DerefMut<Target = Vec<S>>>( self, context: usize, Delay: Delay, Delay: Delay, factor: usize, buf: BUF, ) -> PaddedIt<impl ChunkIt<(S, S, S)> + use<'s, B, BUF>>
When iterating over 2-bit and 1-bit encoded data in parallel,
one must ensure that they have the same stride.
On the larger type, set factor as the ratio to the smaller one,
so that the stride in bytes is a multiple of factor,
so that the smaller type also has a byte-aligned stride.
Source§impl<'s> PackedSeqBase<'s, 1>
impl<'s> PackedSeqBase<'s, 1>
Sourcepub fn iter_kmer_ambiguity(
self,
k: usize,
) -> impl ExactSizeIterator<Item = bool> + use<'s>
pub fn iter_kmer_ambiguity( self, k: usize, ) -> impl ExactSizeIterator<Item = bool> + use<'s>
An iterator indicating for each kmer whether it contains ambiguous bases.
Returns n-(k-1) elements.
Sourcepub fn par_iter_kmer_ambiguity(
self,
k: usize,
context: usize,
skip: usize,
) -> PaddedIt<impl ChunkIt<S> + use<'s>>
pub fn par_iter_kmer_ambiguity( self, k: usize, context: usize, skip: usize, ) -> PaddedIt<impl ChunkIt<S> + use<'s>>
A parallel iterator indicating for each kmer whether it contains ambiguous bases.
First element is the ‘kmer’ consisting only of the first character of each chunk.
k: length of windows to check
context: number of overlapping iterations +1. To determine stride of each lane.
skip: Set to context-1 to skip the iterations added by the context.
pub fn par_iter_kmer_ambiguity_with_buf( self, k: usize, context: usize, skip: usize, buf: &'s mut Vec<S>, ) -> PaddedIt<impl ChunkIt<S> + use<'s>>
Trait Implementations§
Source§impl<'s, const B: usize> Clone for PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
impl<'s, const B: usize> Clone for PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
Source§fn clone(&self) -> PackedSeqBase<'s, B>
fn clone(&self) -> PackedSeqBase<'s, B>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'s, const B: usize> CopyType for PackedSeqBase<'s, B>
impl<'s, const B: usize> CopyType for PackedSeqBase<'s, B>
Source§impl<'s, const B: usize> Debug for PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
impl<'s, const B: usize> Debug for PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
Source§impl<'s, const B: usize> MemDbgImpl for PackedSeqBase<'s, B>
impl<'s, const B: usize> MemDbgImpl for PackedSeqBase<'s, B>
fn _mem_dbg_rec_on( &self, _memdbg_writer: &mut impl Write, _memdbg_total_size: usize, _memdbg_max_depth: usize, _memdbg_prefix: &mut String, _memdbg_is_last: bool, _memdbg_flags: DbgFlags, ) -> Result
fn _mem_dbg_depth_on( &self, writer: &mut impl Write, total_size: usize, max_depth: usize, prefix: &mut String, field_name: Option<&str>, is_last: bool, padded_size: usize, flags: DbgFlags, ) -> Result<(), Error>
Source§impl<'s, const B: usize> MemSize for PackedSeqBase<'s, B>
impl<'s, const B: usize> MemSize for PackedSeqBase<'s, B>
Source§impl<const B: usize> Ord for PackedSeqBase<'_, B>where
Bits<B>: SupportedBits,
impl<const B: usize> Ord for PackedSeqBase<'_, B>where
Bits<B>: SupportedBits,
Source§impl<const B: usize> PartialEq for PackedSeqBase<'_, B>where
Bits<B>: SupportedBits,
impl<const B: usize> PartialEq for PackedSeqBase<'_, B>where
Bits<B>: SupportedBits,
Source§impl<const B: usize> PartialOrd for PackedSeqBase<'_, B>where
Bits<B>: SupportedBits,
impl<const B: usize> PartialOrd for PackedSeqBase<'_, B>where
Bits<B>: SupportedBits,
Source§impl<'s, const B: usize> Seq<'s> for PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
impl<'s, const B: usize> Seq<'s> for PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
Source§fn as_u64(&self) -> u64
fn as_u64(&self) -> u64
Convert a short sequence (kmer) to a packed representation as u64.
Panics if self is longer than 32 characters.
Source§fn revcomp_as_u64(&self) -> u64
fn revcomp_as_u64(&self) -> u64
Convert a short sequence (kmer) to a packed representation of its reverse complement as usize.
Panics if self is longer than 32 characters.
Source§fn as_u128(&self) -> u128
fn as_u128(&self) -> u128
Convert a short sequence (kmer) to a packed representation as u128.
Panics if self is longer than 64 characters.
Source§fn revcomp_as_u128(&self) -> u128
fn revcomp_as_u128(&self) -> u128
Convert a short sequence (kmer) to a packed representation of its reverse complement as usize.
Panics if self is longer than 64 characters.
Source§fn par_iter_bp_delayed_2(
self,
context: usize,
delay1: Delay,
delay2: Delay,
) -> PaddedIt<impl ChunkIt<(S, S, S)>>
fn par_iter_bp_delayed_2( self, context: usize, delay1: Delay, delay2: Delay, ) -> PaddedIt<impl ChunkIt<(S, S, S)>>
NOTE: When self starts does not start at a byte boundary, the
‘delayed’ character is not guaranteed to be 0.
Source§const BITS_PER_CHAR: usize = B
const BITS_PER_CHAR: usize = B
b to represent each character returned by iter_bp and variants..Source§const BASES_PER_BYTE: usize = Self::C8
const BASES_PER_BYTE: usize = Self::C8
Seq.Source§type SeqVec = PackedSeqVecBase<B>
type SeqVec = PackedSeqVecBase<B>
Source§fn get_ascii(&self, index: usize) -> u8
fn get_ascii(&self, index: usize) -> u8
b-bit values.Source§fn to_vec(&self) -> PackedSeqVecBase<B>
fn to_vec(&self) -> PackedSeqVecBase<B>
Source§fn to_revcomp(&self) -> PackedSeqVecBase<B>
fn to_revcomp(&self) -> PackedSeqVecBase<B>
Source§fn slice(&self, range: Range<usize>) -> Self
fn slice(&self, range: Range<usize>) -> Self
range indicates character indices.Source§fn iter_bp(self) -> impl ExactSizeIterator<Item = u8>
fn iter_bp(self) -> impl ExactSizeIterator<Item = u8>
b-bit characters of the sequence.Source§fn par_iter_bp(self, context: usize) -> PaddedIt<impl ChunkIt<S>>
fn par_iter_bp(self, context: usize) -> PaddedIt<impl ChunkIt<S>>
b-bit characters of the sequence in parallel. Read moreSource§fn par_iter_bp_delayed(
self,
context: usize,
delay: Delay,
) -> PaddedIt<impl ChunkIt<(S, S)>>
fn par_iter_bp_delayed( self, context: usize, delay: Delay, ) -> PaddedIt<impl ChunkIt<(S, S)>>
delay positions. Read moreSource§fn bits_per_char(&self) -> usize
fn bits_per_char(&self) -> usize
b=Self::BITS_PER_CHAR.Source§fn to_word(&self) -> usize
fn to_word(&self) -> usize
to_u64.usize.Source§fn to_word_revcomp(&self) -> usize
fn to_word_revcomp(&self) -> usize
revcomp_to_u64.usize.impl<'s, const B: usize> Copy for PackedSeqBase<'s, B>where
Bits<B>: SupportedBits,
impl<const B: usize> Eq for PackedSeqBase<'_, B>where
Bits<B>: SupportedBits,
Auto Trait Implementations§
impl<'s, const B: usize> Freeze for PackedSeqBase<'s, B>
impl<'s, const B: usize> RefUnwindSafe for PackedSeqBase<'s, B>
impl<'s, const B: usize> Send for PackedSeqBase<'s, B>
impl<'s, const B: usize> Sync for PackedSeqBase<'s, B>
impl<'s, const B: usize> Unpin for PackedSeqBase<'s, B>
impl<'s, const B: usize> UnwindSafe for PackedSeqBase<'s, B>
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, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
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> MemDbg for Twhere
T: MemDbgImpl,
impl<T> MemDbg for Twhere
T: MemDbgImpl,
Source§fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
Source§fn mem_dbg_on(
&self,
writer: &mut impl Write,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_on( &self, writer: &mut impl Write, flags: DbgFlags, ) -> Result<(), Error>
core::fmt::Write debug infos about the structure memory
usage, expanding all levels of nested structures.Source§fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
mem_dbg, but expanding only up to max_depth
levels of nested structures.Source§fn mem_dbg_depth_on(
&self,
writer: &mut impl Write,
max_depth: usize,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_depth_on( &self, writer: &mut impl Write, max_depth: usize, flags: DbgFlags, ) -> Result<(), Error>
core::fmt::Write debug infos about the structure memory
usage as mem_dbg_on, but expanding only up to
max_depth levels of nested structures.