Fixed issue where comp tracks with genotypes that didn't exactly overlap the eval track were getting dropped. Fixed issue where the 'row' column wasn't being output for things implementing TableType. This is an urgent patch for Mark - it'll break tests until I go back and update the md5s.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5374 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
1861ca90fc
commit
b42005e7d7
|
|
@ -285,6 +285,8 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
|
||||||
table.addColumn(columnName, "unknown");
|
table.addColumn(columnName, "unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.addColumn("row", "unknown");
|
||||||
|
|
||||||
for ( Object o : t.getColumnKeys() ) {
|
for ( Object o : t.getColumnKeys() ) {
|
||||||
String c;
|
String c;
|
||||||
|
|
||||||
|
|
@ -319,6 +321,8 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
|
||||||
|
|
||||||
String newStateKey = stateKey.toString() + r;
|
String newStateKey = stateKey.toString() + r;
|
||||||
table.set(newStateKey, c, t.getCell(row, col));
|
table.set(newStateKey, c, t.getCell(row, col));
|
||||||
|
|
||||||
|
table.set(newStateKey, "row", r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ public class GenotypeConcordance extends VariantEvaluator {
|
||||||
public Object[] getRowKeys() {
|
public Object[] getRowKeys() {
|
||||||
String rows[] = new String[foundMissedByAC.size()];
|
String rows[] = new String[foundMissedByAC.size()];
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (int i : foundMissedByAC.keySet()) rows[index++] = "Allele Count " + i;
|
for (int i : foundMissedByAC.keySet()) rows[index++] = "AlleleCount_" + i;
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -471,11 +471,11 @@ class SampleStats implements TableType {
|
||||||
// "n_het/ref","n_het/het","n_het/hom",
|
// "n_het/ref","n_het/het","n_het/hom",
|
||||||
// "total_true_hom","%_hom/hom","n_hom/no-call",
|
// "total_true_hom","%_hom/hom","n_hom/no-call",
|
||||||
// "n_hom/ref","n_hom/het","n_hom/hom"};
|
// "n_hom/ref","n_hom/het","n_hom/hom"};
|
||||||
return new String[]{"total_true_ref","pct_ref_vs_ref","n_ref_vs_no-call",
|
return new String[]{"total_true_ref","pct_ref_vs_ref","n_ref_vs_no_call",
|
||||||
"n_ref_vs_ref","n_ref_vs_het","n_ref_vs_hom",
|
"n_ref_vs_ref","n_ref_vs_het","n_ref_vs_hom",
|
||||||
"total_true_het","pct_het_vs_het","n_het_vs_no-call",
|
"total_true_het","pct_het_vs_het","n_het_vs_no_call",
|
||||||
"n_het_vs_ref","n_het_vs_het","n_het_vs_hom",
|
"n_het_vs_ref","n_het_vs_het","n_het_vs_hom",
|
||||||
"total_true_hom","pct_hom_vs_hom","n_hom_vs_no-call",
|
"total_true_hom","pct_hom_vs_hom","n_hom_vs_no_call",
|
||||||
"n_hom_vs_ref","n_hom_vs_het","n_hom_vs_hom"};
|
"n_hom_vs_ref","n_hom_vs_het","n_hom_vs_hom"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -560,9 +560,9 @@ class SampleSummaryStats implements TableType {
|
||||||
"percent_comp_het_called_var",
|
"percent_comp_het_called_var",
|
||||||
"percent_comp_hom_called_hom",
|
"percent_comp_hom_called_hom",
|
||||||
"percent_comp_hom_called_var",
|
"percent_comp_hom_called_var",
|
||||||
"percent_non-reference_sensitivity",
|
"percent_non_reference_sensitivity",
|
||||||
"percent_overall_genotype_concordance",
|
"percent_overall_genotype_concordance",
|
||||||
"percent_non-reference_discrepancy_rate"};
|
"percent_non_reference_discrepancy_rate"};
|
||||||
|
|
||||||
// sample to concordance stats object
|
// sample to concordance stats object
|
||||||
protected final HashMap<String, double[]> concordanceSummary = new HashMap<String, double[]>();
|
protected final HashMap<String, double[]> concordanceSummary = new HashMap<String, double[]>();
|
||||||
|
|
|
||||||
|
|
@ -342,12 +342,13 @@ public class VariantEvalUtils {
|
||||||
* @param allowableTypes a set of allowable variation types
|
* @param allowableTypes a set of allowable variation types
|
||||||
* @param byFilter if false, only accept PASSing VariantContexts. Otherwise, accept both PASSing and filtered
|
* @param byFilter if false, only accept PASSing VariantContexts. Otherwise, accept both PASSing and filtered
|
||||||
* sites
|
* sites
|
||||||
|
* @param subsetBySample if false, do not separate the track into per-sample VCs
|
||||||
* @param trackPerSample if false, don't stratify per sample (and don't cut up the VariantContext like we would need
|
* @param trackPerSample if false, don't stratify per sample (and don't cut up the VariantContext like we would need
|
||||||
* to do this)
|
* to do this)
|
||||||
* @param allowNoCalls if false, don't accept no-call loci from a variant track
|
* @param allowNoCalls if false, don't accept no-call loci from a variant track
|
||||||
* @return a mapping of track names to a list of VariantContext objects
|
* @return a mapping of track names to a list of VariantContext objects
|
||||||
*/
|
*/
|
||||||
public HashMap<String, HashMap<String, VariantContext>> bindVariantContexts(RefMetaDataTracker tracker, ReferenceContext ref, Set<String> trackNames, EnumSet<VariantContext.Type> allowableTypes, boolean byFilter, boolean trackPerSample, boolean allowNoCalls) {
|
public HashMap<String, HashMap<String, VariantContext>> bindVariantContexts(RefMetaDataTracker tracker, ReferenceContext ref, Set<String> trackNames, EnumSet<VariantContext.Type> allowableTypes, boolean byFilter, boolean subsetBySample, boolean trackPerSample, boolean allowNoCalls) {
|
||||||
HashMap<String, HashMap<String, VariantContext>> bindings = new HashMap<String, HashMap<String, VariantContext>>();
|
HashMap<String, HashMap<String, VariantContext>> bindings = new HashMap<String, HashMap<String, VariantContext>>();
|
||||||
|
|
||||||
for (String trackName : trackNames) {
|
for (String trackName : trackNames) {
|
||||||
|
|
@ -360,7 +361,7 @@ public class VariantEvalUtils {
|
||||||
if (vc != null) {
|
if (vc != null) {
|
||||||
VariantContext vcsub = vc;
|
VariantContext vcsub = vc;
|
||||||
|
|
||||||
if (vc.hasGenotypes() && vc.hasGenotypes(variantEvalWalker.getSampleNamesForEvaluation())) {
|
if (subsetBySample && vc.hasGenotypes() && vc.hasGenotypes(variantEvalWalker.getSampleNamesForEvaluation())) {
|
||||||
vcsub = getSubsetOfVariantContext(vc, variantEvalWalker.getSampleNamesForEvaluation());
|
vcsub = getSubsetOfVariantContext(vc, variantEvalWalker.getSampleNamesForEvaluation());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -411,8 +412,8 @@ public class VariantEvalUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap<String, HashMap<String, VariantContext>> evalBindings = bindVariantContexts(tracker, ref, evalNames, allowableTypes, byFilter, perSampleIsEnabled, true);
|
HashMap<String, HashMap<String, VariantContext>> evalBindings = bindVariantContexts(tracker, ref, evalNames, allowableTypes, byFilter, true, perSampleIsEnabled, true);
|
||||||
HashMap<String, HashMap<String, VariantContext>> compBindings = bindVariantContexts(tracker, ref, compNames, allowableTypes, byFilter, false, false);
|
HashMap<String, HashMap<String, VariantContext>> compBindings = bindVariantContexts(tracker, ref, compNames, allowableTypes, byFilter, false, false, false);
|
||||||
|
|
||||||
vcs.putAll(compBindings);
|
vcs.putAll(compBindings);
|
||||||
vcs.putAll(evalBindings);
|
vcs.putAll(evalBindings);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue