This skill reads, writes, and converts phylogenetic tree files, and chooses a parser that preserves the annotations an analysis depends on. The central idea is that a tree file is a lossy serialization: the topology almost always survives a conversion, but branch supports, posterior probabilities, HPD intervals, and per-branch rates do not, and which ones survive is decided by the parsing tool, not by the format string. The most consequential decision is therefore tool selection: reading a BEAST or MrBayes tree with Bio.Phylo or ape::read.nexus silently discards the credible intervals, while treeio (R) and DendroPy (Python) keep them.
A second, subtler trap is that a bare number in plain Newick has no fixed meaning: (A,B)95 could be a bootstrap, a posterior, or a clade name, and IQ-TREE writes two values (SH-aLRT/UFBoot) into the same slot, so a careless parser truncates or mislabels support.
pip install biopython (general I/O), pip install dendropy (annotation-preserving reads).treeio and ape (Bioconductor/CRAN).[&...] comments and only purpose-built readers parse them.Tell your AI agent what you want to do: - "Read this Newick tree file and show me the taxa" - "Convert my Nexus tree to Newick but keep the posterior probabilities" - "Parse all trees from my MrBayes posterior file" - "My BEAST MCC tree lost its HPD bars after conversion - how do I recover them?" - "Are the numbers on my internal nodes bootstraps or clade names?"
"Read the tree from tree.nwk and show its structure and branch lengths" "Parse all trees from my MrBayes .trees posterior and tell me how many there are"
"I need plain Newick for a downstream tool but my tree is a BEAST MCC with HPD intervals - extract the node ages and credible intervals first" "Read this BEAST tree and list every annotation it carries before I decide what to drop"
"Convert my Nexus file from MrBayes to Newick and tell me exactly what is lost" "Transform this Newick tree to phyloXML so I can add typed taxonomy"
"The internal labels on my IQ-TREE output are like 87.5/98 - split them into SH-aLRT and UFBoot"
[&...] annotations matter..confidence vs .name) and that tip labels survive a round-trip against any metadata table.[&...] metadata survives. Never bridge a BEAST tree through Bio.Phylo or ape::read.nexus when the HPDs matter..trees file is the full posterior; a .tree/.mcc is the single annotated summary. Use Phylo.parse/TreeList for the former, and do not confuse them.[A-Za-z0-9_.] and remember the Newick underscore-space convention, which silently desyncs labels from a metadata join key.