pub struct StripedSequence<A: Alphabet, C: PositiveLength = DefaultColumns> { /* private fields */ }
Expand description
An encoded sequence stored in a striped matrix with a fixed column count.
Implementations§
Source§impl<A: Alphabet, C: PositiveLength> StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> StripedSequence<A, C>
Sourcepub fn new(
data: DenseMatrix<A::Symbol, C>,
length: usize,
) -> Result<Self, InvalidData>
pub fn new( data: DenseMatrix<A::Symbol, C>, length: usize, ) -> Result<Self, InvalidData>
Create a new striped sequence from the given dense matrix.
§Errors
Returns InvalidData
when the DenseMatrix
given as input stores
less symbols than the given length
.
Sourcepub fn sample<R: Rng>(rng: R, background: Background<A>, length: usize) -> Self
pub fn sample<R: Rng>(rng: R, background: Background<A>, length: usize) -> Self
Sample a new random sequence from the given background frequencies.
Sourcepub fn matrix(&self) -> &DenseMatrix<A::Symbol, C>
pub fn matrix(&self) -> &DenseMatrix<A::Symbol, C>
Get an immutable reference over the underlying matrix storing the sequence.
Sourcepub fn into_matrix(self) -> DenseMatrix<A::Symbol, C>
pub fn into_matrix(self) -> DenseMatrix<A::Symbol, C>
Extract the underlying matrix where the striped sequence is stored.
Sourcepub fn configure(&mut self, motif: &ScoringMatrix<A>)
pub fn configure(&mut self, motif: &ScoringMatrix<A>)
Reconfigure the striped sequence for searching with a motif.
Sourcepub fn configure_wrap(&mut self, m: usize)
pub fn configure_wrap(&mut self, m: usize)
Add wrap-around rows for a motif of length m
.
Trait Implementations§
Source§impl<A: Alphabet, C: PositiveLength> AsRef<DenseMatrix<<A as Alphabet>::Symbol, C>> for StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> AsRef<DenseMatrix<<A as Alphabet>::Symbol, C>> for StripedSequence<A, C>
Source§fn as_ref(&self) -> &DenseMatrix<A::Symbol, C>
fn as_ref(&self) -> &DenseMatrix<A::Symbol, C>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<A: Alphabet, C: PositiveLength> AsRef<StripedSequence<A, C>> for StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> AsRef<StripedSequence<A, C>> for StripedSequence<A, C>
Source§impl<A: Clone + Alphabet, C: Clone + PositiveLength> Clone for StripedSequence<A, C>
impl<A: Clone + Alphabet, C: Clone + PositiveLength> Clone for StripedSequence<A, C>
Source§fn clone(&self) -> StripedSequence<A, C>
fn clone(&self) -> StripedSequence<A, C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<A: Alphabet, C: PositiveLength> Debug for StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> Debug for StripedSequence<A, C>
Source§impl<A: Alphabet, C: PositiveLength> Default for StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> Default for StripedSequence<A, C>
Source§impl<A: Alphabet, C: PositiveLength> From<EncodedSequence<A>> for StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> From<EncodedSequence<A>> for StripedSequence<A, C>
Source§fn from(encoded: EncodedSequence<A>) -> Self
fn from(encoded: EncodedSequence<A>) -> Self
Converts to this type from the input type.
Source§impl<A: Alphabet, C: PositiveLength> From<StripedSequence<A, C>> for DenseMatrix<A::Symbol, C>
impl<A: Alphabet, C: PositiveLength> From<StripedSequence<A, C>> for DenseMatrix<A::Symbol, C>
Source§fn from(striped: StripedSequence<A, C>) -> Self
fn from(striped: StripedSequence<A, C>) -> Self
Converts to this type from the input type.
Source§impl<A: Alphabet, C: PositiveLength> Index<usize> for StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> Index<usize> for StripedSequence<A, C>
Source§impl<A: Alphabet, C: PositiveLength> SymbolCount<A> for StripedSequence<A, C>
impl<A: Alphabet, C: PositiveLength> SymbolCount<A> for StripedSequence<A, C>
fn count_symbol(&self, symbol: <A as Alphabet>::Symbol) -> usize
fn count_symbols(&self) -> GenericArray<usize, <A as Alphabet>::K>
Auto Trait Implementations§
impl<A, C> Freeze for StripedSequence<A, C>
impl<A, C> RefUnwindSafe for StripedSequence<A, C>
impl<A, C> Send for StripedSequence<A, C>
impl<A, C> Sync for StripedSequence<A, C>
impl<A, C> Unpin for StripedSequence<A, C>
impl<A, C> UnwindSafe for StripedSequence<A, C>
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