@@ -225,7 +225,7 @@ sub runDelly {
225
225
get_chrs_from_dict(\%chrs ,\%opt ) unless scalar (keys %chrs );
226
226
my ( $jobIDs_chunks , $logFiles );
227
227
( $jobIDs_chunks , $logFiles ) = create_interchromosomal_chunks(\@sampleBams , \%chrs , $type , $delly_tmp_dir , $delly_job_dir , $delly_log_dir ,\%opt , \@runningJobs ) if $type eq " TRA" ;
228
- ( $jobIDs_chunks , $logFiles ) = create_intrachromosomal_chunks(\@sampleBams , \%chrs , $type , $delly_tmp_dir , $delly_job_dir , $delly_log_dir ,\%opt , \@runningJobs ) if $type =~ / DEL|DUP|INV/ ;
228
+ ( $jobIDs_chunks , $logFiles ) = create_intrachromosomal_chunks(\@sampleBams , \%chrs , $type , $delly_tmp_dir , $delly_job_dir , $delly_log_dir ,\%opt , \@runningJobs ) if $type =~ / DEL|DUP|INV|INS / ;
229
229
230
230
# Translocation jobs
231
231
if ($type eq " TRA" ) {
@@ -273,8 +273,11 @@ sub runDelly {
273
273
print VCF_CONCAT " if [[ \$ TAIL =~ Done.\$ ]] ; then\n " ;
274
274
print VCF_CONCAT " \t $opt {VCFTOOLS_PATH}/vcf-sort -c --temporary-directory $delly_tmp_dir $delly_tmp_dir /$runName \_ $type \_ CONVERT.vcf > $delly_tmp_dir /$runName \_ $type \_ CONVERT_SORT.vcf\n " ;
275
275
print VCF_CONCAT " \t mv $delly_tmp_dir /$runName \_ $type \_ CONVERT_SORT.vcf $delly_out_dir /$runName \_ $type .vcf\n " ;
276
- print VCF_CONCAT " \t touch $delly_log_dir /DELLY_$type .done\n " ;
277
- print VCF_CONCAT " fi\n\n " ;
276
+ print VCF_CONCAT " \t if [ -s $delly_out_dir /$runName \_ $type .vcf ]\n " ;
277
+ print VCF_CONCAT " \t then\n " ;
278
+ print VCF_CONCAT " \t\t touch $delly_log_dir /DELLY_$type .done\n " ;
279
+ print VCF_CONCAT " \t fi\n " ;
280
+ print VCF_CONCAT " fi\n\n " ;
278
281
close VCF_CONCAT;
279
282
280
283
system " $qsub -o $delly_log_dir /$type \_ VCF_CONCAT.out -e $delly_log_dir /$type \_ VCF_CONCAT.err -N $jobID2 -hold_jid " .join (" ," ,@$jobIDs_chunks ). " $vcf_concat_file " ;
@@ -303,17 +306,20 @@ sub runDelly {
303
306
print VCF_CONCAT " \t\t\t echo \$ VCF_FILE >> $delly_tmp_dir /$type \_ vcf_files.txt\n " ;
304
307
print VCF_CONCAT " \t\t fi\n " ;
305
308
print VCF_CONCAT " \t\t FINISHED+=(\$ FILE)\n " ;
306
- print VCF_CONCAT " \t else\n " ;
307
- print VCF_CONCAT " \t\t FAILED+=(\$ FILE)\n " ;
308
- print VCF_CONCAT " \t fi\n " ;
309
- print VCF_CONCAT " done\n\n " ;
310
- print VCF_CONCAT " if [[ \$ {#FAILED[@]} > 0 ]] ; then\n " ;
311
- print VCF_CONCAT " \t >&2 echo \" error\"\n " ;
312
- print VCF_CONCAT " else\n " ;
313
- print VCF_CONCAT " \t $opt {VCFTOOLS_PATH}/vcf-concat -f $delly_tmp_dir /$type \_ vcf_files.txt | $opt {VCFTOOLS_PATH}/vcf-sort -c --temporary-directory $delly_tmp_dir > $delly_tmp_dir /$runName \_ $type .vcf\n " ;
314
- print VCF_CONCAT " \t mv $delly_tmp_dir /$runName \_ $type .vcf $delly_out_dir /$runName \_ $type .vcf\n " ;
315
- print VCF_CONCAT " \t touch $delly_log_dir /DELLY_$type .done\n " ;
316
- print VCF_CONCAT " fi\n\n " ;
309
+ print VCF_CONCAT " \t else\n " ;
310
+ print VCF_CONCAT " \t\t FAILED+=(\$ FILE)\n " ;
311
+ print VCF_CONCAT " \t fi\n " ;
312
+ print VCF_CONCAT " done\n\n " ;
313
+ print VCF_CONCAT " if [[ \$ {#FAILED[@]} > 0 ]] ; then\n " ;
314
+ print VCF_CONCAT " \t >&2 echo \" error\"\n " ;
315
+ print VCF_CONCAT " else\n " ;
316
+ print VCF_CONCAT " \t $opt {VCFTOOLS_PATH}/vcf-concat -f $delly_tmp_dir /$type \_ vcf_files.txt | $opt {VCFTOOLS_PATH}/vcf-sort -c --temporary-directory $delly_tmp_dir > $delly_tmp_dir /$runName \_ $type .vcf\n " ;
317
+ print VCF_CONCAT " \t mv $delly_tmp_dir /$runName \_ $type .vcf $delly_out_dir /$runName \_ $type .vcf\n " ;
318
+ print VCF_CONCAT " \t if [ -s $delly_out_dir /$runName \_ $type .vcf ]\n " ;
319
+ print VCF_CONCAT " \t then\n " ;
320
+ print VCF_CONCAT " \t\t touch $delly_log_dir /DELLY_$type .done\n " ;
321
+ print VCF_CONCAT " \t fi\n " ;
322
+ print VCF_CONCAT " fi\n\n " ;
317
323
close VCF_CONCAT;
318
324
system " $qsub -o $delly_log_dir /$type \_ VCF_CONCAT.out -e $delly_log_dir /$type \_ VCF_CONCAT.err -N $jobID -hold_jid " .join (" ," ,@$jobIDs_chunks ). " $vcf_concat_file " ;
319
325
push @jobIDs_concat , $jobID ;
@@ -344,13 +350,16 @@ sub runDelly {
344
350
my $vcf_concat_file = " $delly_job_dir /$type \_ " .$jobID3 ." .sh" ;
345
351
open VCF_CONCAT, " >$vcf_concat_file " ;
346
352
print VCF_CONCAT " #!/bin/bash\n\n " ;
347
- print VCF_CONCAT " FILE=$delly_log_dir /$type \_ CONVERT.out\n " ;
353
+ print VCF_CONCAT " FILE=$delly_log_dir /$type \_ CONVERT.out\n " ;
348
354
print VCF_CONCAT " TAIL=`tail -n 1 \$ FILE`\n " ;
349
355
print VCF_CONCAT " if [[ \$ TAIL =~ Done.\$ ]] ; then\n " ;
350
356
print VCF_CONCAT " \t $opt {VCFTOOLS_PATH}/vcf-sort -c --temporary-directory $delly_tmp_dir $delly_tmp_dir /$runName \_ $type \_ CONVERT.vcf > $delly_tmp_dir /$runName \_ $type \_ CONVERT_SORT.vcf\n " ;
351
357
print VCF_CONCAT " \t mv $delly_tmp_dir /$runName \_ $type \_ CONVERT_SORT.vcf $delly_out_dir /$runName \_ $type .vcf\n " ;
352
- print VCF_CONCAT " \t touch $delly_log_dir /DELLY_$type .done\n " ;
353
- print VCF_CONCAT " fi\n\n " ;
358
+ print VCF_CONCAT " \t if [ -s $delly_out_dir /$runName \_ $type .vcf ]\n " ;
359
+ print VCF_CONCAT " \t then\n " ;
360
+ print VCF_CONCAT " \t\t touch $delly_log_dir /DELLY_$type .done\n " ;
361
+ print VCF_CONCAT " \t fi\n " ;
362
+ print VCF_CONCAT " fi\n\n " ;
354
363
close VCF_CONCAT;
355
364
356
365
system " $qsub -o $delly_log_dir /$type \_ VCF_CONCAT.out -e $delly_log_dir /$type \_ VCF_CONCAT.err -N $jobID3 -hold_jid $jobID2 $vcf_concat_file " ;
@@ -365,7 +374,10 @@ sub runDelly {
365
374
print VCF_CONCAT " TAIL=`tail -n 1 $logFile `\n " ;
366
375
print VCF_CONCAT " if [[ \$ TAIL =~ Done.\$ ]] ; then\n " ;
367
376
print VCF_CONCAT " \t mv $delly_tmp_dir /$runName \_ $type .vcf $delly_out_dir /$runName \_ $type .vcf\n " ;
368
- print VCF_CONCAT " \t touch $delly_log_dir /DELLY_$type .done\n " ;
377
+ print VCF_CONCAT " \t if [ -s $delly_out_dir /$runName \_ $type .vcf ]\n " ;
378
+ print VCF_CONCAT " \t then\n " ;
379
+ print VCF_CONCAT " \t\t touch $delly_log_dir /DELLY_$type .done\n " ;
380
+ print VCF_CONCAT " \t fi\n " ;
369
381
print VCF_CONCAT " else\n " ;
370
382
print VCF_CONCAT " \t >&2 echo \" error\"\n " ;
371
383
print VCF_CONCAT " fi\n\n " ;
0 commit comments