Package codon is the package for working with codons, codon transition matrices and codon frequencies.
- func CreateRateTransitionMatrix(cf Frequency, kappa, omega float64, rates float64, m *mat64.Dense) (*mat64.Dense, float64)
- func CreateTransitionMatrix(cf Frequency, kappa, omega float64, m *mat64.Dense) (*mat64.Dense, float64)
- func PrintQ(Q *mat64.Dense, gcode bio.GeneticCode)
- func PrintUnQ(Q *mat64.Dense, gcode bio.GeneticCode)
- func Sum(m *mat64.Dense) (s float64)
- type EMatrix
- type Frequency
- type Sequence
- type Sequences
This section is empty.
CreateRateTransitionMatrix creates a transition matrix given the vector of rates.
func CreateTransitionMatrix ¶
CreateTransitionMatrix creates a transition matrix.
PrintUnQ prints Q or P matrix without codon names.
EMatrix stores Q-matrix and it's eigendecomposition to quickly compute e^Qt.
Copy creates a copy of EMatrix while saving eigendecomposition.
Exp computes P=e^Qt and writes it to cD matrix.
ScaleD scales matrix after the eigendecomposition.
Frequency is array (slice) of codon frequencies.
F3X4 computes F3X4-style frequencies based on the alignment.
func ReadFrequency ¶
ReadFrequency reads codon frequencies from a reader. It should be just a list of numbers in a text format.
Sequence stores a sequence of codons with the sequence name.
type Sequences Sequence
Sequences is an array (slice) of codon sequences with their names. E.g. codon alignment.
func ToCodonSequences ¶
ToCodonSequences converts nucleotide bio.Sequences to CodonSequences.
Fixed returns a bool vector, all absolutely conserved (fixed) positions have true value.
Length returns the length of codon alignment in codons.
Letters returns a set of present and absent codons at each position of the alignment.
func (Sequences) NAmbiguous ¶
NAmbiguous returns number of ambiguous positions in the codon alignment.
NFixed calculates number of constant positions in the alignment.