fasttree(1)

πŸ¦‹ fasttree πŸ¦‹

okay bestie, this is the fasttree(1) page πŸ’– It lives in the User Commands section, so it's a command you run straight from your terminal πŸ’…


🌸 NAME 🌸

fasttree is all about creating phylogenetic trees from alignments of nucleotide or protein sequences 🌳✨


πŸ’– DESCRIPTION πŸ’–

okay so fasttree infers approximately-maximum-likelihood phylogenetic trees from alignments of nucleotide or protein sequences 🌸 It can handle alignments with up to a million sequences in a reasonable amount of time and memory, which is literally iconic πŸ‘‘

it's more accurate than PhyML 3 with default settings ✨ and much more accurate than the distance-matrix methods people traditionally reach for with big alignments πŸ’…

for models, fasttree uses the Jukes-Cantor or generalized time-reversible (GTR) models of nucleotide evolution 🧬 and the JTT (Jones-Taylor-Thornton 1992) model of amino acid evolution 🫢 rates of evolution vary from site to site, so to handle that it uses a single rate for each site (the "CAT" approximation) πŸ¦‹ and to quickly estimate how reliable each split in the tree is, it computes local support values with the Shimodaira-Hasegawa test (these are the same as PhyML 3's "SH-like local supports") πŸ”₯


🌳 SYNOPSIS 🌳

here's how you actually call it 🫢

fasttree protein_alignment > tree

fasttree -nt nucleotide_alignment > tree

fasttree -nt -gtr < nucleotide_alignment > tree

fasttree accepts alignments in fasta or phylip interleaved formats πŸ“

πŸ’… Common options (must be before the alignment file): πŸ’…

these ones have to come before the alignment file, bestie πŸ™ˆ

  • -quiet β€” shh, stop reporting information 🀫
  • -nopr β€” no progress indicator for you πŸ™…β€β™€οΈ
  • -log logfile β€” save intermediate trees, settings, and model details πŸ“
  • -fastest β€” speeds up the neighbor joining phase and reduces memory usage πŸš€ (recommended for >50,000 sequences)
  • -n <number> β€” analyze multiple alignments (phylip format only) πŸ¦‹ (use this for global bootstrap, with seqboot and CompareToBootstrap.pl)
  • -nosupport β€” don't compute support values
  • -intree newick_file β€” set the starting tree(s) 🌱
  • -intree1 newick_file β€” use this starting tree for all the alignments 🌈 (for faster global bootstrap on huge alignments)
  • -pseudo β€” use pseudocounts 🧁 (recommended for highly gapped sequences)
  • -gtr β€” generalized time-reversible model 🧬 (nucleotide alignments only)
  • -wag β€” Whelan-And-Goldman 2001 model πŸ’œ (amino acid alignments only)
  • -quote β€” allow spaces and other restricted characters (but not ' characters) in sequence names, and quote names in the output tree πŸŽ€ (fasta input only; fasttree will not be able to read these trees back in)
  • -noml β€” turn off maximum-likelihood πŸ™…β€β™€οΈ
  • -nome β€” turn off minimum-evolution NNIs and SPRs πŸ™…β€β™€οΈ (recommended if running additional ML NNIs with -intree)
  • -nome -mllen β€” with -intree, optimize branch lengths for a fixed topology 🧚
  • -cat # β€” specify the number of rate categories of sites (default 20) 🌈 or use -nocat to use constant rates
  • -gamma β€” after optimizing the tree under the CAT approximation, rescale the lengths to optimize the Gamma20 likelihood ✨
  • -constraints constraintAlignment β€” constrain the topology search πŸ”’ constraintAlignment should have 1s or 0s to indicate splits
  • -expert β€” see more options πŸ‘€

🧠 Detailed usage for fasttree 2.1.4 SSE3: 🧠

this is the full, unfiltered usage line for version 2.1.4 SSE3 πŸ’€

fasttree [-nt] [-n 100] [-quote] [-pseudo | -pseudo 1.0]

              [-boot 1000 | -nosupport] [-intree starting_trees_file | -intree1
              starting_tree_file] [-quiet | -nopr] [-nni 10] [-spr 2] [-noml |
              -mllen | -mlnni 10] [-mlacc 2] [-cat 20 | -nocat] [-gamma] [-slow
              | -fastest] [-2nd | -no2nd] [-slownni] [-seed 1253] [-top |
              -notop] [-topm 1.0 [-close 0.75] [-refresh 0.8]] [-matrix Matrix
              | -nomatrix] [-nj | -bionj] [-wag] [-nt] [-gtr] [-gtrrates ac ag
              at cg ct gt] [-gtrfreq A C G T] [ -constraints
              constraintAlignment [ -constraintWeight 100.0 ] ] [-log logfile]

              [ alignment_file ]

              > newick_tree

       or

       fasttree [-nt] [-matrix Matrix | -nomatrix] [-rawdist] -makematrix
       [alignment]

              [-n 100] > phylip_distance_matrix

fasttree supports fasta or phylip interleaved alignments. By default fasttree expects protein alignments, so use -nt for nucleotides. If no alignment file is given, fasttree reads standard input 🫧

πŸ“₯ Input/output options: πŸ“₯

  • -n β€” read in multiple alignments. This only works with phylip interleaved format 🧩 For example, you can use it with the output from phylip's seqboot. If you use -n, fasttree will write 1 tree per line to standard output.
  • -intree newickfile β€” read the starting tree in from newickfile. Any branch lengths in the starting trees are ignored.
  • -intree (with -n) β€” reads a separate starting tree for each alignment 🌿
  • -intree1 newickfile β€” read the same starting tree for each alignment 🌿
  • -quiet β€” do not write to standard error during normal operation (no progress indicator, no options summary, no likelihood values, etc.) 🀫
  • -nopr β€” do not write the progress indicator to stderr πŸ™…β€β™€οΈ
  • -log logfile β€” save intermediate trees so you can extract the trees and restart long-running jobs if they crash πŸ›Ÿ -log also reports the per-site rates (1 means slowest category).
  • -quote β€” quote sequence names in the output and allow spaces, commas, parentheses, and colons in them, but not ' characters (fasta files only) πŸŽ€

πŸ§ͺ Distances: πŸ§ͺ

Default: for protein sequences, you get log-corrected distances and an amino acid dissimilarity matrix derived from BLOSUM45. For nucleotide sequences, you get Jukes-Cantor distances. To specify a different matrix, use -matrix FilePrefix or -nomatrix. Use -rawdist to turn the log-correction off, or to use %different instead of Jukes-Cantor πŸ“

  • -pseudo [weight] β€” use pseudocounts to estimate distances between sequences with little or no overlap 🧁 (Off by default.) This is recommended if your alignment has sequences with little or no overlap. If the weight is not specified, it is 1.0.

🌲 Topology refinement: 🌲

by default, fasttree tries to improve the tree with up to 4*log2(N) rounds of minimum-evolution nearest-neighbor interchanges (NNI), where N is the number of unique sequences ✨ plus 2 rounds of subtree-prune-regraft (SPR) moves (also min. evo.), and up to 2*log(N) rounds of maximum-likelihood NNIs πŸ”₯

  • -nni β€” sets the number of rounds of min. evo. NNIs πŸ”
  • -spr β€” sets the number of rounds of SPRs πŸ”
  • -noml β€” turns off both min-evo NNIs and SPRs (useful if refining an approximately maximum-likelihood tree with further NNIs) πŸ™…β€β™€οΈ
  • -sprlength β€” sets the maximum length of a SPR move (default 10) πŸͺ„
  • -mlnni β€” sets the number of rounds of maximum-likelihood NNIs πŸ”
  • -mlacc 2 or -mlacc 3 β€” always optimize all 5 branches at each NNI, and optimize all 5 branches in 2 or 3 rounds πŸ’…
  • -mllen β€” optimize branch lengths without ML NNIs πŸ“
  • -mllen -nome (with -intree) β€” optimize branch lengths on a fixed topology 🧚
  • -slownni β€” turns off heuristics to avoid constant subtrees (affects both ML and ME NNIs) πŸ™ˆ

⏭️ part 2 picks up with the maximum likelihood model options, so stay tuned πŸ‘€πŸ«Ά

Okay bestie, here's the deets on where to find more πŸ’– Check out http://www.microbesonline.org/fasttree/ or just read the comments in the source code 🫢

Here's how you actually run it, it's so easy 🧚

fasttree protein_alignment > tree
fasttree -nt nucleotide_alignment > tree
fasttree -nt -gtr < nucleotide_alignment > tree

FastTree takes alignments in fasta or phylip interleaved format, no cap 🌸

Common options (must be before the alignment file)

Okay these options have to go BEFORE the alignment file, so don't mess up the order bestie πŸ™ˆ

  • -quiet β€” shush the reporting info 🀫 (suppresses the reporting information)
  • -nopr β€” turns off the progress indicator so it stops nagging you πŸ“Š
  • -log logfile β€” saves intermediate trees, settings, and model details to your logfile πŸ“
  • -fastest β€” speeds up the neighbor joining phase and cuts down on memory usage ⚑ (recommended for >50,000 sequences, that's a LOT of sequences πŸ’€)
  • -n <number> β€” analyzes multiple alignments, but ONLY in phylip format 🧩 (use this for global bootstrap, with seqboot and CompareToBootstrap.pl)
  • -nosupport β€” skips computing support values πŸ™…
  • -intree newick_file β€” sets the starting tree(s) 🌳
  • -intree1 newick_file β€” uses this one starting tree for ALL the alignments πŸ‘‘ (great for a faster global bootstrap on huge alignments)
  • -pseudo β€” turns on pseudocounts πŸ•³οΈ (recommended for highly gapped sequences)
  • -gtr β€” generalized time-reversible model 🧬 (nucleotide alignments only)
  • -wag β€” Whelan-And-Goldman 2001 model πŸ§ͺ (amino acid alignments only)
  • -quote β€” lets sequence names have spaces and other restricted characters (but not ' characters) and quotes the names in the output tree πŸŽ€ (fasta input only; fasttree will not be able to read these trees back in ⚠️)
  • -noml β€” turns off maximum-likelihood πŸ™ƒ
  • -nome β€” turns off minimum-evolution NNIs and SPRs πŸ’… (recommended if you're running additional ML NNIs with -intree)
  • -nome -mllen β€” used with -intree, optimizes branch lengths for a fixed topology 🌿
  • -cat # β€” sets the number of rate categories of sites πŸ¦‹ (default 20)
  • -nocat β€” uses constant rates instead πŸ“
  • -gamma β€” after optimizing the tree under the CAT approximation, rescales the lengths to optimize the Gamma20 likelihood ✨
  • -constraints constraintAlignment β€” constrains the topology search 🧱 (constraintAlignment should have 1s or 0s to indicate splits)
  • -expert β€” unlocks even more options 🧠
Heads up, bestie: trees made with -quote can't be read back in by fasttree, so plan accordingly πŸ™ˆ

For more information, see http://www.microbesonline.org/fasttree/ 🌈


Page brought to you by the Lawrence Berkeley National Lab, June 2012 πŸ“πŸ’– Stay iconic, bestie πŸ¦‹βœ¨