-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRE2C.bash
More file actions
executable file
·91 lines (77 loc) · 1.8 KB
/
RE2C.bash
File metadata and controls
executable file
·91 lines (77 loc) · 1.8 KB
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
82
83
84
85
86
87
88
89
90
# !usr/bin/bash -u
# created by Cue Hyunkyu Lee
# Feb 7 2017
# ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")"
# set cur directory
curdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
parsed=""
#unparsed=""
inputf="NA"
outputf="$curdir/out"
threads="1"
corf="NA"
# load the versioninfo
cat $curdir/data/versioninfo
# read argument and parsing them
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--i|--input)
inputf="$(cd "$(dirname "$2")" && pwd)/$(basename "$2")"
parsed="$parsed input"
shift # past argument
;;
--o|--output)
outputf="$(cd "$(dirname "$2")" && pwd)/$(basename "$2")"
parsed="$parsed output"
shift # past argument
;;
--c|--cor)
corf="$(cd "$(dirname "$2")" && pwd)/$(basename "$2")"
parsed="$parsed cor"
shift # past argument
;;
--threads)
parsed="$parsed --threads"
threads="$2"
shift # past argument
;;
--h|--help)
cat $curdir/data/help
exit 0
;;
*)
shift
;;
esac # end of case
shift # past argument
done # end of 1st while
if [ $inputf = "NA" ]
then
echo "failed to find an input file"
exit 0
fi
## print argument parsing information
echo " parsed arguments:$parsed"
#echo "unparsed arguments:$unparsed"
echo " ## input arguments ## "
echo " WD: $curdir"
echo " INPUT: $inputf"
echo " OUT: $outputf"
echo " COR: $corf"
echo " CORES: $threads"
## create log file
logf="$outputf.log"
outf="$outputf.txt"
touch $outf
cat $curdir/data/versioninfo > $logf
echo " ## input arguments ## " >> $logf
echo " WD: $curdir" >> $logf
echo " INPUT: $inputf" >> $logf
echo " OUTPUT: $outputf" >> $logf
echo " COR: $corf" >> $logf
echo " CORES: $threads" >> $logf
## runAnalysis!!
#echo "Rscript $curdir/R/runAnalysis.R \"$curdir\" \"$inputf\" \"$outputf\" \"$corf\""
Rscript $curdir/R/runAnalysis.R $curdir $inputf $outputf $corf $logf $threads