Taxonomic composition - LangilleLab/microbiome_helper GitHub Wiki

MetaPhlAn2 is a tool to estimate taxonomic composition within a sample based on known clade-specific marker genes.

There are several ways you can run this tool in the Microbiome Helper Virtual Box, which are described below.

Use MetaPhlAn2 output produced by HUMAnN2

As described on the Functional Profiling page MetaPhlAn2 is run at the first step of HUMAnN2. You can pass options to MetaPhlAn2 through HUMAnN2 using the --metaphlan-options option. The table of abundances for this command is found in the "SAMPLE_humann2_temp" folder and is named "SAMPLE_metaphlan_bugs_list.tsv".

You can move these MetaPhlAn2 tables to a new folder with the below commands (assuming that each sample's output is in a different subdirectory of humann2_out/.

mkdir metaphlan2_out
cp humann2_out/*/*/*metaphlan_bugs_list.tsv metaphlan2_out/

You can then merge the output files using MetaPhlAn2's utility script merge_metaphlan_tables.py:

/usr/local/metaphlan2/utils/merge_metaphlan_tables.py metaphlan2_out/*metaphlan_bugs_list.tsv > metaphlan_taxonomy.txt

Before converting this file to STAMP format (see below) you can change the column names to match the samples.

sed -i 's/_metaphlan_bugs_list//g' metaphlan_taxonomy.txt

Run basic MetaPhlAn2 commands using wrapper script

run_metaphlan2.pl is a Microbiome Helper script used to wrap MetaPhlAn2 for taxonomic composition using default options. Here is an example command, note that metaphlan_taxonomy.txt is the output of merge_metaphlan_tables.py, which the wrapper script also runs.

run_metaphlan2.pl -p 4 -o metaphlan_taxonomy.txt screened_reads/*

Converting merged MetaPhlAn2 count table to STAMP format

The merged taxonomy file can then be converted to a STAMP profile file with:

metaphlan_to_stamp.pl metaphlan_taxonomy.txt > metaphlan_taxonomy.spf