public interface AlleleList<A extends htsjdk.variant.variantcontext.Allele>
Modifier and Type | Interface and Description |
---|---|
static class |
AlleleList.ActualPermutation<A extends htsjdk.variant.variantcontext.Allele> |
static class |
AlleleList.NonPermutation<A extends htsjdk.variant.variantcontext.Allele>
This is the identity permutation.
|
Modifier and Type | Field and Description |
---|---|
static AlleleList |
EMPTY_LIST |
Modifier and Type | Method and Description |
---|---|
default java.util.List<A> |
asListOfAlleles()
Returns a
List unmodifiable view of this allele-list |
default boolean |
containsAllele(A allele)
Returns
true if this AlleleList contains the specified allele
and false otherwise. |
static <A extends htsjdk.variant.variantcontext.Allele> |
emptyAlleleList()
Returns an unmodifiable empty allele-list.
|
static <A extends htsjdk.variant.variantcontext.Allele> |
equals(AlleleList<A> first,
AlleleList<A> second)
Checks whether two allele lists are in fact the same.
|
A |
getAllele(int index)
Returns the allele at the given index in this AlleleList.
|
int |
indexOfAllele(A allele)
Returns the index of the given Allele in this AlleleList.
|
default int |
indexOfReference()
Resolves the index of the reference allele in an allele-list.
|
int |
numberOfAlleles()
Returns the number of alleles in this AlleleList.
|
default AlleleListPermutation<A> |
permutation(AlleleList<A> target)
Returns a permutation between two allele lists.
|
static final AlleleList EMPTY_LIST
int numberOfAlleles()
int indexOfAllele(A allele)
java.lang.IllegalArgumentException
- if allele is null.A getAllele(int index)
java.lang.IllegalArgumentException
- if index is negative or equal
to or higher than the number of elements in this AlleleList numberOfAlleles()
).default boolean containsAllele(A allele)
true
if this AlleleList contains the specified allele
and false
otherwise.static <A extends htsjdk.variant.variantcontext.Allele> AlleleList<A> emptyAlleleList()
A
- the allele class.null
.static <A extends htsjdk.variant.variantcontext.Allele> boolean equals(AlleleList<A> first, AlleleList<A> second)
first
- one list to compare.second
- another list to compare.true
iff both list are equal.java.lang.IllegalArgumentException
- if if either list is null
.default int indexOfReference()
If there is no reference allele, it returns -1. If there is more than one reference allele, it returns the first occurrence (lowest index).
list.alleleCount()
).java.lang.IllegalArgumentException
- if list
is null
.default java.util.List<A> asListOfAlleles()
List
unmodifiable view of this allele-listnull
.default AlleleListPermutation<A> permutation(AlleleList<A> target)
target
- the target allele list.null
java.lang.IllegalArgumentException
- if target
is null
, or
elements in target
is not contained in this