comparison alignCustomAmplicon/alignCustomAmplicon.pl @ 4:22f35f830f48 draft

Uploaded
author fcaramia
date Wed, 09 Jan 2013 00:45:53 -0500
parents d32bddcff685
children
comparison
equal deleted inserted replaced
3:a72948f2c8c7 4:22f35f830f48
141 -o STR filename for bam file 141 -o STR filename for bam file
142 -p INT number of threads [$OPTIONS{p}] 142 -p INT number of threads [$OPTIONS{p}]
143 -r do not create stats report 143 -r do not create stats report
144 -s sort the bam file 144 -s sort the bam file
145 -v verbose progress 145 -v verbose progress
146 -j STR picard jar
146 ) if(@ARGV != 4); 147 ) if(@ARGV != 4);
147 148
148 my $Script = 'alignCustomAmplicon'; 149 my $Script = 'alignCustomAmplicon';
149 my $ref = shift @ARGV; 150 my $ref = shift @ARGV;
150 my $fastq1 = shift @ARGV; 151 my $fastq1 = shift @ARGV;
168 # Open the log file and redirect output to it 169 # Open the log file and redirect output to it
169 open (STDERR, ">>$logfile") or die 'Couldn\'t create log file!\n'; 170 open (STDERR, ">>$logfile") or die 'Couldn\'t create log file!\n';
170 open (STDOUT, ">>$logfile") or die 'Couldn\'t create log file!\n'; 171 open (STDOUT, ">>$logfile") or die 'Couldn\'t create log file!\n';
171 my $now = localtime time; 172 my $now = localtime time;
172 print "Appending To Log File $now\n\n"; 173 print "Appending To Log File $now\n\n";
174 }
175
176 if (defined $OPTIONS{j})
177 {
178 my $JAR = $OPTIONS{j};
179
173 } 180 }
174 181
175 # print version of this script 182 # print version of this script
176 print "Using $Script version $version \n\n"; 183 print "Using $Script version $version \n\n";
177 184
447 454
448 $_->join() for @threadArray; 455 $_->join() for @threadArray;
449 456
450 # sort the bam file 457 # sort the bam file
451 if(defined $OPTIONS{s}) { 458 if(defined $OPTIONS{s}) {
452 system("MergeSamFiles.sh MAX_RECORDS_IN_RAM=2000000 I=$bam_to_sort O=$bamfile_out VALIDATION_STRINGENCY=LENIENT SO=coordinate USE_THREADING=true CREATE_INDEX=true"); 459 system("java -Xmx8g -jar $JAR MAX_RECORDS_IN_RAM=2000000 I=$bam_to_sort O=$bamfile_out VALIDATION_STRINGENCY=LENIENT SO=coordinate USE_THREADING=true CREATE_INDEX=true");
453 unlink $bam_to_sort; 460 unlink $bam_to_sort;
454 } 461 }
455 462
456 if(!defined $OPTIONS{r}) { 463 if(!defined $OPTIONS{r}) {
457 # print out statistics 464 # print out statistics