Struct lightmotif::pwm::CountMatrix
source · pub struct CountMatrix<A: Alphabet> { /* private fields */ }
Expand description
A matrix storing symbol occurrences at each position.
Implementations§
source§impl<A: Alphabet> CountMatrix<A>
impl<A: Alphabet> CountMatrix<A>
sourcepub fn new(data: DenseMatrix<u32, A::K>) -> Result<Self, InvalidData>
pub fn new(data: DenseMatrix<u32, A::K>) -> Result<Self, InvalidData>
Create a new count matrix from the given data.
The matrix must contain count data, for sequences of the same length, i.e. rows should all sum to the same value.
sourcepub fn from_sequences<'seq, I>(sequences: I) -> Result<Self, InvalidData>
pub fn from_sequences<'seq, I>(sequences: I) -> Result<Self, InvalidData>
Create a new count matrix from the given sequences.
sourcepub fn to_freq<P>(&self, pseudo: P) -> FrequencyMatrix<A>where
P: Into<Pseudocounts<A>>,
pub fn to_freq<P>(&self, pseudo: P) -> FrequencyMatrix<A>where
P: Into<Pseudocounts<A>>,
Build a probability matrix from this count matrix using pseudo-counts.
sourcepub fn counts(&self) -> &DenseMatrix<u32, A::K>
pub fn counts(&self) -> &DenseMatrix<u32, A::K>
The raw counts from the count matrix.
source§impl<A: ComplementableAlphabet> CountMatrix<A>
impl<A: ComplementableAlphabet> CountMatrix<A>
sourcepub fn reverse_complement(&self) -> Self
pub fn reverse_complement(&self) -> Self
Get the reverse-complement of this count matrix.
Trait Implementations§
source§impl<A: Alphabet> AsRef<CountMatrix<A>> for CountMatrix<A>
impl<A: Alphabet> AsRef<CountMatrix<A>> for CountMatrix<A>
source§impl<A: Alphabet> AsRef<DenseMatrix<u32, <A as Alphabet>::K>> for CountMatrix<A>
impl<A: Alphabet> AsRef<DenseMatrix<u32, <A as Alphabet>::K>> for CountMatrix<A>
source§impl<A: Clone + Alphabet> Clone for CountMatrix<A>
impl<A: Clone + Alphabet> Clone for CountMatrix<A>
source§fn clone(&self) -> CountMatrix<A>
fn clone(&self) -> CountMatrix<A>
Returns a copy 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: PartialEq + Alphabet> PartialEq for CountMatrix<A>
impl<A: PartialEq + Alphabet> PartialEq for CountMatrix<A>
source§fn eq(&self, other: &CountMatrix<A>) -> bool
fn eq(&self, other: &CountMatrix<A>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<A: Eq + Alphabet> Eq for CountMatrix<A>
impl<A: Alphabet> StructuralEq for CountMatrix<A>
impl<A: Alphabet> StructuralPartialEq for CountMatrix<A>
Auto Trait Implementations§
impl<A> RefUnwindSafe for CountMatrix<A>
impl<A> Send for CountMatrix<A>
impl<A> Sync for CountMatrix<A>
impl<A> Unpin for CountMatrix<A>
impl<A> UnwindSafe for CountMatrix<A>
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