-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpicrust.qsub
More file actions
58 lines (45 loc) · 1.45 KB
/
picrust.qsub
File metadata and controls
58 lines (45 loc) · 1.45 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash -l
# USAGE: qsub -P <BU PROJECT NAME> picrust.qsub <ASV-TABLE.qza> <REP-SEQUENCES.qza> <OUTPUT DIRECTORY>
#$ -j y
#$ -pe omp 28
# Load parameters
PARAMETERS=$1
echo "### PICRUST ###"
cat $PARAMETERS
if [ -d $INTERDIR ]
then
rm -rf $INTERDIR
fi
source $PARAMETERS
conda activate $CONDA_ENV
INTERDIR=$OUTDIR/intermediate/picrust
# Run picrust
cmd="qiime picrust2 full-pipeline \
--i-table $BIOMFILE \
--i-seq $SEQSFILE \
--output-dir $INTERDIR \
--p-threads $(nproc --all) \
--p-hsp-method $HSP \
--p-max-nsti $NSTI \
--verbose"
echo $cmd
eval $cmd
# Extract Enzyme Classification, KEGG, and Pathway abundances
for f in ec_metagenome.qza ko_metagenome.qza pathway_abundance.qza
do
qiime tools export --input-path $INTERDIR/$f --output-path $INTERDIR
# Convert to tsv
biom convert -i $INTERDIR/feature-table.biom -o $INTERDIR/feature-table.tsv --to-tsv
# Move to output directory and remove stupid header
outpath=$OUTDIR/${f%.qza}.tsv
sed '1d' $INTERDIR/feature-table.tsv > $outpath
echo "SAVED $outpath"
done
## Extract pathway abundances
#qiime tools export --input-path $INTERDIR/pathway_abundance.qza --output-path $INTERDIR
## Convert to tsv
#biom convert -i $INTERDIR/feature-table.biom -o $INTERDIR/feature-table.tsv --to-tsv
## Move to output directory and remove stupid header
#outpath=$OUTDIR/pathway_abundance.tsv
#sed '1d' $INTERDIR/feature-table.tsv > $outpath
#echo "SAVED $outpath"