Documentation
¶
Overview ¶
Package codon is the package for working with codons, codon transition matrices and codon frequencies.
Index ¶
- Variables
- 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
Constants ¶
This section is empty.
Variables ¶
var ( // NOCODON is a special number which represents an unknown // codon. NOCODON = byte(255) )
Functions ¶
func CreateRateTransitionMatrix ¶
func CreateRateTransitionMatrix(cf Frequency, kappa, omega float64, rates []float64, m *mat64.Dense) (*mat64.Dense, float64)
CreateRateTransitionMatrix creates a transition matrix given the vector of rates.
func CreateTransitionMatrix ¶
func CreateTransitionMatrix(cf Frequency, kappa, omega float64, m *mat64.Dense) (*mat64.Dense, float64)
CreateTransitionMatrix creates a transition matrix.
Types ¶
type EMatrix ¶
type EMatrix struct {
// Q is Q-matrix
Q *mat64.Dense
// Scale is matrix scale.
Scale float64
// CF is codon frequency.
CF Frequency
// contains filtered or unexported fields
}
EMatrix stores Q-matrix and it's eigendecomposition to quickly compute e^Qt.
type Frequency ¶
type Frequency struct {
Freq []float64
GCode *bio.GeneticCode
}
Frequency is array (slice) of codon frequencies.
func ReadFrequency ¶
ReadFrequency reads codon frequencies from a reader. It should be just a list of numbers in a text format.
type Sequence ¶
type Sequence struct {
Name string
Sequence []byte
GCode *bio.GeneticCode
}
Sequence stores a sequence of codons with the sequence name.
type Sequences ¶
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.
func (Sequences) Fixed ¶
Fixed returns a bool vector, all absolutely conserved (fixed) positions have true value.
func (Sequences) Letters ¶
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.