-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaDNASeq-byBABS.sh
executable file
·56 lines (51 loc) · 1 KB
/
aDNASeq-byBABS.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
#!/bin/bash
POSITIONAL=()
OUTDIR=""
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--outdir)
OUTDIR="$2"
shift # past argument
shift # past value
;;
--design)
DESIGN="--design $2"
if [[ "$2" = /* ]];
then
DESIGN="--design $2"
else
DESIGN="--design $PWD/$2"
fi
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [[ $OUTDIR == "" ]];
then
echo "ERROR: --outdir not set"
exit
elif [ ! -d $OUTDIR ];
then
echo "$OUTDIR does not exist, creating...."
mkdir -p $OUTDIR
fi
# get wrapper script home
BASH_HOME=$( dirname "${BASH_SOURCE[0]}" )
# check if absolute, if not make so
if [[ "$BASH_HOME" = /* ]];
then
BASH_HOME=$BASH_HOME
else
BASH_HOME=$PWD/$BASH_HOME
fi
cd $OUTDIR
nextflow run $BASH_HOME/aDNASeq-byBABS.nf $DESIGN ${POSITIONAL[@]}
cd -