distance

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2018 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWeightsDirichlet added in v0.1.2

func BuildWeightsDirichlet(al align.Alignment) []float64

Returns a vector of weights following a Dirichlet distribution D(n ; 1,...,1)

with n alignment length

func BuildWeightsGamma added in v0.1.2

func BuildWeightsGamma(al align.Alignment) []float64

Return a normalized vector of weights following a Gamma distribution

func DistMatrix

func DistMatrix(al align.Alignment, weights []float64, model DistModel, cpus int) (outmatrix [][]float64, err error)

Compute a matrix distance, with weights associated to each alignment positions If weights == nil, then all weights are considered 1

Types

type DistModel

type DistModel interface {
	InitModel(al align.Alignment, weights []float64) error
	Distance(seq1 []rune, seq2 []rune, weigths []float64) (float64, error)
}

func Model

func Model(modelType string, removegaps bool) (model DistModel, err error)

Returns the right model depending on the args

type F81Model

type F81Model struct {
	// contains filtered or unexported fields
}

func NewF81Model

func NewF81Model(removegaps bool) *F81Model

func (*F81Model) Distance

func (m *F81Model) Distance(seq1 []rune, seq2 []rune, weights []float64) (float64, error)

computes F81 distance between 2 sequences

func (*F81Model) InitModel

func (m *F81Model) InitModel(al align.Alignment, weights []float64) (err error)

type F84Model

type F84Model struct {
	// contains filtered or unexported fields
}

func NewF84Model

func NewF84Model(removegaps bool) *F84Model

func (*F84Model) Distance

func (m *F84Model) Distance(seq1 []rune, seq2 []rune, weights []float64) (float64, error)

computes F84 distance between 2 sequences

func (*F84Model) InitModel

func (m *F84Model) InitModel(al align.Alignment, weights []float64) (err error)

type JCModel

type JCModel struct {
	// contains filtered or unexported fields
}

func NewJCModel

func NewJCModel(removegaps bool) *JCModel

func (*JCModel) Distance

func (m *JCModel) Distance(seq1 []rune, seq2 []rune, weights []float64) (float64, error)

computes JC69 distance between 2 sequences

func (*JCModel) InitModel

func (m *JCModel) InitModel(al align.Alignment, weights []float64) (err error)

type K2PModel

type K2PModel struct {
	// contains filtered or unexported fields
}

func NewK2PModel

func NewK2PModel(removegaps bool) *K2PModel

func (*K2PModel) Distance

func (m *K2PModel) Distance(seq1 []rune, seq2 []rune, weights []float64) (float64, error)

computes K2P distance between 2 sequences

func (*K2PModel) InitModel

func (m *K2PModel) InitModel(al align.Alignment, weights []float64) (err error)

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 []rune, seq2 []rune, weights []float64) (float64, error)

computes p-distance between 2 sequences

func (*PDistModel) InitModel

func (m *PDistModel) InitModel(al align.Alignment, weights []float64) (err error)

type RawDistModel added in v0.2.8

type RawDistModel struct {
	// contains filtered or unexported fields
}

Like pdist, but without Normalization by the number of sites

func NewRawDistModel added in v0.2.8

func NewRawDistModel(removegaps bool) *RawDistModel

func (*RawDistModel) Distance added in v0.2.8

func (m *RawDistModel) Distance(seq1 []rune, seq2 []rune, weights []float64) (float64, error)

computes p-distance between 2 sequences

func (*RawDistModel) InitModel added in v0.2.8

func (m *RawDistModel) InitModel(al align.Alignment, weights []float64) (err error)

type TN82Model

type TN82Model struct {
	// contains filtered or unexported fields
}

func NewTN82Model

func NewTN82Model(removegaps bool) *TN82Model

func (*TN82Model) Distance

func (m *TN82Model) Distance(seq1 []rune, seq2 []rune, weights []float64) (float64, error)

computes TN82 distance between 2 sequences

func (*TN82Model) InitModel

func (m *TN82Model) InitModel(al align.Alignment, weights []float64) (err error)

type TN93Model

type TN93Model struct {
	// contains filtered or unexported fields
}

func NewTN93Model

func NewTN93Model(removegaps bool) *TN93Model

func (*TN93Model) Distance

func (m *TN93Model) Distance(seq1 []rune, seq2 []rune, weights []float64) (float64, error)

computes TN93 distance between 2 sequences

func (*TN93Model) InitModel

func (m *TN93Model) InitModel(al align.Alignment, weights []float64) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL