diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java index bcb42f7ef..f585299f4 100644 --- a/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java +++ b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java @@ -237,7 +237,9 @@ public class CycleCovariate implements StandardCovariate { // Unknown platforms else { - throw new UserException("The platform (" + read.getReadGroup().getPlatform() + ") associated with read group " + read.getReadGroup() + " is not a recognized platform. Implemented options are e.g. illumina, 454, and solid"); + throw new UserException("The platform (" + read.getReadGroup().getPlatform() + + ") associated with read group " + read.getReadGroup() + + " is not a recognized platform. Allowable options are " + NGSPlatform.knownPlatformsString()); } } diff --git a/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRIntegrationTest.java index 2149091af..907046704 100644 --- a/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRIntegrationTest.java +++ b/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRIntegrationTest.java @@ -82,7 +82,7 @@ public class BQSRIntegrationTest extends WalkerTest { " -I " + bam + " -L " + interval + args + - " -knownSites " + (reference.equals(b36KGReference) ? b36dbSNP129 : hg18dbSNP132) + + " -knownSites " + (reference.equals(b36KGReference) ? b36dbSNP129 : (reference.equals(b37KGReference) ? b37dbSNP129 : hg18dbSNP132)) + " --allow_potentially_misencoded_quality_scores" + // TODO -- remove me when we get new SOLiD bams " -o %s" + " -sortAllCols"; @@ -115,6 +115,8 @@ public class BQSRIntegrationTest extends WalkerTest { {new BQSRTest(b36KGReference, privateTestDir + "NA19240.chr1.BFAST.SOLID.hasCSNoCall.bam", "1:50,000-80,000", " --solid_nocall_strategy LEAVE_READ_UNRECALIBRATED", "c1c3cda8caceed619d3d439c3990cd26")}, {new BQSRTest(b36KGReference, validationDataLocation + "NA12892.SLX.SRP000031.2009_06.selected.1Mb.1RG.bam", "1:10,000,000-10,200,000", " -knownSites:anyNameABCD,VCF " + privateTestDir + "vcfexample3.vcf", "c9953f020a65c1603a6d71aeeb1b95f3")}, {new BQSRTest(b36KGReference, validationDataLocation + "NA12892.SLX.SRP000031.2009_06.selected.1Mb.1RG.bam", "1:10,000,000-10,200,000", " -knownSites:bed " + validationDataLocation + "bqsrKnownTest.bed", "5bfff0c699345cca12a9b33acf95588f")}, + // make sure we work with ION torrent bam + {new BQSRTest(b37KGReference, privateTestDir + "iontorrent.bam", "20:10,000,000-10,200,000", "", "7375c7b692e76b651c278a9fb478fa1c")}, }; } @@ -257,4 +259,17 @@ public class BQSRIntegrationTest extends WalkerTest { UserException.class); executeTest("testPRFailWithLowMaxCycle", spec); } + + @Test + public void testPRFailWithBadPL() { + WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( + " -T BaseRecalibrator" + + " -R " + b37KGReference + + " -I " + privateTestDir + "badPLForBQSR.bam" + + " -L 1:10,000,000-10,200,000" + + " -o %s", + 1, + UserException.class); + executeTest("testPRFailWithBadPL", spec); + } } diff --git a/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java b/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java index f08564644..029dfad31 100644 --- a/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java +++ b/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java @@ -28,6 +28,9 @@ package org.broadinstitute.sting.utils; import org.broadinstitute.sting.utils.sam.GATKSAMReadGroupRecord; import org.broadinstitute.sting.utils.sam.GATKSAMRecord; +import java.util.LinkedList; +import java.util.List; + /** * A canonical, master list of the standard NGS platforms. These values * can be obtained (efficiently) from a GATKSAMRecord object with the @@ -117,4 +120,17 @@ public enum NGSPlatform { public static boolean isKnown(final String platform) { return fromReadGroupPL(platform) != UNKNOWN; } + + /** + * Get a human-readable list of platform names + * @return the list of platform names + */ + public static String knownPlatformsString() { + final List names = new LinkedList(); + for ( final NGSPlatform pl : values() ) { + for ( final String name : pl.BAM_PL_NAMES ) + names.add(name); + } + return Utils.join(",", names); + } } diff --git a/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMReadGroupRecord.java b/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMReadGroupRecord.java index fcebbec9b..ec9d7d219 100644 --- a/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMReadGroupRecord.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMReadGroupRecord.java @@ -72,6 +72,11 @@ public class GATKSAMReadGroupRecord extends SAMReadGroupRecord { return mNGSPlatform; } + @Override + public String toString() { + return "GATKSAMReadGroupRecord @RG:" + getReadGroupId(); + } + /////////////////////////////////////////////////////////////////////////////// // *** The following methods are overloaded to cache the appropriate data ***// ///////////////////////////////////////////////////////////////////////////////