-
Notifications
You must be signed in to change notification settings - Fork 1
/
runTest.sh
162 lines (128 loc) · 3.68 KB
/
runTest.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/bin/bash
## Example: ./run_test.sh baqcomSTARmapping.R
usage="usage: ./$(basename "$0") [options] -- runTest version 0.3.1
Use this script to test the functionality of the pipelines
This script runs by default baqcomTrimmomatic.R (Quality Control). You have to specify which mapping pipeline you want to test
Examples:
./runTest.sh baqcomSTAR.R --- This option will run:
- baqcomTrimmomatic.R (Quality Control)
- baqcomSTAR.R (Index, Mapping and Counting)
./runTest.sh baqcomHisat2.R --- This option will run:
- baqcomTrimmomatic.R (Quality Control)
- baqcomHisat2.R (Index, Mapping)
- baqcomHtseq.R (Counting)
- baqcomFeatureCounts.R (Counting)
./run_test.sh all --- This option will run all available pipelines
"
unset OPTARG
unset OPTIND
while getopts ':h' option; do
case "$option" in
h) echo "$usage"
exit
;;
# p) $endFile
# ;;
\?) printf "illegal option: -%s\n" "$OPTARG" >&2
echo "$usage" >&2
exit 1
;;
esac
done
#exit 0
shift $((OPTIND-1))
pipeline=$1
#check if command line argument is empty or not present
#
if [ "$1" != "" ] && [ "$1" != "baqcomSTAR.R" ] && [ "$1" != "baqcomHisat2.R" ] && [ "$1" != "all" ];
then
echo "Please enter a valid argument"
echo "Example: run_test.sh baqcomSTAR.R"
echo "Example: run_test.sh baqcomHisat2.R"
echo "Example: run_test.sh all"
exit 0
fi
genome=examples/genome/Sus.Scrofa.chr1.genome.dna.toplevel.fa.gz
annotation=examples/genome/Sus.Scrofa.chr1.gene.annotation.gtf.gz
if [ -f "$genome" ];
then
gunzip $genome
echo -e "\nGenome files extracted successfully"
fi
if [ -f "$annotation" ];
then
gunzip $annotation
echo -e "Annotation files extracted successfully\n"
fi
#create input_folder
if [ ! -d 00-Fastq ];
then
mkdir 00-Fastq
if [ "$(ls -A 00-Fastq)" ]
then
echo -e "00-Fastq and files already exist\n"
else
cp examples/HE2* 00-Fastq/
echo -e "00-Fastq created and files moved successfully\n"
fi
fi
#moving files from examples folder to 00-Fastq Folder
#Creating samples.txt
echo -e "\n"
rm -f samples.txt
./createSamples.sh
echo -e "\n"
#
run.trimmomatic () {
echo -e "\n"
echo "Running baqcomTrimmomatic test"
echo -e "\n"
./baqcomTrimmomatic.R -p 36 -l
echo -e "\n"
echo "baqcomTrimmomatic test is done"
}
run.STAR () {
echo -e "\nRunning baqcomSTAR\n"
./baqcomSTAR.R -p 19 -t examples/genome/Sus.Scrofa.chr1.genome.dna.toplevel.fa -g examples/genome/Sus.Scrofa.chr1.gene.annotation.gtf
echo -e "\nbaqcomSTAR test is done\n"
}
run.HISAT2 () {
echo -e "\nRunning baqcomHisat2 test\n"
./baqcomHisat2.R -p 19 -t examples/genome/Sus.Scrofa.chr1.genome.dna.toplevel.fa -g examples/genome/Sus.Scrofa.chr1.gene.annotation.gtf
echo -e "\nbaqcomHisat2 test is done\n"
}
run.HTSEQ () {
echo -e "\nRunning baqcomHtseq test\n"
./baqcomHtseq.R -g examples/genome/Sus.Scrofa.chr1.gene.annotation.gtf
echo -e "\nbaqcomHtseq test is done\n"
}
run.FeatCount () {
echo "Running baqcomFeatureCounts test"
echo -e "\n"
./baqcomFeatureCounts.R -a examples/genome/Sus.Scrofa.chr1.gene.annotation.gtf
echo "baqcomFeatureCounts test is done"
echo -e "\n"
}
if [ "$pipeline" == "" ];
then
run.trimmomatic
elif [[ "$pipeline" == "baqcomSTAR.R" ]];
then
run.trimmomatic
run.STAR
elif [[ "$pipeline" == "baqcomHisat2.R" ]];
then
run.trimmomatic
run.HISAT2
run.HTSEQ
run.FeatCount
elif [[ "$pipeline" == "all" ]];
then
run.trimmomatic
cp -r 02-Reports/ 02-Reports_2/
run.STAR
mv 02-Reports_2 02-Reports
run.HISAT2
run.HTSEQ
run.FeatCount
fi