annotate libexec/callSomaticVariants.pl @ 22:1c8dcda28be7

version 27/11/2014, corrected extra arguments bug
author mini
date Thu, 27 Nov 2014 10:31:58 +0100
parents 0e8e6011082b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
1 #!/usr/bin/env perl
9
0e8e6011082b Strelka Workflow 0.0.2
mini
parents: 6
diff changeset
2
6
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
3 =head1 LICENSE
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
4
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
5 Strelka Workflow Software
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
6 Copyright (c) 2009-2013 Illumina, Inc.
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
7
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
8 This software is provided under the terms and conditions of the
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
9 Illumina Open Source Software License 1.
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
10
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
11 You should have received a copy of the Illumina Open Source
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
12 Software License 1 along with this program. If not, see
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
13 <https://github.com/downloads/sequencing/licenses/>.
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
14
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
15 =head1 SYNOPSIS
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
16
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
17 callSomaticVariants.pl [options] | --help
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
18
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
19 =head2 SUMMARY
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
20
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
21 Run the somatic variant caller for snvs and indels on a single
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
22 chromosome bin.
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
23
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
24 =cut
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
25
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
26 use warnings FATAL => 'all';
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
27 use strict;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
28
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
29 use Carp;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
30 $SIG{__DIE__} = \&Carp::confess;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
31
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
32 use File::Spec;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
33 use Getopt::Long;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
34 use Pod::Usage;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
35
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
36 my $baseDir;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
37 my $libDir;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
38 BEGIN {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
39
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
40 my $thisDir=(File::Spec->splitpath($0))[1];
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
41 $baseDir=File::Spec->catdir($thisDir,File::Spec->updir());
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
42 $libDir=File::Spec->catdir($baseDir,'lib');
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
43 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
44 use lib $libDir;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
45 use Utils;
9
0e8e6011082b Strelka Workflow 0.0.2
mini
parents: 6
diff changeset
46 print "all imported call";
6
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
47
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
48 if(getAbsPath($baseDir)) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
49 errorX("Can't resolve path for strelka_workflow install directory: '$baseDir'");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
50 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
51 my $libexecDir=File::Spec->catdir($baseDir,'libexec');
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
52
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
53
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
54 my $scriptName=(File::Spec->splitpath($0))[2];
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
55 my $argCount=scalar(@ARGV);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
56 my $cmdline = join(' ',$0,@ARGV);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
57
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
58
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
59 my ($chrom, $binId, $configFile);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
60 my $help;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
61
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
62 GetOptions(
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
63 "chrom=s" => \$chrom,
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
64 "bin=s" => \$binId,
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
65 "config=s" => \$configFile,
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
66 "help|h" => \$help) or pod2usage(2);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
67
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
68 pod2usage(2) if($help);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
69 pod2usage(2) unless(defined($chrom));
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
70 pod2usage(2) unless(defined($binId));
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
71 pod2usage(2) unless(defined($configFile));
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
72
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
73
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
74
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
75 #
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
76 # check all fixed paths (not based on commandline arguments):
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
77 #
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
78 checkDir($baseDir);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
79 checkDir($libexecDir);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
80
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
81 my $strelkaBin=File::Spec->catdir($libexecDir,'strelka2');
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
82 checkFile($strelkaBin,"strelka binary");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
83
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
84
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
85
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
86 #
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
87 # read config and validate values
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
88 #
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
89 checkFile($configFile,"configuration ini");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
90 my $config = parseConfigIni($configFile);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
91
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
92 for (qw(knownGenomeSize tumorBam normalBam refFile outDir)) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
93 errorX("Undefined configuration option: '$_'") unless(defined($config->{derived}{$_}));
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
94 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
95
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
96 # we skip maxInputDepth,minTier2Mapq here to allow older config files
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
97 for (qw(minTier1Mapq isWriteRealignedBam binSize ssnvPrior sindelPrior
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
98 ssnvNoise sindelNoise ssnvNoiseStrandBiasFrac)) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
99 errorX("Undefined configuration option: '$_'") unless(defined($config->{user}{$_}));
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
100 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
101
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
102 my $outDir = $config->{derived}{outDir};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
103 my $binDir = File::Spec->catdir($outDir,'chromosomes',$chrom,'bins',$binId);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
104 checkDir($outDir,"output");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
105 checkDir($binDir,"output bin");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
106
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
107
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
108 my $tumorBam = $config->{derived}{tumorBam};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
109 my $normalBam = $config->{derived}{normalBam};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
110 my $refFile = $config->{derived}{refFile};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
111 checkFile($tumorBam,"tumor BAM");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
112 checkFile($normalBam,"normal BAM");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
113 checkFile($refFile,"reference");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
114
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
115
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
116 # pull out some config options for convenience:
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
117 my $binSize=$config->{user}{binSize};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
118 my $isWriteRealignedBam=$config->{user}{isWriteRealignedBam};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
119 my $knownGenomeSize = $config->{derived}{knownGenomeSize};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
120
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
121
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
122 my $begin = (int($binId)*$binSize)+1;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
123 my $end = ((int($binId)+1)*$binSize);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
124 #my $end = $begin+100000; #debug mode
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
125
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
126 my $useroptions = $config->{user};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
127
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
128 # set previous default value if an older config file is being used:
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
129 if(! defined($useroptions->{minTier2Mapq})) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
130 $useroptions->{minTier2Mapq} = 5;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
131 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
132
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
133
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
134 #
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
135 # setup the strelka command-line:
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
136 #
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
137 my $strelka_base_opts= "-clobber" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
138 " -filter-unanchored" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
139 " -min-paired-align-score " . $useroptions->{minTier1Mapq} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
140 " -min-single-align-score 10" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
141 " -min-qscore 0" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
142 " -report-range-begin $begin -report-range-end $end" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
143 " -samtools-reference '$refFile'" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
144 " -max-window-mismatch 3 20 -print-used-allele-counts" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
145 " -bam-seq-name '" . $chrom . "'" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
146 " -genome-size $knownGenomeSize" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
147 " -max-indel-size 50" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
148 " -indel-nonsite-match-prob 0.5" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
149 " --min-contig-open-end-support 35" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
150 " --somatic-snv-rate " . $useroptions->{ssnvPrior} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
151 " --shared-site-error-rate " . $useroptions->{ssnvNoise} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
152 " --shared-site-error-strand-bias-fraction " . $useroptions->{ssnvNoiseStrandBiasFrac} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
153 " --somatic-indel-rate " . $useroptions->{sindelPrior} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
154 " --shared-indel-error-rate " . $useroptions->{sindelNoise} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
155 " --tier2-min-single-align-score " . $useroptions->{minTier2Mapq} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
156 " --tier2-min-paired-align-score " . $useroptions->{minTier2Mapq} .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
157 " --tier2-single-align-score-rescue-mode" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
158 " --tier2-mismatch-density-filter-count 10" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
159 " --tier2-no-filter-unanchored" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
160 " --tier2-indel-nonsite-match-prob 0.25" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
161 " --tier2-include-singleton" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
162 " --tier2-include-anomalous";
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
163
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
164
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
165 my $somSnvFile='somatic.snvs.unfiltered.vcf';
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
166 my $somIndelFile='somatic.indels.unfiltered.vcf';
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
167
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
168 my $cmd = "$strelkaBin $strelka_base_opts" .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
169 " -bam-file " . $normalBam .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
170 " --tumor-bam-file " . $tumorBam .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
171 " --somatic-snv-file " . File::Spec->catfile($binDir,$somSnvFile) .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
172 " --somatic-indel-file " . File::Spec->catfile($binDir,$somIndelFile) .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
173 " --variant-window-flank-file 50 " . File::Spec->catfile($binDir,$somIndelFile . '.window');
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
174
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
175
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
176 sub ualignFile($) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
177 return File::Spec->catfile($binDir,$_[0] . ".unsorted.realigned.bam");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
178 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
179 sub alignFile($) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
180 return File::Spec->catfile($binDir,$_[0] . ".realigned");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
181 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
182
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
183
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
184 if(exists($useroptions->{maxInputDepth}) && ($useroptions->{maxInputDepth} > 0)) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
185 $cmd .= " --max-input-depth " . $useroptions->{maxInputDepth};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
186 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
187
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
188
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
189 if($isWriteRealignedBam) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
190 $cmd .= " -realigned-read-file " . ualignFile("normal") .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
191 " --tumor-realigned-read-file " . ualignFile("tumor");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
192 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
193
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
194 if(defined($useroptions->{extraStrelkaArguments})){
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
195 my $arg=$useroptions->{extraStrelkaArguments};
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
196 if($arg !~ /^\s*$/) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
197 $cmd .= " " . $arg;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
198 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
199 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
200
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
201 # this file contains site stats that used to be printed on stdout:
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
202 #
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
203 $cmd .=
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
204 " --report-file " . File::Spec->catfile($binDir,'strelka.stats');
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
205
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
206 $cmd .=
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
207 " >| " . File::Spec->catfile($binDir,'strelka.stdout') .
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
208 " 2>| " . File::Spec->catfile($binDir,'strelka.stderr');
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
209
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
210
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
211 executeCmd($cmd,0);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
212
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
213
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
214 if($isWriteRealignedBam) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
215 for my $label (qw(normal tumor)) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
216 my $ufile = ualignFile($label);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
217 if( -f $ufile ) {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
218 my $afile = alignFile($label);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
219 my $cmd = "samtools sort " . $ufile . " " . $afile;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
220 executeCmd($cmd,0);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
221 unlink($ufile);
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
222 } else {
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
223 logX("Can't find unsorted realigned BAM file: '$ufile'");
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
224 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
225 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
226 }
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
227
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
228
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
229 1;
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
230
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
231 __END__
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
232
87568e5a7d4f Testing strelka version 0.0.1
mini
parents:
diff changeset
233