Find the most recent common ancestor (MRCA) of a set of tips in a phylogenetic tree
The input tree (-t
) must be rooted and in newick format, with internal nodes labelled. Tip names are matched by providing a regular expression to -r
:
> mrca -t rooted.newick -r "in|out0"
Node2
The MRCA node's label is written to stdout
. If the MRCA is the root of the tree, "root" will be printed if the root node is not named.
./mrca -h
Usage:
[flags]
Flags:
-h, --help help for this command
-r, --regex string regex of tip names to parse
-t, --tree string tree file to read (in Newick format)
First, install go,
then:
go install github.com/bjeight/mrca@latest
or
git clone https://github.com/bjeight/mrca.git
cd mrca
go build -o mrca