Skip to content

Commit 41be40f

Browse files
authored
Merge pull request #94 from UMCUGenetics/release-v2.5.0
Release v2.5.0
2 parents c9e0e45 + acc499b commit 41be40f

27 files changed

+648
-253
lines changed

illumina_annotateVariants.pm renamed to IAP/annotateVariants.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
### Authors: R.F.Ernst & H.H.D.Kerstens
1111
##################################################################################################################################################
1212

13-
package illumina_annotateVariants;
13+
package IAP::annotateVariants;
1414

1515
use strict;
1616
use POSIX qw(tmpnam);
1717
use lib "$FindBin::Bin"; #locates pipeline directory
18-
use illumina_sge;
18+
use IAP::sge;
1919

2020
sub runAnnotateVariants {
2121
###

illumina_baf.pm renamed to IAP/baf.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
### Authors: R.F.Ernst
88
##################################################################
99

10-
package illumina_baf;
10+
package IAP::baf;
1111

1212
use strict;
1313
use POSIX qw(tmpnam);
1414
use lib "$FindBin::Bin"; #locates pipeline directory
15-
use illumina_sge;
15+
use IAP::sge;
1616

1717
sub runBAF {
1818
###

illumina_baseRecal.pm renamed to IAP/baseRecal.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
### Author: R.F.Ernst
88
####################################
99

10-
package illumina_baseRecal;
10+
package IAP::baseRecal;
1111

1212
use strict;
1313
use POSIX qw(tmpnam);
1414
use lib "$FindBin::Bin"; #locates pipeline directory
15-
use illumina_sge;
15+
use IAP::sge;
1616

1717
sub runBaseRecalibration {
1818
###

illumina_callableLoci.pm renamed to IAP/callableLoci.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
### Authors: R.F.Ernst
88
##################################################################
99

10-
package illumina_callableLoci;
10+
package IAP::callableLoci;
1111

1212
use strict;
1313
use POSIX qw(tmpnam);
1414
use lib "$FindBin::Bin"; #locates pipeline directory
15-
use illumina_sge;
15+
use IAP::sge;
1616

1717
sub runCallableLoci {
1818
###

illumina_calling.pm renamed to IAP/calling.pm

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
### Authors: R.F.Ernst & H.H.D.Kerstens
1111
##################################################################
1212

13-
package illumina_calling;
13+
package IAP::calling;
1414

1515
use strict;
1616
use POSIX qw(tmpnam);
1717
use lib "$FindBin::Bin"; #locates pipeline directory
18-
use illumina_sge;
18+
use IAP::sge;
1919

2020
sub runVariantCalling {
2121
###
@@ -148,6 +148,76 @@ sub runVariantCalling {
148148
return \%opt;
149149
}
150150

151+
sub runFingerprint {
152+
###
153+
# Run single sample UnifiedGenotyper for genetic fingerprint analysis
154+
###
155+
my $configuration = shift;
156+
my %opt = %{$configuration};
157+
my $runName = (split("/", $opt{OUTPUT_DIR}))[-1];
158+
my $jobID = "Fingerprint_".get_job_id();
159+
my @running_jobs;
160+
my $log_dir = $opt{OUTPUT_DIR}."/logs";
161+
my $output_dir = "$opt{OUTPUT_DIR}/fingerprint";
162+
163+
### Create output folder
164+
if(! -e $output_dir){
165+
mkdir($output_dir) or die "Couldn't create directory: $output_dir\n";
166+
}
167+
### Create bash script
168+
my $bashFile = $opt{OUTPUT_DIR}."/jobs/".$jobID.".sh";
169+
170+
open FINGERPRINT_SH, ">$bashFile" or die "cannot open file $bashFile \n";
171+
print FINGERPRINT_SH "#!/bin/bash\n";
172+
print FINGERPRINT_SH "bash $opt{CLUSTER_PATH}/settings.sh\n\n";
173+
print FINGERPRINT_SH "cd $output_dir\n\n";
174+
175+
foreach my $sample (@{$opt{SAMPLES}}){
176+
if (-e "$log_dir/Fingerprint_$sample.done"){
177+
print "WARNING: $opt{OUTPUT_DIR}/logs/Fingerprint_$sample.done exists, skipping \n";
178+
} else {
179+
my $sample_bam = "$opt{OUTPUT_DIR}/$sample/mapping/$opt{BAM_FILES}->{$sample}";
180+
my $output_vcf = $sample."_fingerprint.vcf";
181+
182+
## Running jobs
183+
if ( @{$opt{RUNNING_JOBS}->{$sample}} ){
184+
push( @running_jobs, @{$opt{RUNNING_JOBS}->{$sample}} );
185+
}
186+
187+
### Build gatk command
188+
my $command = "java -Djava.io.tmpdir=$opt{OUTPUT_DIR}/tmp/ -Xmx".$opt{FINGERPRINT_MEM}."G -jar $opt{QUEUE_PATH}/GenomeAnalysisTK.jar ";
189+
$command .= "-T UnifiedGenotyper ";
190+
$command .= "-R $opt{GENOME} ";
191+
$command .= "-L $opt{FINGERPRINT_TARGET} ";
192+
$command .= "-I $sample_bam ";
193+
$command .= "-o $output_vcf ";
194+
$command .= "--output_mode EMIT_ALL_SITES ";
195+
196+
print FINGERPRINT_SH "if [ -s $sample_bam ]\n";
197+
print FINGERPRINT_SH "then\n";
198+
print FINGERPRINT_SH "\t$command\n";
199+
print FINGERPRINT_SH "else\n";
200+
print FINGERPRINT_SH "\techo \"ERROR: Sample bam file do not exist.\" >&2\n";
201+
print FINGERPRINT_SH "fi\n";
202+
203+
print FINGERPRINT_SH "if [ \"\$(tail -n 1 $output_vcf | cut -f 1,2)\" = \"\$(tail -n 1 $opt{FINGERPRINT_TARGET} | cut -f 1,2)\" ]\n";
204+
print FINGERPRINT_SH "then\n";
205+
print FINGERPRINT_SH "\ttouch $log_dir/Fingerprint_$sample.done\n";
206+
print FINGERPRINT_SH "fi\n\n";
207+
}
208+
}
209+
210+
## Submit fingerprint job
211+
my $qsub = &qsubJava(\%opt,"FINGERPRINT");
212+
if (@running_jobs){
213+
system "$qsub -o $log_dir/Fingerprint.out -e $log_dir/Fingerprint.err -N $jobID -hold_jid ".join(",",@running_jobs)." $bashFile";
214+
} else {
215+
system "$qsub -o $log_dir/Fingerprint.out -e $log_dir/Fingerprint.err -N $jobID $bashFile";
216+
}
217+
return $jobID;
218+
}
219+
220+
151221
sub runVcfPrep {
152222
###
153223
# Run vcf prep when starting pipeline with a vcf file.

illumina_check.pm renamed to IAP/check.pm

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
### Author: R.F.Ernst
88
########################################################################
99

10-
package illumina_check;
10+
package IAP::check;
1111

1212
use strict;
1313
use POSIX qw(tmpnam);
1414
use FindBin;
1515
use lib "$FindBin::Bin"; #locates pipeline directory
16-
use illumina_sge;
16+
use IAP::sge;
1717

1818
sub runCheck {
1919
###
@@ -121,6 +121,18 @@ sub runCheck {
121121
push( @runningJobs, @{$opt{RUNNING_JOBS}->{'callable_loci'}} );
122122
}
123123
}
124+
if($opt{FINGERPRINT} eq "yes"){
125+
$doneFile = $opt{OUTPUT_DIR}."/logs/Fingerprint_$sample.done";
126+
print BASH "if [ -f $doneFile ]; then\n";
127+
print BASH "\techo \"\t Fingerprint analysis: done \" >>$logFile\n";
128+
print BASH "else\n";
129+
print BASH "\techo \"\t Fingerprint analysis: failed \">>$logFile\n";
130+
print BASH "\tfailed=true\n";
131+
print BASH "fi\n";
132+
if ( $opt{RUNNING_JOBS}->{'fingerprint'} ){
133+
push( @runningJobs, $opt{RUNNING_JOBS}->{'fingerprint'} );
134+
}
135+
}
124136

125137
print BASH "echo \"\">>$logFile\n\n"; ## empty line between samples
126138
}

illumina_copyNumber.pm renamed to IAP/copyNumber.pm

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
### Author: R.F.Ernst & H.H.D.Kerstens
1010
##################################################################################################################################################
1111

12-
package illumina_copyNumber;
12+
package IAP::copyNumber;
1313

1414
use strict;
1515
use POSIX qw(tmpnam);
1616
use File::Path qw(make_path);
1717
use lib "$FindBin::Bin"; #locates pipeline directory
18-
use illumina_sge;
18+
use IAP::sge;
1919

2020
sub runCopyNumberTools {
2121
###
@@ -266,12 +266,6 @@ sub runFreec {
266266
make_path($freec_out_dir) or die "Couldn't create directory: $freec_out_dir\n";
267267
}
268268

269-
## Parse mappability tracks
270-
my @mappabilityTracks;
271-
if($opt{FREEC_MAPPABILITY_TRACKS}) {
272-
@mappabilityTracks = split('\t', $opt{FREEC_MAPPABILITY_TRACKS});
273-
}
274-
275269
## Create freec config
276270
my $freec_config = $freec_out_dir."/freec_config.txt";
277271
open FREEC_CONFIG, ">$freec_config" or die "cannot open file $freec_config \n";
@@ -287,12 +281,10 @@ sub runFreec {
287281
print FREEC_CONFIG "BedGraphOutput=TRUE\n";
288282
print FREEC_CONFIG "outputDir=$freec_out_dir\n";
289283

290-
## mappability tracks
291-
foreach my $mappabilityTrack (@mappabilityTracks){
292-
print FREEC_CONFIG "gemMappabilityFile=$mappabilityTrack\n";
284+
## mappability track
285+
if($opt{FREEC_MAPPABILITY_TRACK}) {
286+
print FREEC_CONFIG "gemMappabilityFile=$opt{FREEC_MAPPABILITY_TRACK}\n";
293287
}
294-
#print FREEC_CONFIG "gemMappabilityFile=/hpc/local/CentOS6/cog_bioinf/freec/hg19_mappability_tracks/out100m1_hg19.gem\n";
295-
#print FREEC_CONFIG "gemMappabilityFile=/hpc/local/CentOS6/cog_bioinf/freec/hg19_mappability_tracks/out100m2_hg19.gem\n";
296288

297289
print FREEC_CONFIG "[sample]\n";
298290
print FREEC_CONFIG "mateFile=$sample_bam\n";

illumina_filterVariants.pm renamed to IAP/filterVariants.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
### Authors: R.F.Ernst & H.H.D.Kerstens
99
#############################################################
1010

11-
package illumina_filterVariants;
11+
package IAP::filterVariants;
1212

1313
use strict;
1414
use POSIX qw(tmpnam);
1515
use lib "$FindBin::Bin"; #locates pipeline directory
16-
use illumina_sge;
16+
use IAP::sge;
1717

1818
sub runFilterVariants {
1919
###

illumina_mapping.pm renamed to IAP/mapping.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
###
1111
##################################################################################################################################################
1212

13-
package illumina_mapping;
13+
package IAP::mapping;
1414

1515
use strict;
1616
use POSIX qw(tmpnam);
1717
use lib "$FindBin::Bin"; #locates pipeline directory
18-
use illumina_sge;
18+
use IAP::sge;
1919

2020
sub runMapping {
2121
###

illumina_nipt.pm renamed to IAP/nipt.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
###
99
#######################################################
1010

11-
package illumina_nipt;
11+
package IAP::nipt;
1212

1313
use strict;
1414
use POSIX qw(tmpnam);
1515
use FindBin;
1616
use lib "$FindBin::Bin"; #locates pipeline directory
17-
use illumina_sge;
17+
use IAP::sge;
1818

1919

2020
sub runNipt {

0 commit comments

Comments
 (0)