1.抽平方法:
single_rarefaction.py -i pick_de_novo_otus/otu_table_clean.biom -o pick_de_novo_otus/otu_table_clean_rare.biom -d 2032
normalize_table.py -i otu_table_clean.biom -a CSS -o otu_table_clean_css.biom
normalize_table.py -i otu_table_clean.biom -a DESeq2 -z -o otu_table_clean_deseq2_norm_no_negatives.biom
###############################################################################
#对OTU丰度进行标准化CSS方法 :https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4010126/ http://qiime.org/scripts/normalize_table.html
mkdir normalized_otu_css/
normalize_table.py -i $workdir/5.pick_otu/pick_de_novo_otus/otu_table_clean.biom -a CSS -o normalized_otu_css/CSS_normalized_otu_table.biom
biom convert -i normalized_otu_css/CSS_normalized_otu_table.biom -o normalized_otu_css/CSS_normalized_otu_table1.txt --to-tsv --header-key taxonomy
#去掉只有界注释的OTU
grep -v 'k; _; _; B; a; c; t; e; r; i; a' normalized_otu_css/CSS_normalized_otu_table1.txt >normalized_otu_css/CSS_normalized_otu_table.txt
#注意biom格式转变 json to hdf5 :https://www.omicsclass.com/article/1314
biom convert -i normalized_otu_css/CSS_normalized_otu_table.txt -o normalized_otu_css/CSS_normalized_otu_table_hdf5.biom --table-type="OTU table" --to-hdf5 --process-obs-metadata taxonomy
biom summarize-table -i normalized_otu_css/CSS_normalized_otu_table_hdf5.biom -o normalized_otu_css/CSS_normalized_otu_table_summary.txt
#对OTU丰度进行标准化 相对丰度
echo Summarize taxa
echo summarize_taxa:level 2,3,4,5,6,7 >taxa_summary_parm.txt
echo plot_taxa_summary:x_width 8 >>taxa_summary_parm.txt
echo plot_taxa_summary:bar_width 0.5 >>taxa_summary_parm.txt
echo plot_taxa_summary:chart_type bar >>taxa_summary_parm.txt
summarize_taxa.py -i normalized_otu_css/CSS_normalized_otu_table_hdf5.biom -o normalized_otu_css/absolute_abundance -a --level 2,3,4,5,6,7
summarize_taxa.py -i normalized_otu_css/CSS_normalized_otu_table_hdf5.biom -o normalized_otu_css/relative_abundance --level 2,3,4,5,6,7
mkdir normalized_otu_css/group_otus_css
for i in city loc country;do
collapse_samples.py -b normalized_otu_css/CSS_normalized_otu_table_hdf5.biom -m $fastmap --collapse_fields $i --output_mapping_fp normalized_otu_css/group_otus_css/group.$i.txt --output_biom_fp normalized_otu_css/group_otus_css/otu_table_$i.biom
biom convert -i normalized_otu_css/group_otus_css/otu_table_$i.biom -o normalized_otu_css/group_otus_css/otu_table_${i}.txt --to-tsv --header-key taxonomy
summarize_taxa.py -i normalized_otu_css/group_otus_css/otu_table_$i.biom -o normalized_otu_css/group_otus_css/taxa_summary_relative.${i} -L 2,3,4,5,6,7
summarize_taxa.py -i normalized_otu_css/group_otus_css/otu_table_$i.biom -o normalized_otu_css/group_otus_css/taxa_summary_absolute.${i} -a -L 2,3,4,5,6,7
done
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!