pub struct ScoringMatrix<A: Alphabet> { /* private fields */ }Expand description
A matrix storing log-odds ratio of symbol occurrences at each position.
Implementations§
Source§impl<A: ComplementableAlphabet> ScoringMatrix<A>
impl<A: ComplementableAlphabet> ScoringMatrix<A>
Sourcepub fn reverse_complement(&self) -> Self
pub fn reverse_complement(&self) -> Self
Get the reverse-complement of this scoring matrix.
Source§impl<A: Alphabet> ScoringMatrix<A>
impl<A: Alphabet> ScoringMatrix<A>
Sourcepub fn new(background: Background<A>, data: DenseMatrix<f32, A::K>) -> Self
pub fn new(background: Background<A>, data: DenseMatrix<f32, A::K>) -> Self
Create a new scoring matrix from the given log-odds matrix.
Sourcepub fn background(&self) -> &Background<A>
pub fn background(&self) -> &Background<A>
The background frequencies of the position weight matrix.
Sourcepub fn max_score(&self) -> f32
pub fn max_score(&self) -> f32
The highest score that can be obtained with this scoring matrix.
Sourcepub fn information_content(&self) -> f32
pub fn information_content(&self) -> f32
Compute the information content of the matrix.
Sourcepub fn score<S, C>(&self, seq: S) -> StripedScores<f32, C>where
C: StrictlyPositive + ArrayLength,
S: AsRef<StripedSequence<A, C>>,
Pipeline<A, Dispatch>: Score<f32, A, C>,
pub fn score<S, C>(&self, seq: S) -> StripedScores<f32, C>where
C: StrictlyPositive + ArrayLength,
S: AsRef<StripedSequence<A, C>>,
Pipeline<A, Dispatch>: Score<f32, A, C>,
Compute the PSSM scores for every position of the given sequence.
§Note
Uses platform-accelerated implementation when available.
Sourcepub fn score_position<S, C>(&self, seq: S, pos: usize) -> f32
pub fn score_position<S, C>(&self, seq: S, pos: usize) -> f32
Compute the score for a single sequence position.
Sourcepub fn to_discrete(&self) -> DiscreteMatrix<A>
pub fn to_discrete(&self) -> DiscreteMatrix<A>
Get a discrete matrix from this position-specific scoring matrix.
Sourcepub fn to_score_distribution(&self) -> ScoreDistribution<A>
pub fn to_score_distribution(&self) -> ScoreDistribution<A>
Get the score distribution for this position-specific scoring matrix.
See crate::pwm::dist module for more information.
§Note
Generating a ScoreDistribution takes time, so this method should be
called only once per ScoringMatrix and the result cached for
optimal performance.
Trait Implementations§
Source§impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for ScoringMatrix<A>
impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for ScoringMatrix<A>
Source§impl<A: Alphabet> AsRef<ScoringMatrix<A>> for ScoringMatrix<A>
impl<A: Alphabet> AsRef<ScoringMatrix<A>> for ScoringMatrix<A>
Source§impl<A: Clone + Alphabet> Clone for ScoringMatrix<A>
impl<A: Clone + Alphabet> Clone for ScoringMatrix<A>
Source§fn clone(&self) -> ScoringMatrix<A>
fn clone(&self) -> ScoringMatrix<A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<A: Alphabet> Correlation for ScoringMatrix<A>
impl<A: Alphabet> Correlation for ScoringMatrix<A>
Source§fn dot(&self, other: &Self, i: usize, j: usize) -> f32
fn dot(&self, other: &Self, i: usize, j: usize) -> f32
i of self and row j of other.