elynx-tree-0.0.1: 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.

Minimal complete definition

getLen, setLen

Methods

getLen :: a -> Double Source #

Length of attached branch.

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

Set attached branch length.

lengthen :: Double -> a -> a Source #

Elongate branch length.

shorten :: Double -> a -> a Source #

Shorten branch length.

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

Distances from the root of a tree to its leaves.

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

Average distance from the root of a tree to its leaves.

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

Height of a tree. Returns 0 if the tree is empty.

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

Lengthen the distance between root and origin.

shortenRoot :: 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.