Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
DEV-618: Let purple generate final SV vcf
Browse files Browse the repository at this point in the history
  • Loading branch information
kduyvesteyn committed Dec 11, 2018
1 parent 86401b2 commit 96150ef
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
12 changes: 6 additions & 6 deletions lib/HMF/Pipeline/Gridss.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use List::MoreUtils qw(uniq);
use HMF::Pipeline::Functions::Config qw(createDirs sampleControlBamsAndJobs);
use HMF::Pipeline::Functions::Job qw(fromTemplate checkReportedDoneFile markDone);
use HMF::Pipeline::Functions::Sge qw(qsubTemplate);
use HMF::Pipeline::Functions::Metadata qw(linkVcfArtefacts);

use parent qw(Exporter);
our @EXPORT_OK = qw(run);
Expand Down Expand Up @@ -250,7 +249,8 @@ sub runGridssCleanup {
sub runGridssFilter {
my ($dirs, $tumor_sample, $joint_name, $dependent_jobs, $opt) = @_;

my $final_vcf = catfile($dirs->{out}, join "", ${tumor_sample}, ".gridss.somatic.vcf.gz");
my $filtered_vcf = catfile($dirs->{out}, join "", ${tumor_sample}, ".gridss.somatic.vcf.gz");
my $full_vcf = catfile($dirs->{out}, join "", ${tumor_sample}, ".gridss.somatic.full.vcf.gz");

# KODU: Run with GRIDSS annotate settings, filter takes little resources.
my $job_id = fromTemplate(
Expand All @@ -263,12 +263,12 @@ sub runGridssFilter {
$opt,
tumor_sample => $tumor_sample,
joint_name => $joint_name,
final_vcf => ${final_vcf},
filtered_vcf => $filtered_vcf,
full_vcf => $full_vcf,
);

$opt->{STRUCTURAL_VARIANT_VCF} = $final_vcf;
$opt->{GRIDSS_VCF} = $final_vcf;
linkVcfArtefacts($opt->{STRUCTURAL_VARIANT_VCF}, 'structural_variant', $opt);
$opt->{GRIDSS_FILTERED_VCF} = $filtered_vcf;
$opt->{GRIDSS_FULL_VCF} = $full_vcf;

return ($job_id);
}
Expand Down
19 changes: 11 additions & 8 deletions lib/HMF/Pipeline/Purple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use File::Spec::Functions;
use HMF::Pipeline::Functions::Config qw(createDirs);
use HMF::Pipeline::Functions::Sge qw(qsubJava);
use HMF::Pipeline::Functions::Job qw(fromTemplate);
use HMF::Pipeline::Functions::Metadata qw(parse linkArtefact);
use HMF::Pipeline::Functions::Metadata qw(parse linkArtefact linkVcfArtefacts);

use parent qw(Exporter);
our @EXPORT_OK = qw(run);
Expand All @@ -20,15 +20,11 @@ sub run {

say "\n### SCHEDULING PURPLE ###";

my $sub_dir = "purple";
my $dirs = createDirs($opt->{OUTPUT_DIR}, purple => $sub_dir);
my $purple_dir = "purple";
my $dirs = createDirs($opt->{OUTPUT_DIR}, purple => $purple_dir);
my $dependent_jobs = dependencies($opt);

my $circos_path = "${sub_dir}/plot/${tumor_sample}.circos.png";
my $purple_cnv = "${sub_dir}/${tumor_sample}.purple.cnv";
my $purple_gene_cnv = "${sub_dir}/${tumor_sample}.purple.gene.cnv";
my $purple_germline_cnv = "${sub_dir}/${tumor_sample}.purple.germline.cnv";
my $purple_purity = "${sub_dir}/${tumor_sample}.purple.purity";
my $purple_purity = "$purple_dir/${tumor_sample}.purple.purity";

my $job_id = fromTemplate(
"Purple",
Expand All @@ -44,6 +40,13 @@ sub run {

$opt->{RUNNING_JOBS}->{purple} = [$job_id] if $job_id;

my $purple_sv_path = "${purple_dir}/${tumor_sample}.purple.sv.vcf.gz";
my $circos_path = "${purple_dir}/plot/${tumor_sample}.circos.png";
my $purple_cnv = "${purple_dir}/${tumor_sample}.purple.cnv";
my $purple_gene_cnv = "${purple_dir}/${tumor_sample}.purple.gene.cnv";
my $purple_germline_cnv = "${purple_dir}/${tumor_sample}.purple.germline.cnv";

linkVcfArtefacts($purple_sv_path, 'structural_variant', $opt);
linkArtefact($circos_path, 'circos_plot', $opt);
linkArtefact($purple_cnv, 'purple_cnv', $opt);
linkArtefact($purple_gene_cnv, 'purple_gene_cnv', $opt);
Expand Down
8 changes: 4 additions & 4 deletions templates/GridssFilter.sh.tt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Rscript ${libgridss}/gridss_somatic_filter.R -p ${gridss_pon} -i ${unzipped_orig

rm ${unzipped_original_vcf}

mv ${full_vcf}.bgz ${full_vcf}.gz
mv ${full_vcf}.bgz.tbi ${full_vcf}.gz.tbi
mv ${full_vcf}.bgz [% full_vcf %]
mv ${full_vcf}.bgz.tbi [% full_vcf %].tbi

mv ${output_vcf}.bgz [% final_vcf %]
mv ${output_vcf}.bgz.tbi [% final_vcf %].tbi
mv ${output_vcf}.bgz [% filtered_vcf %]
mv ${output_vcf}.bgz.tbi [% filtered_vcf %].tbi

success
3 changes: 2 additions & 1 deletion templates/Purple.sh.tt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ java -Xmx[% opt.PURPLE_MEM %]G -jar "[% opt.PURPLE_PATH %]/purple.jar" \
-threads [% opt.PURPLE_THREADS %] \
-gc_profile "[% opt.GC_PROFILE %]" \
-somatic_vcf [% opt.SOMATIC_VARIANT_VCF %] \
-structural_vcf [% opt.GRIDSS_VCF %] \
-structural_vcf [% opt.GRIDSS_FILTERED_VCF %] \
-sv_recovery_vcf [% opt.GRIDSS_FULL_VCF %] \
-baf [% opt.AMBER_BAF_FILE %] \
-circos [% opt.CIRCOS_PATH %]/circos \
-ref_genome [% opt.PURPLE_REF_GENOME_VERSION %] \
Expand Down

0 comments on commit 96150ef

Please sign in to comment.