QIIME2流程分析

官网:

https://docs.qiime2.org/2019.7/

参考过的几篇笔记:

https://www.jianshu.com/p/009963ac7393

https://forum.qiime2.org/t/qiime2-chinese-manual/838

https://blog.csdn.net/qq_42458954/article/details/91344469


protocol:

刚开始要仔细阅读官方documentation,有很多很多,都需要看一下。从软件安装到每一步分析官方文档都有,也有很多选择。以下是我自己习惯跑的总结的一种最简便的分析流程:

data2——过滤feature table——rarefaction稀释重采样——导出feature table在R或其他软件做其他分析——在QIIME中继续做物种分类分析,以及α-和β-多样性分析


在开始之前:

在服务器下载miniconda和qiime2

注意manifest.txt文件的生成,我写了一个很简单的python脚本生成那个文件。

准备metadata文件


#importing data

qiime tools import --type 'SampleData[PairedEndSequencesWithQuality]' --input-path manifest.txt --output-path paired-end-demux.qza --input-format PairedEndFastqManifestPhred33

qiime demux summarize --i-data paired-end-demux.qza --o-visualization paired-end-demux.qzv


#dada2 denoising (table-sampling depth; stats-sequences counts去低质量、嵌合体、合并; rep-seqs-representative sequences) (2 h) 

nohup qiime dada2 denoise-paired --i-demultiplexed-seqs ../1_demux/paired-end-demux.qza --p-trim-left-f 19 --p-trim-left-r 20 --p-trunc-len-f 236 --p-trunc-len-r 209 --o-representative-sequences rep-seqs.qza --o-denoising-stats denoising-stats.qza --o-table table.qza --p-n-threads 20 &

qiime feature-table summarize --i-table table.qza --o-visualization table.qzv --m-sample-metadata-file ../../metadata.txt

qiime metadata tabulate --m-input-file denoising-stats.qza --o-visualization denoising-stats.qzv

qiime metadata tabulate --m-input-file rep-seqs.qza --o-visualization rep-seqs.qzv

##--p-trim-left-f --p-trim-left-r moved primer here


#classifier (9 h) (16s v4和全长官网有训练好的训练器)

nohup qiime feature-classifier classify-sklearn  --i-classifier ../4_classifier/silva-132-99-515-806-nb-classifier.qza  --i-reads rep-seqs.qza  --o-classification taxonomy.qza &

qiime metadata tabulate  --m-input-file taxonomy.qza  --o-visualization taxonomy.qzv 


#table filtering (gg:p__; silva:D_1__)

###Select taxa assigned at least to phylum levels:

qiime taxa filter-table --i-table table.qza --i-taxonomy taxonomy.qza  --p-include D_1__ --o-filtered-table table-with-phyla.qza

qiime feature-table summarize --i-table table-with-phyla.qza --o-visualization table-with-phyla.qzv

###Remove chloroplast and mitochondria: 

qiime taxa filter-table --i-table table-with-phyla.qza --i-taxonomy taxonomy.qza --p-exclude mitochondria,chloroplast --o-filtered-table table-nomito-nochloro.qza

qiime feature-table summarize --i-table table-nomito-nochloro.qza --o-visualization table-nomito-nochloro.qzv

###remove feature frequency less than 10

qiime feature-table filter-features --i-table table-nomito-nochloro.qza --p-min-frequency 10 --o-filtered-table table-frequency10.qza

qiime feature-table summarize --i-table table-frequency10.qza --o-visualization table-frequency10.qzv


#Rarefaction:

qiime feature-table rarefy --i-table table-frequency10.qza --p-sampling-depth 60000 --o-rarefied-table table-filtered-depth60000.qza

qiime feature-table summarize --i-table table-filtered-depth60000.qza --o-visualization table-filtered-depth60000.qzv


#Export feature table

qiime tools export  --input-path table-filtered-depth60000.qza  --output-path table-filtered-depth60000

biom convert -i table-filtered-depth60000/feature-table.biom -o table-filtered-depth60000.txt --to-tsv


#classifier → taxonomy

qiime taxa barplot  --i-table ../3_filtering/table-filtered-depth60000.qza  --i-taxonomy taxonomy.qza  --m-metadata-file ../../metadata.txt  --o-visualization taxa-bar-plots.qzv


#tree   

nohup qiime phylogeny align-to-tree-mafft-fasttree --i-sequences ../3_filtering/filtered-rep-seqs-depth6000.qza --o-alignment aligned-rep-seqs.qza --o-masked-alignment masked-aligned-rep-seqs.qza --o-tree unrooted-tree.qza --o-rooted-tree rooted-tree.qza &

qiime tools export --input-path unrooted-tree.qza --output-path exported-tree

qiime tools export --input-path rooted-tree.qza --output-path exported-tree

#diversity

qiime diversity core-metrics-phylogenetic --i-phylogeny rooted-tree.qza --i-table ../3_filtering/table-filtered-depth60000.qza --p-sampling-depth 50000 --m-metadata-file ../../metadata.txt --output-dir core-metrics-results &

#vector-alpha-group-significance

qiime diversity alpha-group-significance --i-alpha-diversity core-metrics-results/faith_pd_vector.qza --m-metadata-file ../../metadata.txt --o-visualization faith-pd-group-significance.qzv

qiime diversity alpha-group-significance --i-alpha-diversity core-metrics-results/evenness_vector.qza --m-metadata-file ../../metadata.txt --o-visualization evenness-group-significance.qzv

qiime diversity alpha-group-significance --i-alpha-diversity core-metrics-results/shannon_vector.qza --m-metadata-file ../../metadata.txt --o-visualization shannon-group-significance.qzv

qiime diversity alpha-group-significance --i-alpha-diversity core-metrics-results/observed_otus_vector.qza --m-metadata-file ../../metadata.txt --o-visualization observed_otus-group-significance.qzv

#matrix-beta-group-significance

qiime diversity beta-group-significance --i-distance-matrix core-metrics-results/unweighted_unifrac_distance_matrix.qza --m-metadata-file ../../metadata.txt --m-metadata-column site --o-visualization unweighted-unifrac-site-significance.qzv  --p-pairwise

qiime diversity beta-group-significance --i-distance-matrix core-metrics-results/bray_curtis_distance_matrix.qza --m-metadata-file ../../metadata.txt --m-metadata-column site --o-visualization bray_curtis_distance_matrix.qzv  --p-pairwise

qiime diversity beta-group-significance --i-distance-matrix core-metrics-results/jaccard_distance_matrix.qza --m-metadata-file ../../metadata.txt --m-metadata-column site --o-visualization jaccard_distance_matrix.qzv  --p-pairwise

qiime diversity beta-group-significance --i-distance-matrix core-metrics-results/unweighted_unifrac_distance_matrix.qza --m-metadata-file ../../metadata.txt --m-metadata-column site --o-visualization weighted_unifrac_distance_matrix.qzv  --p-pairwise

#Export distance matrix

qiime tools export --input-path core-metrics-results/bray_curtis_distance_matrix.qza --output-path distance-matrix

qiime tools export --input-path core-metrics-results/jaccard_distance_matrix.qza --output-path distance-matrix

qiime tools export --input-path core-metrics-results/unweighted_unifrac_distance_matrix.qza --output-path distance-matrix

qiime tools export --input-path core-metrics-results/weighted_unifrac_distance_matrix.qza --output-path distance-matrix

#beta-pcoa

qiime emperor plot --i-pcoa core-metrics-results/unweighted_unifrac_pcoa_results.qza --m-metadata-file ../../metadata.txt --p-custom-axes site2 --o-visualization unweighted-unifrac-emperor-site.qzv

qiime emperor plot --i-pcoa core-metrics-results/bray_curtis_pcoa_results.qza --m-metadata-file ../../metadata.txt --p-custom-axes site2 --o-visualization bray-curtis-emperor-site.qzv

qiime emperor plot --i-pcoa core-metrics-results/jaccard_pcoa_results.qza --m-metadata-file ../../metadata.txt --p-custom-axes site2 --o-visualization jaccard-emperor-site.qzv

qiime emperor plot --i-pcoa core-metrics-results/weighted_unifrac_pcoa_results.qza --m-metadata-file ../../metadata.txt --p-custom-axes site2 --o-visualization weighted-emperor-site.qzv


#Alpha rarefaction plotting

#--p-metrics (choices can be: shannon, simpson_e, peilou_e, simpson, dominance, chao1, ace, etc) (default: observed_otus, shannon, faith_pd)

qiime diversity alpha-rarefaction  --i-table ../3_filtering/table-filtered-depth60000.qza  --i-phylogeny rooted-tree.qza  --p-max-depth 30000 --m-metadata-file ../../metadata.txt --o-visualization alpha-rarefaction-30000.qzv

qiime diversity alpha-rarefaction  --i-table ../3_filtering/table-filtered-depth60000.qza  --i-phylogeny rooted-tree.qza  --p-max-depth 60000 --m-metadata-file ../../metadata.txt --o-visualization alpha-rarefaction-60000.qzv

qiime diversity alpha-rarefaction  --i-table ../3_filtering/table-filtered-depth60000.qza  --i-phylogeny rooted-tree.qza  --p-max-depth 50000 --m-metadata-file ../../metadata.txt --o-visualization alpha-rarefaction-50000.qzv


#ANCOM analysis for group significance

qiime taxa collapse  --i-table ../3_filtering/table-filtered-depth60000.qza  --i-taxonomy ../4_classifier/taxonomy.qza  --p-level 2  --o-collapsed-table table-level2.qza

qiime taxa collapse  --i-table ../3_filtering/table-filtered-depth60000.qza  --i-taxonomy ../4_classifier/taxonomy.qza  --p-level 6  --o-collapsed-table table-level6.qza

qiime composition add-pseudocount  --i-table table-level2.qza  --o-composition-table comp-table-level2.qza

qiime composition add-pseudocount  --i-table table-level6.qza  --o-composition-table comp-table-level6.qza

qiime composition ancom  --i-table comp-table-level2.qza  --m-metadata-file ../../metadata.txt  --m-metadata-column site  --o-visualization level2-ancom-site.qzv

qiime composition ancom  --i-table comp-table-level6.qza  --m-metadata-file ../../metadata.txt  --m-metadata-column site  --o-visualization level6-ancom-site.qzv

#feature-taxonomy table (ANCOM)------download csv file from qzv

你可能感兴趣的:(QIIME2流程分析)