Struct StripedSequence

Source
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>

Source

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.

Source

pub fn sample<R: Rng>(rng: R, background: Background<A>, length: usize) -> Self

Sample a new random sequence from the given background frequencies.

Source

pub fn len(&self) -> usize

Get the length of the sequence.

Source

pub fn is_empty(&self) -> bool

Check whether the sequence is empty.

Source

pub fn wrap(&self) -> usize

Get the number of wrapping rows in the striped matrix.

Source

pub fn matrix(&self) -> &DenseMatrix<A::Symbol, C>

Get an immutable reference over the underlying matrix storing the sequence.

Source

pub fn into_matrix(self) -> DenseMatrix<A::Symbol, C>

Extract the underlying matrix where the striped sequence is stored.

Source

pub fn configure(&mut self, motif: &ScoringMatrix<A>)

Reconfigure the striped sequence for searching with a motif.

Source

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>

Source§

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>

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<A: Clone + Alphabet, C: Clone + PositiveLength> Clone for StripedSequence<A, C>
where A::Symbol: Clone,

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<A: Alphabet, C: PositiveLength> Debug for StripedSequence<A, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<A: Alphabet, C: PositiveLength> Default for StripedSequence<A, C>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<A: Alphabet, C: PositiveLength> From<EncodedSequence<A>> for StripedSequence<A, C>
where Pipeline<A, Dispatch>: Stripe<A, C>,

Source§

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>

Source§

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>

Source§

type Output = <A as Alphabet>::Symbol

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<A: Alphabet, C: PositiveLength> SymbolCount<A> for StripedSequence<A, C>

Source§

fn count_symbol(&self, symbol: <A as Alphabet>::Symbol) -> usize

Source§

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>
where A: Send, <A as Alphabet>::Symbol: Send,

§

impl<A, C> Sync for StripedSequence<A, C>
where A: Sync, <A as Alphabet>::Symbol: Sync,

§

impl<A, C> Unpin for StripedSequence<A, C>
where A: Unpin, <C as ArrayLength>::ArrayType<<A as Alphabet>::Symbol>: Unpin,

§

impl<A, C> UnwindSafe for StripedSequence<A, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V