pub struct DNAMotif {
    pub scores: Array2<f32>,
    pub min_score: f32,
    pub max_score: f32,
}
Expand description

Position-specific scoring matrix for DNA sequences

Fields

scores: Array2<f32>

matrix holding weights at each position, indexed by [position, base]

min_score: f32

sum of “worst” base at each position

max_score: f32

sum of “best” base at each position

Implementations

Returns a Motif representing the sequences provided.

Arguments
  • seqs - sequences incorporated into motif
  • pseudos - array slice with a pseudocount for each monomer; defaults to pssm::DEF_PSEUDO for all if None is supplied

FIXME: pseudos should be an array of size MONO_CT, but that is currently impossible - see https://github.com/rust-lang/rust/issues/42863

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Return a DNAMotif wrapping an Array2 representing amino acid weights at each position. The dimensions and contents of this array are unchecked, and it is incumbent on the user to ensure the correct dimensions are used (ie, SEQ_LEN x 4), and no zeros appear in the array.

Converts to this type from the input type.
Lookup table mapping monomer -> index
All monomers, in order corresponding to lookup table
Monomer count - equal to length of MONOS
Returns the monomer associated with the given index; the reverse of lookup. Returns INVALID_MONO if the index isn’t associated with a monomer. Read more
Returns the length of motif
Accessor - returns scores matrix
Return sum of “worst” base at each position
Return sum of “best” base at each position
Returns information content of a single position. Used info_content method. FIXME: this should be replaced with a CTFE … or maybe just a constant Read more
Returns a representation of the motif using ambiguous codes. Primarily useful for DNA motifs, where ambiguous codes are common (eg, ‘M’ for ‘A or C’); less so for proteins, where we represent any position without a dominant amino acid as an ‘X’ Read more
Returns a weight matrix representing the sequences provided. This code is shared by implementations of from_seqs Read more
Returns the index of given monomer in the scores matrix using the lookup table LK Read more
Returns the un-normalized sum of matching bases, useful for comparing matches from motifs of different lengths Read more
Returns a ScoredPos struct representing the best match within the query sequence see: MATCHTM: a tool for searching transcription factor binding sites in DNA sequences Nucleic Acids Res. 2003 Jul 1; 31(13): 3576–3579 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC169193/ Read more
Returns a float representing the information content of a motif; roughly the inverse of Shannon Entropy. Adapted from the information content described here: https://en.wikipedia.org/wiki/Sequence_logo#Logo_creation Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.