diff --git a/build.xml b/build.xml
index d3e25d424..8e9de2272 100644
--- a/build.xml
+++ b/build.xml
@@ -955,8 +955,8 @@
-
-
+
+
diff --git a/public/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java b/public/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java
index 8fbfa96e9..f2291e5ec 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java
@@ -177,11 +177,8 @@ public class GATKReport {
*/
public void print(PrintStream out) {
out.println(GATKREPORT_HEADER_PREFIX + getVersion().toString() + SEPARATOR + getTables().size());
- for (GATKReportTable table : tables.values()) {
- if (table.getNumRows() > 0) {
- table.write(out);
- }
- }
+ for (GATKReportTable table : tables.values())
+ table.write(out);
}
public Collection getTables() {
diff --git a/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportDataType.java b/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportDataType.java
index d9bae19c7..6451c5836 100644
--- a/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportDataType.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportDataType.java
@@ -48,9 +48,9 @@ public enum GATKReportDataType {
Boolean("%[Bb]"),
/**
- * Used for byte and char value. Will display as a char so use printable values!
+ * Used for char values. Will display as a char so use printable values!
*/
- Byte("%[Cc]"),
+ Character("%[Cc]"),
/**
* Used for float and double values. Will output a decimal with format %.8f unless otherwise specified.
@@ -58,7 +58,7 @@ public enum GATKReportDataType {
Decimal("%.*[EeFf]"),
/**
- * Used for int, and long values. Will display the full number by default.
+ * Used for int, byte, short, and long values. Will display the full number by default.
*/
Integer("%[Dd]"),
@@ -97,17 +97,26 @@ public enum GATKReportDataType {
GATKReportDataType value;
if (object instanceof Boolean) {
value = GATKReportDataType.Boolean;
- } else if (object instanceof Byte || object instanceof Character) {
- value = GATKReportDataType.Byte;
- } else if (object instanceof Float || object instanceof Double) {
+
+ } else if (object instanceof Character) {
+ value = GATKReportDataType.Character;
+
+ } else if (object instanceof Float ||
+ object instanceof Double) {
value = GATKReportDataType.Decimal;
- } else if (object instanceof Integer || object instanceof Long) {
+
+ } else if (object instanceof Integer ||
+ object instanceof Long ||
+ object instanceof Short ||
+ object instanceof Byte ) {
value = GATKReportDataType.Integer;
+
} else if (object instanceof String) {
value = GATKReportDataType.String;
+
} else {
value = GATKReportDataType.Unknown;
- //throw new ReviewedStingException("GATKReport could not convert the data object into a GATKReportDataType. Acceptable data objects are found in the documentation.");
+ //throw new UserException("GATKReport could not convert the data object into a GATKReportDataType. Acceptable data objects are found in the documentation.");
}
return value;
}
@@ -140,8 +149,8 @@ public enum GATKReportDataType {
return 0.0D;
case Boolean:
return false;
- case Byte:
- return (byte) 0;
+ case Character:
+ return '0';
case Integer:
return 0L;
case String:
@@ -166,16 +175,7 @@ public enum GATKReportDataType {
case Boolean:
case Integer:
return a.toString().equals(b.toString());
- case Byte:
- // A mess that checks if the bytes and characters contain the same value
- if ((a instanceof Character && b instanceof Character) ||
- (a instanceof Byte && b instanceof Byte))
- return a.toString().equals(b.toString());
- else if (a instanceof Character && b instanceof Byte) {
- return ((Character) a).charValue() == ((Byte) b).byteValue();
- } else if (a instanceof Byte && b instanceof Character) {
- return ((Byte) a).byteValue() == ((Character) b).charValue();
- }
+ case Character:
case String:
default:
return a.equals(b);
@@ -201,8 +201,8 @@ public enum GATKReportDataType {
return Long.parseLong(str);
case String:
return str;
- case Byte:
- return (byte) str.toCharArray()[0];
+ case Character:
+ return str.toCharArray()[0];
default:
return str;
}
@@ -225,7 +225,7 @@ public enum GATKReportDataType {
return "%d";
case String:
return "%s";
- case Byte:
+ case Character:
return "%c";
case Null:
default:
diff --git a/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java b/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java
index e0e3ad1fc..1fe67154e 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java
@@ -254,7 +254,7 @@ public class GATKReportTable {
* @param dottedColumnValues Period concatenated values.
* @return The first primary key matching the column values or throws an exception.
*/
- public Object getPrimaryKey(String dottedColumnValues) {
+ public Object getPrimaryKeyByData(String dottedColumnValues) {
Object key = findPrimaryKey(dottedColumnValues);
if (key == null)
throw new ReviewedStingException("Attempted to get non-existent GATKReportTable key for values: " + dottedColumnValues);
@@ -411,9 +411,8 @@ public class GATKReportTable {
if (value == null)
value = "null";
- // This code is bs. Why am do I have to conform to bad code
- // Below is some ode to convert a string into its appropriate type.
- // This is just Roger ranting
+ // This code below is bs. Why am do I have to conform to bad code
+ // Below is some code to convert a string into its appropriate type.
// If we got a string but the column is not a String type
Object newValue = null;
@@ -431,7 +430,7 @@ public class GATKReportTable {
} catch (Exception e) {
}
}
- if (column.getDataType().equals(GATKReportDataType.Byte) && ((String) value).length() == 1) {
+ if (column.getDataType().equals(GATKReportDataType.Character) && ((String) value).length() == 1) {
newValue = ((String) value).charAt(0);
}
@@ -816,7 +815,7 @@ public class GATKReportTable {
out.println();
}
- out.println();
+ out.println();
}
public int getNumRows() {
@@ -877,8 +876,6 @@ public class GATKReportTable {
this.set(rowKey, columnKey, toAdd.get(rowKey));
//System.out.printf("Putting row with PK: %s \n", rowKey);
} else {
-
- // TODO we should be able to handle combining data by adding, averaging, etc.
this.set(rowKey, columnKey, toAdd.get(rowKey));
System.out.printf("OVERWRITING Row with PK: %s \n", rowKey);
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationReport.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationReport.java
index ce00240b8..897e1645d 100644
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationReport.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationReport.java
@@ -94,8 +94,11 @@ public class RecalibrationReport {
BitSet key = entry.getKey();
RecalDatum otherDatum = entry.getValue();
RecalDatum thisDatum = thisTable.get(key);
- thisDatum.increment(otherDatum); // add the two datum objects into 'this'
- thisDatum.resetCalculatedQualities(); // reset the empirical quality to make sure the user doesn't forget to recalculate it
+ if (thisDatum == null)
+ thisDatum = otherDatum; // sometimes the datum in other won't be present in 'this'. So just assign it!
+ else
+ thisDatum.increment(otherDatum); // add the two datum objects into 'this'
+ thisDatum.resetCalculatedQualities(); // reset the empirical quality to make sure the user doesn't forget to recalculate it
}
}
}
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java
index e1ce2ee18..23d7c0ad6 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java
@@ -41,7 +41,8 @@ public abstract class AlleleFrequencyCalculationModel implements Cloneable {
public enum Model {
/** The default model with the best performance in all cases */
- EXACT
+ EXACT,
+ POOL
}
protected int N;
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ExactAFCalculationModel.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ExactAFCalculationModel.java
index 891159512..4bda3282e 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ExactAFCalculationModel.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ExactAFCalculationModel.java
@@ -152,7 +152,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
@Override
public boolean equals(Object obj) {
- return (obj instanceof ExactACcounts) ? Arrays.equals(counts, ((ExactACcounts)obj).counts) : false;
+ return (obj instanceof ExactACcounts) && Arrays.equals(counts, ((ExactACcounts)obj).counts);
}
@Override
@@ -202,7 +202,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
}
public boolean equals(Object obj) {
- return (obj instanceof ExactACset) ? ACcounts.equals(((ExactACset)obj).ACcounts) : false;
+ return (obj instanceof ExactACset) && ACcounts.equals(((ExactACset)obj).ACcounts);
}
}
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java
index fb2428258..7527e17b6 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java
@@ -47,9 +47,17 @@ import java.util.Map;
*/
public abstract class GenotypeLikelihoodsCalculationModel implements Cloneable {
+/* public enum Model {
+ SNP,
+ INDEL,
+ BOTH
+ }
+ */
public enum Model {
SNP,
INDEL,
+ POOLSNP,
+ POOLINDEL,
BOTH
}
@@ -60,7 +68,7 @@ public abstract class GenotypeLikelihoodsCalculationModel implements Cloneable {
GENOTYPE_GIVEN_ALLELES
}
- protected UnifiedArgumentCollection UAC;
+ protected final UnifiedArgumentCollection UAC;
protected Logger logger;
/**
@@ -70,7 +78,7 @@ public abstract class GenotypeLikelihoodsCalculationModel implements Cloneable {
*/
protected GenotypeLikelihoodsCalculationModel(UnifiedArgumentCollection UAC, Logger logger) {
if ( logger == null || UAC == null ) throw new ReviewedStingException("Bad arguments");
- this.UAC = UAC.clone();
+ this.UAC = UAC;
this.logger = logger;
}
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java
index 7b8e5c897..58b8af493 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java
@@ -38,7 +38,7 @@ public class UnifiedArgumentCollection {
* Controls the model used to calculate the probability that a site is variant plus the various sample genotypes in the data at a given locus.
*/
@Argument(fullName = "p_nonref_model", shortName = "pnrm", doc = "Non-reference probability calculation model to employ -- EXACT is the default option, while GRID_SEARCH is also available.", required = false)
- public AlleleFrequencyCalculationModel.Model AFmodel = AlleleFrequencyCalculationModel.Model.EXACT;
+ protected AlleleFrequencyCalculationModel.Model AFmodel = AlleleFrequencyCalculationModel.Model.EXACT;
/**
* The expected heterozygosity value used to compute prior likelihoods for any locus. The default priors are:
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java
index a04aef77b..bf482f5d7 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java
@@ -222,7 +222,7 @@ public class UnifiedGenotyper extends LocusWalker headerInfo = getHeaderInfo();
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java
index 4f1c64001..39745507c 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java
@@ -36,14 +36,17 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotatorEngine;
import org.broadinstitute.sting.utils.*;
import org.broadinstitute.sting.utils.baq.BAQ;
+import org.broadinstitute.sting.utils.classloader.PluginManager;
import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
+import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.pileup.PileupElement;
import org.broadinstitute.sting.utils.pileup.ReadBackedExtendedEventPileup;
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
import org.broadinstitute.sting.utils.variantcontext.*;
import java.io.PrintStream;
+import java.lang.reflect.Constructor;
import java.util.*;
public class UnifiedGenotyperEngine {
@@ -71,7 +74,7 @@ public class UnifiedGenotyperEngine {
private final VariantAnnotatorEngine annotationEngine;
// the model used for calculating genotypes
- private ThreadLocal