From 7cf4b63d763ebbecac23676da19d6328abe45359 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Wed, 1 Aug 2012 09:23:04 -0400 Subject: [PATCH 1/2] Disabling indel quals in BaseRecalibrator as it should be, not PrintReads. --- .../sting/queue/qscripts/DataProcessingPipeline.scala | 2 +- .../sting/queue/qscripts/PacbioProcessingPipeline.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala index 56e2ddebb..56f6460fb 100755 --- a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala +++ b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala @@ -347,6 +347,7 @@ class DataProcessingPipeline extends QScript { this.knownSites ++= qscript.dbSNP this.covariate ++= Seq("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "ContextCovariate") this.input_file :+= inBam + this.disable_indel_quals = true this.out = outRecalFile if (!defaultPlatform.isEmpty) this.default_platform = defaultPlatform if (!qscript.intervalString.isEmpty) this.intervalsString ++= Seq(qscript.intervalString) @@ -359,7 +360,6 @@ class DataProcessingPipeline extends QScript { case class recal (inBam: File, inRecalFile: File, outBam: File) extends PrintReads with CommandLineGATKArgs { this.input_file :+= inBam this.BQSR = inRecalFile - this.disable_indel_quals = true this.baq = CalculationMode.CALCULATE_AS_NECESSARY this.out = outBam if (!qscript.intervalString.isEmpty) this.intervalsString ++= Seq(qscript.intervalString) diff --git a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala index b7246ca8f..a4a6636fe 100755 --- a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala +++ b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala @@ -166,6 +166,7 @@ class PacbioProcessingPipeline extends QScript { this.knownSites :+= dbSNP this.covariate ++= List("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "ContextCovariate") this.input_file :+= inBam + this.disable_indel_quals = true this.out = outRecalFile this.analysisName = queueLogDir + outRecalFile + ".covariates" this.jobName = queueLogDir + outRecalFile + ".covariates" @@ -178,7 +179,6 @@ class PacbioProcessingPipeline extends QScript { this.input_file :+= inBam this.BQSR = inRecalFile this.out = outBam - this.disable_indel_quals = true this.isIntermediate = false this.analysisName = queueLogDir + outBam + ".recalibration" this.jobName = queueLogDir + outBam + ".recalibration" From 56f8afab971d4c67c4d07c8a270e9d2b697cb731 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Wed, 1 Aug 2012 09:50:00 -0400 Subject: [PATCH 2/2] Requested by Geraldine: adding a utility to register deprecated walkers (and the major version of the first release since they were removed) so that the User Error printed out for e.g. CountCovariates now states: Walker CountCovariates is no longer available in the GATK; it has been deprecated since version 2.0. --- .../sting/gatk/GenomeAnalysisEngine.java | 35 +++++++++++++++++++ .../sting/utils/exceptions/UserException.java | 6 ++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index eab9fde79..5d6fb75ed 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -274,6 +274,38 @@ public class GenomeAnalysisEngine { //return result; } + // TODO -- Let's move this to a utility class in unstable - but which one? + // ************************************************************************************** + // * Handle Deprecated Walkers * + // ************************************************************************************** + + // Mapping from walker name to major version number where the walker first disappeared + private static Map deprecatedGATKWalkers = new HashMap(); + static { + deprecatedGATKWalkers.put("CountCovariates", "2.0"); + deprecatedGATKWalkers.put("TableRecalibration", "2.0"); + } + + /** + * Utility method to check whether a given walker has been deprecated in a previous GATK release + * + * @param walkerName the walker class name (not the full package) to check + */ + public static boolean isDeprecatedWalker(final String walkerName) { + return deprecatedGATKWalkers.containsKey(walkerName); + } + + /** + * Utility method to check whether a given walker has been deprecated in a previous GATK release + * + * @param walkerName the walker class name (not the full package) to check + */ + public static String getDeprecatedMajorVersionNumber(final String walkerName) { + return deprecatedGATKWalkers.get(walkerName); + } + + // ************************************************************************************** + /** * Retrieves an instance of the walker based on the walker name. * @@ -287,6 +319,9 @@ public class GenomeAnalysisEngine { if ( isGATKLite() && GATKLiteUtils.isAvailableOnlyInFullGATK(walkerName) ) { e = new UserException.NotSupportedInGATKLite("the " + walkerName + " walker is available only in the full version of the GATK"); } + else if ( isDeprecatedWalker(walkerName) ) { + e = new UserException.DeprecatedWalker(walkerName, getDeprecatedMajorVersionNumber(walkerName)); + } throw e; } } diff --git a/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java b/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java index 9ce4e82a1..52da31362 100755 --- a/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java +++ b/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java @@ -316,9 +316,9 @@ public class UserException extends ReviewedStingException { - public static class MissingWalker extends UserException { - public MissingWalker(String walkerName, String message) { - super(String.format("Walker %s is not available: %s", walkerName, message)); + public static class DeprecatedWalker extends UserException { + public DeprecatedWalker(String walkerName, String version) { + super(String.format("Walker %s is no longer available in the GATK; it has been deprecated since version %s", walkerName, version)); } }