Documentation
¶
Index ¶
- Constants
- func BuildWeightsDirichlet(al align.Alignment) []float64
- func BuildWeightsGamma(al align.Alignment) []float64
- func DistMatrix(al align.Alignment, weights []float64, model DistModel, ...) (outmatrix [][]float64, err error)
- func SimPlotDistances(al align.Alignment, refseq string, distmodel string, ...) (sp []struct{ ... }, err error)
- type DistModel
- type F81Model
- type F84Model
- type JCModel
- type K2PModel
- type PDistModel
- func (m *PDistModel) Distance(seq1 []uint8, seq2 []uint8, weights []float64) (diff float64, err error)
- func (m *PDistModel) InitModel(al align.Alignment, weights []float64, gamma bool, alpha float64) (err error)
- func (m *PDistModel) Sequence(i int) (seq []uint8, err error)
- func (m *PDistModel) SetCountGapMutations(countgapmut int) (err error)
- func (m *PDistModel) SetRemoveAmbiguous(removeAmbiguous bool)
- type RawDistModel
- func (m *RawDistModel) Distance(seq1 []uint8, seq2 []uint8, weights []float64) (diff float64, err error)
- func (m *RawDistModel) InitModel(al align.Alignment, weights []float64, gamma bool, alpha float64) (err error)
- func (m *RawDistModel) Sequence(i int) (seq []uint8, err error)
- func (m *RawDistModel) SetCountGapMutations(countgapmut int) (err error)
- type TN82Model
- type TN93Model
Constants ¶
const ( GAP_COUNT_NONE = 0 GAP_COUNT_INTERNAL = 1 GAP_COUNT_ALL = 2 )
const (
NT_DIST_OVER = 100000
)
Variables ¶
This section is empty.
Functions ¶
func BuildWeightsDirichlet ¶
Returns a vector of weights following a Dirichlet distribution D(n ; 1,...,1)
with n alignment length
func BuildWeightsGamma ¶
Return a normalized vector of weights following a Gamma distribution
func DistMatrix ¶
func DistMatrix(al align.Alignment, weights []float64, model DistModel, range1Min, range1Max, range2Min, range2Max int, gamma bool, alpha float64, cpus int) (outmatrix [][]float64, err error)
DistMatrix computes a matrix distance, with weights associated to each alignment positions If weights == nil, then all weights are considered 1 range1, range2: To restrict the computation to the distances between these ranges of sequence IDS, based [range1Min,range1Max] vs. [range2Min, range2Max] If range1Min, range1Max, range2Min or range2Max are -1, then computes the usual half matrix
func SimPlotDistances ¶ added in v0.4.0
func SimPlotDistances(al align.Alignment, refseq string, distmodel string, windowsize, windowstep int, group bool, splitsep string, splitfield int) (sp []struct { WindowStart, WindowEnd int CompSeq string Distance float64 }, err error)
Compute the distance for each windows between the reference sequence and all the other sequences. Can be used to draw a simplot If group is true Then extract group name from the sequence names, using splitfield and splitsep Sequences are grouped and distance from refseq is computed as the average with each group
Types ¶
type DistModel ¶
type F81Model ¶
type F81Model struct {
// contains filtered or unexported fields
}
func NewF81Model ¶
type F84Model ¶
type F84Model struct {
// contains filtered or unexported fields
}
func NewF84Model ¶
type JCModel ¶
type JCModel struct {
// contains filtered or unexported fields
}
func NewJCModel ¶
type K2PModel ¶
type K2PModel struct {
// contains filtered or unexported fields
}
func NewK2PModel ¶
type PDistModel ¶
type PDistModel struct {
// contains filtered or unexported fields
}
func NewPDistModel ¶
func NewPDistModel(removegaps bool) *PDistModel
func (*PDistModel) Distance ¶
func (m *PDistModel) Distance(seq1 []uint8, seq2 []uint8, weights []float64) (diff float64, err error)
computes p-distance between 2 sequences
func (*PDistModel) Sequence ¶ added in v0.3.4
func (m *PDistModel) Sequence(i int) (seq []uint8, err error)
Sequence returns the ith sequence of the alignment encoded in int
func (*PDistModel) SetCountGapMutations ¶
func (m *PDistModel) SetCountGapMutations(countgapmut int) (err error)
func (*PDistModel) SetRemoveAmbiguous ¶ added in v0.3.4
func (m *PDistModel) SetRemoveAmbiguous(removeAmbiguous bool)
SetRemoveAmbiguous sets removeAmbiguous model variable if true, ambiguous positions are removed for the normalisation by the length for example: N vs. A : position not taken into account in length (can not decide wether there is a difference) R vs. Y : position taken into account in length (we know there is a difference)
type RawDistModel ¶
type RawDistModel struct {
// contains filtered or unexported fields
}
Like pdist, but without Normalization by the number of sites
func NewRawDistModel ¶
func NewRawDistModel(removegaps bool) *RawDistModel
func (*RawDistModel) Distance ¶
func (m *RawDistModel) Distance(seq1 []uint8, seq2 []uint8, weights []float64) (diff float64, err error)
Distance computes the number of differences between 2 sequences These differences include gaps vs. nt
func (*RawDistModel) Sequence ¶ added in v0.3.4
func (m *RawDistModel) Sequence(i int) (seq []uint8, err error)
Sequence returns the ith sequence of the alignment encoded in int
func (*RawDistModel) SetCountGapMutations ¶
func (m *RawDistModel) SetCountGapMutations(countgapmut int) (err error)
type TN82Model ¶
type TN82Model struct {
// contains filtered or unexported fields
}