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.
Side by side
| MetaPhlAn 3 | MetaPhlAn 4 / 4.1 | |
|---|---|---|
| Unit of the output | named species from reference genomes | species-level genome bins (SGBs), known and unknown |
| Marker source | ChocoPhlAn 3, from ~100,000 reference genomes | ChocoPhlAn 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 covered | 13,500 species | 26,970 SGBs (21,978 known + 4,992 unknown) at the 2023 paper |
| Database string | mpa_v30_CHOCOPhlAn_201901 | mpa_vJun23_CHOCOPhlAnSGB_202307 for 4.1 |
| Uncultured lineages | invisible | quantified as uSGBs |
| Unclassified fraction | not reported | --unclassified_estimation rescales abundances by the mapped fraction |
| Eukaryotes / viruses | limited eukaryotic markers | SGB-level resolution for bacteria, archaea and eukaryotes |
| Aligner | Bowtie2 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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
| Flag | What it does | Why it matters |
|---|---|---|
--unclassified_estimation | Rescales relative abundances according to the fraction of reads that mapped | Without 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. |
--bowtie2out | Saves the intermediate alignment | Re-profiling from the saved alignment is fast. Re-profiling from reads is not. Save it — the alignment is the expensive part. |
--nproc | Threads for Bowtie2 | The only knob that matters for wall-clock on a big sample. |
--subsampling | Subsamples reads before profiling | Makes 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_type | fastq, bowtie2out, sam… | The mechanism by which you re-analyse a saved alignment. |