HC GenotypingEngine marginalizes over haplotypes when outputing events that were found on a subset of the called haplotypes.
This commit is contained in:
parent
78a4e7e45e
commit
1da8928407
|
|
@ -39,6 +39,7 @@ public class Haplotype {
|
||||||
protected final double[] quals;
|
protected final double[] quals;
|
||||||
private GenomeLoc genomeLocation = null;
|
private GenomeLoc genomeLocation = null;
|
||||||
private HashMap<String, double[]> readLikelihoodsPerSample = 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
|
* 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();
|
return readLikelihoodsPerSample.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isReference() {
|
||||||
|
return isRef;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsReference( boolean isRef ) {
|
||||||
|
this.isRef = isRef;
|
||||||
|
}
|
||||||
|
|
||||||
public double getQualitySum() {
|
public double getQualitySum() {
|
||||||
double s = 0;
|
double s = 0;
|
||||||
for (int k=0; k < bases.length; k++) {
|
for (int k=0; k < bases.length; k++) {
|
||||||
|
|
|
||||||
|
|
@ -656,12 +656,21 @@ public class VariantContext implements Feature { // to enable tribble intergrati
|
||||||
return alleles.get(i+1);
|
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
|
* @param other VariantContext whose alternate alleles to compare against
|
||||||
* @return true if this VariantContext has the same alternate alleles as other,
|
* @return true if this VariantContext has the same alternate alleles as other,
|
||||||
* regardless of ordering. Otherwise returns false.
|
* regardless of ordering. Otherwise returns false.
|
||||||
*/
|
*/
|
||||||
public boolean hasSameAlternateAllelesAs ( VariantContext other ) {
|
public boolean hasSameAlternateAllelesAs ( final VariantContext other ) {
|
||||||
List<Allele> thisAlternateAlleles = getAlternateAlleles();
|
List<Allele> thisAlternateAlleles = getAlternateAlleles();
|
||||||
List<Allele> otherAlternateAlleles = other.getAlternateAlleles();
|
List<Allele> otherAlternateAlleles = other.getAlternateAlleles();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue