1. output grep-able strings for genotype eval

2. free DB coverage from isSNP restriction


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1322 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-07-27 17:36:59 +00:00
parent 1bca9409a4
commit 089ae85be7
2 changed files with 14 additions and 9 deletions

View File

@ -94,7 +94,7 @@ public class GenotypeConcordance extends BasicVariantAnalysis implements Genotyp
StringBuffer sb = new StringBuffer();
sb.append(TRUTH_NAMES[i] + "\t");
for (int j=0; j < 4; j++)
sb.append(cellToString(table[i][j], truth_totals[i]) + "\t\t");
sb.append(table[i][j] +" (" + cellPercent(table[i][j], truth_totals[i]) + ")\t\t");
sb.append(truth_totals[i]);
s.add(sb.toString());
}
@ -104,21 +104,28 @@ public class GenotypeConcordance extends BasicVariantAnalysis implements Genotyp
StringBuffer sb = new StringBuffer();
sb.append(TRUTH_NAMES[i] + "\t");
for (int j=0; j < 4; j++)
sb.append(cellToString(table[i][j], truth_totals[i]) + "\t\t");
sb.append(table[i][j] + " (" + cellPercent(table[i][j], calls_totals[j]) + ")\t\t");
s.add(sb.toString());
}
s.add(String.format("TOTALS\t%d\t\t%d\t\t%d\t\t%d", calls_totals[CALL_REF], calls_totals[CALL_VAR_HET], calls_totals[CALL_VAR_HOM], calls_totals[NO_CALL]));
s.add("\n");
for (int i=0; i < 4; i++) {
for (int j=0; j < 4; j++) {
s.add(TRUTH_NAMES[i]+"_"+CALL_NAMES[j]+"_COUNT "+table[i][j]);
s.add(TRUTH_NAMES[i]+"_"+CALL_NAMES[j]+"_PERCENT_OF_TRUTH "+cellPercent(table[i][j], truth_totals[i]));
s.add(TRUTH_NAMES[i]+"_"+CALL_NAMES[j]+"_PERCENT_OF_CALLS "+cellPercent(table[i][j], calls_totals[j]));
}
}
return s;
}
private static String cellToString(int count, int total) {
private static String cellPercent(int count, int total) {
StringBuffer sb = new StringBuffer();
sb.append(count + " (");
if ( total == 0 )
sb.append(0);
else
sb.append(100*count/total);
sb.append("%)");
sb.append("%");
return sb.toString();
}

View File

@ -4,9 +4,7 @@ import org.broadinstitute.sting.gatk.refdata.AllelicVariant;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.LocusContext;
import java.io.PrintStream;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
/**
@ -53,8 +51,8 @@ public class VariantDBCoverage extends BasicVariantAnalysis implements GenotypeA
public String update(AllelicVariant eval, RefMetaDataTracker tracker, char ref, LocusContext context) {
// There are four cases here:
AllelicVariant dbsnp = (AllelicVariant)tracker.lookup(dbName, null);
inc(dbsnp != null, eval != null && eval.isSNP());
return dbsnp == null && eval != null && eval.isSNP() ? "Novel " + eval : null;
inc(dbsnp != null, eval != null);
return dbsnp == null && eval != null ? "Novel " + eval : null;
}
/**