GraftM: a tool for scalable, phylogenetically informed classification of genes within metagenomes

Nucleic Acids Res. 2018 Jun 1;46(10):e59. doi: 10.1093/nar/gky174.


Large-scale metagenomic datasets enable the recovery of hundreds of population genomes from environmental samples. However, these genomes do not typically represent the full diversity of complex microbial communities. Gene-centric approaches can be used to gain a comprehensive view of diversity by examining each read independently, but traditional pairwise comparison approaches typically over-classify taxonomy and scale poorly with increasing metagenome and database sizes. Here we introduce GraftM, a tool that uses gene specific packages to rapidly identify gene families in metagenomic data using hidden Markov models (HMMs) or DIAMOND databases, and classifies these sequences using placement into pre-constructed gene trees. The speed and accuracy of GraftM was benchmarked with in silico and in vitro mock communities using taxonomic markers, and was found to have higher accuracy at the family level with a processing time 2.0-3.7× faster than currently available software. Exploration of a wetland metagenome using 16S rRNA- and methyl-coenzyme M reductase (McrA)-specific gpkgs revealed taxonomic and functional shifts across a depth gradient. Analysis of the NCBI nr database using the McrA gpkg allowed the detection of novel sequences belonging to phylum-level lineages. A growing collection of gpkgs is available online (, where curated packages can be uploaded and exchanged.

Publication types

  • Research Support, Non-U.S. Gov't
  • Research Support, U.S. Gov't, Non-P.H.S.

MeSH terms

  • Computer Simulation
  • Databases, Genetic
  • Genes, Archaeal
  • Genes, Bacterial
  • Markov Chains
  • Metagenome / genetics*
  • Metagenomics / methods*
  • Phylogeny*
  • RNA, Ribosomal, 16S / genetics
  • Sensitivity and Specificity
  • Software*
  • Soil Microbiology
  • Sweden


  • RNA, Ribosomal, 16S