Merge pull request #159 from broadinstitute/md_bqsr_ion

Trivial BQSR bug fixes and improvement
This commit is contained in:
Geraldine Van der Auwera 2013-04-16 08:54:47 -07:00
commit e176fc3af1
4 changed files with 40 additions and 2 deletions

View File

@ -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());
}
}

View File

@ -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);
}
}

View File

@ -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<String> names = new LinkedList<String>();
for ( final NGSPlatform pl : values() ) {
for ( final String name : pl.BAM_PL_NAMES )
names.add(name);
}
return Utils.join(",", names);
}
}

View File

@ -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 ***//
///////////////////////////////////////////////////////////////////////////////