metaphlan2實戰(zhàn)案例

#參考博客:http://blog.sciencenet.cn/blog-3334560-1110159.html(存在問題,以英文文檔為主)

#參考英文文檔:https://bitbucket.org/biobakery/biobakery/wiki/metaphlan2

########################################

#? ? ? ? ? ? 第一部分 軟件安裝? ? ? ? #

########################################

#切換目錄:/mnt/raid1/jialonghao/MetaPhlAn2

wget https://bitbucket.org/biobakery/metaphlan2/get/default.zip

unzip default.zip

mv biobakery-metaphlan2-4d4992ccea96 metaphlan2_2018.07

cd metaphlan2_2018.07/

export PATH=`pwd`:`pwd`/utils:$PATH

export mpa_dir=`pwd`

metaphlan2.py -v

#MetaPhlAn version 2.7.7 (31 May 2018)

########################################

#? ? ? ? ? ? 第二部分 使用實例? ? ? ? #

########################################

#step1:定量物種譜

#如果輸入文件是fastq,需要依賴bowtie2安裝好

#下載數(shù)據(jù)

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

curl -O https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014464-Anterior_nares.fasta.gz

curl -O https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014470-Tongue_dorsum.fasta.gz

curl -O https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014472-Buccal_mucosa.fasta.gz

#創(chuàng)建metaphlan2_analysis目錄,將下載的文件移到該目錄下

mkdir metaphlan2_analysis

mv SRS*.fasta.gz metaphlan2_analysis/

cd metaphlan2_analysis

ls

################################################################################

#6個.fasta.gz文件? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #

#SRS014459-Stool.fasta.gz? ? ? ? ? SRS014472-Buccal_mucosa.fasta.gz? ? ? ? ? #

#SRS014464-Anterior_nares.fasta.gz? SRS014476-Supragingival_plaque.fasta.gz? ? #

#SRS014470-Tongue_dorsum.fasta.gz? SRS014494-Posterior_fornix.fasta.gz? ? ? ? #

################################################################################

#Run a single sample

metaphlan2.py SRS014476-Supragingival_plaque.fasta.gz? --input_type fasta > SRS014476-Supragingival_plaque_profile.txt

#此命令包括從數(shù)據(jù)庫下載數(shù)據(jù),解壓,建立Bowtie index等步驟。

#注意Warning: gzbuffer added in zlib v1.2.3.5. Unable to change buffer size from default of 8192.

#結(jié)果文件為:

#SRS014476-Supragingival_plaque.fasta.gz.bowtie2out.txt? 獨特序列marker的中間比對結(jié)果

#SRS014476-Supragingival_plaque_profile.txt? ? ? ? ? ? ? 最終完成的有機體豐度

#含有物種分類次序:

# Kingdom: k__, Phylum: p__, Class: c__, Order: o__, Family: f__, Genus: g__, Species: s__

#界 ( Kingdom)、門( Phylum)、綱 (Class)、目 (Order)、科( Family)、屬( Genus)、種 (Species)


#Run on multiple cores

metaphlan2.py SRS014459-Stool.fasta.gz --input_type fasta --nproc 4 > SRS014459-Stool_profile.txt

#注意Warning: gzbuffer added in zlib v1.2.3.5. Unable to change buffer size from default of 8192.

#Run multiple samples

#每個MetaPhlAn2執(zhí)行過程只處理一個樣本,但是產(chǎn)生的單樣本分析可以很容易地組合成一個包含多個樣本的豐度表。

#讓我們完成輸入文件教程部分的最后四個示例:

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

#如果你熟悉bash shell也可以寫腳本

for f in SRS*.fasta.gz

do

? ? metaphlan2.py $f --input_type fasta --nproc 4 > ${f%.fasta.gz}_profile.txt

done

#將上述文件合并為以tab鍵分隔的表格

merge_metaphlan_tables.py *_profile.txt > merged_abundance_table.txt

#step2 結(jié)果可視化

cp merged_abundance_table.txt merged_metaphlan2.txt

metaphlan_hclust_heatmap.py -c bbcry --top 25 --minv 0.1 -s log --in merged_metaphlan2.txt --out abundance_heatmap.pdf

metaphlan_hclust_heatmap.py -c bbcry --top 25 --minv 0.1 -s log --in merged_metaphlan2.txt --out abundance_heatmap.png

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Linux習(xí)慣問題: 在vim編輯時,按了ctrl + s后,再按ctrl + q就可以繼續(xù)執(zhí)行了。ctrl + ...
    光著腳的鞋閱讀 4,700評論 0 16
  • 又到初夏時節(jié)。 我心里牽念著村西頭的那條河,河里最近幾年侍弄的荷塘,不知現(xiàn)在長成了什么樣? 去年跟幾位朋友周末去金...
    茶潤人生閱讀 289評論 0 0
  • 今天順利的擠上了19路公交車,看著穿著鮮亮的人們,突然想到了小時候。記得小時候很少洗澡,夏天還好,接滿一盆涼水,從...
    笨石頭閱讀 173評論 0 0
  • 2018年4月1日 星期天 天氣晴 今天下午康靖祺跟奶奶一起從西城回來了,他媽媽說作業(yè)差不多做完了,讓我檢...
    康靖祺姑姑閱讀 208評論 0 1
  • 三年四班石蕊 2018年1月2日星期二小雪 每天陪女兒閱讀一小時,加油,加油。
    石蕊媽媽閱讀 280評論 0 0

友情鏈接更多精彩內(nèi)容