pub struct CodonUsage { /* private fields */ }Expand description
Codon usage frequency table.
Counts occurrences of each of the 64 codons in a coding sequence.
Implementations§
Source§impl CodonUsage
impl CodonUsage
Sourcepub fn from_sequence(seq: &[u8]) -> Self
pub fn from_sequence(seq: &[u8]) -> Self
Build a codon usage table from a coding sequence.
The sequence should be in-frame coding DNA/RNA. Non-standard bases and incomplete trailing codons are skipped.
Sourcepub fn merge(&mut self, other: &CodonUsage)
pub fn merge(&mut self, other: &CodonUsage)
Merge another usage table into this one.
Sourcepub fn frequency(&self, codon: &[u8]) -> f64
pub fn frequency(&self, codon: &[u8]) -> f64
Relative frequency of a codon (count / total codons).
Sourcepub fn rscu(&self, codon: &[u8], code: &GeneticCode) -> f64
pub fn rscu(&self, codon: &[u8], code: &GeneticCode) -> f64
Relative Synonymous Codon Usage for a codon.
RSCU = observed / expected, where expected = (total for AA) / (number of synonymous codons). An RSCU of 1.0 means no bias.
Sourcepub fn relative_adaptiveness(&self, code: &GeneticCode) -> [f64; 64]
pub fn relative_adaptiveness(&self, code: &GeneticCode) -> [f64; 64]
Compute the relative adaptiveness (w_i) for all 64 codons.
For each amino acid, w_i = RSCU_i / max(RSCU for that AA). Stop codons get w = 0.0.
Trait Implementations§
Source§impl Clone for CodonUsage
impl Clone for CodonUsage
Source§fn clone(&self) -> CodonUsage
fn clone(&self) -> CodonUsage
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 moreAuto Trait Implementations§
impl Freeze for CodonUsage
impl RefUnwindSafe for CodonUsage
impl Send for CodonUsage
impl Sync for CodonUsage
impl Unpin for CodonUsage
impl UnsafeUnpin for CodonUsage
impl UnwindSafe for CodonUsage
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