forked from bioinform/somaticseq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ssSomaticSeq.Wrapper.sh
executable file
·192 lines (148 loc) · 5.98 KB
/
ssSomaticSeq.Wrapper.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/bin/bash
set -e
OPTS=`getopt -o o: --long output-dir:,mutect2:,strelka:,varscan:,vardict:,lofreq:,scalpel:,genome-reference:,cosmic:,dbsnp:,gatk:,in-bam:,classifier-snv:,classifier-indel:,ada-r-script:,exclusion-region:,inclusion-region:,truth-indel:,truth-snv:,pass-threshold:,lowqual-threshold:,keep-intermediates: -n 'ssSomaticSeq.Wrapper.sh' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
eval set -- "$OPTS"
MYDIR="$( cd "$( dirname "$0" )" && pwd )"
merged_dir='.'
keep_intermediates=0
while true; do
case "$1" in
-o | --output-dir )
case "$2" in
"") shift 2 ;;
*) merged_dir=$2 ; shift 2 ;;
esac ;;
--mutect2 )
case "$2" in
"") shift 2 ;;
*) mutect2_vcf=$2 ; shift 2 ;;
esac ;;
--varscan )
case "$2" in
"") shift 2 ;;
*) varscan_vcf=$2 ; shift 2 ;;
esac ;;
--vardict )
case "$2" in
"") shift 2 ;;
*) vardict_vcf=$2 ; shift 2 ;;
esac ;;
--lofreq )
case "$2" in
"") shift 2 ;;
*) lofreq_vcf=$2 ; shift 2 ;;
esac ;;
--scalpel )
case "$2" in
"") shift 2 ;;
*) scalpel_vcf=$2 ; shift 2 ;;
esac ;;
--strelka )
case "$2" in
"") shift 2 ;;
*) strelka_vcf=$2 ; shift 2 ;;
esac ;;
--genome-reference )
case "$2" in
"") shift 2 ;;
*) hg_ref=$2 ; shift 2 ;;
esac ;;
--cosmic )
case "$2" in
"") shift 2 ;;
*) cosmic=$2 ; shift 2 ;;
esac ;;
--dbsnp )
case "$2" in
"") shift 2 ;;
*) dbsnp=$2 ; shift 2 ;;
esac ;;
--gatk )
case "$2" in
"") shift 2 ;;
*) gatk=$2 ; shift 2 ;;
esac ;;
--in-bam )
case "$2" in
"") shift 2 ;;
*) tbam=$2 ; shift 2 ;;
esac ;;
--classifier-snv )
case "$2" in
"") shift 2 ;;
*) snpclassifier=$2 ; shift 2 ;;
esac ;;
--classifier-indel )
case "$2" in
"") shift 2 ;;
*) indelclassifier=$2 ; shift 2 ;;
esac ;;
--ada-r-script )
case "$2" in
"") shift 2 ;;
*) ada_r_script=$2 ; shift 2 ;;
esac ;;
--inclusion-region )
case "$2" in
"") shift 2 ;;
*) inclusion_region=$2 ; shift 2 ;;
esac ;;
--exclusion-region )
case "$2" in
"") shift 2 ;;
*) exclusion_region=$2 ; shift 2 ;;
esac ;;
--truth-indel )
case "$2" in
"") shift 2 ;;
*) indelgroundtruth=$2 ; shift 2 ;;
esac ;;
--truth-snv )
case "$2" in
"") shift 2 ;;
*) snpgroundtruth=$2 ; shift 2 ;;
esac ;;
--keep-intermediates )
case "$2" in
"") shift 2 ;;
*) keep_intermediates=$2 ; shift 2 ;;
esac ;;
-- ) shift; break ;;
* ) break ;;
esac
done
mkdir -p ${merged_dir}
echo 'This SomaticSeq.Wrapper.sh script is being obsolesced.'
echo 'It is only here to maintain compatibility with previous versions.'
echo 'You should look into run_parallel.py or somaticseq/run_somaticseq.py in the future.'
echo 'This script simply runs the somaticseq/run_somaticseq.py script.'
echo ''
if [[ $merged_dir ]]; then outdir_arg="-outdir $merged_dir"; fi
if [[ $hg_ref ]]; then ref_arg="-ref $hg_ref"; fi
if [[ $cosmic ]]; then cosmic_arg="-cosmic $cosmic"; fi
if [[ $dbsnp ]]; then dbsnp_arg="-dbsnp $dbsnp"; fi
if [[ $snpclassifier ]]; then classifier_snv_arg="--classifier-snv $snpclassifier"; fi
if [[ $indelclassifier ]]; then classifier_indel_arg="--classifier-indel $indelclassifier"; fi
if [[ $masked_region ]]; then exclude_arg="-exclude $masked_region"; fi
if [[ $inclusion_region ]]; then include_arg="-include $inclusion_region"; fi
if [[ $indelgroundtruth ]]; then truth_indel_arg="--truth-indel $indelgroundtruth"; fi
if [[ $snpgroundtruth ]]; then truth_snv_arg="--truth-snv $snpgroundtruth"; fi
if [[ $pass_threshold ]]; then pass_arg="--pass-threshold $pass_threshold"; fi
if [[ $lowqual_threshold ]]; then low_arg="--lowqual-threshold $lowqual_threshold"; fi
if [[ $tbam ]]; then bam_arg="-bam $tbam" ; fi
if [[ $mutect2_vcf ]]; then mutect2_arg="-mutect2 $mutect2_vcf"; fi
if [[ $varscan_vcf ]]; then varscan_arg="-varscan $varscan_vcf" ; fi
if [[ $vardict_vcf ]]; then vardict_arg="-vardict $vardict_vcf" ; fi
if [[ $lofreq_vcf ]]; then lofreq_arg="-lofreq $lofreq_vcf" ; fi
if [[ $scalpel_vcf ]]; then scalpel_arg="-scalpel $scalpel_vcf" ; fi
if [[ $strelka_vcf ]]; then strelka_arg="-strelka $strelka_vcf" ; fi
if [[ $keep_intermediates == 1 ]]; then keep_intermediate_arg='--keep-intermediates'; fi
${MYDIR}/somaticseq/run_somaticseq.py $outdir_arg $ref_arg $cosmic_arg $dbsnp_arg $classifier_snv_arg $classifier_indel_arg $exclude_arg $include_arg $truth_indel_arg $truth_snv_arg $pass_arg $low_arg $keep_intermediate_arg \
single $bam_arg $mutect2_arg $varscan_arg $vardict_arg $lofreq_arg $scalpel_arg $strelka_arg
echo ''
echo 'This ssSomaticSeq.Wrapper.sh script is being obsolesced.'
echo 'It is only here to maintain compatibility with previous versions.'
echo 'You should look into run_parallel.py or somaticseq/run_somaticseq.py in the future.'
echo 'This script simply runs the somaticseq/run_somaticseq.py script.'