elynx-tree-0.1.0: Handle phylogenetic trees

Copyright(c) Dominik Schrempf 2019
LicenseGPL-3
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ELynx.Data.Tree.MeasurableTree

Description

Creation date: Thu Jan 17 14:16:34 2019.

Synopsis

Documentation

class Measurable a where Source #

A Node label with measurable and modifiable branch length to the parent.

Methods

getLen :: a -> Double Source #

Length of attached branch.

setLen :: Double -> a -> a Source #

Set attached branch length.

Instances
Measurable (PhyloLabel a) Source #

If no branch length is available, 0 is returned. This is probably not the best (and final) behavior.

Instance details

Defined in ELynx.Data.Tree.PhyloTree

distancesRootLeaves :: Measurable a => Tree a -> [Double] Source #

Distances from the root node of a tree to its leaves (this are not the distances from the origin to the leaves, see distancesOriginLeaves).

distancesOriginLeaves :: Measurable a => Tree a -> [Double] Source #

Distances from the origin of a tree to its leaves (this is not the distance from the root node to the leaves, which would be distanceOriginLeaves t - (getLen $ rootLabel t).). See also distancesRootLeaves.

averageDistanceOriginLeaves :: Measurable a => Tree a -> Double Source #

Average distance from the origin of a tree to its leaves, see distancesOriginLeaves.

height :: Measurable a => Tree a -> Double Source #

Height (max distance between origin and leaves) of a tree. Return 0 if the tree is empty.

rootHeight :: Measurable a => Tree a -> Double Source #

Height of root node. Return 0 if the tree is empty.

lengthenStem :: Measurable a => Double -> Tree a -> Tree a Source #

Lengthen the distance between root and origin.

shortenStem :: Measurable a => Double -> Tree a -> Tree a Source #

Lengthen the distance between root and origin.

summarize :: Measurable a => Tree a -> ByteString Source #

Summarize a tree with measureable branch lengths.

totalBranchLength :: Measurable a => Tree a -> Double Source #

Total branch length of a tree.

normalize :: Measurable a => Tree a -> Tree a Source #

Normalize tree so that sum of branch lengths is 1.0.

prune :: Measurable a => Tree a -> Tree a Source #

Prune degree 2 nodes. Add branch lengths but forget pruned node label. See pruneWith.

removeMultifurcations :: Measurable a => Tree a -> Tree a Source #

Remove multifurcations by copying multifurcating nodes and introducing branches of length 0.

ultrametric :: Measurable a => Tree a -> Bool Source #

Check if a tree is ultrametric.