annotate libexec/callSomaticVariants.pl @ 6:87568e5a7d4f

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