-
Notifications
You must be signed in to change notification settings - Fork 0
/
gRNAs_Step1.sh
77 lines (65 loc) · 1.29 KB
/
gRNAs_Step1.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
helpFunction()
{
echo "Usage: $0 -i [] -o [] -t [all/mut/snp/nd]"
echo -e "\t-i Input xlsx file on s3"
echo -e "\t-o output s3 directory"
echo -e "\t-t Description of what gRNAs to produce"
echo ""
exit 1 # Exit script after printing help
}
runner()
{
if [ $ex -eq 0 ]
then
echo ""
elif [ $ex -eq 2 ]
then
echo "Failed generating gRNAs for $1" >&2
exit 1
else
echo "Unexpected error occured, $1" >&2
exit 1
fi
}
while getopts "i:o:t:" opt
do
case "$opt" in
i ) input_path="$OPTARG" ;;
o ) output_path="$OPTARG" ;;
t ) type="${OPTARG}" ;;
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done
# Print helpFunction in case parameters are empty
if [ -z "$input_path" ] || [ -z "$output_path" ] || [ -z "$type" ]
then
echo "Some or all of the parameters are empty";
helpFunction
fi
if [ -z $CODE_LOCATION ] ; then
CODE_LOCATION=$(dirname $(readlink -f $0))
fi
case $type in
all)
runner Mut
runner SNP
runner ND
;;
mut)
runner Mut
;;
snp)
runner SNP
;;
nd)
runner ND
;;
*)
echo -n "unknown"
;;
esac
d=$(date +%d-%m-%Y)
filename="${input_path##*/}"
filename=${filename%".xlsx"}
outfilename=$output_path/${filename}_OUT_$d.xlsx