acr

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: GPL-2.0 Imports: 6 Imported by: 1

Documentation

Overview

package acr provides data structures & functions for ancestral character reconstruction methods

Index

Constants

View Source
const (
	ALGO_DELTRAN = iota
	ALGO_ACCTRAN
	ALGO_DOWNPASS
	ALGO_NONE
)

Variables

This section is empty.

Functions

func AncestralStateIndices

func AncestralStateIndices(alphabet []string) map[string]int

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)

Jump to

Keyboard shortcuts

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