Marker-based profiling

MetaPhlAn 3 versus 4

MetaPhlAn works by aligning reads against clade-specific marker genes — sequences chosen to be present in every member of a clade and absent everywhere else — and converting marker coverage into an estimate of relative abundance. That design has not changed. What changed between version 3 and version 4 is what the rows of the output table are, and that is a bigger change than it sounds.

What MetaPhlAn 3 was

MetaPhlAn 3 (Beghini et al., eLife, 2021, as part of bioBakery 3) built its marker set with ChocoPhlAn 3 from reference genomes. The scale, from the paper: ~1.1 million unique clade-specific markers covering 13,500 species, selected from a set of 16,800 species pangenomes derived from roughly 100,000 reference genomes — about 84 ± 47 markers per species. The shipped database is mpa_v30_CHOCOPhlAn_201901.

The key property: every row is a named taxon, from a reference genome, with a place in the NCBI taxonomy. If an organism in your sample had no sequenced isolate, it had no markers, and MetaPhlAn 3 could not see it at all — not as an unknown, simply not at all.

What MetaPhlAn 4 changed

MetaPhlAn 4 (Blanco-Míguez et al., Nature Biotechnology, 2023) folded in metagenome assemblies alongside isolate genomes. The unit of the database is no longer a named species but a species-level genome bin.

the community cultured never cultured — invisible to MetaPhlAn 3 genome sources isolate genomes MAGs — over a million, mostly unnamed cluster at a fixed genetic distance kSGB — contains an isolate has a species name 21,978 known SGBs e.g. Blautia wexlerae uSGB — MAGs only no name, no isolate 4,992 unknown SGBs e.g. SGB4933_group kSGBs uSGBs — now quantified a uSGB is only as good as the MAGs that defined it

Side by side

MetaPhlAn 3MetaPhlAn 4 / 4.1
Unit of the outputnamed species from reference genomesspecies-level genome bins (SGBs), known and unknown
Marker sourceChocoPhlAn 3, from ~100,000 reference genomesChocoPhlAn SGB, reference genomes plus >1.1 million MAGs
Markers~1.1 M, ~84 ± 47 per species~7.3 M in the 4.1 database
Taxa covered13,500 species26,970 SGBs (21,978 known + 4,992 unknown) at the 2023 paper
Database stringmpa_v30_CHOCOPhlAn_201901mpa_vJun23_CHOCOPhlAnSGB_202307 for 4.1
Uncultured lineagesinvisiblequantified as uSGBs
Unclassified fractionnot reported--unclassified_estimation rescales abundances by the mapped fraction
Eukaryotes / viruseslimited eukaryotic markersSGB-level resolution for bacteria, archaea and eukaryotes
AlignerBowtie2 against the marker set, in both

Counts are as reported in the papers and manuals cited on the versions page. Database contents grow between releases — check metaphlan --version and the database string in your own output rather than trusting this table.

Comparing a version 3 table with a version 4 one

The short answer is that you cannot do it directly, and the ways people try mostly do not work.

  1. Rows are different objects A version 3 row is an NCBI species. A version 4 row is an SGB. Some SGBs map cleanly onto one named species; some split a named species into several SGBs; some group several named species into one. The mapping is many-to-many, and it is not a rename.
  2. Dropping the uSGBs does not fix it Tempting, because it leaves you with named rows. But the abundances of the remaining rows were computed in a community where the uSGBs were present and competing for reads. Delete them afterwards and your relative abundances no longer sum to anything meaningful.
  3. Collapsing to genus is the least-bad move Genus-level assignments are far more stable across the change than species-level ones, so if you must span the versions, do the comparison at genus or above and say that is why.
  4. Re-running is the actual answer If both datasets still exist as reads, re-profile the old one with the new version. It costs compute and nothing else, and it is the only comparison that is clean.
  5. And say which database string you used Not just MetaPhlAn 4 — the database string, which is what actually determines the content. Two people on the same MetaPhlAn version with different databases get different answers.
A practical convenience

MetaPhlAn ships sgb_to_gtdb_profile.py, which converts an SGB profile into GTDB taxonomy. That is useful if the rest of your pipeline speaks GTDB — but note it is a relabelling, not a re-analysis, and it does not make a version 4 profile comparable to a version 3 one. It makes it comparable to other GTDB-labelled things.

Flags worth knowing

FlagWhat it doesWhy it matters
--unclassified_estimationRescales relative abundances according to the fraction of reads that mappedWithout it, abundances sum to 100% of what was profiled, not of the sample. Two samples with very different mappability look more similar than they are.
--bowtie2outSaves the intermediate alignmentRe-profiling from the saved alignment is fast. Re-profiling from reads is not. Save it — the alignment is the expensive part.
--nprocThreads for Bowtie2The only knob that matters for wall-clock on a big sample.
--subsamplingSubsamples reads before profilingMakes samples of very different depth comparable, at the cost of sensitivity for rare taxa. A deliberate choice to state, not a default to accept.
--input_typefastq, bowtie2out, sam…The mechanism by which you re-analyse a saved alignment.