-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrapper_de_rbh.sh
executable file
·57 lines (42 loc) · 1.34 KB
/
wrapper_de_rbh.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
55
56
57
#!/bin/bash
set -e
echo "${@:1}" > Input_Parameters.txt
#inputs
# $1 - plantA.fa
# $2 - plantB.fa
# $3 - simple/forked
if [ ! -d /apples/FASTADB ]; then mkdir /apples/FASTADB; fi
if [ ! -d /apples/BLASTDB ]; then mkdir /apples/BLASTDB; fi
if [ ! -d /apples/outputs ]; then mkdir /apples/outputs; fi
fileA=$1
fileB=$2
FILENAMEA=${fileA##*/} # remove the path and leave only the file name
FILENAMEB=${fileB##*/}
mv ${fileA} /apples/FASTADB/PlantA.fa
mv ${fileB} /apples/FASTADB/PlantB.fa
cd /apples/bin
# The rbhSearch script accept both name.fa and name, but we remove the .fa here
# ${FILENAMEB%.fa} <- this was supposed to remove the ".fa" suffix but sometimes this could be .fasta or anything else
# So we ditch this filter (next line of comment) and use a more generic species name to make sure everything runs.
#perl rbhSearch.pl ${FILENAMEA%.fa} ${FILENAMEB%.fa}
# perl rbhSearch.pl PlantA PlantB
case ${3} in
simple)
perl rbhSearch.pl PlantA PlantB
;;
forked)
if [ ! -d /apples/tempdir ]; then mkdir /apples/tempdir; fi
perl rbhSearchForked.pl PlantA PlantB
;;
*)
perl rbhSearch.pl PlantA PlantB
;;
esac
# rm -r /apples/FASTADB/
# rm -r /apples/BLASTDB/
cp /apples/outputs/* /de-app-work
cd /de-app-work
touch "PlantA_"${FILENAMEA} # So that the user can keep track of what input was used
touch "PlantB_"${FILENAMEB}
echo $(nproc)
echo "done"