HC GenotypingEngine marginalizes over haplotypes when outputing events that were found on a subset of the called haplotypes.

This commit is contained in:
Ryan Poplin 2012-03-14 15:22:21 -04:00
parent 78a4e7e45e
commit 1da8928407
2 changed files with 19 additions and 1 deletions

View File

@ -39,6 +39,7 @@ public class Haplotype {
protected final double[] quals;
private GenomeLoc genomeLocation = null;
private HashMap<String, double[]> readLikelihoodsPerSample = null;
private boolean isRef = false;
/**
* Create a simple consensus sequence with provided bases and a uniform quality over all bases of qual
@ -86,6 +87,14 @@ public class Haplotype {
return readLikelihoodsPerSample.keySet();
}
public boolean isReference() {
return isRef;
}
public void setIsReference( boolean isRef ) {
this.isRef = isRef;
}
public double getQualitySum() {
double s = 0;
for (int k=0; k < bases.length; k++) {

View File

@ -656,12 +656,21 @@ public class VariantContext implements Feature { // to enable tribble intergrati
return alleles.get(i+1);
}
/**
* @param other VariantContext whose alleles to compare against
* @return true if this VariantContext has the same alleles (both ref and alts) as other,
* regardless of ordering. Otherwise returns false.
*/
public boolean hasSameAllelesAs ( final VariantContext other ) {
return hasSameAlternateAllelesAs(other) && other.getReference().equals(getReference(), false);
}
/**
* @param other VariantContext whose alternate alleles to compare against
* @return true if this VariantContext has the same alternate alleles as other,
* regardless of ordering. Otherwise returns false.
*/
public boolean hasSameAlternateAllelesAs ( VariantContext other ) {
public boolean hasSameAlternateAllelesAs ( final VariantContext other ) {
List<Allele> thisAlternateAlleles = getAlternateAlleles();
List<Allele> otherAlternateAlleles = other.getAlternateAlleles();