Skip to content

Commit 9340658

Browse files
authored
Merge pull request #106 from UMCUGenetics/release-v2.6.0
Release v2.6.0
2 parents 40d8c4c + 8d30ad1 commit 9340658

21 files changed

+433
-418
lines changed

IAP/calling.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ sub runFingerprint {
189189
$command .= "-T UnifiedGenotyper ";
190190
$command .= "-R $opt{GENOME} ";
191191
$command .= "-L $opt{FINGERPRINT_TARGET} ";
192+
$command .= "-D $opt{FINGERPRINT_TARGET} ";
192193
$command .= "-I $sample_bam ";
193194
$command .= "-o $output_vcf ";
194195
$command .= "--output_mode EMIT_ALL_SITES ";

IAP/copyNumber.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ sub runCopyNumberTools {
145145
next;
146146
}
147147

148-
## Run CNV callers only Freec for wgs data
148+
## Run CNV callers
149149
if($opt{CNV_FREEC} eq "yes"){
150150
print "\n###SCHEDULING FREEC####\n";
151151
my $freec_job = runFreec($sample, $sample_out_dir, $sample_job_dir, $sample_log_dir, $sample_bam, "", \@running_jobs, \%opt);
@@ -274,6 +274,7 @@ sub runFreec {
274274
print FREEC_CONFIG "chrLenFile= $opt{FREEC_CHRLENFILE}\n";
275275
print FREEC_CONFIG "ploidy=2\n";
276276
print FREEC_CONFIG "samtools=$opt{SAMTOOLS_PATH}/samtools\n";
277+
print FREEC_CONFIG "sambamba=$opt{SAMBAMBA_PATH}/sambamba\n";
277278
print FREEC_CONFIG "chrFiles= $opt{FREEC_CHRFILES}\n";
278279
print FREEC_CONFIG "window=$opt{FREEC_WINDOW}\n";
279280
print FREEC_CONFIG "maxThreads=$opt{FREEC_THREADS}\n";
@@ -325,7 +326,7 @@ sub runFreec {
325326
print FREEC_SH "\tcd $freec_out_dir\n";
326327
print FREEC_SH "\tcat $opt{FREEC_PATH}/assess_significance.R | R --slave --args ".$sample_bam_name."_CNVs ".$sample_bam_name."_ratio.txt\n";
327328
print FREEC_SH "\tcat $opt{FREEC_PATH}/makeGraph.R | R --slave --args 2 ".$sample_bam_name."_ratio.txt\n";
328-
print FREEC_SH "\tcat $opt{IAP_PATH}/scripts/makeKaryotype.R | R --slave --args 2 24 4 500000 ".$sample_bam_name."_ratio.txt\n";
329+
print FREEC_SH "\tcat $opt{IAP_PATH}/scripts/makeKaryotype.R | R --slave --args 2 4 500000 ".$sample_bam_name."_ratio.txt\n";
329330
print FREEC_SH "\ttouch $log_dir/freec.done\n";
330331
print FREEC_SH "\techo \"End FREEC\t\" `date` \"\t $sample_bam \t $control_bam\t\" `uname -n` >> $log_dir/freec.log\n\n";
331332
print FREEC_SH "else\n";

IAP/poststats.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ sub runPostStats {
6868

6969
my $bashFile = $opt{OUTPUT_DIR}."/jobs/".$jobID.".sh";
7070
my $logDir = $opt{OUTPUT_DIR}."/logs";
71+
my $outputDir = "Exoncov";
7172

7273
open PS_SH, ">$bashFile" or die "cannot open file $bashFile\n";
7374
print PS_SH "#!/bin/bash\n\n";
@@ -78,7 +79,7 @@ sub runPostStats {
7879

7980
## Setup ExonCallCov
8081
if ( $opt{EXONCALLCOV} eq "yes" ){
81-
$command = "python $opt{EXONCALLCOV_PATH} --queue $opt{EXONCALLCOV_QUEUE} -a $opt{EXONCALLCOV_TIME} -c $opt{EXONCALLCOV_MEM} -b $opt{EXONCALLCOV_BED} -n $opt{EXONCALLCOV_ENS} -p $opt{EXONCALLCOV_PREF} -l $opt{EXONCALLCOV_PANEL} -s $opt{SAMBAMBA_PATH}/sambamba";
82+
$command = "python $opt{EXONCALLCOV_PATH} -o $outputDir --queue $opt{EXONCALLCOV_QUEUE} -a $opt{EXONCALLCOV_TIME} -c $opt{EXONCALLCOV_MEM} -b $opt{EXONCALLCOV_BED} -n $opt{EXONCALLCOV_ENS} -p $opt{EXONCALLCOV_PREF} -l $opt{EXONCALLCOV_PANEL} -s $opt{SAMBAMBA_PATH}/sambamba";
8283
print PS_SH "$command\n";
8384
}
8485

@@ -99,7 +100,7 @@ sub runPostStats {
99100
print PSCHECK_SH "if [ -s QCStats/*.bamMetrics.pdf -a ";
100101
if ( $opt{EXONCALLCOV} eq "yes" ){
101102
foreach my $sample (@{$opt{SAMPLES}}){
102-
print PSCHECK_SH "-s Exoncov_v3/$sample.html -a ";
103+
print PSCHECK_SH "-s $outputDir/$sample.html -a ";
103104
}
104105
}
105106
print PSCHECK_SH "-s QCStats/*.bamMetrics.html ]\nthen\n";

IAP/somaticVariants.pm

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,10 @@ sub runStrelka {
226226
# Check strelka completed
227227
print STRELKA_SH "\tif [ -f $strelka_out_dir/task.complete ]\n";
228228
print STRELKA_SH "\tthen\n";
229-
print STRELKA_SH "\t\tjava -Xmx".$opt{STRELKA_MEM}."G -jar $opt{GATK_PATH}/GenomeAnalysisTK.jar -T CombineVariants -R $opt{GENOME} --genotypemergeoption unsorted -o passed.somatic.merged.vcf -V results/passed.somatic.snvs.vcf -V results/passed.somatic.indels.vcf \n";
230-
print STRELKA_SH "\t\tperl -p -e 's/\\t([A-Z][A-Z]:)/\\tGT:\$1/g' passed.somatic.merged.vcf | perl -p -e 's/(:T[UO]R?)\\t/\$1\\t0\\/0:/g' | perl -p -e 's/(:\\d+,\\d+)\\t/\$1\\t0\\/1:/g' | perl -p -e 's/(#CHROM.*)/##StrelkaGATKCompatibility=Added GT fields to strelka calls for gatk compatibility.\\n\$1/g' > temp.vcf\n";
231-
print STRELKA_SH "\t\tmv temp.vcf passed.somatic.merged.vcf\n";
229+
print STRELKA_SH "\t\tjava -Xmx".$opt{STRELKA_MEM}."G -jar $opt{GATK_PATH}/GenomeAnalysisTK.jar -T CombineVariants -R $opt{GENOME} --genotypemergeoption unsorted -V:snp results/passed.somatic.snvs.vcf -V:indel results/passed.somatic.indels.vcf -o passed.somatic.merged.vcf\n";
230+
#print STRELKA_SH "\t\tperl -p -e 's/\\t([A-Z][A-Z]:)/\\tGT:\$1/g' passed.somatic.merged.vcf | perl -p -e 's/(:T[UO]R?)\\t/\$1\\t0\\/0:/g' | perl -p -e 's/(:\\d+,\\d+)\\t/\$1\\t0\\/1:/g' | perl -p -e 's/(#CHROM.*)/##StrelkaGATKCompatibility=Added GT fields to strelka calls for gatk compatibility.\\n\$1/g' > tmp.vcf\n";
231+
print STRELKA_SH "\t\tawk -F'\t' -v OFS='\t' '/^#CHROM/ { print \"##StrelkaGATKCompatibility=Added GT fields to strelka calls for gatk compatibility.\"; } /^[^#]/ { \$9 = \"GT:\" \$9; \$10 = \"0/0:\" \$10; \$11 = \"0/1:\" \$11; } { print }' passed.somatic.merged.vcf | python $opt{IAP_PATH}/scripts/filterStrelka.py > tmp.vcf\n";
232+
print STRELKA_SH "\t\tmv tmp.vcf passed.somatic.merged.vcf\n";
232233
print STRELKA_SH "\t\trm -r chromosomes/ \n";
233234
print STRELKA_SH "\t\ttouch $log_dir/strelka.done\n";
234235
print STRELKA_SH "\tfi\n\n";
@@ -416,7 +417,7 @@ sub runVarscan {
416417
print VARSCAN_SH "\tjava -Xmx".$opt{VARSCAN_MEM}."G -jar $opt{VARSCAN_PATH} processSomatic $sample_tumor_name.snp.vcf $opt{VARSCAN_POSTSETTINGS}\n\n";
417418

418419
# merge varscan hc snps and indels
419-
print VARSCAN_SH "\tjava -Xmx".$opt{VARSCAN_MEM}."G -jar $opt{GATK_PATH}/GenomeAnalysisTK.jar -T CombineVariants -R $opt{GENOME} --genotypemergeoption unsorted -o $sample_tumor_name.merged.Somatic.hc.vcf -V $sample_tumor_name.snp.Somatic.hc.vcf -V $sample_tumor_name.indel.Somatic.hc.vcf\n";
420+
print VARSCAN_SH "\tjava -Xmx".$opt{VARSCAN_MEM}."G -jar $opt{GATK_PATH}/GenomeAnalysisTK.jar -T CombineVariants -R $opt{GENOME} --genotypemergeoption unsorted -o $sample_tumor_name.merged.Somatic.hc.vcf -V:snp $sample_tumor_name.snp.Somatic.hc.vcf -V:indel $sample_tumor_name.indel.Somatic.hc.vcf\n";
420421
print VARSCAN_SH "\tsed -i 's/SSC/VS_SSC/' $sample_tumor_name.merged.Somatic.hc.vcf\n\n"; # to resolve merge conflict with FB vcfs
421422

422423
# Check varscan completed
@@ -479,17 +480,17 @@ sub runFreeBayes {
479480
$freebayes_command .= "$opt{FREEBAYES_SETTINGS} $sample_ref_bam $sample_tumor_bam > $freebayes_out_dir/$output_name.vcf";
480481

481482
## Sort vcf, remove duplicate lines and filter on target
482-
my $sort_uniq_normalize_filter_command = "$opt{VCFTOOLS_PATH}/vcf-sort -c -t $freebayes_tmp_dir $freebayes_out_dir/$output_name.vcf ";
483-
$sort_uniq_normalize_filter_command .= "| $opt{VCFLIB_PATH}/vcfuniq ";
484-
$sort_uniq_normalize_filter_command .= "| $opt{VT_PATH}/vt normalize -r $opt{GENOME} - > $freebayes_out_dir/$output_name.sorted_uniq_normalized.vcf\n";
485-
483+
my $sort_uniq_filter_command = "$opt{VCFTOOLS_PATH}/vcf-sort -c -t $freebayes_tmp_dir $freebayes_out_dir/$output_name.vcf ";
484+
$sort_uniq_filter_command .= "| $opt{VCFLIB_PATH}/vcfuniq ";
485+
$sort_uniq_filter_command .= "> $freebayes_out_dir/$output_name.sorted_uniq.vcf\n";
486+
486487
my $mv_command;
487488
# Filter vcf on target
488489
if($opt{SOMVAR_TARGETS}){
489-
$sort_uniq_normalize_filter_command .= "\n\tjava -Xmx".$opt{FREEBAYES_MEM}."G -jar $opt{GATK_PATH}/GenomeAnalysisTK.jar -T SelectVariants -R $opt{GENOME} -L $opt{SOMVAR_TARGETS} -V $output_name.sorted_uniq_normalized.vcf -o $freebayes_out_dir/$output_name.sorted_uniq_normalized_targetfilter.vcf\n";
490-
$mv_command = "mv $freebayes_out_dir/$output_name.sorted_uniq_normalized_targetfilter.vcf $freebayes_out_dir/$output_name.vcf";
490+
$sort_uniq_filter_command .= "\n\tjava -Xmx".$opt{FREEBAYES_MEM}."G -jar $opt{GATK_PATH}/GenomeAnalysisTK.jar -T SelectVariants -R $opt{GENOME} -L $opt{SOMVAR_TARGETS} -V $output_name.sorted_uniq.vcf -o $freebayes_out_dir/$output_name.sorted_uniq_targetfilter.vcf\n";
491+
$mv_command = "mv $freebayes_out_dir/$output_name.sorted_uniq_targetfilter.vcf $freebayes_out_dir/$output_name.vcf";
491492
} else {
492-
$mv_command = "mv $freebayes_out_dir/$output_name.sorted_uniq_normalized.vcf $freebayes_out_dir/$output_name.vcf";
493+
$mv_command = "mv $freebayes_out_dir/$output_name.sorted_uniq.vcf $freebayes_out_dir/$output_name.vcf";
493494
}
494495
## Create bashscript
495496
open FREEBAYES_SH, ">$bash_file" or die "cannot open file $bash_file \n";
@@ -499,7 +500,7 @@ sub runFreeBayes {
499500
print FREEBAYES_SH "then\n";
500501
print FREEBAYES_SH "\techo \"Start Freebayes\t\" `date` \"\t $chr \t $sample_ref_bam \t $sample_tumor_bam\t\" `uname -n` >> $log_dir/freebayes.log\n\n";
501502
print FREEBAYES_SH "\t$freebayes_command\n";
502-
print FREEBAYES_SH "\t$sort_uniq_normalize_filter_command\n";
503+
print FREEBAYES_SH "\t$sort_uniq_filter_command\n";
503504
print FREEBAYES_SH "\t$mv_command\n\n";
504505
print FREEBAYES_SH "\techo \"End Freebayes\t\" `date` \"\t $chr $sample_ref_bam \t $sample_tumor_bam\t\" `uname -n` >> $log_dir/freebayes.log\n";
505506
print FREEBAYES_SH "else\n";
@@ -534,6 +535,17 @@ sub runFreeBayes {
534535
}
535536
$file_test .= "]";
536537
$concat_command .= "> $sample_tumor_name.vcf";
538+
539+
# Freebayes post process command
540+
my $freebayes_post_process = "java -Xmx".$opt{FREEBAYES_MEM}."G -jar $opt{SNPEFF_PATH}/SnpSift.jar filter \"$opt{FREEBAYES_SOMATICFILTER}\" $freebayes_out_dir/$sample_tumor_name.vcf ";
541+
$freebayes_post_process .= "| $opt{BCFTOOLS_PATH}/bcftools view -a - ";
542+
$freebayes_post_process .= "| python $opt{IAP_PATH}/scripts/filterFreebayes.py ";
543+
$freebayes_post_process .= "| $opt{VT_PATH}/vt decompose -s - ";
544+
$freebayes_post_process .= "| $opt{VT_PATH}/vt decompose_blocksub - ";
545+
$freebayes_post_process .= "| $opt{VT_PATH}/vt normalize -q -r $opt{GENOME} - ";
546+
$freebayes_post_process .= "| $opt{VCFLIB_PATH}/vcffixup - ";
547+
$freebayes_post_process .= "| $opt{VCFLIB_PATH}/vcfstreamsort ";
548+
$freebayes_post_process .= "> $freebayes_out_dir/$sample_tumor_name\_somatic_filtered.vcf";
537549

538550
# Create bash script
539551
open FREEBAYES_SH, ">$bash_file" or die "cannot open file $bash_file \n";
@@ -543,19 +555,9 @@ sub runFreeBayes {
543555
print FREEBAYES_SH "$file_test\n";
544556
print FREEBAYES_SH "then\n";
545557
print FREEBAYES_SH "\techo \"Start concat and postprocess Freebayes\t\" `date` \"\t $sample_ref_bam \t $sample_tumor_bam\t\" `uname -n` >> $log_dir/freebayes.log\n";
546-
print FREEBAYES_SH "\t$concat_command\n\n";
558+
print FREEBAYES_SH "\t$concat_command\n";
559+
print FREEBAYES_SH "\t$freebayes_post_process\n";
547560

548-
# Uniqify freebayes output
549-
print FREEBAYES_SH "\tuniq $freebayes_out_dir/$sample_tumor_name.vcf > $freebayes_out_dir/$sample_tumor_name.uniq.vcf\n";
550-
print FREEBAYES_SH "\tmv $freebayes_out_dir/$sample_tumor_name.uniq.vcf $freebayes_out_dir/$sample_tumor_name.vcf\n\n";
551-
552-
# Filter freebayes vcf
553-
print FREEBAYES_SH "python $opt{IAP_PATH}/scripts/filterFreebayes.py -v $freebayes_out_dir/$sample_tumor_name.vcf |";
554-
print FREEBAYES_SH "java -Xmx".$opt{FREEBAYES_MEM}."G -jar $opt{SNPEFF_PATH}/SnpSift.jar filter \"$opt{FREEBAYES_SOMATICFILTER}\" > $freebayes_out_dir/$sample_tumor_name\_somatic_filtered.vcf \n";
555-
556-
# Normalize freebayes vcf -> moved to chr steps
557-
# print FREEBAYES_SH "$opt{VT_PATH}/vt normalize -r $opt{GENOME} $freebayes_out_dir/$sample_tumor_name\_somatic_filtered_unnormalized.vcf -o $freebayes_out_dir/$sample_tumor_name\_somatic_filtered.vcf \n";
558-
559561
#Check freebayes completed
560562
print FREEBAYES_SH "\tif [ -s $freebayes_out_dir/$sample_tumor_name\_somatic_filtered.vcf ]\n";
561563
print FREEBAYES_SH "\tthen\n";

IAP/structuralVariants.pm

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ sub runDelly {
225225
get_chrs_from_dict(\%chrs,\%opt) unless scalar(keys %chrs);
226226
my ( $jobIDs_chunks, $logFiles );
227227
( $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/;
229229

230230
# Translocation jobs
231231
if ($type eq "TRA") {
@@ -273,8 +273,11 @@ sub runDelly {
273273
print VCF_CONCAT "if [[ \$TAIL =~ Done.\$ ]] ; then\n";
274274
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";
275275
print VCF_CONCAT "\tmv $delly_tmp_dir/$runName\_$type\_CONVERT_SORT.vcf $delly_out_dir/$runName\_$type.vcf\n";
276-
print VCF_CONCAT "\ttouch $delly_log_dir/DELLY_$type.done\n";
277-
print VCF_CONCAT "fi\n\n";
276+
print VCF_CONCAT "\tif [ -s $delly_out_dir/$runName\_$type.vcf ]\n";
277+
print VCF_CONCAT "\tthen\n";
278+
print VCF_CONCAT "\t\ttouch $delly_log_dir/DELLY_$type.done\n";
279+
print VCF_CONCAT "\tfi\n";
280+
print VCF_CONCAT "fi\n\n";
278281
close VCF_CONCAT;
279282

280283
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 {
303306
print VCF_CONCAT "\t\t\techo \$VCF_FILE >> $delly_tmp_dir/$type\_vcf_files.txt\n";
304307
print VCF_CONCAT "\t\tfi\n";
305308
print VCF_CONCAT "\t\tFINISHED+=(\$FILE)\n";
306-
print VCF_CONCAT "\telse\n";
307-
print VCF_CONCAT "\t\tFAILED+=(\$FILE)\n";
308-
print VCF_CONCAT "\tfi\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 "\tmv $delly_tmp_dir/$runName\_$type.vcf $delly_out_dir/$runName\_$type.vcf\n";
315-
print VCF_CONCAT "\ttouch $delly_log_dir/DELLY_$type.done\n";
316-
print VCF_CONCAT "fi\n\n";
309+
print VCF_CONCAT "\telse\n";
310+
print VCF_CONCAT "\t\tFAILED+=(\$FILE)\n";
311+
print VCF_CONCAT "\tfi\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 "\tmv $delly_tmp_dir/$runName\_$type.vcf $delly_out_dir/$runName\_$type.vcf\n";
318+
print VCF_CONCAT "\tif [ -s $delly_out_dir/$runName\_$type.vcf ]\n";
319+
print VCF_CONCAT "\tthen\n";
320+
print VCF_CONCAT "\t\ttouch $delly_log_dir/DELLY_$type.done\n";
321+
print VCF_CONCAT "\tfi\n";
322+
print VCF_CONCAT "fi\n\n";
317323
close VCF_CONCAT;
318324
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";
319325
push @jobIDs_concat, $jobID;
@@ -344,13 +350,16 @@ sub runDelly {
344350
my $vcf_concat_file = "$delly_job_dir/$type\_".$jobID3.".sh";
345351
open VCF_CONCAT, ">$vcf_concat_file";
346352
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";
348354
print VCF_CONCAT "TAIL=`tail -n 1 \$FILE`\n";
349355
print VCF_CONCAT "if [[ \$TAIL =~ Done.\$ ]] ; then\n";
350356
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";
351357
print VCF_CONCAT "\tmv $delly_tmp_dir/$runName\_$type\_CONVERT_SORT.vcf $delly_out_dir/$runName\_$type.vcf\n";
352-
print VCF_CONCAT "\ttouch $delly_log_dir/DELLY_$type.done\n";
353-
print VCF_CONCAT "fi\n\n";
358+
print VCF_CONCAT "\tif [ -s $delly_out_dir/$runName\_$type.vcf ]\n";
359+
print VCF_CONCAT "\tthen\n";
360+
print VCF_CONCAT "\t\ttouch $delly_log_dir/DELLY_$type.done\n";
361+
print VCF_CONCAT "\tfi\n";
362+
print VCF_CONCAT "fi\n\n";
354363
close VCF_CONCAT;
355364

356365
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 {
365374
print VCF_CONCAT "TAIL=`tail -n 1 $logFile`\n";
366375
print VCF_CONCAT "if [[ \$TAIL =~ Done.\$ ]] ; then\n";
367376
print VCF_CONCAT "\tmv $delly_tmp_dir/$runName\_$type.vcf $delly_out_dir/$runName\_$type.vcf\n";
368-
print VCF_CONCAT "\ttouch $delly_log_dir/DELLY_$type.done\n";
377+
print VCF_CONCAT "\tif [ -s $delly_out_dir/$runName\_$type.vcf ]\n";
378+
print VCF_CONCAT "\tthen\n";
379+
print VCF_CONCAT "\t\ttouch $delly_log_dir/DELLY_$type.done\n";
380+
print VCF_CONCAT "\tfi\n";
369381
print VCF_CONCAT "else\n";
370382
print VCF_CONCAT "\t>&2 echo \"error\"\n";
371383
print VCF_CONCAT "fi\n\n";

IAP/vcfutils.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ sub runVcfUtils {
122122
print "WARNING: $opt{OUTPUT_DIR}/logs/ROH_$sample.done exists, skipping \n";
123123
} else {
124124
print VCFUTILS_SH "cd $opt{OUTPUT_DIR}/tmp/\n";
125-
print VCFUTILS_SH "$opt{BCFTOOLS_PATH}/bcftools roh -s $sample $opt{ROH_SETTINGS} $opt{OUTPUT_DIR}/$vcf > $sample\_ROH.txt\n";
126-
print VCFUTILS_SH "python $opt{IAP_PATH}/scripts/get_roh_regions.py $sample\_ROH.txt > $sample\_ROH_regions.txt\n";
125+
print VCFUTILS_SH "$opt{BCFTOOLS_PATH}/bcftools view -f PASS $opt{OUTPUT_DIR}/$vcf | $opt{BCFTOOLS_PATH}/bcftools roh -s $sample -O s $opt{ROH_SETTINGS} - > $sample\_ROH_sites.txt\n";
126+
print VCFUTILS_SH "$opt{BCFTOOLS_PATH}/bcftools view -f PASS $opt{OUTPUT_DIR}/$vcf | $opt{BCFTOOLS_PATH}/bcftools roh -s $sample -O r $opt{ROH_SETTINGS} - > $sample\_ROH_regions.txt\n";
127+
#print VCFUTILS_SH "python $opt{IAP_PATH}/scripts/get_roh_regions.py $sample\_ROH.txt > $sample\_ROH_regions.txt\n"; # Not needed anymore.
127128
print VCFUTILS_SH "\tmv $sample\_ROH*.txt $output_dir/\n";
128-
print VCFUTILS_SH "if [ -s $output_dir/$sample\_ROH.txt -a -s $output_dir/$sample\_ROH_regions.txt ]; then\n";
129+
print VCFUTILS_SH "if [ -s $output_dir/$sample\_ROH_sites.txt -a -s $output_dir/$sample\_ROH_regions.txt ]; then\n";
129130
print VCFUTILS_SH "\ttouch $opt{OUTPUT_DIR}/logs/ROH_$sample.done\n";
130131
print VCFUTILS_SH "else\n";
131132
print VCFUTILS_SH "\tfailed=true\n";

LICENSE

100644100755
File mode changed.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ GENOME /path/to/genome.fasta
133133
####SOMATIC SAMPLE REGEX####
134134
## Only required for somatic variant calling, copy number and structural variant analysis
135135
SOMATIC_REGEX (CPCT\d{8})([TR][IVX]*$)
136+
SOMATIC_REGEX_REF_CODE R #comma separated list of ref origin values
137+
SOMATIC_REGEX_TUMOR_CODE T #comma separated list of tumor origin values
136138
### SOMATIC_REGEX should follow this patern: (<sample_match>)(<origin_match>)
137139
# R = reference
138140
# T = tumor
@@ -440,8 +442,8 @@ VCFUTILS_PHASE yes/no
440442
VCFUTILS_GENDERCHECK yes/no
441443
PED /path/to/ped_file_folder/
442444
VCFUTILS_ROH yes/no
443-
BCFTOOLS_PATH /path/to/bcftools-1.3
444-
ROH_SETTINGS --AF-dflt 0.4
445+
BCFTOOLS_PATH /path/to/bcftools-1.4
446+
ROH_SETTINGS --AF-dflt 0.4 --ignore-homref --skip-indels
445447
VCFUTILS_SINGLE_SAMPLE_VCF yes/no
446448
447449
####NIPT CLUSTER CONFIGURATION####

0 commit comments

Comments
 (0)