echo pick_otus:similarity 0.97 > otu_params.txt
echo pick_otus:otu_picking_method usearch61_ref >> otu_params.txt #uclust_ref,usearch_ref, usearch61_ref
echo assign_taxonomy:similarity 0.8 >>otu_params.txt
echo assign_taxonomy:assignment_method uclust >>otu_params.txt # rdp, blast,rtax, mothur, uclust, sortmerna #如果是ITS/18S数据,数据库更改为UNITE,assignment_method方法改为blast。详细使用说明,请读官方文档http://qiime.org/scripts/assign_taxonomy.html
#echo assign_taxonomy:assignment_method rdp >>otu_params.txt
#echo assign_taxonomy:rdp_max_memory 20000 >>otu_params.txt
#echo assign_taxonomy:confidence 0.5 >>otu_params.txt
#对数据进行标准化与过滤
pick_closed_reference_otus.py -r $greengene_16S_97_seq \
-t $greengene_16S_97_tax -i $workdir/5.pick_otu_qiime/qiime.fasta -f \
-o pick_closed_reference_otus -p otu_params.txt -s
filter_otus_from_otu_table.py -i pick_closed_reference_otus/otu_table.biom \
-o pick_closed_reference_otus/otu_table_filtered.biom --min_count_fraction 0.00001 \
--negate_ids_to_exclude -e $greengene_16S_97_seq
sort_otu_table.py -i pick_closed_reference_otus/otu_table_filtered.biom \
-o pick_closed_reference_otus/closed_otu_table.biom
single_rarefaction.py -i pick_closed_reference_otus/closed_otu_table.biom \
-o pick_closed_reference_otus/closed_otu_table_rare.biom -d 1604
biom convert -i pick_closed_reference_otus/closed_otu_table_rare.biom \
-o pick_closed_reference_otus/closed_otu_table_rare.txt --to-tsv --header-key taxonomy
picrust2_pipeline.py -s pick_closed_reference_otus/rep_set/qiime_rep_set.fasta -i pick_closed_reference_otus/closed_otu_table_rare.biom -o picrust2_out_pipeline -p 10
#校正拷贝数
normalize_by_copy_number.py -i pick_closed_reference_otus/closed_otu_table_rare.biom \
-o normalized_otus.biom \
-c $dbdir/picrust_data/16S_13_5_precalculated.tab.gz
biom convert -i normalized_otus.biom -o normalized_otus.txt --to-tsv --header-key taxonomy
#KEGG功能预测
predict_metagenomes.py -i normalized_otus.biom -o predictions_kegg.biom -c $dbdir/picrust_data/ko_13_5_precalculated.tab.gz
biom convert -i predictions_kegg.biom --to-tsv --header-key KEGG_Description -o predictions_kegg.txt
#COG功能预测
predict_metagenomes.py --type_of_prediction cog -i normalized_otus.biom -o predictions_cog.biom -c $dbdir/picrust_data/cog_13_5_precalculated.tab.gz
biom convert -i predictions_cog.biom --to-tsv --header-key COG_Description -o predictions_cog.txt
#KEGG功能预测结果分类汇总
categorize_by_function.py -i predictions_kegg.biom -c "KEGG_Pathways" -l 1 -o predictions_kegg_at_L1.biom
categorize_by_function.py -i predictions_kegg.biom -c "KEGG_Pathways" -l 2 -o predictions_kegg_at_L2.biom
categorize_by_function.py -i predictions_kegg.biom -c "KEGG_Pathways" -l 3 -o predictions_kegg_at_L3.biom
biom convert -i predictions_kegg_at_L1.biom --to-tsv --header-key KEGG_Pathways -o predictions_kegg_at_L1.txt
biom convert -i predictions_kegg_at_L2.biom --to-tsv --header-key KEGG_Pathways -o predictions_kegg_at_L2.txt
biom convert -i predictions_kegg_at_L3.biom --to-tsv --header-key KEGG_Pathways -o predictions_kegg_at_L3.txt
#COG功能预测结果分类汇总
categorize_by_function.py -i predictions_cog.biom -c "COG_Category" -l 1 -o predictions_cog_at_L1.biom
categorize_by_function.py -i predictions_cog.biom -c "COG_Category" -l 2 -o predictions_cog_at_L2.biom
biom convert -i predictions_cog_at_L1.biom --to-tsv --header-key COG_Category -o predictions_cog_at_L1.txt
biom convert -i predictions_cog_at_L2.biom --to-tsv --header-key COG_Category -o predictions_cog_at_L2.txt
#关注的功能有哪些细菌,所有结果此文件很大,需要自行运行得到结果
#metagenome_contributions.py -i normalized_otus.biom -o ko_metagenome_contributions.xls -c $dbdir/picrust_data/ko_13_5_precalculated.tab.gz
#metagenome_contributions.py -i normalized_otus.biom -t cog -o cog_metagenome_contributions.xls -c $dbdir/picrust_data/cog_13_5_precalculated.tab.gz
#只导出关心的功能
metagenome_contributions.py -i normalized_otus.biom \
-o ko_metagenome_contributions1.xls -c $dbdir/picrust_data/ko_13_5_precalculated.tab.gz \
-l K00001,K00002,K00004
metagenome_contributions.py -i normalized_otus.biom -t cog \
-o cog_metagenome_contributions1.xls -c $dbdir/picrust_data/cog_13_5_precalculated.tab.gz \
-l COG0001,COG0002
#利用qiime软件 汇总统计并可视化分析
echo summarize_taxa:md_identifier "KEGG_Pathways" >sum_taxa_picrust.txt
echo summarize_taxa:absolute_abundance True >> sum_taxa_picrust.txt #注释掉即为相对丰度
echo summarize_taxa:level 1,2,3 >>sum_taxa_picrust.txt
summarize_taxa_through_plots.py -f -i predictions_kegg.biom -p sum_taxa_picrust.txt -o summarize_kegg_through_plots
#alpha 多样性分析,统计的是注释到的每个样品中KO的数目
alpha_diversity.py -i predictions_kegg.biom -m observed_species,shannon,chao1,simpson,goods_coverage,ace -o alpha_div_index.txt
#beta多样性分析,反应不同样品中功能组成的差异,没有进化树无法计算unifrac
echo beta_diversity:metrics binary_jaccard,bray_curtis,binary_euclidean > beta_params.txt
beta_diversity_through_plots.py -f -i predictions_kegg.biom -m $fastmap -o beta_diversity_through_plots -p beta_params.txt
#转换成STAMP格式方便STAMP 差异统计分析
biom_to_stamp.py -m KEGG_Pathways predictions_kegg_at_L2.biom > predictions_kegg_at_L2.spf
biom_to_stamp.py -m KEGG_Pathways predictions_kegg_at_L3.biom > predictions_kegg_at_L3.spf
biom_to_stamp.py -m KEGG_Description predictions_kegg.biom > predictions_kegg.spf
biom_to_stamp.py predictions_cog_at_L1.biom > predictions_cog_at_L1.spf
biom_to_stamp.py predictions_cog_at_L2.biom > predictions_cog_at_L2.spf
biom_to_stamp.py predictions_cog.biom > predictions_cog.spf
#Lefse差异分析
koeken.py -i predictions_kegg_at_L3.biom -m $fastmap -l 3 -pc --split Description -cl loc -str 1 \
--effect 3 --pval 0.05 -dp 300 -o lefse/loc_less_strict -pi
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!