Skip to content

Docs CSC now features an automatic Finnish translation. Click here for more information.

Warning!

Puhti and Mahti computing services have been decommissioned and no new jobs are accepted or executed on its compute nodes. Puhti and Mahti login nodes and storage services are planned to remain available until 15 October 2026. Clean up unnecessary files and move any data you need to keep by 31 August 2026. See the Roihu data migration guide for instructions on transferring your data to Roihu.

MetaPhlAn

MetaPhlAn is a computational tool for profiling the composition of microbial communities from metagenomic sequencing data.

License

Free to use and open source under MIT License.

Available

  • Roihu: 4.2.4 (module py-metaphlan), via the bio-apps module.

Usage

MetaPhlAn is part of the bio-apps collection on Roihu. Load the bio-apps module tree and then the MetaPhlAn module:

module load bio-apps/v202603
module load py-metaphlan/4.2.4

You can check basic usage with the command:

metaphlan --help

Database

MetaPhlAn needs a marker database (the ChocoPhlAn-SGB Bowtie2 indexes) to run. On Roihu a shared, read-only copy is provided centrally, and the py-metaphlan module points MetaPhlAn at it automatically through the $METAPHLAN_DB_DIR environment variable — so for the bundled database versions you do not need to pass --db_dir.

The following database versions are available in the shared location:

  • mpa_vJan26_CHOCOPhlAnSGB_202605 (latest)
  • mpa_vJun23_CHOCOPhlAnSGB_202403

They sit side by side in one folder; choose which one to use with --index (its value must be one of the versions listed above):

metaphlan --index mpa_vJan26_CHOCOPhlAnSGB_202605 ...

Using your own database

To use a version that is not in the shared location — or to let MetaPhlAn download and build a fresh database — point --db_dir at a writable directory of your own. An explicit --db_dir overrides $METAPHLAN_DB_DIR, and because the shared copy is read-only MetaPhlAn cannot create a missing index there.

For example, create a directory for the databases in your project's /scratch:

cd /scratch/<project>
mkdir metaphlan_databases

Databases can be pre-prepared with the --install option:

metaphlan --install --db_dir metaphlan_databases

The database is quite big and downloading and building it can take some time.

By default the latest MetaPhlAn database is downloaded and built. You can request a specific version with the --index parameter:

metaphlan --install --index mpa_vJan21_CHOCOPhlAnSGB_202103 --db_dir metaphlan_databases

If the requested database is not found in the indicated writable location, it will be generated automatically.

A test input dataset for testing MetaPhlAn can be downloaded from the MetaPhlAn github site:

wget https://github.com/biobakery/MetaPhlAn/releases/download/4.0.2/SRS014476-Supragingival_plaque.fasta.gz

In this example the job is executed as an interactive job. On the Roihu interactive partition each reserved core provides 1.875 GB of memory (up to 32 cores / 60 GB / 36 hours), so request the number of cores that gives you enough memory — here 8 cores (about 15 GB):

sinteractive --account <project> --cores 8
module load bio-apps/v202603
module load py-metaphlan/4.2.4
metaphlan --nproc 8 --index mpa_vJan26_CHOCOPhlAnSGB_202605 SRS014476-Supragingival_plaque.fasta.gz --input_type fasta > SRS014476-Supragingival_plaque_profile.txt

Support

CSC Service Desk

More information