diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/AllelicVariant.java b/java/src/org/broadinstitute/sting/gatk/refdata/AllelicVariant.java index 720f5bc09..99160d2e0 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/AllelicVariant.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/AllelicVariant.java @@ -119,4 +119,12 @@ public interface AllelicVariant extends Comparable { * @return */ int getPloidy() throws IllegalStateException; + + /** Returns true if the site has at most two known or observed alleles (ref and non-ref), or false if there are > 2 allelic variants known or observed. When + * the implementing class is a genotype, alleles should be always counted including the reference allele whether it was observed in the particular + * individual or not: i.e. if the reference is 'C', then both 'CA' and 'AA' genotypes must be reported as bi-allelic, while 'AT' is not bi-allelic (since there are + * two allelic variants, 'A' and 'T' in addition to the (known) reference variant 'C'). + * @return + */ + boolean isBiallelic() ; } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/rodDbSNP.java b/java/src/org/broadinstitute/sting/gatk/refdata/rodDbSNP.java index 286b02b31..d62c9d067 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/rodDbSNP.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/rodDbSNP.java @@ -222,4 +222,10 @@ public class rodDbSNP extends ReferenceOrderedDatum implements AllelicVariant { // TODO Auto-generated method stub return false; } + + @Override + public boolean isBiallelic() { + // TODO Auto-generated method stub + return observed.indexOf('/')==observed.lastIndexOf('/'); + } }