Documentation ¶
Index ¶
- func ADPoissonTreeLoglike(nodels []*gophy.Node, lam float64) float64
- func AncTritomyML(tree *gophy.Node, sites []int)
- func AssertUnrootedTree(tree *gophy.Node)
- func BMCalcLensBackFront(t *gophy.Tree, sites []int)
- func BMOptimBLEM(t *gophy.Tree, niter int)
- func BMPruneRooted(n *gophy.Node)
- func BMPruneRootedSingle(n *gophy.Node, i int)
- func CalcExpectedTraits(tree *gophy.Node)
- func CalcRootedLogLike(n *gophy.Node, nlikes *float64, startFresh bool)
- func CalcSiteMeans(nodes []*gophy.Node) (siteSum []float64)
- func CalcUnrootedLogLike(tree *gophy.Node, startFresh bool) (chll float64)
- func ClusterCalcExpectedTraits(tree *gophy.Node, sites []int)
- func ClusterMissingTraitsEM(t *gophy.Tree, cluster *Cluster, niter int)
- func GreedyIterateLengthsMissing(t *gophy.Tree, sites []int, niter int)
- func InitMissingValues(tree []*gophy.Node)
- func IterateLengthsWeighted(tree *gophy.Tree, cluster *Cluster, niter int)
- func MakeMissingMeansTip(n *gophy.Node, means []float64)
- func MakeStratHeights(tree *gophy.Tree)
- func MaxClustLab(l map[int]*Cluster) (biggest int)
- func OldestChildAge(node *gophy.Node) float64
- func OptimizePreservationLam(tree *gophy.Tree) (float64, float64)
- func PBMLogLikeRt(tree *gophy.Node, startFresh bool, workers int) (sitelikes float64)
- func PoissonTreeLoglike(tree *gophy.Tree) float64
- func ReadMCLoutput(clfl string) (clusters map[int]*Cluster)
- func ReadStrat(stratfl string, t *gophy.Tree)
- func SingleSiteLL(tree *gophy.Node, site int) (sitelike float64)
- func SubUnrootedLogLikeParallel(tree *gophy.Node, sites []int, workers int) (sitelikes float64)
- func TimeTraverse(preNodes []*gophy.Node, internalOnly bool) (ret []*gophy.Node)
- func TritomySubML(tree *gophy.Node, sites []int)
- func TritomyWeightedML(tree *gophy.Node, weights map[int]float64)
- func WeightedUnrootedLogLikeParallel(tree *gophy.Node, startFresh bool, weights []float64, workers int) (sitelikes float64)
- type Cluster
- type HCSearch
- func (s *HCSearch) CalcRelLikes() (denom float64)
- func (s *HCSearch) CheckCluster(checkConfig *SiteConfiguration) (keep bool)
- func (s *HCSearch) ClusterString() string
- func (s *HCSearch) NewSiteConfig() *SiteConfiguration
- func (s *HCSearch) PerturbedRun()
- func (s *HCSearch) RefineSavedClusterings()
- func (s *HCSearch) RunEM()
- func (s *HCSearch) RunSingleHC()
- func (s *HCSearch) SplitEM()
- func (s *HCSearch) WriteBestClusters()
- func (s *HCSearch) WriteClusterTrees()
- type SiteConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ADPoissonTreeLoglike ¶
ADPoissonTreeLoglike calculates the ancestor - descendent
for a set of stratigraphic ranges
func AncTritomyML ¶
AncTritomyML will calculate the MLEs for the branch lengths of a tifurcating 3-taxon tree assuming that direct ancestors may be in the tree
func AssertUnrootedTree ¶
AssertUnrootedTree is a quick check to make sure the tree passed is unrooted
func BMCalcLensBackFront ¶
BMCalcLensBackFront will do one pass of the EM branch length estimation
func BMOptimBLEM ¶
BMOptimBLEM will calculate the BM branch lengths using an iterative EM calculation that imputes missing data using PICs
func BMPruneRooted ¶
BMPruneRooted will prune BM branch lens and PICs down to a rooted node root node should be a real (ie. bifurcating) root
func BMPruneRootedSingle ¶
BMPruneRootedSingle will prune BM branch lens and calculate PIC of a single trait down to a rooted node root node should be a real (ie. bifurcating) root
func CalcExpectedTraits ¶
CalcExpectedTraits will plug in the expected values for missing traits under BM using the pruning/PIC ancestral state estimation approach
func CalcRootedLogLike ¶
CalcRootedLogLike will return the BM likelihood of a tree assuming that no data are missing from the tips.
func CalcSiteMeans ¶
CalcSiteMeans will calculate the mean value for all the sites in the matrix for which the site is not missing
func CalcUnrootedLogLike ¶
CalcUnrootedLogLike will calculate the log-likelihood of an unrooted tree, while assuming that no sites have missing data.
func ClusterCalcExpectedTraits ¶
ClusterCalcExpectedTraits will plug in the expected values for missing traits under BM using the pruning/PIC ancestral state estimation approach
func ClusterMissingTraitsEM ¶
ClusterMissingTraitsEM will calculate the BM branch lengths using an iterative EM calculation that imputes missing data using PICs using the traits in a single cluster
func GreedyIterateLengthsMissing ¶
GreedyIterateLengthsMissing will calculate the BM branch lengths using an iterative EM calculation that imputes missing data using PICs using the traits in a single cluster
func InitMissingValues ¶
InitMissingValues will find the missing sites in a data matrix and plug in values corresponding to the mean of the remaining sites
func IterateLengthsWeighted ¶
IterateLengthsWeighted will iteratively calculate the ML branch lengths for a particular topology and cluster when doing the greedy site clustering procedure.
func MakeMissingMeansTip ¶
MakeMissingMeansTip will replace missing values with the mean across all tips for a single tip
func MakeStratHeights ¶
MakeStratHeights assigns the strat heights
func MaxClustLab ¶
MaxClustLab returns the maximum value in a map of ints used like a set
func OldestChildAge ¶
OldestChildAge returns the oldest Child
func OptimizePreservationLam ¶
OptimizePreservationLam will optimize the poisson rate parameter in the preservation model
func PBMLogLikeRt ¶
PBMLogLikeRt will calculate the BM log like on a rooted tree
func PoissonTreeLoglike ¶
PoissonTreeLoglike calculates the Poisson LogLike based on
stratigraphic ranges
func ReadMCLoutput ¶
func SingleSiteLL ¶
SingleSiteLL will return the likelihood of a single site
func SubUnrootedLogLikeParallel ¶
SubUnrootedLogLikeParallel will calculate the log-likelihood of an unrooted tree, while assuming that some sites have missing data. This can be used to calculate the likelihoods of trees that have complete trait sampling, but it will be slower than CalcRootedLogLike.
func TimeTraverse ¶
TimeTraverse will visit all descendant nodes in order of their heights (earliest -> latest)
func TritomySubML ¶
TritomySubML will calculate the MLEs for the branch lengths of a tifurcating 3-taxon tree using only the sites indicated in sites
func TritomyWeightedML ¶
TritomyWeightedML will calculate the MLEs for the branch lengths of a tifurcating 3-taxon tree
func WeightedUnrootedLogLikeParallel ¶
func WeightedUnrootedLogLikeParallel(tree *gophy.Node, startFresh bool, weights []float64, workers int) (sitelikes float64)
WeightedUnrootedLogLikeParallel will calculate the log-likelihood of an unrooted tree, while assuming that some sites have missing data. This can be used to calculate the likelihoods of trees that have complete trait sampling, but it will be slower than CalcRootedLogLike.
Types ¶
type Cluster ¶
type Cluster struct { Sites []int // this stores all of the sites with a preference for this cluster BranchLengths []float64 LogLike float64 SiteWeights map[int]float64 // this will store the probability that each site in the MATRIX belongs here. }
Cluster structure for sealiontomo stuff
type HCSearch ¶
type HCSearch struct { Tree *gophy.Tree PreorderNodes []*gophy.Node Clusters map[int]*Cluster SiteAssignments map[int]int Gen int Threads int Workers int RunName string LogOutFile string K int PrintFreq int CurrentAIC float64 NumTraits float64 Criterion int SavedConfig []*SiteConfiguration CurBestAIC float64 JoinLikes map[int]map[int]float64 SplitGen int Alpha float64 NumPoints float64 ExpandPenalty float64 MinK int }
func InitEMSearch ¶
func InitGreedyHC ¶
func TransferGreedyHC ¶
func (*HCSearch) CalcRelLikes ¶
func (*HCSearch) CheckCluster ¶
func (s *HCSearch) CheckCluster(checkConfig *SiteConfiguration) (keep bool)
func (*HCSearch) ClusterString ¶
ClusterString will return a string of the current set of clusters
func (*HCSearch) NewSiteConfig ¶
func (s *HCSearch) NewSiteConfig() *SiteConfiguration
func (*HCSearch) PerturbedRun ¶
func (s *HCSearch) PerturbedRun()
func (*HCSearch) RefineSavedClusterings ¶
func (s *HCSearch) RefineSavedClusterings()
func (*HCSearch) RunSingleHC ¶
func (s *HCSearch) RunSingleHC()
func (*HCSearch) WriteBestClusters ¶
func (s *HCSearch) WriteBestClusters()
func (*HCSearch) WriteClusterTrees ¶
func (s *HCSearch) WriteClusterTrees()
type SiteConfiguration ¶
type SiteConfiguration struct { Sites map[int]map[int]bool AIC float64 ClusterTrees map[int]string ClusterSizes map[int]int ClusterString string }
func (*SiteConfiguration) CalcClusterSizes ¶
func (c *SiteConfiguration) CalcClusterSizes()
func (*SiteConfiguration) Equals ¶
func (c *SiteConfiguration) Equals(check *SiteConfiguration) (equal bool)