***下载数据库
### kraken2 database
wget https://genome-idx.s3.amazonaws.com/kraken/k2_pluspf_8gb_20210517.tar.gz
tar -zxvf k2_pluspf_8gb_20210517.tar.gz
### bracken database
singularity exec ../../software/MetaGenome.sif bracken-build -d K2/ -t 4
***分类kraken & 丰度估计bracken
*step1: kraken-物种组成
singularity exec ../../software/MetaGenome.sif kraken2 --threads 4 --quick --paired --db ../../Database/K2/ --report A1.kreport --output A1.kraken ../../P1.data_filter/02.contaminant/A1_1.clean.fq.gz ../../P1.data_filter/02.contaminant/A1_2.clean.fq.gz
singularity exec ../../software/MetaGenome.sif kraken2 --threads 4 --quick --paired --db ../../Database/K2/ --report A2.kreport --output A2.kraken ../../P1.data_filter/02.contaminant/A2_1.clean.fq.gz ../../P1.data_filter/02.contaminant/A2_2.clean.fq.gz
*step2:bracken-丰度计算
singularity exec ../../software/MetaGenome.sif bracken -d ../../Database/K2/ -i A1.kreport -o out_S/A1.bracken.S -w out_S/A1.kreport -l S -t 10
singularity exec ../../software/MetaGenome.sif bracken -d ../../Database/K2/ -i A2.kreport -o out_S/A2.bracken.S -w out_S/A2.kreport -l S -t 10
*step3:样本结果合并 转换成表格***
singularity exec ../../software/MetaGenome.sif kraken-biom ./out_S/*.kreport --max D -o ./out_S/S.biom
singularity exec ../../software/MetaGenome.sif biom convert -i ./out_S/S.biom -o ./out_S/S.count.tsv.tmp --to-tsv --header-key taxonomy
表格内容调整
sed 's/; g__\([^;]\+\); s__/; g__\1; s__\1 /' ./out_S/S.count.tsv.tmp > ./out_S/S.taxID.count.tsv
sed '/^#/! s/^[0-9]\+\t\(.*[A-Za-z]\+__\([^;]\+\)\)$/\2\t\1/' ./out_S/S.taxID.count.tsv > ./out_S/S.taxName.count.tsv
sed '1d; 2s/^#//' ./out_S/S.taxName.count.tsv |awk -F "\t" -v 'OFS=\t' '{$NF = ""; { print $0 }}' | sed 's/\t$//' > ./out_S/S.count.tsv
绘图-barplot 热图(聚类) krona图
singularity exec ../../software/MetaGenome.sif Rscript ../script/draw_taxonBarplot.R out_S/S.count.tsv 20 out_S/S.count.out
singularity exec ../../software/MetaGenome.sif kreport2krona.py -r A1.kreport -o A1.kreport.krona
singularity exec ../../software/MetaGenome.sif ktImportText -o A1.kreport.krona.html A1.kreport.krona