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.Distance

Description

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

Documentation

symmetric :: (Ord a, Named a) => Tree a -> Tree a -> Int Source #

See symmetricWith, but with id for comparisons.

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

incompatibleSplits :: (Ord a, Named a) => Tree a -> Tree a -> Int Source #

See incompatibleSplitsWith, use id for comparisons.

incompatibleSplitsWith :: (Ord b, Show b) => (a -> b) -> Tree a -> Tree a -> Int Source #

Number of incompatible splits. Similar to symmetricWith but all bipartition induced by multifurcations are considered. For a detailed description of how the distance is calculated, see compatible.

A multifurcation on a tree may (but not necessarily does) represent missing information about the order of bifurcations. In this case, it is interesting to get a set of compatible bifurcations of the tree. For example, the tree

(A,(B,C,D))

induces the following bipartitions:

A|BCD
B|ACD
C|ABD
D|ABC

Those are also reported by the function bipartitions. However, the tree is additionally compatible with the following hidden bipartitions:

AB|CD
AC|BD
AD|BC

For an explanation of how compatibility of a bipartition with a multipartition is checked, see compatible. Before using compatible, bipartitions are simply converted to multipartitions with two subsets.

Only if a bipartition is not compatible with all induced multifurcations of the other tree, it is incompatible.

XXX: Comparing a list of trees with this function recomputes bipartitions.

branchScore :: (Ord a, Named a, Measurable a) => Tree a -> Tree a -> Double Source #

See branchScoreWith, use id for comparisons.

branchScoreWith Source #

Arguments

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

pairwise Source #

Arguments

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

adjacent Source #

Arguments

:: (Tree a -> Tree a -> b)

Distance function

-> [Tree a]

Input trees

-> [b] 

Compute distances between adjacent pairs of a list of input trees. Use given distance measure.