From e1856320139f6fbb40165541861e3c0a7fb4682e Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Mon, 30 Apr 2012 14:29:46 -0400 Subject: [PATCH] Exhaustive unit tests for Pool SNP genotype likelihoods: a) Add ability for ErrorModel to be specified by external log-probability vector for testing. b) For a given depth and ploidy(=2*samples/pool), create artificial high quality pileup testing from AC=0 to AC=ploidy, and test that pool GL's have expected content.Misc. refactorings and cleanups c) Misc. cleanups and beautification. --- .../genotyper/ArtificialReadPileupTestProvider.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java index 1c372aa82..b1720e509 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java @@ -65,8 +65,9 @@ public class ArtificialReadPileupTestProvider { public final GenomeLoc window = genomeLocParser.createGenomeLoc(artificialContig,artificialRefStart,10); public final ReferenceContext referenceContext = new ReferenceContext(genomeLocParser,loc,window,this.refBases.getBytes()); + byte BASE_QUAL = 50; - public ArtificialReadPileupTestProvider(int numSamples, final String SAMPLE_PREFIX) { + public ArtificialReadPileupTestProvider(final int numSamples, final String SAMPLE_PREFIX) { sampleRGs = new ArrayList(); for ( int i = 0; i < numSamples; i++ ) { @@ -78,6 +79,10 @@ public class ArtificialReadPileupTestProvider { } + public ArtificialReadPileupTestProvider(final int numSamples, final String SAMPLE_PREFIX, final byte q) { + this(numSamples,SAMPLE_PREFIX); + BASE_QUAL = q; + } public List getSampleNames() { return sampleNames; } @@ -85,6 +90,9 @@ public class ArtificialReadPileupTestProvider { return refBases.substring(offset,offset+1).getBytes()[0]; } + public ReferenceContext getReferenceContext() { return referenceContext;} + public GenomeLocParser getGenomeLocParser() { return genomeLocParser; } + public Map getAlignmentContextFromAlleles(int eventLength, String altBases, int[] numReadsPerAllele) { // RefMetaDataTracker tracker = new RefMetaDataTracker(null,referenceContext); @@ -151,7 +159,7 @@ public class ArtificialReadPileupTestProvider { for ( int d = 0; d < numReadsPerAllele[alleleCounter]; d++ ) { byte[] readBases = trueHaplotype(allele, offset, refAlleleLength); byte[] readQuals = new byte[readBases.length]; - Arrays.fill(readQuals, (byte) 50); + Arrays.fill(readQuals, (byte)BASE_QUAL); GATKSAMRecord read = new GATKSAMRecord(header); read.setBaseQualities(readQuals);