elynx-tree-0.5.0.2: 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.

THIS MODULE IS INCOMPLETE.

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: Topologys are rooted.

Note: Topologys 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 or more children. This convention is not enforced here. Newick topologies are just parsed as they are, and a rooted topology is returned.

THIS MODULE IS INCOMPLETE.

Synopsis

Documentation

equal :: (Eq a, Ord a) => Topology a -> Topology a -> Either String Bool Source #

The equality check is slow because the order of children is considered to be arbitrary.

NOTE: The equality check is only meaningful if the topologies have unique leaves.

Return Left if a topology does not have unique leaves.

equal' :: Eq a => Topology a -> Topology a -> Bool Source #

Same as equal, but assume that leaves are unique.