public class Allele extends java.lang.Object implements java.lang.Comparable<Allele>
Modifier and Type | Field and Description |
---|---|
static Allele |
NO_CALL |
static java.lang.String |
NO_CALL_STRING |
Modifier | Constructor and Description |
---|---|
protected |
Allele(Allele allele,
boolean ignoreRefState)
Creates a new allele based on the provided one.
|
protected |
Allele(byte[] bases,
boolean isRef)
A generic static NO_CALL allele for use
|
protected |
Allele(java.lang.String bases,
boolean isRef) |
Modifier and Type | Method and Description |
---|---|
static boolean |
acceptableAlleleBases(byte[] bases) |
static boolean |
acceptableAlleleBases(byte[] bases,
boolean allowNsAsAcceptable) |
static boolean |
acceptableAlleleBases(java.lang.String bases) |
static boolean |
acceptableAlleleBases(java.lang.String bases,
boolean allowNsAsAcceptable) |
boolean |
basesMatch(Allele test) |
boolean |
basesMatch(byte[] test) |
boolean |
basesMatch(java.lang.String test) |
int |
compareTo(Allele other) |
static Allele |
create(Allele allele,
boolean ignoreRefState)
Creates a new allele based on the provided one.
|
static Allele |
create(byte base) |
static Allele |
create(byte[] bases)
Creates a non-Ref allele.
|
static Allele |
create(byte[] bases,
boolean isRef)
Create a new Allele that includes bases and if tagged as the reference allele if isRef == true.
|
static Allele |
create(byte base,
boolean isRef) |
static Allele |
create(java.lang.String bases)
Creates a non-Ref allele.
|
static Allele |
create(java.lang.String bases,
boolean isRef) |
boolean |
equals(Allele other,
boolean ignoreRefState)
Returns true if this and other are equal.
|
boolean |
equals(java.lang.Object other) |
static Allele |
extend(Allele left,
byte[] right) |
byte[] |
getBases()
Return the DNA bases segregating in this allele.
|
java.lang.String |
getBaseString()
Return the DNA bases segregating in this allele in String format.
|
byte[] |
getDisplayBases()
Same as #getDisplayString() but returns the result as byte[].
|
java.lang.String |
getDisplayString()
Return the printed representation of this allele.
|
static Allele |
getMatchingAllele(java.util.Collection<Allele> allAlleles,
byte[] alleleBases) |
int |
hashCode() |
boolean |
isCalled() |
boolean |
isNoCall() |
boolean |
isNonReference() |
boolean |
isReference() |
boolean |
isSymbolic() |
int |
length() |
static boolean |
oneIsPrefixOfOther(Allele a1,
Allele a2) |
java.lang.String |
toString() |
static boolean |
wouldBeNoCallAllele(byte[] bases) |
static boolean |
wouldBeNullAllele(byte[] bases) |
static boolean |
wouldBeSymbolicAllele(byte[] bases) |
public static final java.lang.String NO_CALL_STRING
public static final Allele NO_CALL
protected Allele(byte[] bases, boolean isRef)
protected Allele(java.lang.String bases, boolean isRef)
protected Allele(Allele allele, boolean ignoreRefState)
allele
- the allele from which to copy the basesignoreRefState
- should we ignore the reference state of the input allele and use the default ref state?public static Allele create(byte[] bases, boolean isRef)
bases
- the DNA sequence of this variation, '-', of '.'isRef
- should we make this a reference allele?java.lang.IllegalArgumentException
- if bases contains illegal characters or is otherwise malformatedpublic static Allele create(byte base, boolean isRef)
public static Allele create(byte base)
public static boolean wouldBeNullAllele(byte[] bases)
bases
- bases representing an allelepublic static boolean wouldBeNoCallAllele(byte[] bases)
bases
- bases representing an allelepublic static boolean wouldBeSymbolicAllele(byte[] bases)
bases
- bases representing an allelepublic static boolean acceptableAlleleBases(java.lang.String bases)
bases
- bases representing an allelepublic static boolean acceptableAlleleBases(java.lang.String bases, boolean allowNsAsAcceptable)
public static boolean acceptableAlleleBases(byte[] bases)
bases
- bases representing an allelepublic static boolean acceptableAlleleBases(byte[] bases, boolean allowNsAsAcceptable)
public static Allele create(java.lang.String bases, boolean isRef)
bases
- bases representing an alleleisRef
- is this the reference allele?Allele(byte[], boolean)
public static Allele create(java.lang.String bases)
bases
- bases representing an allelepublic static Allele create(byte[] bases)
bases
- bases representing an allelepublic static Allele create(Allele allele, boolean ignoreRefState)
allele
- the allele from which to copy the basesignoreRefState
- should we ignore the reference state of the input allele and use the default ref state?public boolean isNoCall()
public boolean isCalled()
public boolean isReference()
public boolean isNonReference()
public boolean isSymbolic()
public java.lang.String toString()
toString
in class java.lang.Object
public byte[] getBases()
public java.lang.String getBaseString()
public java.lang.String getDisplayString()
public byte[] getDisplayBases()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other allelepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(Allele other, boolean ignoreRefState)
other
- allele to compare toignoreRefState
- if true, ignore ref state in comparisonpublic boolean basesMatch(byte[] test)
test
- bases to test againstpublic boolean basesMatch(java.lang.String test)
test
- bases to test againstpublic boolean basesMatch(Allele test)
test
- allele to test againstpublic int length()
public static Allele getMatchingAllele(java.util.Collection<Allele> allAlleles, byte[] alleleBases)
public int compareTo(Allele other)
compareTo
in interface java.lang.Comparable<Allele>