文章目录
简介
- MetaPhlAn是一种物种注释工具,可从宏基因组鸟枪测序数据(即非16S)中分析微生物群落(细菌,古细菌和真核生物)的组成。使用StrainPhlAn,还可以执行准确的菌株级微生物分析。
- MetaPhlAn使用序列比对marker基因,来获得相对丰度信息,相对于其他策略而言,物种检出较少,但假阳性较低,只能检出数据库内的物种。
- MetaPhlAn2和MetaPhlAn3原理应该是一样的,最大的更新应该是数据库,MetaPhlAn3目前还没有文章。
At this moment, a manuscript for MetaPhlAn 3 is not available.
If used MetaPhlAn 3.0 for your research, please consider citing the MetaPhlAn2 paper
- 两个版本数据库比较:官方统计,差距还是挺大的,比较metaphlan2也好多年前了。
Index | MetaPhlAn2 | MetaPhlAn3 |
---|---|---|
参考基因 | 17,000 | 100,000 |
细菌和古菌 | 13,500 | 99,500 |
病毒 | 3,500 | - |
真核生物 | 110 | 500 |
类群特异的标记基因 | 1M+ | 1.1M+ |
安装
metaphlan3安装依赖python3,所以安装时需要先安装python3, 如果是单独安装的话,还需要将其他依赖关系安装上,如bowtie2(2.3版本及以上)和perl。当然这里更建议使用conda虚拟环境,并在虚拟环境中安装。
conda create --name mpa -c bioconda python=3.7 metaphlan
报错:An error occurred while installing package 'conda-forge::click-7.1.2-pyh9f0ad1d_0'.
原因:应该是conda版本的问题,本人使用的时anaconda2。
解决:先在虚拟环境中安装python3,再安装metaphlan。
## 构建虚拟环境,并安装python3.7
conda create --name mpa -c bioconda python=3.7
## conda安装metaphlan3
source activate mpa
conda install metaphlan
## 安装后想退出虚拟环境
source deactivate
数据库下载
安装完成后,直接运行metaphlan,软件会自动下载数据库到默认目录,也就是虚拟环境中python包目录envs/mpa/lib/python3.7/site-packages/metaphlan/metaphlan_databases
。软件会先下载file_list.txt文件,文件里包含所有数据库下载链接。接着就是下载和构建index。这是第一次运行时的步骤,之后会跳过这步(除非数据库不在了)直接跑。
报错:Warning: Unable to download https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAA4XDP85WHon_eHvztxkamTa/file_list.txt?dl=1
UnboundLocalError: local variable 'ls_f' referenced before assignment
原因:连接不上,所以下载不了文件。
解决:连上网络。或者找别人借一下,例如我,哈哈。把metaphlan_index.zip
和file_list.txt
下载到默认路径,解压metaphlan_index.zip
即可。下次跑的时候会自动构建index。p.s. 记得把file_list.txt
也下载的默认路径,不然别人还是找不到对象:)。另外,虽然有很多个数据库在,但MetaPhlAn3默认是使用mpa_v30_CHOCOPhlAn_201901.tar
这个数据库。
## 百度网盘
链接:https://pan.baidu.com/s/1vaVDoImSphujus6Z8sbW8w
提取码:vwsc
运行
所有参数
usage: metaphlan --input_type {fastq,fasta,bowtie2out,sam} [--force]
[--bowtie2db METAPHLAN_BOWTIE2_DB] [-x INDEX]
[--bt2_ps BowTie2 presets] [--bowtie2_exe BOWTIE2_EXE]
[--bowtie2_build BOWTIE2_BUILD] [--bowtie2out FILE_NAME]
[--min_mapq_val MIN_MAPQ_VAL] [--no_map] [--tmp_dir]
[--tax_lev TAXONOMIC_LEVEL] [--min_cu_len]
[--min_alignment_len] [--add_viruses] [--ignore_eukaryotes]
[--ignore_bacteria] [--ignore_archaea] [--stat_q]
[--perc_nonzero] [--ignore_markers IGNORE_MARKERS]
[--avoid_disqm] [--stat] [-t ANALYSIS TYPE]
[--nreads NUMBER_OF_READS] [--pres_th PRESENCE_THRESHOLD]
[--clade] [--min_ab] [-o output file] [--sample_id_key name]
[--use_group_representative] [--sample_id value]
[-s sam_output_file] [--legacy-output] [--CAMI_format_output]
[--unknown_estimation] [--biom biom_output] [--mdelim mdelim]
[--nproc N] [--install] [--force_download]
[--read_min_len READ_MIN_LEN] [-v] [-h]
[INPUT_FILE] [OUTPUT_FILE]
DESCRIPTION
MetaPhlAn version 3.0.2 (23 Jul 2020):
METAgenomic PHyLogenetic ANalysis for metagenomi