elynx-tree-0.3.2: Handle phylogenetic trees

Copyright(c) Dominik Schrempf 2020
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ELynx.Data.Tree.Measurable

Description

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

Synopsis

Documentation

type BranchLength = Double Source #

Branch length.

class Measurable e where Source #

A branch label with measurable and modifiable branch length.

Methods

getLen :: e -> BranchLength Source #

Length of attached branch.

setLen :: BranchLength -> e -> e Source #

Set attached branch length.

applyStem :: Measurable e => (BranchLength -> BranchLength) -> Tree e a -> Tree e a Source #

Lengthen the stem of a tree.

getStem :: Measurable e => Tree e a -> BranchLength Source #

Get the length of the stem of a tree.

setStem :: Measurable e => BranchLength -> Tree e a -> Tree e a Source #

Set the length of the stem of a tree.

height :: Measurable e => Tree e a -> BranchLength Source #

The maximum distance between origin and leaves.

The height includes the length of the stem.

rootHeight :: Measurable e => Tree e a -> BranchLength Source #

The maximum distance between root node and leaves.

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

Distances from the origin of a tree to the leaves.

The distances include the length of the stem.

totalBranchLength :: Measurable e => Tree e a -> BranchLength Source #

Total branch length of a tree.

normalizeBranchLengths :: Measurable e => Tree e a -> Tree e a Source #

Normalize branch lengths so that the sum is 1.0.

normalizeHeight :: Measurable e => Tree e a -> Tree e a Source #

Normalize height of tree to 1.0.

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

Check if a tree is ultrametric.

makeUltrametric :: Measurable e => Tree e a -> Tree e a Source #

Elongate terminal branches such that the tree becomes ultrametric.