-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheOTU_parallel.csh~
executable file
·70 lines (57 loc) · 1.67 KB
/
eOTU_parallel.csh~
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /bin/sh
#$ -S /bin/bash
# -cwd
#path to file where all of the data is
#load in the variables from the second command line input
. ./$1
source /etc/profile.d/modules.sh
module load qiime-default
module load R/2.12.1
module load mothur
#process number is the first command line variable
UNIQUE2=${UNIQUE}.${SGE_TASK_ID}.${AFTER}
#Align the sequences with mothur
mothur "#align.seqs(template=${FALIGN},candidate=${UNIQUE2}.fa)"
if [[ -s ${UNIQUE2}.align ]] ; then
NULLVAR=0
else
echo "PipeStop error:${UNIQUE2}.align is empty; stopped program after mothur:align.seqs" ;
exit;
fi ;
#make the distance matrix from the aligned sequences
FastTree -nt -makematrix ${UNIQUE2}.align > ${UNIQUE2}.dst
if [[ -s ${UNIQUE2}.dst ]] ; then
NULLVAR=0
else
echo "PipeStop error:${UNIQUE2}.dst is empty; stopped program after FastTree" ;
exit;
fi ;
FastTree -nt -makematrix ${UNIQUE2}.fa > ${UNIQUE2}.unaligned.dst
if [[ -s ${UNIQUE2}.unaligned.dst ]] ; then
NULLVAR=0
else
echo "PipeStop error:${UNIQUE2}.unaligned.dst is empty; stopped program after FastTree" ;
exit;
fi ;
perl ${BIN}/${ERRORPROGRAM} -d ${UNIQUE2}.dst,${UNIQUE2}.unaligned.dst -m ${UNIQUE2}.mat -out ${UNIQUE2} -dist ${CUTOFF} ${VARSTRING}
if [[ -s ${UNIQUE2}.err ]] ; then
NULLVAR=0
else
echo "PipeStop error:${UNIQUE2}.err is empty; stopped program after ${ERRORPROGRAM}" ;
exit;
fi ;
rm ${UNIQUE2}.R_file.chi
rm ${UNIQUE2}.R_file.chisim
rm ${UNIQUE2}.R_file.err
rm ${UNIQUE2}.R_file.fis
rm ${UNIQUE2}.R_file.fisp
rm ${UNIQUE2}.R_file.in
rm ${UNIQUE2}.R_file.lic
if [[ $CLEAN ]] ; then
rm ${UNIQUE2}.dst
rm ${UNIQUE2}.align
rm ${UNIQUE2}.align.report
rm ${UNIQUE2}.unaligned.dst
rm ${UNIQUE2}.mat
rm ${UNIQUE2}.fa
fi ;