elynx-tree-0.5.0: Handle phylogenetic trees
Copyright(c) Dominik Schrempf 2020
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ELynx.Topology.Phylogeny

Description

Creation date: Sat Jul 18 13:15:49 2020.

A topology, as it is used in phylogenetics is a Topology with unique leaf labels, and the order of the topologies in the sub-forest is considered to be meaningless.

Internally, however, the underlying Topology data structure stores the sub-forest as a (non-empty) list, which has a specific order. Hence, we have to do some tricks when comparing topologies, and topology comparison is slow.

Also, the uniqueness of the leaves is not ensured by the data type, but has to be checked at runtime. Functions relying on the tree to have unique leaves do perform this check, and return Left with an error message, if the tree has duplicate leaves.

Note: Topologies are rooted.

Note: Topologies encoded in Newick format correspond to rooted topologies. By convention only, a topology parsed from Newick format is usually thought to be unrooted, when the root node is multifurcating and has three children. This convention is not enforced here. Newick topologies are just parsed as they are, and a rooted topology is returned.

The bifurcating root of a topology can be changed with roots, or rootAt.

Topologies with multifurcating root nodes can be properly rooted using outgroup.

Synopsis

Documentation

outgroup :: Ord a => Set a -> Topology a -> Either String (Topology a) Source #

Resolve a multifurcation at the root using an outgroup.

roots :: Topology a -> Either String (Forest a) Source #

For a rooted topology with a bifurcating root node, get all possible rooted topologies.

rootAt :: Ord a => Bipartition a -> Topology a -> Either String (Forest a) Source #

Root a tree at a specific position.