Skip to content

Commit 15bf73e

Browse files
authored
Merge pull request #123 from UMCUGenetics/develop
v2.8.0
2 parents aa2d168 + f73ff31 commit 15bf73e

File tree

3 files changed

+91
-5
lines changed

3 files changed

+91
-5
lines changed

IAP/copyNumber.pm

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ sub runCopyNumberTools {
156156
my $qdnaseq_job = runqDNAseq($sample, $sample_out_dir, $sample_job_dir, $sample_log_dir, $sample_bam, \@running_jobs, \%opt);
157157
if($qdnaseq_job){push(@cnv_jobs, $qdnaseq_job)};
158158
}
159-
159+
if($opt{CNV_EXOMEDEPTH} eq "yes"){
160+
print "\n###SCHEDULING EXOMEDEPTH####\n";
161+
my $exomedepth_job = runExomedepth($sample, $sample_out_dir, $sample_job_dir, $sample_log_dir, $sample_bam, \@running_jobs, \%opt);
162+
if($exomedepth_job){push(@cnv_jobs, $exomedepth_job)};
163+
}
164+
160165

161166
## Check copy number analysis
162167
my $job_id = "CHECK_".$sample."_".get_job_id();
@@ -165,12 +170,20 @@ sub runCopyNumberTools {
165170
open CHECK_SH, ">$bash_file" or die "cannot open file $bash_file \n";
166171
print CHECK_SH "#!/bin/bash\n\n";
167172
print CHECK_SH "echo \"Start Check\t\" `date` `uname -n` >> $sample_log_dir/check.log\n\n";
168-
if($opt{CNV_QDNASEQ} eq "yes" && $opt{CNV_FREEC} eq "yes"){
173+
if($opt{CNV_FREEC} eq "yes" && $opt{CNV_QDNASEQ} eq "yes" && $opt{CNV_EXOMEDEPTH} eq "yes"){
174+
print CHECK_SH "if [ -f $sample_log_dir/freec.done -a -f $sample_log_dir/qdnaseq.done -a -f $sample_log_dir/exomedepth.done ]\n";
175+
} elsif($opt{CNV_FREEC} eq "yes" && $opt{CNV_QDNASEQ} eq "yes" && $opt{CNV_EXOMEDEPTH} eq "no"){
169176
print CHECK_SH "if [ -f $sample_log_dir/freec.done -a -f $sample_log_dir/qdnaseq.done ]\n";
170-
} elsif ($opt{CNV_QDNASEQ} eq "yes" && $opt{CNV_FREEC} eq "no") {
171-
print CHECK_SH "if [ -f $sample_log_dir/qdnaseq.done ]\n";
172-
} elsif ($opt{CNV_QDNASEQ} eq "no" && $opt{CNV_FREEC} eq "yes") {
177+
} elsif($opt{CNV_FREEC} eq "yes" && $opt{CNV_QDNASEQ} eq "no" && $opt{CNV_EXOMEDEPTH} eq "yes"){
178+
print CHECK_SH "if [ -f $sample_log_dir/freec.done -a -f $sample_log_dir/exomedepth.done ]\n";
179+
} elsif($opt{CNV_FREEC} eq "no" && $opt{CNV_QDNASEQ} eq "yes" && $opt{CNV_EXOMEDEPTH} eq "yes"){
180+
print CHECK_SH "if [ -f $sample_log_dir/qdnaseq.done -a -f $sample_log_dir/exomedepth.done ]\n";
181+
} elsif($opt{CNV_FREEC} eq "yes" && $opt{CNV_QDNASEQ} eq "no" && $opt{CNV_EXOMEDEPTH} eq "no"){
173182
print CHECK_SH "if [ -f $sample_log_dir/freec.done ]\n";
183+
} elsif($opt{CNV_FREEC} eq "no" && $opt{CNV_QDNASEQ} eq "yes" && $opt{CNV_EXOMEDEPTH} eq "no"){
184+
print CHECK_SH "if [ -f $sample_log_dir/qdnaseq.done ]\n";
185+
} elsif($opt{CNV_FREEC} eq "no" && $opt{CNV_QDNASEQ} eq "no" && $opt{CNV_EXOMEDEPTH} eq "yes"){
186+
print CHECK_SH "if [ -f $sample_log_dir/exomedepth.done ]\n";
174187
}
175188
print CHECK_SH "then\n";
176189
print CHECK_SH "\ttouch $sample_log_dir/$sample.done\n";
@@ -245,6 +258,62 @@ sub runqDNAseq {
245258
return $job_id;
246259
}
247260

261+
sub runExomedepth {
262+
###
263+
# Run exomedepth
264+
###
265+
my ($sample_name, $out_dir, $job_dir, $log_dir, $sample_bam, $running_jobs, $opt) = (@_);
266+
my @running_jobs = @{$running_jobs};
267+
my %opt = %{$opt};
268+
269+
# Skip Exomedepth if done file exists
270+
if (-e "$log_dir/exomedepth.done"){
271+
print "WARNING: $log_dir/exomedepth.done exists, skipping \n";
272+
return;
273+
}
274+
275+
## Create ExomeDepth output directory
276+
my $exomedepth_out_dir = "$opt{OUTPUT_DIR}/ExomeDepth/";
277+
278+
if(! -e $exomedepth_out_dir){
279+
make_path($exomedepth_out_dir) or die "Couldn't create directory: $exomedepth_out_dir\n";
280+
}
281+
282+
my $command = "python $opt{EXOMEDEPTH_PATH} -c -m $opt{MAIL} ";
283+
$command .= "--ib=$sample_bam ";
284+
$command .= "-o $exomedepth_out_dir ";
285+
286+
## Create EXOMEDEPTH bash script
287+
my $job_id = "EXOMEDEPTH_".$sample_name."_".get_job_id();
288+
my $bash_file = $job_dir."/".$job_id.".sh";
289+
290+
open EXOMEDEPTH_SH, ">$bash_file" or die "cannot open file $bash_file \n";
291+
print EXOMEDEPTH_SH "#!/bin/bash\n\n";
292+
print EXOMEDEPTH_SH "if [ -s $sample_bam ]\n";
293+
print EXOMEDEPTH_SH "then\n";
294+
print EXOMEDEPTH_SH "\techo \"Start EXOMEDEPTH\t\" `date` \"\t $sample_bam\t\" `uname -n` >> $log_dir/exomedepth.log\n";
295+
print EXOMEDEPTH_SH "\tcd $exomedepth_out_dir\n";
296+
print EXOMEDEPTH_SH "\t$command\n";
297+
print EXOMEDEPTH_SH "\tif [ -f $exomedepth_out_dir/logs/$sample_name*.done ]\n";
298+
print EXOMEDEPTH_SH "\tthen\n";
299+
print EXOMEDEPTH_SH "\t\ttouch $log_dir/exomedepth.done\n";
300+
print EXOMEDEPTH_SH "\tfi\n";
301+
print EXOMEDEPTH_SH "\techo \"End EXOMEDEPTH\t\" `date` \"\t $sample_bam\t\" `uname -n` >> $log_dir/exomedepth.log\n";
302+
print EXOMEDEPTH_SH "else\n";
303+
print EXOMEDEPTH_SH "\techo \"ERROR: Input bam files do not exist.\" >> $log_dir/exomedepth.log\n";
304+
print EXOMEDEPTH_SH "fi\n";
305+
close EXOMEDEPTH_SH;
306+
307+
## Run job
308+
my $qsub = &qsubTemplate(\%opt,"EXOMEDEPTH");
309+
if ( @running_jobs ){
310+
system "$qsub -o $log_dir -e $log_dir -N $job_id -hold_jid ".join(",",@running_jobs)." $bash_file";
311+
} else {
312+
system "$qsub -o $log_dir -e $log_dir -N $job_id $bash_file";
313+
}
314+
return $job_id;
315+
}
316+
248317

249318
sub runFreec {
250319
###

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ perl illumina_pipeline.pl /path/to/output_dir/settings.config>
4949
- [Contra](http://contra-cnv.sourceforge.net/)
5050
- [FREEC](http://bioinfo-out.curie.fr/projects/freec/)
5151
- [QDNAseq](https://github.com/ccagc/QDNAseq) (used tag: v1.9.2-HMF.1)
52+
- [ExomeDepth](https://github.com/UMCUGenetics/ExomeDepth)
5253
- [Varscan](http://varscan.sourceforge.net/)
5354
- [Strelka](https://sites.google.com/site/strelkasomaticvariantcaller/)
5455
- [Freebayes](https://github.com/ekg/freebayes)
@@ -359,6 +360,14 @@ QDNASEQ_THREADS number of threads
359360
QDNASEQ_MEM maximum memory
360361
QDNASEQ_PATH /hpc/local/CentOS7/cog_bioinf/QDNAseq_v1.9.2-HMF.1
361362
363+
## EXOMEDEPTH
364+
CNV_EXOMEDEPTH yes/no
365+
EXOMEDEPTH_QUEUE queue_name
366+
EXOMEDEPTH_TIME estimated runtime
367+
EXOMEDEPTH_THREADS number of threads
368+
EXOMEDEPTH_MEM maximum memory
369+
EXOMEDEPTH_PATH /hpc/diaggen/software/development/Dx_resources_ED/ExomeDepth/run_ExomeDepth.py
370+
362371
## Contra
363372
CNV_CONTRA yes/no
364373
CONTRA_THREADS number_of_threads

illumina_pipeline.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,14 @@ sub checkConfig{
698698
if(! $opt{QDNASEQ_MEM}){ print "ERROR: No QDNASEQ_MEM option found in config files.\n"; $checkFailed = 1; }
699699
if(! $opt{QDNASEQ_TIME}){ print "ERROR: No QDNASEQ_TIME option found in config files.\n"; $checkFailed = 1; }
700700
}
701+
if(! $opt{CNV_EXOMEDEPTH}){ print "ERROR: No CNV_EXOMEDEPTH in config files.\n"; $checkFailed = 1; }
702+
if($opt{CNV_EXOMEDEPTH} eq "yes"){
703+
if(! $opt{EXOMEDEPTH_PATH}){ print "ERROR: No EXOMEDEPTH_PATH option found in config files.\n"; $checkFailed = 1; }
704+
if(! $opt{EXOMEDEPTH_QUEUE}){ print "ERROR: No EXOMEDEPTH_QUEUE option found in config files.\n"; $checkFailed = 1; }
705+
if(! $opt{EXOMEDEPTH_THREADS}){ print "ERROR: No EXOMEDEPTH_THREADS option found in config files.\n"; $checkFailed = 1; }
706+
if(! $opt{EXOMEDEPTH_MEM}){ print "ERROR: No EXOMEDEPTH_MEM option found in config files.\n"; $checkFailed = 1; }
707+
if(! $opt{EXOMEDEPTH_TIME}){ print "ERROR: No EXOMEDEPTH_TIME option found in config files.\n"; $checkFailed = 1; }
708+
}
701709
}
702710
## SV_CALLING
703711
if($opt{SV_CALLING} eq "yes"){

0 commit comments

Comments
 (0)