OTUtable标准化方法

OTUtable标准方法

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

2.css方法或者deseq2方法

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


  • 发表于 2020-08-19 16:19
  • 阅读 ( 4515 )
  • 分类:宏基因组

0 条评论

请先 登录 后评论
omicsgene
omicsgene

生物信息

698 篇文章

作家榜 »

  1. omicsgene 698 文章
  2. 安生水 347 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. xun 82 文章
  6. 红橙子 78 文章
  7. rzx 74 文章
  8. CORNERSTONE 72 文章