Copyright | (c) Dominik Schrempf 2020 |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Thu Jan 17 14:16:34 2019.
Non-negativity of branch lengths is not (yet) ensured. To ensure non-negativity, a newtype wrapper could be used, but this would be a major refactor.
Synopsis
- type BranchLength = Double
- class Measurable e where
- getLen :: e -> BranchLength
- setLen :: BranchLength -> e -> e
- applyStem :: Measurable e => (BranchLength -> BranchLength) -> Tree e a -> Tree e a
- getStem :: Measurable e => Tree e a -> BranchLength
- setStem :: Measurable e => BranchLength -> Tree e a -> Tree e a
- height :: Measurable e => Tree e a -> BranchLength
- rootHeight :: Measurable e => Tree e a -> BranchLength
- distancesOriginLeaves :: Measurable e => Tree e a -> [BranchLength]
- totalBranchLength :: Measurable e => Tree e a -> BranchLength
- normalizeBranchLengths :: Measurable e => Tree e a -> Tree e a
- normalizeHeight :: Measurable e => Tree e a -> Tree e a
- ultrametric :: Measurable e => Tree e a -> Bool
- makeUltrametric :: Measurable e => Tree e a -> Tree e a
Documentation
type BranchLength = Double Source #
Branch length.
class Measurable e where Source #
A branch label with measurable and modifiable branch length.
getLen :: e -> BranchLength Source #
Length of attached branch.
setLen :: BranchLength -> e -> e Source #
Set attached branch length.
Instances
Measurable Double Source # | |
Defined in ELynx.Tree.Measurable | |
Measurable PhyloExplicit Source # | |
Defined in ELynx.Tree.Phylogeny getLen :: PhyloExplicit -> BranchLength Source # setLen :: BranchLength -> PhyloExplicit -> PhyloExplicit Source # | |
Measurable Length Source # | |
Defined in ELynx.Tree.Phylogeny |
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.