Temporary fix for case where genotype likelihoods are exactly (1,0,0) or (0,1,0) etc. at a site with new indel genotyper: this would make us blow up when converting to log space and try to assign genotypes at a site. A more robust solution is in the works.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4401 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
delangel 2010-10-01 17:43:43 +00:00
parent b83fdf8a17
commit e920badcc4
1 changed files with 8 additions and 1 deletions

View File

@ -47,6 +47,7 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo
private final double insertionEndProbability = 0.5;
private final double alphaDeletionProbability = 1e-3;
private final int HAPLOTYPE_SIZE = 80;
private static final double MINUS_INFINITY = -1e200;
// todo - the following need to be exposed for command line argument control
private final double indelHeterozygosity = 1.0/8000;
@ -125,9 +126,15 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo
double[] genotypeLikelihoods = HaplotypeIndelErrorModel.getPosteriorProbabilitesFromHaplotypeLikelihoods( haplotypeLikehoodMatrix);
// todo- cleaner solution for case where probability is of form (1,0,0) or similar
for (int k=0; k < 3; k++) {
genotypeLikelihoods[k] = Math.log10(genotypeLikelihoods[k]);
if (Double.isInfinite(genotypeLikelihoods[k]))
genotypeLikelihoods[k] = -MINUS_INFINITY;
}
GLs.put(sample.getKey(), new BiallelicGenotypeLikelihoods(sample.getKey(),vc.getReference(),
vc.getAlternateAllele(0),
Math.log10(genotypeLikelihoods[0]),Math.log10(genotypeLikelihoods[1]), Math.log10(genotypeLikelihoods[2])));
genotypeLikelihoods[0],genotypeLikelihoods[1], genotypeLikelihoods[2]));
}
}