Quick fixes to BQSRGatherer and GATKReportTable

* when gathering, be aware that some keys will be missing from some tables.
   * when a gatktable has no elements, it should still output the header so we know it had no records
This commit is contained in:
Mauricio Carneiro 2012-03-27 22:51:21 -04:00
parent 63cf7ec7ec
commit bb36cd4adf
2 changed files with 7 additions and 7 deletions

View File

@ -177,12 +177,9 @@ public class GATKReport {
*/ */
public void print(PrintStream out) { public void print(PrintStream out) {
out.println(GATKREPORT_HEADER_PREFIX + getVersion().toString() + SEPARATOR + getTables().size()); out.println(GATKREPORT_HEADER_PREFIX + getVersion().toString() + SEPARATOR + getTables().size());
for (GATKReportTable table : tables.values()) { for (GATKReportTable table : tables.values())
if (table.getNumRows() > 0) {
table.write(out); table.write(out);
} }
}
}
public Collection<GATKReportTable> getTables() { public Collection<GATKReportTable> getTables() {
return tables.values(); return tables.values();

View File

@ -94,6 +94,9 @@ public class RecalibrationReport {
BitSet key = entry.getKey(); BitSet key = entry.getKey();
RecalDatum otherDatum = entry.getValue(); RecalDatum otherDatum = entry.getValue();
RecalDatum thisDatum = thisTable.get(key); RecalDatum thisDatum = thisTable.get(key);
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.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 thisDatum.resetCalculatedQualities(); // reset the empirical quality to make sure the user doesn't forget to recalculate it
} }