-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcutadapt.sh
executable file
·54 lines (48 loc) · 1.98 KB
/
cutadapt.sh
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
#!/bin/bash
# sanity check
printf "Conda env: $CONDA_DEFAULT_ENV\n"
printf "Python version: $(python --version)\n"
printf "Biopython version: $(conda list | egrep biopython | awk '{print $2}')\n"
printf "Bash version: ${BASH_VERSION}\n\n"
outlocation=$(mktemp -d /data/files/XXXXXX)
SCRIPTDIR=$(dirname "$(readlink -f "$0")")
if [ $3 == "forward_mode" ]
then
python $SCRIPTDIR"/cutadapt_wrapper.py" -i $1 -t $2 -ts $3 -fp $4 -e $5 -l $6 -of $outlocation -un $7 -O $8
mv $outlocation"/output/trimmed.zip" $9
cp $outlocation"/adminlog.log" "${10}"
[ $7 == "yes" ] && mv $outlocation"/output/untrimmed.zip" "${11}"
rm -rf $outlocation
fi
if [ $3 == "reverse_mode" ]
then
python $SCRIPTDIR"/cutadapt_wrapper.py" -i $1 -t $2 -ts $3 -rp $4 -e $5 -l $6 -of $outlocation -un $7 -O $8
mv $outlocation"/output/trimmed.zip" $9
cp $outlocation"/adminlog.log" "${10}"
[ $7 == "yes" ] && mv $outlocation"/output/untrimmed.zip" "${11}"
rm -rf $outlocation
fi
if [ $3 == "both_mode" ]
then
python $SCRIPTDIR"/cutadapt_wrapper.py" -i $1 -t $2 -ts $3 -fp $4 -rp $5 -e $6 -l $7 -of $outlocation -un $8 -O $9
mv $outlocation"/output/trimmed.zip" "${10}"
cp $outlocation"/adminlog.log" "${11}"
[ $8 == "yes" ] && mv $outlocation"/output/untrimmed.zip" "${12}"
rm -rf $outlocation
fi
if [ $3 == "both_mode_anchored" ]
then
python $SCRIPTDIR"/cutadapt_wrapper.py" -i $1 -t $2 -ts $3 -fp $4 -rp $5 -e $6 -l $7 -of $outlocation -un $8 -O $9
mv $outlocation"/output/trimmed.zip" "${10}"
cp $outlocation"/adminlog.log" "${11}"
[ $8 == "yes" ] && mv $outlocation"/output/untrimmed.zip" "${12}"
rm -rf $outlocation
fi
if [ $3 == "both_three_optional_mode" ]
then
python $SCRIPTDIR"/cutadapt_wrapper.py" -i $1 -t $2 -ts $3 -fp $4 -rp $5 -e $6 -l $7 -of $outlocation -un $8 -O $9
mv $outlocation"/output/trimmed.zip" "${10}"
cp $outlocation"/adminlog.log" "${11}"
[ $8 == "yes" ] && mv $outlocation"/output/untrimmed.zip" "${12}"
rm -rf $outlocation
fi