diff --git a/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java b/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java index 92252c39e..d9e6782e5 100755 --- a/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java +++ b/java/src/org/broadinstitute/sting/gatk/report/GATKReport.java @@ -24,11 +24,21 @@ public class GATKReport { tables.put(tableName, table); } + /** + * Return true if table with a given name exists + * + * @param tableName the name of the table + * @return true if the table exists, false otherwise + */ + public boolean hasTable(String tableName) { + return tables.containsKey(tableName); + } + /** * Return a table with a given name * * @param tableName the name of the table - * @return the name of the table + * @return the table object */ public GATKReportTable getTable(String tableName) { return tables.get(tableName); diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java index eba88c972..c062dbe22 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java @@ -747,21 +747,26 @@ public class NewVariantEvalWalker extends RodWalker implements String subTableName = ve.getClass().getSimpleName() + "." + field.getName(); String subTableDesc = datamap.get(field).description(); - report.addTable(subTableName, subTableDesc); - GATKReportTable table = report.getTable(subTableName); + GATKReportTable table; + if (!report.hasTable(subTableName)) { + report.addTable(subTableName, subTableDesc); + table = report.getTable(subTableName); - table.addPrimaryKey("entry", false); - table.addColumn(subTableName, subTableName); + table.addPrimaryKey("entry", false); + table.addColumn(subTableName, subTableName); - for ( VariantStratifier vs : stratificationObjects ) { - String columnName = vs.getClass().getSimpleName(); + for ( VariantStratifier vs : stratificationObjects ) { + String columnName = vs.getClass().getSimpleName(); - table.addColumn(columnName, "unknown"); - } + table.addColumn(columnName, "unknown"); + } - for ( Object o : t.getColumnKeys() ) { - String c = (String) o; - table.addColumn(c, 0.0); + for ( Object o : t.getColumnKeys() ) { + String c = (String) o; + table.addColumn(c, 0.0); + } + } else { + table = report.getTable(subTableName); } for (int row = 0; row < t.getRowKeys().length; row++) { diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java index 558a7d1d3..da54034ab 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java @@ -258,11 +258,18 @@ public class GenotypeConcordance extends VariantEvaluator { qualityScoreHistograms = new QualityScoreHistograms(); } - if ( alleleCountStats == null && eval != null && validation != null ) { + if ( alleleCountStats == null && eval != null && validation != null && validation.getSampleNames().size() > 0) { alleleCountStats = new ACStats(eval,validation,Genotype.Type.values().length); alleleCountSummary = new ACSummaryStats(eval, validation); } + if ( alleleCountStats != null ) { +// for ( int i = 0; i <= 2*validation.getGenotypes().size(); i++ ) { +// concordanceStats.put(String.format("compAC%d",i), new long[nGenotypeTypes][nGenotypeTypes]); +// rowKeys[1+2*evalvc.getGenotypes().size()+i] = String.format("compAC%d",i); +// } + } + if (sampleStats == null) { if (eval != null) { // initialize the concordance table @@ -321,10 +328,7 @@ public class GenotypeConcordance extends VariantEvaluator { sampleStats.incrValue(sample, truth, called); if ( evalAC != null && validationAC != null) { alleleCountStats.incrValue(evalAC,truth,called); - - //System.err.println(evalAC + " " + validationAC); - - //alleleCountStats.incrValue(validationAC,truth,called); + alleleCountStats.incrValue(validationAC,truth,called); } } }