Documentation ¶
Overview ¶
package acr provides data structures & functions for ancestral character reconstruction methods
Index ¶
Constants ¶
const ( ALGO_DELTRAN = iota ALGO_ACCTRAN ALGO_DOWNPASS ALGO_NONE )
Variables ¶
This section is empty.
Functions ¶
func AncestralStateIndices ¶
func ParsimonyAcr ¶
func ParsimonyAcr(t *tree.Tree, tipCharacters map[string]string, algo int, randomResolve bool) (nametostates map[string]string, nsteps int, err error)
Will annotate the tree nodes with ancestral characters Computed using parsimony Characters will be located in the comment field of each node at the first index tipCharacters: mapping between tipnames and character state Algo: One of ALGO_DELTRAN, ALGO_ACCTRAN, and ALGO_DOWNPASS : returns an error otherwise If ALGO_DOWNPASS, just executes UPPASS then DOWNPASS, If ALGO_DELTRAN, then executes UPPASS, DOWNPASS, then DELTRAN, If ALGO_ACCTRAN, then executes UPPASS and ACCTRAN Returns a map with the states of all nodes. If a node has a name, key is its name, if a node has no name, the key will be its id in the deep first traversal of the tree. Also returns the number of parsimony steps if randomResolve is true, then in the second pass, each ambiguities will be resolved randomly
Types ¶
type AncestralState ¶
type AncestralState []float64
counts or probabilities of each character indices correspond to Alphanumeric order of the alphabet (all possible states)