美文网首页metagenomic宏基因组微生物
MetaPhlAn2宏基因组物种注释

MetaPhlAn2宏基因组物种注释

作者: 胡童远 | 来源:发表于2020-08-10 09:17 被阅读0次

导读

上一篇介绍了MetaPhlAn:宏基因组微生物分类分析教程,这次来学习MetaPhlAn2的使用方法。

bitbucket地址:https://bitbucket.org/biobakery/biobakery/wiki/metaphlan2

依赖:
Python (version >= 2.7)
Bowtie2
Numpy
Pandas (optional, only required by utility scripts)
BioPython (optional, only required by utility scripts)
SciPy (optional, only required by utility scripts)
Matplotlib (optional, only required by utility scripts)
biom (optional, only required for <tt class="docutils literal">biom</tt> format input/output)

一、conda安装

conda install -c bioconda metaphlan2

二、测序数据

windows下载:
SRS014476-Supragingival_plaque.fasta.gz
SRS014494-Posterior_fornix.fasta.gz
SRS014459-Stool.fasta.gz
SRS014464-Anterior_nares.fasta.gz
SRS014470-Tongue_dorsum.fasta.gz
SRS014472-Buccal_mucosa.fasta.gz

linux下载:

curl -O https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014476-Supragingival_plaque.fasta.gz
curl -O https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014494-Posterior_fornix.fasta.gz
curl -O https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014459-Stool.fasta.gz

三、MetaPhlAn2分析

1. 准备

mkdir metaphlan2_analysis
mv ~/Downloads/SRS*.fasta.gz metaphlan2_analysis/
cd metaphlan2_analysis
ls

2. 单样品分析

# 分析第一个样品
metaphlan2.py SRS014476-Supragingival_plaque.fasta.gz  --input_type fasta > SRS014476-Supragingival_plaque_profile.txt
# 查看比对结果
less -S SRS014476-Supragingival_plaque.fasta.gz.bowtie2out.txt
# 查看单样品物种丰度表
less -S SRS014476-Supragingival_plaque_profile.txt
# 多线程模式,第2个样品
metaphlan2.py SRS014459-Stool.fasta.gz --input_type fasta --nproc 4 > SRS014459-Stool_profile.txt

3. 多样品分析

# 剩下的4个样品
metaphlan2.py SRS014464-Anterior_nares.fasta.gz --input_type fasta --nproc 4 > SRS014464-Anterior_nares_profile.txt
metaphlan2.py SRS014470-Tongue_dorsum.fasta.gz --input_type fasta --nproc 4 > SRS014470-Tongue_dorsum_profile.txt
metaphlan2.py SRS014472-Buccal_mucosa.fasta.gz --input_type fasta --nproc 4 > SRS014472-Buccal_mucosa_profile.txt
metaphlan2.py SRS014494-Posterior_fornix.fasta.gz --input_type fasta --nproc 4 > SRS014494-Posterior_fornix_profile.txt

或者

# 一个循环完成6个样品的分析
for f in SRS*.fasta.gz
do
    metaphlan2.py $f --input_type fasta --nproc 4 > ${f%.fasta.gz}_profile.txt
done

4. 六个样品的物种丰度表
SRS014459-Stool_profile.txt
SRS014464-Anterior_nares_profile.txt SRS014470-Tongue_dorsum_profile.txt
SRS014472-Buccal_mucosa_profile.txt
SRS014476-Supragingival_plaque_profile.txt
SRS014494-Posterior_fornix_profile.txt

5. 六个样品的比对结果
SRS014459-Stool.fasta.gz.bowtie2out.txt
SRS014464-Anterior_nares.fasta.gz.bowtie2out.txt
SRS014470-Tongue_dorsum.fasta.gz.bowtie2out.txt
SRS014472-Buccal_mucosa.fasta.gz.bowtie2out.txt
SRS014476-Supragingival_plaque.fasta.gz.bowtie2out.txt
SRS014494-Posterior_fornix.fasta.gz.bowtie2out.txt

6. 合并六个样品的物种丰度表

merge_metaphlan_tables.py *_profile.txt > merged_abundance_table.txt

获取结果总表:merged_abundance_table.txt

# 查看结果总表
less -S merged_abundance_table.txt

四、hcluast2绘制热图

1. conda安装hclust2

conda install -c biobakery hclust2

2. 提取种水平丰度信息

grep -E "(s__)|(^ID)" merged_abundance_table.txt | grep -v "t__" | sed 's/^.*s__//g' > merged_abundance_table_species.txt

3. 绘制热图

hclust2.py -i merged_abundance_table_species.txt -o abundance_heatmap_species.png --ftop 25 --f_dist_f braycurtis --s_dist_f braycurtis --cell_aspect_ratio 0.5 -l --flabel_size 6 --slabel_size 6 --max_flabel_len 100 --max_slabel_len 100 --minv 0.1 --dpi 300

五、GraPhlAn绘制进化树

1. conda安装GraPhlAn

conda install -c biobakery graphlan

2. 准备输入文件

获取merged_abundance.tree.txt和merged_abunance.annot.txt

export2graphlan.py --skip_rows 1,2 -i merged_abundance_table.txt --tree merged_abundance.tree.txt --annotation merged_abundance.annot.txt --most_abundant 100 --abundance_threshold 1 --least_biomarkers 10 --annotations 5,6 --external_annotations 7 --min_clade_size 1

3. 绘制进化树

获取:
merged_abundance.xml
merged_abundance.png
merged_abundance_legend.png
merged_abundance_annot.png

graphlan_annotate.py --annot merged_abundance.annot.txt merged_abundance.tree.txt merged_abundance.xml
graphlan.py --dpi 300 merged_abundance.xml merged_abundance.png --external_legends

六、PanPhlAn绘制种水平heatmap

PanPhlAn教程

1. 输入数据

MetaPhlAn intermediate bowtie2 output files

13530241_SF05.fasta.gz.bowtie2out.txt
13530241_SF06.fasta.gz.bowtie2out.txt
19272639_SF05.fasta.gz.bowtie2out.txt
19272639_SF06.fasta.gz.bowtie2out.txt
40476924_SF05.fasta.gz.bowtie2out.txt
40476924_SF06.fasta.gz.bowtie2out.txt

2. 创建所选物种丰度表

物种:s__Eubacterium_siraeum
丰度:大于1%

metaphlan2.py --input_type bowtie2out -t clade_specific_strain_tracker --clade s__Eubacterium_siraeum --min_ab 1.0 13530241_SF05.fasta.gz.bowtie2out.txt > 13530241_SF05.siraeum.txt
metaphlan2.py --input_type bowtie2out -t clade_specific_strain_tracker --clade s__Eubacterium_siraeum --min_ab 1.0 13530241_SF06.fasta.gz.bowtie2out.txt > 13530241_SF06.siraeum.txt
metaphlan2.py --input_type bowtie2out -t clade_specific_strain_tracker --clade s__Eubacterium_siraeum --min_ab 1.0 19272639_SF05.fasta.gz.bowtie2out.txt > 19272639_SF05.siraeum.txt
metaphlan2.py --input_type bowtie2out -t clade_specific_strain_tracker --clade s__Eubacterium_siraeum --min_ab 1.0 19272639_SF06.fasta.gz.bowtie2out.txt > 19272639_SF06.siraeum.txt
metaphlan2.py --input_type bowtie2out -t clade_specific_strain_tracker --clade s__Eubacterium_siraeum --min_ab 1.0 40476924_SF05.fasta.gz.bowtie2out.txt > 40476924_SF05.siraeum.txt
metaphlan2.py --input_type bowtie2out -t clade_specific_strain_tracker --clade s__Eubacterium_siraeum --min_ab 1.0 40476924_SF06.fasta.gz.bowtie2out.txt > 40476924_SF06.siraeum.txt

结果:
13530241_SF05.siraeum.txt
13530241_SF06.siraeum.txt
19272639_SF05.siraeum.txt
19272639_SF06.siraeum.txt
40476924_SF05.siraeum.txt
40476924_SF06.siraeum.txt

3. 结果合并

merge_metaphlan_tables.py *.siraeum.txt > siraeum_tracker.txt

4. 绘制热图

hclust2.py -i siraeum_tracker.txt -o siraeum_tracker.png --skip_rows 1 --f_dist_f hamming --no_flabels --dpi 300 --cell_aspect_ratio 0.01

相关文章

  • MetaPhlAn2宏基因组物种注释

    导读 上一篇介绍了MetaPhlAn:宏基因组微生物分类分析教程[https://www.jianshu.com/...

  • IGV基因组浏览器打开BAM文件查看reads比对情况

    输入文件有:物种基因组序列文件、物种基因组注释文件、转录本比对后的BAM文件;以斑胸草雀为例:-基因组注释文件: ...

  • 常见的OrgDB包,方便对应物种注释

    列举了19个OrgDB,物种对应的全基因组注释R包,方便根据EntreZ进行基因的注释分析等等 | 物种 | Or...

  • Kraken2安装与数据库构建2022-01-02

    Kraken2是一款快速宏基因组DNA序列进行物种注释的软件。我将其用于测序数据以及序列的物种的物种注释,检查测序...

  • mOTUs2

    一种用于宏基因组物种注释及定量的新方法。 题目:Microbial abundance, activity and...

  • SnpEff 配置基因组注释文件

    SnpEff 软件提供了绝大多数物种的基因组注释信息,但随着基因组版本的不断更新和新的更好的基因组的出现,我们有时...

  • SqueezeMeta使用教程

    SqueezeMeta是一个全自动的宏基因组数据处理流程,涵盖了组装、分箱、物种注释、功能注释以及各个样品具有的物...

  • 如何轻松构建物种系统发育树

    在常规的基因组分析中,当我们对某一物种的基因组进行从头组装与注释获得其的基本信息后,通常会想知道该物种与一些其他近...

  • RNA-seq 分析常用的软件

    如果所研究的物种有组装注释质量较好基因组序列,且和该基因组序列比对效率较高,那么可以采用有参转录组的分析策略,直接...

  • 2020-12-16 解决一个基因矫正的问题

    问题描述:有些物种,基因组拼接的可能不是很好,或者说,在基因注释的时候,没有注释的很清楚,这个时候会怀疑直接从基因...

网友评论

    本文标题:MetaPhlAn2宏基因组物种注释

    本文链接:https://www.haomeiwen.com/subject/tzoldktx.html