From 921eaad33f9979ca52cc59c0a6ac0db435a35b10 Mon Sep 17 00:00:00 2001 From: Mauricio Carneiro Date: Wed, 18 Jul 2012 14:20:48 -0400 Subject: [PATCH] Generalized the default platform parameter in BQSRv2 Parameter wasn't working outside of the BQSR walker. It now takes the information on the recalibration report in other tools (PrintReads for example) and treats all reads as coming from the defined default platform. --- .../sting/gatk/walkers/bqsr/CycleCovariate.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/CycleCovariate.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/CycleCovariate.java index e3b7f2637..f0ff8f2bd 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/CycleCovariate.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/CycleCovariate.java @@ -49,6 +49,7 @@ public class CycleCovariate implements StandardCovariate { private static final int MAXIMUM_CYCLE_VALUE = 1000; private static final int CUSHION_FOR_INDELS = 4; + private static String default_platform = null; private static final EnumSet DISCRETE_CYCLE_PLATFORMS = EnumSet.of(NGSPlatform.ILLUMINA, NGSPlatform.SOLID, NGSPlatform.PACBIO, NGSPlatform.COMPLETE_GENOMICS); private static final EnumSet FLOW_CYCLE_PLATFORMS = EnumSet.of(NGSPlatform.LS454, NGSPlatform.ION_TORRENT); @@ -58,13 +59,16 @@ public class CycleCovariate implements StandardCovariate { public void initialize(final RecalibrationArgumentCollection RAC) { if (RAC.DEFAULT_PLATFORM != null && !NGSPlatform.isKnown(RAC.DEFAULT_PLATFORM)) throw new UserException.CommandLineException("The requested default platform (" + RAC.DEFAULT_PLATFORM + ") is not a recognized platform."); + + if (RAC.DEFAULT_PLATFORM != null) + default_platform = RAC.DEFAULT_PLATFORM; } // Used to pick out the covariate's value from attributes of the read @Override public void recordValues(final GATKSAMRecord read, final ReadCovariates values) { final int readLength = read.getReadLength(); - final NGSPlatform ngsPlatform = read.getNGSPlatform(); + final NGSPlatform ngsPlatform = default_platform == null ? read.getNGSPlatform() : NGSPlatform.fromReadGroupPL(default_platform); // Discrete cycle platforms if (DISCRETE_CYCLE_PLATFORMS.contains(ngsPlatform)) {