Copyright | (c) Dominik Schrempf 2020 |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Thu Jan 17 14:56:27 2019.
Some functions are inspired by Biobase.Newick.Import.
In particular, no conversion from _ to (space) is done right now.
For a description of rooted Tree
s, please see the Rooted
Code snippet:
import Data.Attoparsec.ByteString import ELynx.Tree getOneNewick = either error id . parseOnly (oneNewick Standard)
Synopsis
- data NewickFormat
- describeNewickFormat :: NewickFormat -> String
- newick :: NewickFormat -> Parser (Tree Phylo Name)
- parseNewick :: NewickFormat -> ByteString -> Tree Phylo Name
- oneNewick :: NewickFormat -> Parser (Tree Phylo Name)
- parseOneNewick :: NewickFormat -> ByteString -> Tree Phylo Name
- someNewick :: NewickFormat -> Parser (Forest Phylo Name)
- parseSomeNewick :: NewickFormat -> ByteString -> [Tree Phylo Name]
Documentation
data NewickFormat Source #
Newick tree format.
>>>
unlines $ map (("- " <>) . description) (allValues :: [NewickFormat])
- Standard: Branch support values are stored in square brackets after branch lengths. - IqTree: Branch support values are stored as node names after the closing bracket of forests. - RevBayes: Key-value pairs is provided in square brackets after node names as well as branch lengths. XXX: Key value pairs are ignored at the moment.
Instances
describeNewickFormat :: NewickFormat -> String Source #
Short description of the supported Newick formats.
newick :: NewickFormat -> Parser (Tree Phylo Name) Source #
Newick tree parser. Also succeeds when more trees follow.
parseNewick :: NewickFormat -> ByteString -> Tree Phylo Name Source #
See newick
.
oneNewick :: NewickFormat -> Parser (Tree Phylo Name) Source #
One Newick tree parser. Fails when end of input is not reached.
parseOneNewick :: NewickFormat -> ByteString -> Tree Phylo Name Source #
See oneNewick
.
someNewick :: NewickFormat -> Parser (Forest Phylo Name) Source #
One or more Newick trees parser.
parseSomeNewick :: NewickFormat -> ByteString -> [Tree Phylo Name] Source #
See someNewick
.