Fixed issue with GenotypeConcordance being initialized incorrectly when the first seen comptrack had no samples.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5102 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
58f0ecff89
commit
3e9f185dad
|
|
@ -24,11 +24,21 @@ public class GATKReport {
|
||||||
tables.put(tableName, table);
|
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
|
* Return a table with a given name
|
||||||
*
|
*
|
||||||
* @param tableName the name of the table
|
* @param tableName the name of the table
|
||||||
* @return the name of the table
|
* @return the table object
|
||||||
*/
|
*/
|
||||||
public GATKReportTable getTable(String tableName) {
|
public GATKReportTable getTable(String tableName) {
|
||||||
return tables.get(tableName);
|
return tables.get(tableName);
|
||||||
|
|
|
||||||
|
|
@ -747,21 +747,26 @@ public class NewVariantEvalWalker extends RodWalker<Integer, Integer> implements
|
||||||
String subTableName = ve.getClass().getSimpleName() + "." + field.getName();
|
String subTableName = ve.getClass().getSimpleName() + "." + field.getName();
|
||||||
String subTableDesc = datamap.get(field).description();
|
String subTableDesc = datamap.get(field).description();
|
||||||
|
|
||||||
report.addTable(subTableName, subTableDesc);
|
GATKReportTable table;
|
||||||
GATKReportTable table = report.getTable(subTableName);
|
if (!report.hasTable(subTableName)) {
|
||||||
|
report.addTable(subTableName, subTableDesc);
|
||||||
|
table = report.getTable(subTableName);
|
||||||
|
|
||||||
table.addPrimaryKey("entry", false);
|
table.addPrimaryKey("entry", false);
|
||||||
table.addColumn(subTableName, subTableName);
|
table.addColumn(subTableName, subTableName);
|
||||||
|
|
||||||
for ( VariantStratifier vs : stratificationObjects ) {
|
for ( VariantStratifier vs : stratificationObjects ) {
|
||||||
String columnName = vs.getClass().getSimpleName();
|
String columnName = vs.getClass().getSimpleName();
|
||||||
|
|
||||||
table.addColumn(columnName, "unknown");
|
table.addColumn(columnName, "unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( Object o : t.getColumnKeys() ) {
|
for ( Object o : t.getColumnKeys() ) {
|
||||||
String c = (String) o;
|
String c = (String) o;
|
||||||
table.addColumn(c, 0.0);
|
table.addColumn(c, 0.0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
table = report.getTable(subTableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int row = 0; row < t.getRowKeys().length; row++) {
|
for (int row = 0; row < t.getRowKeys().length; row++) {
|
||||||
|
|
|
||||||
|
|
@ -258,11 +258,18 @@ public class GenotypeConcordance extends VariantEvaluator {
|
||||||
qualityScoreHistograms = new QualityScoreHistograms();
|
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);
|
alleleCountStats = new ACStats(eval,validation,Genotype.Type.values().length);
|
||||||
alleleCountSummary = new ACSummaryStats(eval, validation);
|
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 (sampleStats == null) {
|
||||||
if (eval != null) {
|
if (eval != null) {
|
||||||
// initialize the concordance table
|
// initialize the concordance table
|
||||||
|
|
@ -321,10 +328,7 @@ public class GenotypeConcordance extends VariantEvaluator {
|
||||||
sampleStats.incrValue(sample, truth, called);
|
sampleStats.incrValue(sample, truth, called);
|
||||||
if ( evalAC != null && validationAC != null) {
|
if ( evalAC != null && validationAC != null) {
|
||||||
alleleCountStats.incrValue(evalAC,truth,called);
|
alleleCountStats.incrValue(evalAC,truth,called);
|
||||||
|
alleleCountStats.incrValue(validationAC,truth,called);
|
||||||
//System.err.println(evalAC + " " + validationAC);
|
|
||||||
|
|
||||||
//alleleCountStats.incrValue(validationAC,truth,called);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue