Fixed a bug that wrongly swapped the mother and father genotypes in case the child genotype missing.
This commit is contained in:
parent
893787de53
commit
385a6abec1
|
|
@ -547,10 +547,15 @@ public class PhaseByTransmission extends RodWalker<HashMap<Byte,Integer>, HashMa
|
||||||
int parentsCalled = 0;
|
int parentsCalled = 0;
|
||||||
Map<Genotype.Type,Double> firstParentLikelihoods;
|
Map<Genotype.Type,Double> firstParentLikelihoods;
|
||||||
Map<Genotype.Type,Double> secondParentLikelihoods;
|
Map<Genotype.Type,Double> secondParentLikelihoods;
|
||||||
|
ArrayList<Genotype.Type> bestFirstParentGenotype = new ArrayList<Genotype.Type>();
|
||||||
|
ArrayList<Genotype.Type> bestSecondParentGenotype = new ArrayList<Genotype.Type>();
|
||||||
|
ArrayList<Genotype.Type> bestChildGenotype = new ArrayList<Genotype.Type>();
|
||||||
Genotype.Type pairSecondParentGenotype = null;
|
Genotype.Type pairSecondParentGenotype = null;
|
||||||
if(mother == null || !mother.isCalled()){
|
if(mother == null || !mother.isCalled()){
|
||||||
firstParentLikelihoods = getLikelihoodsAsMapSafeNull(father);
|
firstParentLikelihoods = getLikelihoodsAsMapSafeNull(father);
|
||||||
secondParentLikelihoods = getLikelihoodsAsMapSafeNull(mother);
|
secondParentLikelihoods = getLikelihoodsAsMapSafeNull(mother);
|
||||||
|
bestFirstParentGenotype.add(getTypeSafeNull(father));
|
||||||
|
bestSecondParentGenotype.add(getTypeSafeNull(mother));
|
||||||
pairSecondParentGenotype = mother == null ? Genotype.Type.UNAVAILABLE : mother.getType();
|
pairSecondParentGenotype = mother == null ? Genotype.Type.UNAVAILABLE : mother.getType();
|
||||||
if(father != null && father.isCalled())
|
if(father != null && father.isCalled())
|
||||||
parentsCalled = 1;
|
parentsCalled = 1;
|
||||||
|
|
@ -558,6 +563,8 @@ public class PhaseByTransmission extends RodWalker<HashMap<Byte,Integer>, HashMa
|
||||||
else{
|
else{
|
||||||
firstParentLikelihoods = getLikelihoodsAsMapSafeNull(mother);
|
firstParentLikelihoods = getLikelihoodsAsMapSafeNull(mother);
|
||||||
secondParentLikelihoods = getLikelihoodsAsMapSafeNull(father);
|
secondParentLikelihoods = getLikelihoodsAsMapSafeNull(father);
|
||||||
|
bestFirstParentGenotype.add(getTypeSafeNull(mother));
|
||||||
|
bestSecondParentGenotype.add(getTypeSafeNull(father));
|
||||||
if(father == null || !father.isCalled()){
|
if(father == null || !father.isCalled()){
|
||||||
parentsCalled = 1;
|
parentsCalled = 1;
|
||||||
pairSecondParentGenotype = father == null ? Genotype.Type.UNAVAILABLE : father.getType();
|
pairSecondParentGenotype = father == null ? Genotype.Type.UNAVAILABLE : father.getType();
|
||||||
|
|
@ -566,6 +573,7 @@ public class PhaseByTransmission extends RodWalker<HashMap<Byte,Integer>, HashMa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map<Genotype.Type,Double> childLikelihoods = getLikelihoodsAsMapSafeNull(child);
|
Map<Genotype.Type,Double> childLikelihoods = getLikelihoodsAsMapSafeNull(child);
|
||||||
|
bestChildGenotype.add(getTypeSafeNull(child));
|
||||||
|
|
||||||
//Prior vars
|
//Prior vars
|
||||||
double bestConfigurationLikelihood = 0.0;
|
double bestConfigurationLikelihood = 0.0;
|
||||||
|
|
@ -574,13 +582,6 @@ public class PhaseByTransmission extends RodWalker<HashMap<Byte,Integer>, HashMa
|
||||||
ArrayList<Integer> bestMVCount = new ArrayList<Integer>();
|
ArrayList<Integer> bestMVCount = new ArrayList<Integer>();
|
||||||
bestMVCount.add(0);
|
bestMVCount.add(0);
|
||||||
|
|
||||||
ArrayList<Genotype.Type> bestFirstParentGenotype = new ArrayList<Genotype.Type>();
|
|
||||||
ArrayList<Genotype.Type> bestSecondParentGenotype = new ArrayList<Genotype.Type>();
|
|
||||||
ArrayList<Genotype.Type> bestChildGenotype = new ArrayList<Genotype.Type>();
|
|
||||||
bestFirstParentGenotype.add(getTypeSafeNull(mother));
|
|
||||||
bestSecondParentGenotype.add(getTypeSafeNull(father));
|
|
||||||
bestChildGenotype.add(getTypeSafeNull(child));
|
|
||||||
|
|
||||||
//Get the most likely combination
|
//Get the most likely combination
|
||||||
//Only check for most likely combination if at least a parent and the child have genotypes
|
//Only check for most likely combination if at least a parent and the child have genotypes
|
||||||
if(child.isCalled() && parentsCalled > 0){
|
if(child.isCalled() && parentsCalled > 0){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue