Safe Haskell | None |
---|
This is a preprocessor which can (optionally) be invoked to collapse short branch lengths.
- collapseBranches :: forall a. (a -> Bool) -> (a -> a -> a) -> NewickTree a -> NewickTree a
- collapseBranchLenThresh :: Double -> NewickTree DefDecor -> NewickTree DefDecor
- collapseBranchBootStrapThresh :: Int -> NewickTree DefDecor -> NewickTree DefDecor
- pruneTreeLeaves :: Set Label -> NewickTree DefDecor -> Maybe (NewickTree DefDecor)
Documentation
collapseBranches :: forall a. (a -> Bool) -> (a -> a -> a) -> NewickTree a -> NewickTree aSource
Removes branches that do not meet a predicate, leaving a shallower, bushier tree. This does NOT change the set of leaves (taxa), it only removes interior nodes.
`collapseBranches pred collapser tree` uses pred
to test the meta-data to see
if collapsing the intermediate node below the branch is necessary, and if it is,
it uses collapser
to reduce all the metadata for the collapsed branches into a
single piece of metadata.
collapseBranchLenThresh :: Double -> NewickTree DefDecor -> NewickTree DefDecorSource
A common configuration. Collapse branches based on a length threshold.
collapseBranchBootStrapThresh :: Int -> NewickTree DefDecor -> NewickTree DefDecorSource
A common configuration. Collapse branches based on bootstrap values.
pruneTreeLeaves :: Set Label -> NewickTree DefDecor -> Maybe (NewickTree DefDecor)Source
Prune the leaves of the tree to only those leaves in the provided set.
If ALL leaves are pruned from the set, this function returns nothing.