Interface Allele
- All Superinterfaces:
Comparable<Allele>
,Serializable
- All Known Implementing Classes:
SimpleAllele
Types of alleles:
Ref: a t C g a // C is the reference base : a t G g a // C base is a G in some individuals : a t - g a // C base is deleted w.r.t. the reference : a t CAg a // A base is inserted w.r.t. the reference sequence
In these cases, where are the alleles?
- SNP polymorphism of C/G -> { C , G } -> C is the reference allele
- 1 base deletion of C -> { tC , t } -> C is the reference allele and we include the preceding reference base (null alleles are not allowed)
- 1 base insertion of A -> { C ; CA } -> C is the reference allele (because null alleles are not allowed)
Suppose I see a the following in the population:
Ref: a t C g a // C is the reference base : a t G g a // C base is a G in some individuals : a t - g a // C base is deleted w.r.t. the reference
How do I represent this? There are three segregating alleles:
{ C , G , - }
and these are represented as:
{ tC, tG, t }
Now suppose I have this more complex example:
Ref: a t C g a // C is the reference base : a t - g a : a t - - a : a t CAg a
There are actually four segregating alleles:
{ Cg , -g, --, and CAg } over bases 2-4
represented as:
{ tCg, tg, t, tCAg }
Critically, it should be possible to apply an allele to a reference sequence to create the correct haplotype sequence:
Allele + reference => haplotype
For convenience, we are going to create Alleles where the GenomeLoc of the allele is stored outside of the Allele object itself. So there's an idea of an A/C polymorphism independent of it's surrounding context. Given list of alleles it's possible to determine the "type" of the variation
A / C @ loc => SNP - / A => INDEL
If you know where allele is the reference, you can determine whether the variant is an insertion or deletion.
Alelle also supports is concept of a NO_CALL allele. This Allele represents a haplotype that couldn't be determined. This is usually represented by a '.' allele.
Note that Alleles store all bases as bytes, in **UPPER CASE**. So 'atc' == 'ATC' from the perspective of an Allele.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Allele
static final Allele
static final Allele
static final Allele
static final Allele
static final char
static final char
static final Allele
static final String
A generic static NO_CALL allele for usestatic final Allele
static final String
static final Allele
static final Allele
static final Allele
static final Allele
static final Allele
static final char
Non ref allele representationsstatic final Allele
static final String
A generic static SPAN_DEL allele for usestatic final Allele
static final Allele
static final Allele
static final Allele
static final Allele
static final char
static final char
static final Allele
static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
acceptableAlleleBases
(byte[] bases) static boolean
acceptableAlleleBases
(byte[] bases, boolean isReferenceAllele) static boolean
acceptableAlleleBases
(String bases) static boolean
acceptableAlleleBases
(String bases, boolean isReferenceAllele) boolean
basesMatch
(byte[] test) boolean
basesMatch
(Allele test) boolean
basesMatch
(String test) 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
Creates a new allele based on the provided one.static Allele
Creates a non-Ref allele.static Allele
Returns an allele with the given bases and reference status.boolean
boolean
static Allele
byte[]
getBases()
byte[]
int
hashCode()
boolean
boolean
isCalled()
boolean
isNoCall()
boolean
boolean
boolean
isPrefixOf
(Allele other) boolean
boolean
boolean
int
length()
static boolean
oneIsPrefixOfOther
(Allele a1, Allele a2) toString()
static boolean
wouldBeBreakpoint
(byte[] bases) Deprecated.static boolean
wouldBeNoCallAllele
(byte[] bases) Deprecated.static boolean
wouldBeNullAllele
(byte[] bases) Deprecated.static boolean
wouldBeSingleBreakend
(byte[] bases) Deprecated.static boolean
wouldBeStarAllele
(byte[] bases) Deprecated.static boolean
wouldBeSymbolicAllele
(byte[] bases) Deprecated.Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
NO_CALL_STRING
A generic static NO_CALL allele for use- See Also:
-
SPAN_DEL_STRING
A generic static SPAN_DEL allele for use- See Also:
-
SINGLE_BREAKEND_INDICATOR
static final char SINGLE_BREAKEND_INDICATORNon ref allele representations- See Also:
-
BREAKEND_EXTENDING_RIGHT
static final char BREAKEND_EXTENDING_RIGHT- See Also:
-
BREAKEND_EXTENDING_LEFT
static final char BREAKEND_EXTENDING_LEFT- See Also:
-
SYMBOLIC_ALLELE_START
static final char SYMBOLIC_ALLELE_START- See Also:
-
SYMBOLIC_ALLELE_END
static final char SYMBOLIC_ALLELE_END- See Also:
-
NON_REF_STRING
- See Also:
-
UNSPECIFIED_ALTERNATE_ALLELE_STRING
- See Also:
-
REF_A
-
ALT_A
-
REF_C
-
ALT_C
-
REF_G
-
ALT_G
-
REF_T
-
ALT_T
-
REF_N
-
ALT_N
-
SPAN_DEL
-
NO_CALL
-
NON_REF_ALLELE
-
UNSPECIFIED_ALTERNATE_ALLELE
-
SV_SIMPLE_DEL
-
SV_SIMPLE_INS
-
SV_SIMPLE_INV
-
SV_SIMPLE_CNV
-
SV_SIMPLE_DUP
-
-
Method Details
-
create
Create a new Allele that includes bases and if tagged as the reference allele if isRef == true. If bases == '-', a Null allele is created. If bases == '.', a no call Allele is created. If bases == '*', a spanning deletions Allele is created.- Parameters:
bases
- the DNA sequence of this variation, '-', '.', or '*'isRef
- should we make this a reference allele?- Throws:
IllegalArgumentException
- if bases contains illegal characters or is otherwise malformated
-
create
-
create
-
extend
-
wouldBeNullAllele
Deprecated.- Parameters:
bases
- bases representing an allele- Returns:
- true if the bases represent the null allele
-
wouldBeStarAllele
Deprecated.- Parameters:
bases
- bases representing an allele- Returns:
- true if the bases represent the SPAN_DEL allele
-
wouldBeNoCallAllele
Deprecated.- Parameters:
bases
- bases representing an allele- Returns:
- true if the bases represent the NO_CALL allele
-
wouldBeSymbolicAllele
Deprecated.- Parameters:
bases
- bases representing an allele- Returns:
- true if the bases represent a symbolic allele, including breakpoints and breakends
-
wouldBeBreakpoint
Deprecated.- Parameters:
bases
- bases representing an allele- Returns:
- true if the bases represent a symbolic allele in breakpoint notation, (ex: G]17:198982] or ]13:123456]T )
-
wouldBeSingleBreakend
Deprecated.- Parameters:
bases
- bases representing an allele- Returns:
- true if the bases represent a symbolic allele in single breakend notation (ex: .A or A. )
-
acceptableAlleleBases
- Parameters:
bases
- bases representing a reference allele- Returns:
- true if the bases represent the well formatted allele
-
acceptableAlleleBases
- Parameters:
bases
- bases representing an alleleisReferenceAllele
- is a reference allele- Returns:
- true if the bases represent the well formatted allele
-
acceptableAlleleBases
static boolean acceptableAlleleBases(byte[] bases) - Parameters:
bases
- bases representing a reference allele- Returns:
- true if the bases represent the well formatted allele
-
acceptableAlleleBases
static boolean acceptableAlleleBases(byte[] bases, boolean isReferenceAllele) - Parameters:
bases
- bases representing an alleleisReferenceAllele
- true if a reference allele- Returns:
- true if the bases represent the well formatted allele
-
create
Returns an allele with the given bases and reference status.- Parameters:
bases
- bases representing an alleleisRef
- is this the reference allele?
-
create
Creates a non-Ref allele. @see Allele(byte[], boolean) for full information- Parameters:
bases
- bases representing an allele
-
create
Creates a non-Ref allele. @see Allele(byte[], boolean) for full information- Parameters:
bases
- bases representing an allele
-
create
Creates a new allele based on the provided one. Ref state will be copied unless ignoreRefState is true (in which case the returned allele will be non-Ref). This method is efficient because it can skip the validation of the bases (since the original allele was already validated)- Parameters:
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?
-
oneIsPrefixOfOther
-
isPrefixOf
-
isNoCall
boolean isNoCall()- Returns:
- true if this is the NO_CALL allele
-
isCalled
boolean isCalled() -
isReference
boolean isReference()- Returns:
- true if this Allele is the reference allele
-
isNonReference
boolean isNonReference()- Returns:
- true if this Allele is not the reference allele
-
isSymbolic
boolean isSymbolic()- Returns:
- true if this Allele is symbolic (i.e. no well-defined base sequence), this includes breakpoints and breakends
-
isBreakpoint
boolean isBreakpoint()- Returns:
- true if this Allele is a breakpoint ( ex: G]17:198982] or ]13:123456]T )
-
isSingleBreakend
boolean isSingleBreakend()- Returns:
- true if this Allele is a single breakend (ex: .A or A.)
-
toString
String toString() -
getBases
byte[] getBases() -
getBaseString
String getBaseString() -
getDisplayString
String getDisplayString() -
getDisplayBases
byte[] getDisplayBases() -
equals
-
hashCode
int hashCode() -
equals
-
basesMatch
boolean basesMatch(byte[] test) -
basesMatch
-
basesMatch
-
length
int length() -
isNonRefAllele
boolean isNonRefAllele()- Returns:
- true if Allele is either
<NON_REF>
or<*>
-