METAPHLAN2(1)
METAPHLAN2 π
okay bestie, gather round π«Ά this is the manual page for metaphlan2 β a User Command β and she is that girl. Let's get into it.
NAME β¨
metaphlan2 β METAgenomic PHyLogenetic ANalysis for metagenomic taxonomic profiling πΈ
SYNOPSIS π¦
metaphlan2
--input_type {fastq,fasta,multifasta,multifastq,bowtie2out,sam}
[--mpa_pkl MPA_PKL] [--bowtie2db METAPHLAN_BOWTIE2_DB] [--bt2_ps BowTie2
presets] [--bowtie2_exe BOWTIE2_EXE] [--bowtie2out FILE_NAME] [--no_map]
[--tmp_dir] [--tax_lev TAXONOMIC_LEVEL] [--min_cu_len]
[--min_alignment_len] [--ignore_viruses] [--ignore_eukaryotes]
[--ignore_bacteria] [--ignore_archaea] [--stat_q] [--ignore_markers
IGNORE_MARKERS] [--avoid_disqm] [--stat] [-t ANALYSIS TYPE] [--nreads
NUMBER_OF_READS] [--pres_th PRESENCE_THRESHOLD] [--clade] [--min_ab]
[-h] [-o output file] [--sample_id_key name] [--sample_id value] [-s
sam_output_file] [--biom biom_output] [--mdelim mdelim] [--nproc N] [-v]
[INPUT_FILE] [OUTPUT_FILE]
DESCRIPTION π§
MetaPhlAn 2 clade-abundance estimation π
okay so the basic usage of MetaPhlAn 2 is literally this: you take a metagenome from a microbiome sample, and she identifies the clades hanging out in there β from phyla all the way down to species, and to strains in particular cases β plus their relative abundance. That is the default analysis type, and it's called --analysis_type rel_ab. periodt. π
- Profiling a metagenome from raw reads π₯
metaphlan2 metagenome.fastq --input_type fastq
- You can take advantage of multiple CPUs and save the intermediate BowTie2 output for re-running
MetaPhlAn extremely quickly:
metaphlan2 metagenome.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 5 --input_type fastq
- If you already mapped your metagenome against the marker DB (using a previous MetaPhlAn run), you can obtain the results in few seconds by using the previously saved
--bowtie2outfile and specifying the input (--input_type bowtie2out) β‘
metaphlan2 metagenome.bowtie2.bz2 --nproc 5 --input_type bowtie2out
- You can also provide an externally BowTie2-mapped SAM if you specify this format with
--input_type. Two steps: first apply BowTie2 and then feed MetaPhlAn2 with the obtained sam π
bowtie2 --sam-no-hd --sam-no-sq --no-unal --very-sensitive -S metagenome.sam -x /usr/share/metaphlan2/db_v20/mpa_v20_m200 -U metagenome.fastq
metaphlan2 metagenome.sam --input_type sam > profiled_metagenome.txt
- Multiple alternative ways to pass the input are also available π
cat metagenome.fastq | metaphlan2 --input_type fastq
tar xjf metagenome.tar.bz2 --to-stdout | metaphlan2 --input_type fastq
metaphlan2 --input_type fastq < metagenome.fastq
metaphlan2 --input_type fastq <(bzcat metagenome.fastq.bz2)
metaphlan2 --input_type fastq <(zcat metagenome_1.fastq.gz metagenome_2.fastq.gz)
- We can also natively handle paired-end metagenomes, and, more generally, metagenomes stored in multiple files β but bestie, you need to specify the
--bowtie2outparameter for this one, no cap π¨
metaphlan2 metagenome_1.fastq,metagenome_2.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 5 --input_type fastq
MetaPhlAn 2 strain tracking π¦
MetaPhlAn 2 introduces the capability of charachterizing organisms at the strain level using non aggregated marker information. That capability comes in several slightly different flavours, and it's a way to do strain tracking and comparison across multiple samples. Usually you first run MetaPhlAn 2 with the default --analysis_type to profile the species present in the community, and then you do a strain-level profiling to zoom in on specific species of interest. And the best part? It's fast, because it exploits the --bowtie2out intermediate file that got saved during the execution of the default analysis type. iconic behaviour honestly. β¨
- The following command will output the abundance of each marker with a RPK (reads per kil-base) higher 0.0. (we're assuming that
metagenome_outfmt.bz2has been generated before as shown above, bestie).
metaphlan2 -t marker_ab_table metagenome_outfmt.bz2 --input_type bowtie2out > marker_abundance_table.txt
The obtained RPK can be optionally normalized by the total number of reads in the metagenome to guarantee fair comparisons of abundances across samples. The number of reads in the metagenome needs to be passed with the '--nreads' argument π
- The list of markers present in the sample can be obtained with
'-t marker_pres_table'π
metaphlan2 -t marker_pres_table metagenome_outfmt.bz2 --input_type bowtie2out > marker_abundance_table.txt
The --pres_th argument (default 1.0) sets the minimum RPK value to consider a marker present.
- The list
'-t clade_profiles'analysis type reports the same information of'-t marker_ab_table'but the markers are reported on a clade-by-clade basis πΈ
metaphlan2 -t clade_profiles metagenome_outfmt.bz2 --input_type bowtie2out > marker_abundance_table.txt
- Finally, to obtain all markers present for a specific clade and all its subclades, you should use
'-t clade_specific_strain_tracker'. For example, the following command is reporting the presence/absence of the markers for the B. fragulis species and its strains β the optional argument--min_abspecifies the minimum clade abundance for reporting the markers π
$ metaphlan2 -t clade_specific_strain_tracker --clade s__Bacteroides_fragilis metagenome_outfmt.bz2 --input_type bowtie2out > marker_abundance_table.txt
and that's only part 1 bestie, do NOT go anywhere, there's more π
β¨ OPTIONS β¨
π positional arguments
INPUT_FILEβ the input file can be:- a fastq file containing metagenomic reads
- OR
- a BowTie2 produced SAM file.
- OR
- an intermediary mapping file of the metagenome generated by a previous MetaPhlAn run
If the input file is missing, the script assumes that the input is provided using the standard input, or named pipes. IMPORTANT: the type of input needs to be specified with --input_type
OUTPUT_FILEβ the tab-separated output file of the predicted taxon relative abundances [stdoutif not present]
π Required arguments
--input_type{fastq,fasta,multifasta,multifastq,bowtie2out,sam}β set whether the input is the multifasta file of metagenomic reads or the SAM file of the mapping of the reads against the MetaPhlAn db. [default'automatic', i.e. the script will try to guess the input format]
𧬠Mapping arguments:
--mpa_pklMPA_PKL β the metadata pickled MetaPhlAn file--bowtie2dbMETAPHLAN_BOWTIE2_DB β The BowTie2 database file of the MetaPhlAn database. Used if--input_typeisfastq,fasta,multifasta, ormultifastq--bt2_psBowTie2 presets β presets options for BowTie2 (applied only when a multifasta file is provided) The choices enabled in MetaPhlAn are:sensitivevery-sensitivesensitive-localvery-sensitive-local
[default very-sensitive]
--bowtie2_exeBOWTIE2_EXE β Full path and name of the BowTie2 executable. This option allows MetaPhlAn to reach the executable even when it is not in the system PATH or the system PATH is unreachable--bowtie2outFILE_NAME β The file for saving the output of BowTie2--no_mapβ Avoid storing the--bowtie2outmap file--tmp_dirβ the folder used to store temporary files [default is the OS dependent tmp dir]
π¦ Post-mapping arguments
--tax_levTAXONOMIC_LEVEL β The taxonomic level for the relative abundance output:'a': all taxonomic levels'k': kingdoms'p': phyla only'c': classes only'o': orders only'f': families only'g': genera only's': species only
[default 'a']
--min_cu_lenβ minimum total nucleotide length for the markers in a clade for estimating the abundance without considering sub-clade abundances [default2000]--min_alignment_lenβ The sam records for aligned reads with the longest subalignment length smaller than this threshold will be discarded. [defaultNone]--ignore_virusesβ Do not profile viral organisms--ignore_eukaryotesβ Do not profile eukaryotic organisms--ignore_bacteriaβ Do not profile bacterial organisms--ignore_archaeaβ Do not profile archeal organisms--stat_qβ Quantile value for the robust average [default0.1]--ignore_markersIGNORE_MARKERS β File containing a list of markers to ignore.--avoid_disqmβ Deactivate the procedure of disambiguating the quasi-markers based on the marker abundance pattern found in the sample. It is generally recommended too keep the disambiguation procedure in order to minimize false positives--statβ EXPERIMENTAL! Statistical approach for converting marker abundances into clade abundances'avg_g': clade global (i.e. normalizing all markers together) average'avg_l': average of length-normalized marker counts'tavg_g': truncated clade global average at--stat_qquantile'tavg_l': trunated average of length-normalized marker counts (at--stat_q)'wavg_g': winsorized clade global average (at--stat_q)'wavg_l': winsorized average of length-normalized marker counts (at--stat_q)'med': median of length-normalized marker counts
[default tavg_g]
β¨ Additional analysis types and arguments
-tANALYSIS TYPE β Type of analysis to perform:rel_ab: profiling a metagenomes in terms of relative abundancesrel_ab_w_read_stats: profiling a metagenomes in terms of relative abundances and estimate the number of reads coming from each clade.reads_map: mapping from reads to clades (only reads hitting a marker)clade_profiles: normalized marker counts for clades with at least a non-null markermarker_ab_table: normalized marker counts (only when > 0.0 and normalized by metagenome size if--nreadsis specified)marker_counts: non-normalized marker counts [use with extreme caution]marker_pres_table: list of markers present in the sample (threshold at 1.0 if not differently specified with--pres_th
[default 'rel_ab']
--nreadsNUMBER_OF_READS β The total number of reads in the original metagenome. It is used only when-t marker_tableis specified for normalizing the length-normalized counts with the metagenome size as well. No normalization applied if--nreadsis not specified--pres_thPRESENCE_THRESHOLD β Threshold for calling a marker present by the-t marker_pres_tableoption--cladeβ The clade for clade_specific_strain_tracker analysis--min_abβ The minimum percentage abundace for the clade in the clade_specific_strain_tracker analysis-h,--helpβ show this help message and exit
π Output arguments
-ooutput file,--output_fileoutput file β The output file (if not specified as positional argument)--sample_id_keyname β Specify the sample ID key for this analysis. Defaults to'#SampleID'.--sample_idvalue β Specify the sample ID for this analysis. Defaults to'Metaphlan2_Analysis'.-ssam_output_file,--samoutsam_output_file β The sam output file--biombiom_output,--biom_output_filebiom_output β If requesting biom file output: The name of the output file in biom format--mdelimmdelim,--metadata_delimiter_charmdelim β Delimiter for bug metadata: - defaults to pipe. e.g. the pipe ink__Bacteria|p__Proteobacteria
π Other arguments
--nprocN β The number of CPUs to use for parallelizing the mapping [default1, i.e. no parallelism]-v,--versionβ Prints the current MetaPhlAn version and exit
π AUTHOR
The code of MetaPhlAn was rwitten by Nicola Segata (nicola.segata@unitn.it), Duy Tin Truong (duytin.truong@unitn.it).
This manpage was written by Andreas Tille for the Debian distribution and can be used for any other usage of the program.
Okay bestie, that's the whole METAPHLAN2(1) page! This iconic manual is from metaphlan2 2.5.0, dated July 2016. π β¨
π¦ where this page comes from
- ubuntu jammy: metaphlan2 3.0.14-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms