While this fix worked for the evaluator module, it could potentially have bad effects in the phasing walkers. Special-case nocalls in the PhasingEvaluator and return AllelePair to previous state.
This commit is contained in:
parent
9c6fda7e15
commit
673ceadd11
|
|
@ -35,10 +35,6 @@ public class AllelePair {
|
|||
private Allele bottom;
|
||||
|
||||
public AllelePair(Genotype gt) {
|
||||
if ( gt.isNoCall() ) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
if (gt.getPloidy() != 2)
|
||||
throw new ReviewedStingException("AllelePair must have ploidy of 2! incoming gt was"+gt.toBriefString());
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ public class GenotypePhasingEvaluator extends VariantEvaluator {
|
|||
if (evalSampGenotypes != null)
|
||||
evalSampGt = evalSampGenotypes.get(samp);
|
||||
|
||||
if (compSampGt == null || evalSampGt == null) { // Since either comp or eval (or both) are missing the site, the best we can do is hope to preserve phase [if the non-missing one preserves phase]
|
||||
if (compSampGt == null || evalSampGt == null || compSampGt.isNoCall() || evalSampGt.isNoCall()) { // Since either comp or eval (or both) are missing the site, the best we can do is hope to preserve phase [if the non-missing one preserves phase]
|
||||
// Having an unphased site breaks the phasing for the sample [does NOT permit "transitive phasing"] - hence, must reset phasing knowledge for both comp and eval [put a null CompEvalGenotypes]:
|
||||
if (isNonNullButUnphased(compSampGt) || isNonNullButUnphased(evalSampGt))
|
||||
samplePrevGenotypes.put(samp, null);
|
||||
|
|
@ -209,7 +209,7 @@ public class GenotypePhasingEvaluator extends VariantEvaluator {
|
|||
}
|
||||
|
||||
public boolean isNonNullButUnphased(Genotype gt) {
|
||||
return (gt != null && !genotypesArePhasedAboveThreshold(gt));
|
||||
return (gt != null && !gt.isNoCall() && !genotypesArePhasedAboveThreshold(gt));
|
||||
}
|
||||
|
||||
public boolean genotypesArePhasedAboveThreshold(Genotype gt) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue