Copyright | (c) Dominik Schrempf 2019 |
---|---|
License | GPL-3 |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Thu Jun 13 17:15:54 2019.
Various distance functions for phylogenetic trees (and binary trees in general). All trees are assumed to be UNROOTED.
Synopsis
- symmetricDistance :: Ord a => Tree a -> Tree a -> Int
- symmetricDistanceWith :: Ord b => (a -> b) -> Tree a -> Tree a -> Int
- incompatibleSplitsDistance :: (Ord a, Show a) => Tree a -> Tree a -> Int
- incompatibleSplitsDistanceWith :: (Ord b, Show b) => (a -> b) -> Tree a -> Tree a -> Int
- computePairwiseDistances :: (a -> a -> b) -> [a] -> [(Int, Int, b)]
- computeAdjacentDistances :: (Tree a -> Tree a -> b) -> [Tree a] -> [b]
- branchScoreDistance :: (Ord a, Measurable a, Named a) => Tree a -> Tree a -> Double
- branchScoreDistanceWith :: (Ord a, Ord b, Floating c) => (a -> b) -> (a -> c) -> Tree a -> Tree a -> c
Documentation
symmetricDistance :: Ord a => Tree a -> Tree a -> Int Source #
See symmetricDistanceWith
, but with id
for comparisons.
symmetricDistanceWith :: Ord b => (a -> b) -> Tree a -> Tree a -> Int Source #
Symmetric (Robinson-Foulds) distance between two trees. Before comparing
the leaf labels, apply a given function. This is useful, for example, to
compare the labels of Named
trees on their names only. The tree is assumed
to be UNROOTED!
XXX: Comparing a list of trees with this function recomputes bipartitions.
incompatibleSplitsDistance :: (Ord a, Show a) => Tree a -> Tree a -> Int Source #
See incompatibleSplitsDistanceWith
, use id
for comparisons.
incompatibleSplitsDistanceWith :: (Ord b, Show b) => (a -> b) -> Tree a -> Tree a -> Int Source #
Number of incompatible splits. Similar to symmetricDistanceWith
but
merges multifurcations.
XXX: Comparing a list of trees with this function recomputes bipartitions.
computePairwiseDistances Source #
:: (a -> a -> b) | Distance function |
-> [a] | Input trees |
-> [(Int, Int, b)] | (index i, index j, distance i j) |
Compute pairwise distances of a list of input trees. Use given distance measure. Returns a triple, the first two elements are the indices of the compared trees, the third is the distance.
computeAdjacentDistances Source #
Compute distances between adjacent pairs of a list of input trees. Use given distance measure.
branchScoreDistance :: (Ord a, Measurable a, Named a) => Tree a -> Tree a -> Double Source #
See branchScoreDistanceWith
, use id
for comparisons.
branchScoreDistanceWith Source #
:: (Ord a, Ord b, Floating c) | |
=> (a -> b) | Label to compare on |
-> (a -> c) | Branch information (e.g., length) associated with a node |
-> Tree a | |
-> Tree a | |
-> c |
Compute branch score distance between two trees. Before comparing the leaf
labels, apply a function. This is useful, for example, to compare the labels
of Named
trees on their names only. The branch information which is
compared to compute the distance is extracted from the nodes with a given
function. Assumes that the trees are UNROOTED.
XXX: Comparing a list of trees with this function recomputes bipartitions.