diff --git a/public/java/src/org/broadinstitute/sting/utils/Haplotype.java b/public/java/src/org/broadinstitute/sting/utils/Haplotype.java index c42742627..aa19ac9c3 100755 --- a/public/java/src/org/broadinstitute/sting/utils/Haplotype.java +++ b/public/java/src/org/broadinstitute/sting/utils/Haplotype.java @@ -39,6 +39,7 @@ public class Haplotype { protected final double[] quals; private GenomeLoc genomeLocation = null; private HashMap 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++) { diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java index f5c57ca44..0bf4c6550 100755 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java @@ -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 thisAlternateAlleles = getAlternateAlleles(); List otherAlternateAlleles = other.getAlternateAlleles();