From 492d4d38bb6417b9d7868dd60dc011b223ba697e Mon Sep 17 00:00:00 2001 From: Keiran Raine Date: Mon, 29 Apr 2019 11:10:48 +0000 Subject: [PATCH] Add ability to leave workspace in uncleaned state to allow flagging after a -noflag run --- CHANGES.md | 8 ++++++-- bin/caveman.pl | 27 +++++++++++++++++++-------- lib/Sanger/CGP/Caveman.pm | 4 ++-- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 88edb2d..0c18b45 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,12 @@ # CHANGES +## 1.13.14 + +* Adds `-noclean` option to allow resumption following `-noflag` execution. + ## 1.13.13 -* Build with CaVEMan [1.13.15](https://github.com/cancerit/CaVEMan/releases/tag/1.13.15) +* Build with CaVEMan [1.13.15](https://github.com/cancerit/CaVEMan/releases/tag/1.13.15) ## 1.13.12 @@ -13,7 +17,7 @@ * Add AMPLICON and TARGETED to accepted protocol list. Change RNA-seq, but also keep RNA. * https://www.ebi.ac.uk/ena/submit/reads-library-strategy * In line with Update of CaVEMan: -* Build with CaVEMan [1.13.13](https://github.com/cancerit/CaVEMan/releases/tag/1.13.13) +* Build with CaVEMan [1.13.13](https://github.com/cancerit/CaVEMan/releases/tag/1.13.13) ## 1.13.10 diff --git a/bin/caveman.pl b/bin/caveman.pl index 8edb586..055cc3d 100755 --- a/bin/caveman.pl +++ b/bin/caveman.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl ##########LICENCE########## -# Copyright (c) 2014-2018 Genome Research Ltd. +# Copyright (c) 2014-2019 Genome Research Ltd. # # Author: CASM/Cancer IT # @@ -191,13 +191,15 @@ BEGIN Sanger::CGP::Caveman::Implement::zip_flagged($options); } - if((!exists $options->{'process'}) #We aren't specifying steps - || ($options->{'process'} eq 'flag') #We've flagged so we are done anyway - || ($options->{'noflag'} == 1 && $options->{'process'} eq 'add_ids')){ #No flagging wanted and preflagging step done - #finally cleanup after ourselves by removing the temporary output folder, split files etc. - #Zip the snps files with IDs - Sanger::CGP::Caveman::Implement::pre_cleanup_zip($options); - cleanup($options); + if($options->{'noclean'} == 0) { + if((!exists $options->{'process'}) #We aren't specifying steps + || ($options->{'process'} eq 'flag') #We've flagged so we are done anyway + || ($options->{'noflag'} == 1 && $options->{'process'} eq 'add_ids')){ #No flagging wanted and preflagging step done + #finally cleanup after ourselves by removing the temporary output folder, split files etc. + #Zip the snps files with IDs + Sanger::CGP::Caveman::Implement::pre_cleanup_zip($options); + cleanup($options); + } } } @@ -306,6 +308,7 @@ sub setup { 'TP|tumour-platform=s' => \$opts{'nplat'}, 'st|seqType=s' => \$opts{'seqType'}, 'noflag|no-flagging' => \$opts{'noflag'}, + 'noclean' => \$opts{'noclean'}, 'mpc|mut_probability_cutoff=f' => \$opts{'mpc'}, 'spc|snp_probability_cutoff=f' => \$opts{'spc'}, 'e|read-count=i' => \$opts{'read-count'}, @@ -326,6 +329,7 @@ sub setup { pod2usage(-msg => "\nERROR: Options must be defined.\n", -verbose => 2, -output => \*STDERR) unless($defined); $opts{'noflag'} = 0 unless(defined $opts{'noflag'}); + $opts{'noclean'} = 0 unless(defined $opts{'noclean'}); #Check all files and dirs are readable and exist. PCAP::Cli::file_for_reading('reference',$opts{'reference'}); @@ -541,6 +545,7 @@ =head1 SYNOPSIS -normal-platform -NP Normal platform to override bam value -tumour-platform -TP Tumour platform to override bam value -no-flagging -noflag Do not flag, instead cleanup at the end of the merged results after estep. + -noclean Do not cleanup, use in conjunction with -noflag to allow flagging later. -mut_probability_cutoff -mpc Minimum total somatic genotype probability for output -snp_probability_cutoff -spc Minimum total germline genotype probability for output -read-count -e Modify the split size (caveman split) [350,000] @@ -669,6 +674,12 @@ =head1 OPTIONS Don't flag the data, just cleanup after merging results +=item B<-noclean> + +Leaves the workspace in processing state. Intended for use with '-no-flagging' +to allow resumption with multi thread flagging once dependent files are in place. +For example run as `-no-flagging -noclean` and subsequently run `-p flag`. + =item B<-read-count> Modify the read count threshold used when splitting into mstep/estep jobs. diff --git a/lib/Sanger/CGP/Caveman.pm b/lib/Sanger/CGP/Caveman.pm index 55bc8bd..2faee25 100644 --- a/lib/Sanger/CGP/Caveman.pm +++ b/lib/Sanger/CGP/Caveman.pm @@ -1,7 +1,7 @@ package Sanger::CGP::Caveman; ##########LICENCE########## -# Copyright (c) 2014-2018 Genome Research Ltd. +# Copyright (c) 2014-2019 Genome Research Ltd. # # Author: CASM/Cancer IT # @@ -26,6 +26,6 @@ package Sanger::CGP::Caveman; use strict; use Const::Fast qw(const); -our $VERSION = '1.13.13'; +our $VERSION = '1.13.14'; 1;