-
Notifications
You must be signed in to change notification settings - Fork 0
/
q2x_ancom.batch
executable file
·45 lines (34 loc) · 1.17 KB
/
q2x_ancom.batch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -euxo pipefail
cd $(dirname `readlink -f $0`)
work_dir=$PWD
prefix=`cat configuration.txt | grep "^prefix" | cut -d "=" -f 2`
investigate_group=`cat configuration.txt | grep "^investigate_group" | cut -d "=" -f 2`
input_tables="${prefix}_da2_tab_pk_filtered.qza ${prefix}_un3_tab_pk_filtered.qza ${prefix}_up_tab_pk_filtered.qza"
output_file="ANCOM"
metadata_file="${prefix}_manifest.tsv"
if [ ! -d ${output_file} ];then
mkdir ${output_file}
else
rm -rf ${output_file}
mkdir ${output_file}
fi
for i in `seq 2 7`;do
for tab in ${input_tables};do
prefix=${tab%_tab*}
qiime taxa collapse \
--i-table ${tab} \
--i-taxonomy ${prefix}_tax_pk.qza \
--p-level ${i} \
--o-collapsed-table ${output_file}/${prefix}_tab_level${i}.qza
qiime composition add-pseudocount \
--i-table ${output_file}/${prefix}_tab_level${i}.qza \
--o-composition-table ${output_file}/${prefix}_tab_level${i}_pse.qza
qiime composition ancom \
--i-table ${output_file}/${prefix}_tab_level${i}_pse.qza \
--m-metadata-file ${metadata_file} \
--m-metadata-column ${investigate_group} \
--o-visualization ${output_file}/${prefix}_ancom_level${i}_strain.qzv
done
done
exit 0