This skill computes evolutionary distance matrices from sequence alignments and builds fast distance-based trees (NJ, BIONJ, FastME, UPGMA), with bootstrap support and a saturation pre-flight. The idea everything hinges on: a distance is a model-corrected estimate of expected substitutions per site, the correction is where the biology lives, and the matrix discards the per-site information ML uses, so distance trees are fast and scalable but only as good as the correction, and structurally weaker than ML on hard, homoplasy-rich data. Two flat rules drive most decisions: never use UPGMA for molecular phylogeny without an established clock, and never call Biopython's identity distance a Jukes-Cantor tree (it is uncorrected; use ape dist.dna or FastME for a real correction).
pip install biopython scikit-bio # Python NJ algorithm + p-distance / matrix distances
# Model-corrected distances live in R:
# Rscript -e "install.packages(c('ape','phangorn'))"
# FastME standalone (best distance tree, large n): conda install -c bioconda fastme
Conceptual prerequisites: a trimmed multiple sequence alignment (distances are only as good as the alignment); awareness that Bio.Phylo and scikit-bio do NOT correct for multiple hits, so divergent data needs ape/FastME for the distance step.
Tell your AI agent what you want to do: - "Build a neighbor joining tree from this alignment" - "Compute a TN93-corrected distance matrix and a FastME tree" - "Test my sequences for substitution saturation before I trust a distance tree" - "Make a bootstrap consensus distance tree with 500 replicates"
"Compute a model-corrected distance matrix from this DNA alignment using TN93 with a gamma correction"
"My taxa have very different GC content: give me a LogDet distance matrix instead of JC"
"Calculate protein distances from this alignment using the LG matrix"
"Build a FastME balanced-minimum-evolution tree from these sequences"
"Make a neighbor joining tree and explain why you did not use UPGMA"
"Generate a fast NJ starting tree to seed an IQ-TREE ML search"
"Check whether these deep divergences are saturated before building a distance tree"
"Plot transitions against corrected distance to see if the signal has plateaued"
"Build a distance tree and report bootstrap support with 1000 replicates"
"Why is my bootstrap support high on a clade that looks wrong?"
DistanceCalculator has no JC/K80/TN93; do the correction in ape/FastME and pass the matrix in, or stay in R.