More fixes for exact AF calculation model in new unified genotyper:

a) Fixed bugs in new dynamic programming-based genotyper
b) Fixed up temp hack that handles extended pileups for now.



git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4398 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
delangel 2010-10-01 02:32:50 +00:00
parent eb67aee732
commit fa9c21c020
2 changed files with 11 additions and 7 deletions

View File

@ -134,8 +134,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
protected Map<String, Genotype> generateCalls(Map<String, StratifiedAlignmentContext> contexts,
Map<String, BiallelicGenotypeLikelihoods> GLs,
int bestAFguess) {
// first experiment: refine do genotype assignment by Hardy Weinberg equilibrium assumption.
HashMap<String, Genotype> calls = new HashMap<String, Genotype>();
HashMap<String, Genotype> calls = new HashMap<String, Genotype>();
double[][] pathMetricArray = new double[GLs.size()+1][bestAFguess+1];
@ -144,6 +143,13 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
ArrayList<String> sampleIndices = new ArrayList<String>();
int sampleIdx = 0;
// todo - optimize initialization
for (int k=0; k <= bestAFguess; k++)
for (int j=0; j <= GLs.size(); j++)
pathMetricArray[j][k] = -1e30;
pathMetricArray[0][0] = 0.0;
if (SIMPLE_GREEDY_GENOTYPER) {
sampleIndices.addAll(GLs.keySet());
sampleIdx = GLs.size();
@ -222,10 +228,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
if (qual <= 0.0) {
qual = 0.0;
myAlleles.clear();
myAlleles.add(Allele.NO_CALL);
myAlleles.add(Allele.NO_CALL);
}
}
attributes.put(VCFConstants.GENOTYPE_QUALITY_KEY,String.format("%4.2f", 10*qual));

View File

@ -230,7 +230,8 @@ public class UnifiedGenotyperEngine {
// todo - temp fix until we can deal with extended events properly
//VariantContext vc = new VariantContext("UG_call", loc.getContig(), loc.getStart(), loc.getStop(), alleles, genotypes, phredScaledConfidence/10.0, passesCallThreshold(phredScaledConfidence, atTriggerTrack) ? null : filter, attributes);
VariantContext vc = new VariantContext("UG_call", loc.getContig(), loc.getStart(),
loc.getStart()+refAllele.length(), alleles, genotypes, phredScaledConfidence/10.0, passesCallThreshold(phredScaledConfidence, atTriggerTrack) ? null : filter, attributes);
Math.max(loc.getStart()+refAllele.length()-1,loc.getStart()),
alleles, genotypes, phredScaledConfidence/10.0, passesCallThreshold(phredScaledConfidence, atTriggerTrack) ? null : filter, attributes);
if ( annotationEngine != null ) {