diff --git a/build.xml b/build.xml
index e92e41c10..1e88bb400 100644
--- a/build.xml
+++ b/build.xml
@@ -708,6 +708,9 @@
+
+
+
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java
index 2b3290595..93bdf8c9d 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java
@@ -54,7 +54,7 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompa
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.ExperimentalAnnotation;
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation;
import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.variant.vcf.VCFHeaderLineType;
import org.broadinstitute.variant.vcf.VCFInfoHeaderLine;
import org.broadinstitute.sting.utils.help.DocumentedGATKFeature;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java
index 3acba48ae..13969eb54 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java
@@ -55,7 +55,7 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompa
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation;
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation;
import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.QualityUtils;
import org.broadinstitute.variant.vcf.VCFHeaderLineType;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java
index 2df5fefa8..354e508c2 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java
@@ -60,7 +60,7 @@ import org.broadinstitute.sting.gatk.iterators.ReadTransformer;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.walkers.*;
import org.broadinstitute.sting.utils.MathUtils;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.baq.BAQ;
import org.broadinstitute.sting.utils.clipping.ReadClipper;
import org.broadinstitute.sting.utils.collections.Pair;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java
index 8c8de2bad..2baa89999 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java
@@ -47,7 +47,7 @@
package org.broadinstitute.sting.gatk.walkers.genotyper;
import net.sf.samtools.SAMUtils;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.QualityUtils;
import org.broadinstitute.sting.utils.exceptions.UserException;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoods.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoods.java
index aa117eb3b..14bffbc34 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoods.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoods.java
@@ -49,9 +49,8 @@ package org.broadinstitute.sting.gatk.walkers.genotyper;
import net.sf.samtools.SAMUtils;
import org.broadinstitute.sting.gatk.walkers.genotyper.afcalc.ExactACset;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.MathUtils;
-import org.broadinstitute.sting.utils.baq.BAQ;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.pileup.PileupElement;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoodsCalculationModel.java
index 9aa8c13ec..9ea027698 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoodsCalculationModel.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidySNPGenotypeLikelihoodsCalculationModel.java
@@ -77,7 +77,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContextUtils;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.utils.*;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.variant.variantcontext.*;
import java.util.*;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java
index b3740bbb7..f48ae81cf 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java
@@ -51,7 +51,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.AlignmentContextUtils;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.GenomeLocParser;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.broadinstitute.sting.utils.pileup.PileupElement;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java
index 84c109c9d..5a1bdf9e5 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java
@@ -52,7 +52,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContextUtils;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.walkers.indels.PairHMMIndelErrorModel;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.GenomeLocParser;
import org.broadinstitute.sting.utils.Haplotype;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java
index 7dc3e8ee3..0652cc236 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java
@@ -51,7 +51,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.AlignmentContextUtils;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.GenomeLocParser;
import org.broadinstitute.sting.utils.MathUtils;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java
index 8f6097661..19d218023 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java
@@ -62,7 +62,7 @@ import org.broadinstitute.sting.utils.*;
import org.broadinstitute.sting.utils.baq.BAQ;
import org.broadinstitute.sting.utils.classloader.PluginManager;
import org.broadinstitute.sting.utils.variant.GATKVariantContextUtils;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.variant.vcf.VCFConstants;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.pileup.PileupElement;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java
index 9aeffe966..8b789791d 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java
@@ -58,7 +58,7 @@ import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap;
import org.broadinstitute.sting.utils.sam.GATKSAMRecord;
import org.broadinstitute.sting.utils.variant.GATKVariantContextUtils;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.variant.variantcontext.*;
import java.io.PrintStream;
@@ -84,7 +84,7 @@ public class GenotypingEngine {
final List haplotypes,
final List samples,
final Map haplotypeReadMap,
- final Map> perSampleFilteredReadList,
+ final Map> perSampleFilteredReadList,
final byte[] ref,
final GenomeLoc refLoc,
final GenomeLoc activeRegionWindow,
@@ -124,12 +124,12 @@ public class GenotypingEngine {
// Walk along each position in the key set and create each event to be outputted
for( final int loc : startPosKeySet ) {
if( loc >= activeRegionWindow.getStart() && loc <= activeRegionWindow.getStop() ) { // genotyping an event inside this active region
- final ArrayList eventsAtThisLoc = new ArrayList(); // the overlapping events to merge into a common reference view
- final ArrayList priorityList = new ArrayList(); // used to merge overlapping events into common reference view
+ final List eventsAtThisLoc = new ArrayList(); // the overlapping events to merge into a common reference view
+ final List priorityList = new ArrayList(); // used to merge overlapping events into common reference view
if( !in_GGA_mode ) {
for( final Haplotype h : haplotypes ) {
- final HashMap eventMap = h.getEventMap();
+ final Map eventMap = h.getEventMap();
final VariantContext vc = eventMap.get(loc);
if( vc != null && !containsVCWithMatchingAlleles(eventsAtThisLoc, vc) ) {
eventsAtThisLoc.add(vc);
@@ -142,7 +142,7 @@ public class GenotypingEngine {
if( compVC.getStart() == loc ) {
int alleleCount = 0;
for( final Allele compAltAllele : compVC.getAlternateAlleles() ) {
- ArrayList alleleSet = new ArrayList(2);
+ List alleleSet = new ArrayList(2);
alleleSet.add(compVC.getReference());
alleleSet.add(compAltAllele);
final String vcSourceName = "Comp" + compCount + "Allele" + alleleCount;
@@ -180,7 +180,7 @@ public class GenotypingEngine {
if( eventsAtThisLoc.size() != mergedVC.getAlternateAlleles().size() ) {
throw new ReviewedStingException("Record size mismatch! Something went wrong in the merging of alleles.");
}
- final HashMap mergeMap = new HashMap();
+ final Map mergeMap = new HashMap();
mergeMap.put(null, mergedVC.getReference()); // the reference event (null) --> the reference allele
for(int iii = 0; iii < mergedVC.getAlternateAlleles().size(); iii++) {
mergeMap.put(eventsAtThisLoc.get(iii), mergedVC.getAlternateAllele(iii)); // BUGBUG: This is assuming that the order of alleles is the same as the priority list given to simpleMerge function
@@ -232,7 +232,7 @@ public class GenotypingEngine {
return genotypes;
}
- private void validatePriorityList( final ArrayList priorityList, final ArrayList eventsAtThisLoc ) {
+ private void validatePriorityList( final List priorityList, final List eventsAtThisLoc ) {
for( final VariantContext vc : eventsAtThisLoc ) {
if( !priorityList.contains(vc.getSource()) ) {
throw new ReviewedStingException("Event found on haplotype that wasn't added to priority list. Something went wrong in the merging of alleles.");
@@ -251,7 +251,7 @@ public class GenotypingEngine {
private static Map filterToOnlyOverlappingReads( final GenomeLocParser parser,
final Map perSampleReadMap,
- final Map> perSampleFilteredReadList,
+ final Map> perSampleFilteredReadList,
final VariantContext call ) {
final Map returnMap = new HashMap();
@@ -284,7 +284,7 @@ public class GenotypingEngine {
}
protected static void cleanUpSymbolicUnassembledEvents( final List haplotypes ) {
- final ArrayList haplotypesToRemove = new ArrayList();
+ final List haplotypesToRemove = new ArrayList();
for( final Haplotype h : haplotypes ) {
for( final VariantContext vc : h.getEventMap().values() ) {
if( vc.isSymbolic() ) {
@@ -407,7 +407,7 @@ public class GenotypingEngine {
// remove the old event from the eventMap on every haplotype and the start pos key set, replace with merged event
for( final Haplotype h : haplotypes ) {
- final HashMap eventMap = h.getEventMap();
+ final Map eventMap = h.getEventMap();
if( eventMap.containsKey(thisStart) && eventMap.containsKey(nextStart) ) {
eventMap.remove(thisStart);
eventMap.remove(nextStart);
@@ -418,7 +418,7 @@ public class GenotypingEngine {
boolean containsStart = false;
boolean containsNext = false;
for( final Haplotype h : haplotypes ) {
- final HashMap eventMap = h.getEventMap();
+ final Map eventMap = h.getEventMap();
if( eventMap.containsKey(thisStart) ) { containsStart = true; }
if( eventMap.containsKey(nextStart) ) { containsNext = true; }
}
@@ -457,7 +457,7 @@ public class GenotypingEngine {
if( refBases.length == altBases.length ) { // insertion + deletion of same length creates an MNP --> trim common prefix bases off the beginning of the allele
while( iii < refBases.length && refBases[iii] == altBases[iii] ) { iii++; }
}
- final ArrayList mergedAlleles = new ArrayList();
+ final List mergedAlleles = new ArrayList();
mergedAlleles.add( Allele.create( ArrayUtils.subarray(refBases, iii, refBases.length), true ) );
mergedAlleles.add( Allele.create( ArrayUtils.subarray(altBases, iii, altBases.length), false ) );
return new VariantContextBuilder("merged", thisVC.getChr(), thisVC.getStart() + iii, nextVC.getEnd(), mergedAlleles).make();
@@ -492,10 +492,10 @@ public class GenotypingEngine {
eventMapper.put(new Event(vc), new ArrayList());
}
- final ArrayList undeterminedHaplotypes = new ArrayList(haplotypes.size());
+ final List undeterminedHaplotypes = new ArrayList(haplotypes.size());
for( final Haplotype h : haplotypes ) {
if( h.isArtificialHaplotype() && loc == h.getArtificialAllelePosition() ) {
- final ArrayList alleles = new ArrayList(2);
+ final List alleles = new ArrayList(2);
alleles.add(h.getArtificialRefAllele());
alleles.add(h.getArtificialAltAllele());
final Event artificialVC = new Event( (new VariantContextBuilder()).source("artificialHaplotype")
@@ -572,13 +572,13 @@ public class GenotypingEngine {
}
@Ensures({"result.size() == haplotypeAllelesForSample.size()"})
- protected static List findEventAllelesInSample( final List eventAlleles, final List haplotypeAlleles, final List haplotypeAllelesForSample, final ArrayList> alleleMapper, final ArrayList haplotypes ) {
+ protected static List findEventAllelesInSample( final List eventAlleles, final List haplotypeAlleles, final List haplotypeAllelesForSample, final List> alleleMapper, final List haplotypes ) {
if( haplotypeAllelesForSample.contains(Allele.NO_CALL) ) { return noCall; }
- final ArrayList eventAllelesForSample = new ArrayList();
+ final List eventAllelesForSample = new ArrayList();
for( final Allele a : haplotypeAllelesForSample ) {
final Haplotype haplotype = haplotypes.get(haplotypeAlleles.indexOf(a));
for( int iii = 0; iii < alleleMapper.size(); iii++ ) {
- final ArrayList mappedHaplotypes = alleleMapper.get(iii);
+ final List mappedHaplotypes = alleleMapper.get(iii);
if( mappedHaplotypes.contains(haplotype) ) {
eventAllelesForSample.add(eventAlleles.get(iii));
break;
@@ -597,8 +597,8 @@ public class GenotypingEngine {
return false;
}
- protected static HashMap generateVCsFromAlignment( final Haplotype haplotype, final int alignmentStartHapwrtRef, final Cigar cigar, final byte[] ref, final byte[] alignment, final GenomeLoc refLoc, final String sourceNameToAdd ) {
- final HashMap vcs = new HashMap();
+ protected static Map generateVCsFromAlignment( final Haplotype haplotype, final int alignmentStartHapwrtRef, final Cigar cigar, final byte[] ref, final byte[] alignment, final GenomeLoc refLoc, final String sourceNameToAdd ) {
+ final Map vcs = new HashMap();
int refPos = alignmentStartHapwrtRef;
if( refPos < 0 ) { return null; } // Protection against SW failures
@@ -609,7 +609,7 @@ public class GenotypingEngine {
switch( ce.getOperator() ) {
case I:
{
- final ArrayList insertionAlleles = new ArrayList();
+ final List insertionAlleles = new ArrayList();
final int insertionStart = refLoc.getStart() + refPos - 1;
final byte refByte = ref[refPos-1];
if( BaseUtils.isRegularBase(refByte) ) {
@@ -639,7 +639,7 @@ public class GenotypingEngine {
case D:
{
final byte[] deletionBases = Arrays.copyOfRange( ref, refPos - 1, refPos + elementLength ); // add padding base
- final ArrayList deletionAlleles = new ArrayList();
+ final List deletionAlleles = new ArrayList();
final int deletionStart = refLoc.getStart() + refPos - 1;
// BUGBUG: how often does this symbolic deletion allele case happen?
//if( haplotype != null && ( (haplotype.leftBreakPoint + alignmentStartHapwrtRef + refLoc.getStart() + elementLength - 1 >= deletionStart && haplotype.leftBreakPoint + alignmentStartHapwrtRef + refLoc.getStart() + elementLength - 1 < deletionStart + elementLength)
@@ -667,7 +667,7 @@ public class GenotypingEngine {
final byte altByte = alignment[alignmentPos];
if( refByte != altByte ) { // SNP!
if( BaseUtils.isRegularBase(refByte) && BaseUtils.isRegularBase(altByte) ) {
- final ArrayList snpAlleles = new ArrayList();
+ final List snpAlleles = new ArrayList();
snpAlleles.add( Allele.create( refByte, true ) );
snpAlleles.add( Allele.create( altByte, false ) );
vcs.put(refLoc.getStart() + refPos, new VariantContextBuilder(sourceNameToAdd, refLoc.getContig(), refLoc.getStart() + refPos, refLoc.getStart() + refPos, snpAlleles).make());
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java
index a27eaac8e..027c62e68 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java
@@ -56,6 +56,7 @@ import org.broadinstitute.sting.gatk.arguments.StandardCallerArgumentCollection;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.AlignmentContextUtils;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
+import org.broadinstitute.sting.gatk.downsampling.DownsampleType;
import org.broadinstitute.sting.gatk.filters.BadMateFilter;
import org.broadinstitute.sting.gatk.io.StingSAMFileWriter;
import org.broadinstitute.sting.gatk.iterators.ReadTransformer;
@@ -132,7 +133,7 @@ import java.util.*;
@PartitionBy(PartitionType.LOCUS)
@BAQMode(ApplicationTime = ReadTransformer.ApplicationTime.FORBIDDEN)
@ActiveRegionTraversalParameters(extension=65, maxRegion=300)
-//@Downsample(by= DownsampleType.BY_SAMPLE, toCoverage=5)
+@Downsample(by= DownsampleType.BY_SAMPLE, toCoverage=20)
public class HaplotypeCaller extends ActiveRegionWalker implements AnnotatorCompatible {
/**
@@ -180,9 +181,6 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
@Argument(fullName="minKmer", shortName="minKmer", doc="Minimum kmer length to use in the assembly graph", required = false)
protected int minKmer = 11;
- @Argument(fullName="downsampleRegion", shortName="dr", doc="coverage, per-sample, to downsample each active region to", required = false)
- protected int DOWNSAMPLE_PER_SAMPLE_PER_REGION = 1000;
-
/**
* If this flag is provided, the haplotype caller will include unmapped reads in the assembly and calling
* when these reads occur in the region being analyzed. Typically, for paired end analyses, one pair of the
@@ -276,10 +274,10 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
// bases with quality less than or equal to this value are trimmed off the tails of the reads
private static final byte MIN_TAIL_QUALITY = 20;
- private ArrayList samplesList = new ArrayList();
+ private List samplesList = new ArrayList();
private final static double LOG_ONE_HALF = -Math.log10(2.0);
private final static double LOG_ONE_THIRD = -Math.log10(3.0);
- private final ArrayList allelesToGenotype = new ArrayList();
+ private final List allelesToGenotype = new ArrayList();
private final static Allele FAKE_REF_ALLELE = Allele.create("N", true); // used in isActive function to call into UG Engine. Should never appear anywhere in a VCF file
private final static Allele FAKE_ALT_ALLELE = Allele.create("", false); // used in isActive function to call into UG Engine. Should never appear anywhere in a VCF file
@@ -431,7 +429,7 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
genotypes.add( new GenotypeBuilder(sample.getKey()).alleles(noCall).PL(genotypeLikelihoods).make() );
}
- final ArrayList alleles = new ArrayList();
+ final List alleles = new ArrayList();
alleles.add( FAKE_REF_ALLELE );
alleles.add( FAKE_ALT_ALLELE );
final VariantCallContext vcOut = UG_engine_simple_genotyper.calculateGenotypes(new VariantContextBuilder("HCisActive!", context.getContig(), context.getLocation().getStart(), context.getLocation().getStop(), alleles).genotypes(genotypes).make(), GenotypeLikelihoodsCalculationModel.Model.INDEL);
@@ -452,7 +450,7 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
// we're benchmarking ART and/or the active region determination code in the HC, just leave without doing any work
return 1;
- final ArrayList activeAllelesToGenotype = new ArrayList();
+ final List activeAllelesToGenotype = new ArrayList();
if( UG_engine.getUAC().GenotypingMode == GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES ) {
for( final VariantContext vc : allelesToGenotype ) {
@@ -463,7 +461,7 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
allelesToGenotype.removeAll( activeAllelesToGenotype );
}
- if( !activeRegion.isActive()) { return 0; } // Not active so nothing to do!
+ if( !activeRegion.isActive() ) { return 0; } // Not active so nothing to do!
if( activeRegion.size() == 0 && UG_engine.getUAC().GenotypingMode != GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES ) { return 0; } // No reads here so nothing to do!
if( UG_engine.getUAC().GenotypingMode == GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES && activeAllelesToGenotype.isEmpty() ) { return 0; } // No alleles found in this region so nothing to do!
@@ -474,8 +472,7 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
final Haplotype referenceHaplotype = new Haplotype(activeRegion.getActiveRegionReference(referenceReader), true); // Create the reference haplotype which is the bases from the reference that make up the active region
final byte[] fullReferenceWithPadding = activeRegion.getFullReference(referenceReader, REFERENCE_PADDING);
- //int PRUNE_FACTOR = Math.max(MIN_PRUNE_FACTOR, determinePruneFactorFromCoverage( activeRegion ));
- final ArrayList haplotypes = assemblyEngine.runLocalAssembly( activeRegion, referenceHaplotype, fullReferenceWithPadding, fullSpanBeforeClipping, MIN_PRUNE_FACTOR, activeAllelesToGenotype );
+ final List haplotypes = assemblyEngine.runLocalAssembly( activeRegion, referenceHaplotype, fullReferenceWithPadding, fullSpanBeforeClipping, MIN_PRUNE_FACTOR, activeAllelesToGenotype );
if( haplotypes.size() == 1 ) { return 1; } // only the reference haplotype remains so nothing else to do!
activeRegion.hardClipToActiveRegion(); // only evaluate the parts of reads that are overlapping the active region
@@ -487,10 +484,10 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
// evaluate each sample's reads against all haplotypes
final Map stratifiedReadMap = likelihoodCalculationEngine.computeReadLikelihoods( haplotypes, splitReadsBySample( activeRegion.getReads() ) );
- final Map> perSampleFilteredReadList = splitReadsBySample( filteredReads );
+ final Map> perSampleFilteredReadList = splitReadsBySample( filteredReads );
// subset down to only the best haplotypes to be genotyped in all samples ( in GGA mode use all discovered haplotypes )
- final ArrayList bestHaplotypes = ( UG_engine.getUAC().GenotypingMode != GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES ?
+ final List bestHaplotypes = ( UG_engine.getUAC().GenotypingMode != GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES ?
likelihoodCalculationEngine.selectBestHaplotypes( haplotypes, stratifiedReadMap, maxNumHaplotypesInPopulation ) : haplotypes );
for( final VariantContext call : genotypingEngine.assignGenotypeLikelihoods( UG_engine,
@@ -561,7 +558,7 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
private void finalizeActiveRegion( final org.broadinstitute.sting.utils.activeregion.ActiveRegion activeRegion ) {
if( DEBUG ) { System.out.println("\nAssembling " + activeRegion.getLocation() + " with " + activeRegion.size() + " reads: (with overlap region = " + activeRegion.getExtendedLoc() + ")"); }
- final ArrayList finalizedReadList = new ArrayList();
+ final List finalizedReadList = new ArrayList();
final FragmentCollection fragmentCollection = FragmentUtils.create( activeRegion.getReads() );
activeRegion.clearReads();
@@ -571,18 +568,13 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
finalizedReadList.addAll( FragmentUtils.mergeOverlappingPairedFragments(overlappingPair) );
}
- Collections.shuffle(finalizedReadList, GenomeAnalysisEngine.getRandomGenerator());
-
// Loop through the reads hard clipping the adaptor and low quality tails
- final ArrayList readsToUse = new ArrayList(finalizedReadList.size());
+ final List readsToUse = new ArrayList(finalizedReadList.size());
for( final GATKSAMRecord myRead : finalizedReadList ) {
final GATKSAMRecord postAdapterRead = ( myRead.getReadUnmappedFlag() ? myRead : ReadClipper.hardClipAdaptorSequence( myRead ) );
if( postAdapterRead != null && !postAdapterRead.isEmpty() && postAdapterRead.getCigar().getReadLength() > 0 ) {
final GATKSAMRecord clippedRead = ReadClipper.hardClipLowQualEnds( postAdapterRead, MIN_TAIL_QUALITY );
- // protect against INTERVALS with abnormally high coverage
- // TODO BUGBUG: remove when positional downsampler is hooked up to ART/HC
- if( activeRegion.readOverlapsRegion(clippedRead) &&
- clippedRead.getReadLength() > 0 && activeRegion.size() < samplesList.size() * DOWNSAMPLE_PER_SAMPLE_PER_REGION ) {
+ if( activeRegion.readOverlapsRegion(clippedRead) && clippedRead.getReadLength() > 0 ) {
readsToUse.add(clippedRead);
}
}
@@ -591,7 +583,7 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
}
private List filterNonPassingReads( final org.broadinstitute.sting.utils.activeregion.ActiveRegion activeRegion ) {
- final ArrayList readsToRemove = new ArrayList();
+ final List readsToRemove = new ArrayList();
for( final GATKSAMRecord rec : activeRegion.getReads() ) {
if( rec.getReadLength() < 24 || rec.getMappingQuality() < 20 || BadMateFilter.hasBadMate(rec) || (keepRG != null && !rec.getReadGroup().getId().equals(keepRG)) ) {
readsToRemove.add(rec);
@@ -607,10 +599,10 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
return getToolkit().getGenomeLocParser().createGenomeLoc(activeRegion.getReadSpanLoc().getContig(), padLeft, padRight);
}
- private HashMap> splitReadsBySample( final List reads ) {
- final HashMap> returnMap = new HashMap>();
+ private Map> splitReadsBySample( final List reads ) {
+ final Map> returnMap = new HashMap>();
for( final String sample : samplesList) {
- ArrayList readList = returnMap.get( sample );
+ List readList = returnMap.get( sample );
if( readList == null ) {
readList = new ArrayList();
returnMap.put(sample, readList);
@@ -711,24 +703,4 @@ public class HaplotypeCaller extends ActiveRegionWalker implem
return new Cigar(readCigarElements);
}
-
- /*
- private int determinePruneFactorFromCoverage( final ActiveRegion activeRegion ) {
- final ArrayList readLengthDistribution = new ArrayList();
- for( final GATKSAMRecord read : activeRegion.getReads() ) {
- readLengthDistribution.add(read.getReadLength());
- }
- final double meanReadLength = MathUtils.average(readLengthDistribution);
- final double meanCoveragePerSample = (double) activeRegion.getReads().size() / ((double) activeRegion.getExtendedLoc().size() / meanReadLength) / (double) samplesList.size();
- int PRUNE_FACTOR = 0;
- if( meanCoveragePerSample > 8.5 ) {
- PRUNE_FACTOR = (int) Math.floor( Math.sqrt( meanCoveragePerSample - 5.0 ) );
- } else if( meanCoveragePerSample > 3.0 ) {
- PRUNE_FACTOR = 1;
- }
-
- if( DEBUG ) { System.out.println(String.format("Mean coverage per sample = %.1f --> prune factor = %d", meanCoveragePerSample, PRUNE_FACTOR)); }
- return PRUNE_FACTOR;
- }
- */
}
\ No newline at end of file
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java
index 57e071189..655b3e529 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java
@@ -91,11 +91,11 @@ public class LikelihoodCalculationEngine {
DEBUG = debug;
}
- public Map computeReadLikelihoods( final ArrayList haplotypes, final HashMap> perSampleReadList ) {
+ public Map computeReadLikelihoods( final List haplotypes, final Map> perSampleReadList ) {
final Map stratifiedReadMap = new HashMap();
int X_METRIC_LENGTH = 0;
- for( final Map.Entry> sample : perSampleReadList.entrySet() ) {
+ for( final Map.Entry> sample : perSampleReadList.entrySet() ) {
for( final GATKSAMRecord read : sample.getValue() ) {
final int readLength = read.getReadLength();
if( readLength > X_METRIC_LENGTH ) { X_METRIC_LENGTH = readLength; }
@@ -115,7 +115,7 @@ public class LikelihoodCalculationEngine {
pairHMM.initialize(X_METRIC_LENGTH, Y_METRIC_LENGTH);
// for each sample's reads
- for( final Map.Entry> sampleEntry : perSampleReadList.entrySet() ) {
+ for( final Map.Entry> sampleEntry : perSampleReadList.entrySet() ) {
//if( DEBUG ) { System.out.println("Evaluating sample " + sample + " with " + perSampleReadList.get( sample ).size() + " passing reads"); }
// evaluate the likelihood of the reads given those haplotypes
stratifiedReadMap.put(sampleEntry.getKey(), computeReadLikelihoods(haplotypes, sampleEntry.getValue()));
@@ -123,7 +123,7 @@ public class LikelihoodCalculationEngine {
return stratifiedReadMap;
}
- private PerReadAlleleLikelihoodMap computeReadLikelihoods( final ArrayList haplotypes, final ArrayList reads) {
+ private PerReadAlleleLikelihoodMap computeReadLikelihoods( final List haplotypes, final List reads) {
// first, a little set up to get copies of the Haplotypes that are Alleles (more efficient than creating them each time)
final int numHaplotypes = haplotypes.size();
final Map alleleVersions = new HashMap(numHaplotypes);
@@ -235,72 +235,13 @@ public class LikelihoodCalculationEngine {
return likelihoodMatrix;
}
- /*
@Requires({"haplotypes.size() > 0"})
@Ensures({"result.size() <= haplotypes.size()"})
- public ArrayList selectBestHaplotypes( final ArrayList haplotypes ) {
-
- // BUGBUG: This function needs a lot of work. Need to use 4-gamete test or Tajima's D to decide to break up events into separate pieces for genotyping
-
- final int numHaplotypes = haplotypes.size();
- final Set sampleKeySet = haplotypes.get(0).getSampleKeySet(); // BUGBUG: assume all haplotypes saw the same samples
- final ArrayList bestHaplotypesIndexList = new ArrayList();
- bestHaplotypesIndexList.add(0); // always start with the reference haplotype
- final double[][][] haplotypeLikelihoodMatrix = new double[sampleKeySet.size()][numHaplotypes][numHaplotypes];
-
- int sampleCount = 0;
- for( final String sample : sampleKeySet ) {
- haplotypeLikelihoodMatrix[sampleCount++] = computeDiploidHaplotypeLikelihoods( haplotypes, sample );
- }
-
- int hap1 = 0;
- int hap2 = 0;
- int chosenSample = 0;
- //double bestElement = Double.NEGATIVE_INFINITY;
- final int maxChosenHaplotypes = Math.min( 15, sampleKeySet.size() * 2 + 1 );
- while( bestHaplotypesIndexList.size() < maxChosenHaplotypes ) {
- double maxElement = Double.NEGATIVE_INFINITY;
- for( int kkk = 0; kkk < sampleCount; kkk++ ) {
- for( int iii = 0; iii < numHaplotypes; iii++ ) {
- for( int jjj = 0; jjj <= iii; jjj++ ) {
- if( haplotypeLikelihoodMatrix[kkk][iii][jjj] > maxElement ) {
- maxElement = haplotypeLikelihoodMatrix[kkk][iii][jjj];
- hap1 = iii;
- hap2 = jjj;
- chosenSample = kkk;
- }
- }
- }
- }
- if( maxElement == Double.NEGATIVE_INFINITY ) { break; }
-
- if( !bestHaplotypesIndexList.contains(hap1) ) { bestHaplotypesIndexList.add(hap1); }
- if( !bestHaplotypesIndexList.contains(hap2) ) { bestHaplotypesIndexList.add(hap2); }
-
- for( int iii = 0; iii < numHaplotypes; iii++ ) {
- for( int jjj = 0; jjj <= iii; jjj++ ) {
- haplotypeLikelihoodMatrix[chosenSample][iii][jjj] = Double.NEGATIVE_INFINITY;
- }
- }
- }
-
- if( DEBUG ) { System.out.println("Chose " + (bestHaplotypesIndexList.size() - 1) + " alternate haplotypes to genotype in all samples."); }
-
- final ArrayList bestHaplotypes = new ArrayList();
- for( final int hIndex : bestHaplotypesIndexList ) {
- bestHaplotypes.add( haplotypes.get(hIndex) );
- }
- return bestHaplotypes;
- }
- */
-
- @Requires({"haplotypes.size() > 0"})
- @Ensures({"result.size() <= haplotypes.size()"})
- public ArrayList selectBestHaplotypes( final ArrayList haplotypes, final Map stratifiedReadMap, final int maxNumHaplotypesInPopulation ) {
+ public List selectBestHaplotypes( final List haplotypes, final Map stratifiedReadMap, final int maxNumHaplotypesInPopulation ) {
final int numHaplotypes = haplotypes.size();
final Set sampleKeySet = stratifiedReadMap.keySet();
- final ArrayList bestHaplotypesIndexList = new ArrayList();
+ final List bestHaplotypesIndexList = new ArrayList();
bestHaplotypesIndexList.add( findReferenceIndex(haplotypes) ); // always start with the reference haplotype
final List haplotypesAsAlleles = new ArrayList();
for( final Haplotype h : haplotypes ) { haplotypesAsAlleles.add(Allele.create(h.getBases())); }
@@ -332,7 +273,7 @@ public class LikelihoodCalculationEngine {
if( DEBUG ) { System.out.println("Chose " + (bestHaplotypesIndexList.size() - 1) + " alternate haplotypes to genotype in all samples."); }
- final ArrayList bestHaplotypes = new ArrayList();
+ final List bestHaplotypes = new ArrayList();
for( final int hIndex : bestHaplotypesIndexList ) {
bestHaplotypes.add( haplotypes.get(hIndex) );
}
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LocalAssemblyEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LocalAssemblyEngine.java
index b0e340dc2..3efa342b1 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LocalAssemblyEngine.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LocalAssemblyEngine.java
@@ -51,7 +51,7 @@ import org.broadinstitute.sting.utils.Haplotype;
import org.broadinstitute.sting.utils.activeregion.ActiveRegion;
import org.broadinstitute.variant.variantcontext.VariantContext;
-import java.util.ArrayList;
+import java.util.List;
/**
* Created by IntelliJ IDEA.
@@ -67,5 +67,5 @@ public abstract class LocalAssemblyEngine {
protected LocalAssemblyEngine() {
}
- public abstract ArrayList runLocalAssembly(ActiveRegion activeRegion, Haplotype refHaplotype, byte[] fullReferenceWithPadding, GenomeLoc refLoc, int PRUNE_FACTOR, ArrayList activeAllelesToGenotype);
+ public abstract List runLocalAssembly(ActiveRegion activeRegion, Haplotype refHaplotype, byte[] fullReferenceWithPadding, GenomeLoc refLoc, int PRUNE_FACTOR, List activeAllelesToGenotype);
}
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java
index e16994fa4..a9768557d 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java
@@ -84,7 +84,7 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
private final boolean DEBUG;
private final PrintStream GRAPH_WRITER;
- private final ArrayList> graphs = new ArrayList>();
+ private final List> graphs = new ArrayList>();
private final int MIN_KMER;
private int PRUNE_FACTOR = 2;
@@ -96,7 +96,7 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
MIN_KMER = minKmer;
}
- public ArrayList runLocalAssembly( final ActiveRegion activeRegion, final Haplotype refHaplotype, final byte[] fullReferenceWithPadding, final GenomeLoc refLoc, final int PRUNE_FACTOR, final ArrayList activeAllelesToGenotype ) {
+ public List runLocalAssembly( final ActiveRegion activeRegion, final Haplotype refHaplotype, final byte[] fullReferenceWithPadding, final GenomeLoc refLoc, final int PRUNE_FACTOR, final List activeAllelesToGenotype ) {
this.PRUNE_FACTOR = PRUNE_FACTOR;
// create the graphs
@@ -168,7 +168,7 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
}
protected static void pruneGraph( final DefaultDirectedGraph graph, final int pruneFactor ) {
- final ArrayList edgesToRemove = new ArrayList();
+ final List edgesToRemove = new ArrayList();
for( final DeBruijnEdge e : graph.edgeSet() ) {
if( e.getMultiplicity() <= pruneFactor && !e.getIsRef() ) { // remove non-reference edges with weight less than or equal to the pruning factor
edgesToRemove.add(e);
@@ -177,7 +177,7 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
graph.removeAllEdges(edgesToRemove);
// Run through the graph and clean up singular orphaned nodes
- final ArrayList verticesToRemove = new ArrayList();
+ final List verticesToRemove = new ArrayList();
for( final DeBruijnVertex v : graph.vertexSet() ) {
if( graph.inDegreeOf(v) == 0 && graph.outDegreeOf(v) == 0 ) {
verticesToRemove.add(v);
@@ -187,7 +187,7 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
}
protected static void eliminateNonRefPaths( final DefaultDirectedGraph graph ) {
- final ArrayList verticesToRemove = new ArrayList();
+ final List verticesToRemove = new ArrayList();
boolean done = false;
while( !done ) {
done = true;
@@ -313,8 +313,8 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
}
@Ensures({"result.contains(refHaplotype)"})
- private ArrayList findBestPaths( final Haplotype refHaplotype, final byte[] fullReferenceWithPadding, final GenomeLoc refLoc, final ArrayList activeAllelesToGenotype, final GenomeLoc activeRegionWindow ) {
- final ArrayList returnHaplotypes = new ArrayList();
+ private List findBestPaths( final Haplotype refHaplotype, final byte[] fullReferenceWithPadding, final GenomeLoc refLoc, final List activeAllelesToGenotype, final GenomeLoc activeRegionWindow ) {
+ final List returnHaplotypes = new ArrayList();
// add the reference haplotype separately from all the others
final SWPairwiseAlignment swConsensus = new SWPairwiseAlignment( fullReferenceWithPadding, refHaplotype.getBases(), SW_MATCH, SW_MISMATCH, SW_GAP, SW_GAP_EXTEND );
@@ -343,7 +343,7 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
// for GGA mode, add the desired allele into the haplotype if it isn't already present
if( !activeAllelesToGenotype.isEmpty() ) {
- final HashMap eventMap = GenotypingEngine.generateVCsFromAlignment( h, h.getAlignmentStartHapwrtRef(), h.getCigar(), fullReferenceWithPadding, h.getBases(), refLoc, "HCassembly" ); // BUGBUG: need to put this function in a shared place
+ final Map eventMap = GenotypingEngine.generateVCsFromAlignment( h, h.getAlignmentStartHapwrtRef(), h.getCigar(), fullReferenceWithPadding, h.getBases(), refLoc, "HCassembly" ); // BUGBUG: need to put this function in a shared place
for( final VariantContext compVC : activeAllelesToGenotype ) { // for GGA mode, add the desired allele into the haplotype if it isn't already present
final VariantContext vcOnHaplotype = eventMap.get(compVC.getStart());
@@ -378,7 +378,7 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
return returnHaplotypes;
}
- private boolean addHaplotype( final Haplotype haplotype, final byte[] ref, final ArrayList haplotypeList, final int activeRegionStart, final int activeRegionStop, final boolean FORCE_INCLUSION_FOR_GGA_MODE ) {
+ private boolean addHaplotype( final Haplotype haplotype, final byte[] ref, final List haplotypeList, final int activeRegionStart, final int activeRegionStop, final boolean FORCE_INCLUSION_FOR_GGA_MODE ) {
if( haplotype == null ) { return false; }
final SWPairwiseAlignment swConsensus = new SWPairwiseAlignment( ref, haplotype.getBases(), SW_MATCH, SW_MISMATCH, SW_GAP, SW_GAP_EXTEND );
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java
index 851703648..ad554a130 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java
@@ -75,7 +75,7 @@ import org.broadinstitute.sting.utils.sam.NWaySAMFileWriter;
import org.broadinstitute.sting.utils.sam.ReadUtils;
import org.broadinstitute.sting.utils.text.TextFormattingUtils;
import org.broadinstitute.sting.utils.text.XReadLines;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.variant.variantcontext.VariantContext;
import java.io.File;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java
index de91765b7..cbc6a1f94 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java
@@ -46,7 +46,7 @@
package org.broadinstitute.sting.gatk.walkers.phasing;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import java.util.Arrays;
import java.util.LinkedList;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java
index f2ba027f8..a04789f61 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java
@@ -46,7 +46,7 @@
package org.broadinstitute.sting.gatk.walkers.phasing;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.QualityUtils;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java
index 56fc59c7f..fe38461c5 100644
--- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java
+++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java
@@ -59,7 +59,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.walkers.*;
import org.broadinstitute.sting.utils.variant.GATKVCFUtils;
import org.broadinstitute.sting.utils.variant.GATKVariantContextUtils;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.HasGenomeLocation;
import org.broadinstitute.sting.utils.SampleUtils;
@@ -320,7 +320,7 @@ public class ReadBackedPhasing extends RodWalker that maps from rgKey x errorModel -> double,
- // where the double is the result of this calculation. The entire calculation can
- // be done upfront, on initialization of this BaseRecalibration structure
- //
- final NestedIntegerArray byReadGroupTable = recalibrationTables.getReadGroupTable();
- globalDeltaQs = new NestedIntegerArray( byReadGroupTable.getDimensions() );
- logger.info("Calculating global delta Q table...");
- for ( NestedIntegerArray.Leaf leaf : byReadGroupTable.getAllLeaves() ) {
- final int rgKey = leaf.keys[0];
- final int eventIndex = leaf.keys[1];
- final double globalDeltaQ = calculateGlobalDeltaQ(rgKey, EventType.eventFrom(eventIndex));
- globalDeltaQs.put(globalDeltaQ, rgKey, eventIndex);
- }
-
-
- // The calculation of the deltaQ report is constant. key[0] and key[1] are the read group and qual, respectively
- // and globalDeltaQ is a constant for the read group. So technically the delta Q reported is simply a lookup
- // into a matrix indexed by rgGroup, qual, and event type.
- // the code below actually creates this cache with a NestedIntegerArray calling into the actual
- // calculateDeltaQReported code.
- final NestedIntegerArray byQualTable = recalibrationTables.getQualityScoreTable();
- deltaQReporteds = new NestedIntegerArray( byQualTable.getDimensions() );
- logger.info("Calculating delta Q reported table...");
- for ( NestedIntegerArray.Leaf leaf : byQualTable.getAllLeaves() ) {
- final int rgKey = leaf.keys[0];
- final int qual = leaf.keys[1];
- final int eventIndex = leaf.keys[2];
- final EventType event = EventType.eventFrom(eventIndex);
- final double globalDeltaQ = getGlobalDeltaQ(rgKey, event);
- final double deltaQReported = calculateDeltaQReported(rgKey, qual, event, globalDeltaQ, (byte)qual);
- deltaQReporteds.put(deltaQReported, rgKey, qual, eventIndex);
- }
-
- logger.info("done calculating cache");
}
/**
@@ -189,29 +150,37 @@ public class BaseRecalibration {
// the rg key is constant over the whole read, the global deltaQ is too
final int rgKey = fullReadKeySet[0][0];
+ final RecalDatum empiricalQualRG = recalibrationTables.getReadGroupTable().get(rgKey, errorModel.ordinal());
- final double globalDeltaQ = getGlobalDeltaQ(rgKey, errorModel);
+ if( empiricalQualRG != null ) {
+ final double epsilon = ( globalQScorePrior > 0.0 && errorModel.equals(EventType.BASE_SUBSTITUTION) ? globalQScorePrior : empiricalQualRG.getEstimatedQReported() );
- for (int offset = 0; offset < readLength; offset++) { // recalibrate all bases in the read
- final byte origQual = quals[offset];
+ for (int offset = 0; offset < readLength; offset++) { // recalibrate all bases in the read
+ final byte origQual = quals[offset];
- // only recalibrate usable qualities (the original quality will come from the instrument -- reported quality)
- if ( origQual >= preserveQLessThan ) {
- // get the keyset for this base using the error model
- final int[] keySet = fullReadKeySet[offset];
- final double deltaQReported = getDeltaQReported(keySet[0], keySet[1], errorModel, globalDeltaQ);
- final double deltaQCovariates = calculateDeltaQCovariates(recalibrationTables, keySet, errorModel, globalDeltaQ, deltaQReported, origQual);
+ // only recalibrate usable qualities (the original quality will come from the instrument -- reported quality)
+ if ( origQual >= preserveQLessThan ) {
+ // get the keyset for this base using the error model
+ final int[] keySet = fullReadKeySet[offset];
+ final RecalDatum empiricalQualQS = recalibrationTables.getQualityScoreTable().get(keySet[0], keySet[1], errorModel.ordinal());
+ final List empiricalQualCovs = new ArrayList();
+ for (int i = 2; i < requestedCovariates.length; i++) {
+ if (keySet[i] < 0) {
+ continue;
+ }
+ empiricalQualCovs.add(recalibrationTables.getTable(i).get(keySet[0], keySet[1], keySet[i], errorModel.ordinal()));
+ }
- // calculate the recalibrated qual using the BQSR formula
- double recalibratedQualDouble = origQual + globalDeltaQ + deltaQReported + deltaQCovariates;
+ double recalibratedQualDouble = hierarchicalBayesianQualityEstimate( epsilon, empiricalQualRG, empiricalQualQS, empiricalQualCovs );
- // recalibrated quality is bound between 1 and MAX_QUAL
- final byte recalibratedQual = QualityUtils.boundQual(MathUtils.fastRound(recalibratedQualDouble), QualityUtils.MAX_RECALIBRATED_Q_SCORE);
+ // recalibrated quality is bound between 1 and MAX_QUAL
+ final byte recalibratedQual = QualityUtils.boundQual(MathUtils.fastRound(recalibratedQualDouble), QualityUtils.MAX_RECALIBRATED_Q_SCORE);
- // return the quantized version of the recalibrated quality
- final byte recalibratedQualityScore = quantizationInfo.getQuantizedQuals().get(recalibratedQual);
+ // return the quantized version of the recalibrated quality
+ final byte recalibratedQualityScore = quantizationInfo.getQuantizedQuals().get(recalibratedQual);
- quals[offset] = recalibratedQualityScore;
+ quals[offset] = recalibratedQualityScore;
+ }
}
}
@@ -220,102 +189,15 @@ public class BaseRecalibration {
}
}
- private double getGlobalDeltaQ(final int rgKey, final EventType errorModel) {
- final Double cached = globalDeltaQs.get(rgKey, errorModel.ordinal());
-
- if ( TEST_CACHING ) {
- final double calcd = calculateGlobalDeltaQ(rgKey, errorModel);
- if ( calcd != cached )
- throw new IllegalStateException("calculated " + calcd + " and cached " + cached + " global delta q not equal at " + rgKey + " / " + errorModel);
+ @Ensures("result > 0.0")
+ protected static double hierarchicalBayesianQualityEstimate( final double epsilon, final RecalDatum empiricalQualRG, final RecalDatum empiricalQualQS, final List empiricalQualCovs ) {
+ final double globalDeltaQ = ( empiricalQualRG == null ? 0.0 : empiricalQualRG.getEmpiricalQuality(epsilon) - epsilon );
+ final double deltaQReported = ( empiricalQualQS == null ? 0.0 : empiricalQualQS.getEmpiricalQuality(globalDeltaQ + epsilon) - (globalDeltaQ + epsilon) );
+ double deltaQCovariates = 0.0;
+ for( final RecalDatum empiricalQualCov : empiricalQualCovs ) {
+ deltaQCovariates += ( empiricalQualCov == null ? 0.0 : empiricalQualCov.getEmpiricalQuality(deltaQReported + globalDeltaQ + epsilon) - (deltaQReported + globalDeltaQ + epsilon) );
}
- return cachedWithDefault(cached);
- }
-
- private double getDeltaQReported(final int rgKey, final int qualKey, final EventType errorModel, final double globalDeltaQ) {
- final Double cached = deltaQReporteds.get(rgKey, qualKey, errorModel.ordinal());
-
- if ( TEST_CACHING ) {
- final double calcd = calculateDeltaQReported(rgKey, qualKey, errorModel, globalDeltaQ, (byte)qualKey);
- if ( calcd != cached )
- throw new IllegalStateException("calculated " + calcd + " and cached " + cached + " global delta q not equal at " + rgKey + " / " + qualKey + " / " + errorModel);
- }
-
- return cachedWithDefault(cached);
- }
-
- /**
- * @param d a Double (that may be null) that is the result of a delta Q calculation
- * @return a double == d if d != null, or 0.0 if it is
- */
- private double cachedWithDefault(final Double d) {
- return d == null ? 0.0 : d;
- }
-
- /**
- * Note that this calculation is a constant for each rgKey and errorModel. We need only
- * compute this value once for all data.
- *
- * @param rgKey read group key
- * @param errorModel the event type
- * @return global delta Q
- */
- private double calculateGlobalDeltaQ(final int rgKey, final EventType errorModel) {
- double result = 0.0;
-
- final RecalDatum empiricalQualRG = recalibrationTables.getReadGroupTable().get(rgKey, errorModel.ordinal());
-
- if (empiricalQualRG != null) {
- final double aggregrateQReported = ( globalQScorePrior > 0.0 && errorModel.equals(EventType.BASE_SUBSTITUTION) ? globalQScorePrior : empiricalQualRG.getEstimatedQReported() );
- final double globalDeltaQEmpirical = empiricalQualRG.getEmpiricalQuality(aggregrateQReported);
- result = globalDeltaQEmpirical - aggregrateQReported;
- }
-
- return result;
- }
-
- private double calculateDeltaQReported(final int rgKey, final int qualKey, final EventType errorModel, final double globalDeltaQ, final byte qualFromRead) {
- double result = 0.0;
-
- final RecalDatum empiricalQualQS = recalibrationTables.getQualityScoreTable().get(rgKey, qualKey, errorModel.ordinal());
- if (empiricalQualQS != null) {
- final double deltaQReportedEmpirical = empiricalQualQS.getEmpiricalQuality(globalDeltaQ + qualFromRead);
- result = deltaQReportedEmpirical - (globalDeltaQ + qualFromRead);
- }
-
- return result;
- }
-
- private double calculateDeltaQCovariates(final RecalibrationTables recalibrationTables, final int[] key, final EventType errorModel, final double globalDeltaQ, final double deltaQReported, final byte qualFromRead) {
- double result = 0.0;
-
- // for all optional covariates
- for (int i = 2; i < requestedCovariates.length; i++) {
- if (key[i] < 0)
- continue;
-
- result += calculateDeltaQCovariate(recalibrationTables.getTable(i),
- key[0], key[1], key[i], errorModel,
- globalDeltaQ, deltaQReported, qualFromRead);
- }
-
- return result;
- }
-
- private double calculateDeltaQCovariate(final NestedIntegerArray table,
- final int rgKey,
- final int qualKey,
- final int tableKey,
- final EventType errorModel,
- final double globalDeltaQ,
- final double deltaQReported,
- final byte qualFromRead) {
- final RecalDatum empiricalQualCO = table.get(rgKey, qualKey, tableKey, errorModel.ordinal());
- if (empiricalQualCO != null) {
- final double deltaQCovariateEmpirical = empiricalQualCO.getEmpiricalQuality(deltaQReported + globalDeltaQ + qualFromRead);
- return deltaQCovariateEmpirical - (deltaQReported + globalDeltaQ + qualFromRead);
- } else {
- return 0.0;
- }
+ return epsilon + globalDeltaQ + deltaQReported + deltaQCovariates;
}
}
diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java
index 0b4441439..bd0063a7d 100644
--- a/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java
+++ b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java
@@ -181,6 +181,7 @@ public class RecalDatum {
if ( Double.isNaN(estimatedQReported) ) throw new IllegalArgumentException("estimatedQReported is NaN");
this.estimatedQReported = estimatedQReported;
+ empiricalQuality = UNINITIALIZED;
}
public final double getEstimatedQReported() {
diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java
index 699f26c5e..f7c3440e4 100644
--- a/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java
+++ b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java
@@ -52,7 +52,7 @@ import org.broadinstitute.sting.gatk.report.GATKReportTable;
import org.broadinstitute.sting.gatk.walkers.bqsr.RecalibrationArgumentCollection;
import org.broadinstitute.sting.utils.classloader.JVMUtils;
import org.broadinstitute.sting.utils.recalibration.covariates.*;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.R.RScriptExecutor;
import org.broadinstitute.sting.utils.Utils;
import org.broadinstitute.sting.utils.classloader.PluginManager;
diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java
index 2f9a38972..f10c26ddc 100644
--- a/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java
+++ b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java
@@ -131,7 +131,7 @@ public class RecalibrationReport {
* Combines two recalibration reports by adding all observations and errors
*
* Note: This method DOES NOT recalculate the empirical qualities and quantized qualities. You have to recalculate
- * them after combining. The reason for not calculating it is because this function is inteded for combining a
+ * them after combining. The reason for not calculating it is because this function is intended for combining a
* series of recalibration reports, and it only makes sense to calculate the empirical qualities and quantized
* qualities after all the recalibration reports have been combined. Having the user recalculate when appropriate,
* makes this method faster
diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java
index 66c74d667..4fc9470f4 100644
--- a/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java
+++ b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java
@@ -48,7 +48,7 @@ package org.broadinstitute.sting.utils.recalibration.covariates;
import org.apache.log4j.Logger;
import org.broadinstitute.sting.gatk.walkers.bqsr.RecalibrationArgumentCollection;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.clipping.ClippingRepresentation;
import org.broadinstitute.sting.utils.clipping.ReadClipper;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
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 0578ac60c..bccaea827 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
@@ -48,7 +48,7 @@ package org.broadinstitute.sting.utils.recalibration.covariates;
import org.broadinstitute.sting.utils.recalibration.ReadCovariates;
import org.broadinstitute.sting.gatk.walkers.bqsr.RecalibrationArgumentCollection;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.NGSPlatform;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.sam.GATKSAMRecord;
diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatCovariate.java
index b6b954c4a..0eeb18251 100644
--- a/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatCovariate.java
+++ b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatCovariate.java
@@ -52,7 +52,7 @@ import org.broadinstitute.sting.gatk.walkers.bqsr.RecalibrationArgumentCollectio
import org.broadinstitute.sting.utils.recalibration.ReadCovariates;
import org.broadinstitute.sting.utils.sam.GATKSAMRecord;
import org.broadinstitute.sting.utils.variant.GATKVariantContextUtils;
-import org.broadinstitute.variant.utils.BaseUtils;
+import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.collections.Pair;
import java.util.Arrays;
diff --git a/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java
index 2815599d9..f82f24439 100644
--- a/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java
+++ b/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java
@@ -125,19 +125,19 @@ public class BQSRGathererUnitTest extends BaseTest {
testTablesWithColumns(originalTable, calculatedTable, columnsToTest);
// test the RecalTable0 table
- columnsToTest = Arrays.asList(RecalUtils.READGROUP_COLUMN_NAME, RecalUtils.EVENT_TYPE_COLUMN_NAME, RecalUtils.EMPIRICAL_QUALITY_COLUMN_NAME, RecalUtils.ESTIMATED_Q_REPORTED_COLUMN_NAME, RecalUtils.NUMBER_OBSERVATIONS_COLUMN_NAME, RecalUtils.NUMBER_ERRORS_COLUMN_NAME);
+ columnsToTest = Arrays.asList(RecalUtils.READGROUP_COLUMN_NAME, RecalUtils.EVENT_TYPE_COLUMN_NAME, RecalUtils.ESTIMATED_Q_REPORTED_COLUMN_NAME, RecalUtils.NUMBER_OBSERVATIONS_COLUMN_NAME, RecalUtils.NUMBER_ERRORS_COLUMN_NAME);
originalTable = originalReport.getTable(RecalUtils.READGROUP_REPORT_TABLE_TITLE);
calculatedTable = calculatedReport.getTable(RecalUtils.READGROUP_REPORT_TABLE_TITLE);
testTablesWithColumns(originalTable, calculatedTable, columnsToTest);
// test the RecalTable1 table
- columnsToTest = Arrays.asList(RecalUtils.READGROUP_COLUMN_NAME, RecalUtils.QUALITY_SCORE_COLUMN_NAME, RecalUtils.EVENT_TYPE_COLUMN_NAME, RecalUtils.EMPIRICAL_QUALITY_COLUMN_NAME, RecalUtils.NUMBER_OBSERVATIONS_COLUMN_NAME, RecalUtils.NUMBER_ERRORS_COLUMN_NAME);
+ columnsToTest = Arrays.asList(RecalUtils.READGROUP_COLUMN_NAME, RecalUtils.QUALITY_SCORE_COLUMN_NAME, RecalUtils.EVENT_TYPE_COLUMN_NAME, RecalUtils.NUMBER_OBSERVATIONS_COLUMN_NAME, RecalUtils.NUMBER_ERRORS_COLUMN_NAME);
originalTable = originalReport.getTable(RecalUtils.QUALITY_SCORE_REPORT_TABLE_TITLE);
calculatedTable = calculatedReport.getTable(RecalUtils.QUALITY_SCORE_REPORT_TABLE_TITLE);
testTablesWithColumns(originalTable, calculatedTable, columnsToTest);
// test the RecalTable2 table
- columnsToTest = Arrays.asList(RecalUtils.READGROUP_COLUMN_NAME, RecalUtils.QUALITY_SCORE_COLUMN_NAME, RecalUtils.COVARIATE_VALUE_COLUMN_NAME, RecalUtils.COVARIATE_NAME_COLUMN_NAME, RecalUtils.EVENT_TYPE_COLUMN_NAME, RecalUtils.EMPIRICAL_QUALITY_COLUMN_NAME, RecalUtils.NUMBER_OBSERVATIONS_COLUMN_NAME, RecalUtils.NUMBER_ERRORS_COLUMN_NAME);
+ columnsToTest = Arrays.asList(RecalUtils.READGROUP_COLUMN_NAME, RecalUtils.QUALITY_SCORE_COLUMN_NAME, RecalUtils.COVARIATE_VALUE_COLUMN_NAME, RecalUtils.COVARIATE_NAME_COLUMN_NAME, RecalUtils.EVENT_TYPE_COLUMN_NAME, RecalUtils.NUMBER_OBSERVATIONS_COLUMN_NAME, RecalUtils.NUMBER_ERRORS_COLUMN_NAME);
originalTable = originalReport.getTable(RecalUtils.ALL_COVARIATES_REPORT_TABLE_TITLE);
calculatedTable = calculatedReport.getTable(RecalUtils.ALL_COVARIATES_REPORT_TABLE_TITLE);
testTablesWithColumns(originalTable, calculatedTable, columnsToTest);
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 254bfd92c..1f4875298 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
@@ -188,12 +188,12 @@ public class BQSRIntegrationTest extends WalkerTest {
public Object[][] createPRTestData() {
List