-
Notifications
You must be signed in to change notification settings - Fork 5
/
xworkStripes
executable file
·81 lines (76 loc) · 2.32 KB
/
xworkStripes
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
77
78
79
80
81
#!/bin/bash
#
# xworkStripes: a little script to make working with GoSTRIPES easier ...
# Alls this does is to set the variable rws (run with singularity)
# so that you can run commands from the GoSTRIPES container by
# simply preceding them with $rws .
#
# Last update: December 12, 2018. Volker Brendel.
#
boundDirset=0
imageset=0
alliswell=1
OPTIND=1
while getopts "b:i:" optname
do
case "$optname" in
"b")
boundDirset=1
boundDir=$OPTARG
;;
"i")
imageset=1
GoSTRIPESimage=$OPTARG
;;
"?")
echo "Unknown option $OPTARG."
;;
":")
echo "No argument value provided for option $OPTARG."
;;
*)
# Bad luck!?:
echo "An unknown error occurred while processing options."
;;
esac
done
if [[ $boundDirset == 0 || $imageset == 0 ]]
then
echo ""
echo "USAGE: source xworkSTRIPES -b boundDir -i GoSTRIPESimage"
echo ""
echo "Required arguments:"
echo ""
echo " boundDir = your working directory, accessible to GoSTRIPES"
echo " GoSTRIPESimage = full path to the GoSTRIPES Singularity image"
echo ""
echo "If you see this message, then something was not quite right."
echo " boundDIR was set to: $boundDIR."
echo " GoSTRIPESimage was set to: $GoSTRIPESimage."
echo ""
alliswell=0
fi
if [[ $alliswell == 1 ]]
then
echo ""
echo ""
echo "Ready to go STRIPES!"
echo ""
echo "Your current directory:"
echo "$HOSTNAME"; pwd; echo""; date; echo""
rws="singularity exec -e -B $boundDir $GoSTRIPESimage"
echo "The rws variable has been set to: $rws"
echo 'Run a command within the GoSTRIPES container by preceding it with $rws.'
echo ""
echo "Example:"
echo " which fastq-interleave"
echo "will show you if you have fastq-interleave on your host system."
echo ' $rws fastq-interleave'
echo "will show you help information for the program, already installed in the GoSTRIPES image."
echo ""
echo "NOTE: You must invoke xworkStripes with 'source'."
echo ' Otherwise $rws will not be available in your shell.'
echo ' You might consider setting $rws as an enviroment variable.'
echo ' Another approach is to set rws as an alias.'
export rws
fi