public interface Marker extends java.lang.Comparable<Marker>
Interface Marker
represents a genetic marker.
All instances of class Marker
are required to be immutable.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
allele(int index)
Returns the specified allele.
|
java.lang.String[] |
alleles()
Returns the alleles.
|
java.lang.String |
chrom()
Returns the chromosome.
|
int |
chromIndex()
Returns the chromosome index.
|
int |
compareTo(Marker other)
Compares this marker with the specified marker
for order, and returns a negative integer, 0, or a positive integer
depending on whether this marker is less than, equal to,
or greater than the specified marker.
|
int |
end()
Returns the INFO END field, or -1 if there is no INFO END field.
|
boolean |
equals(java.lang.Object obj)
Returns
true if the specified object is a
Marker with the same chromosome,
position, allele lists, and INFO END field, and
returns false otherwise. |
int |
hashCode()
Returns the hash code value for this object.
|
java.lang.String |
id()
Returns the first marker identifier if there is at least
one identifier in the VCF record ID field, and returns
this.chr() + ":" + this.pos() otherwise. |
java.lang.String |
id(int index)
Returns the specified marker identifier.
|
int |
nAlleles()
Returns the number of alleles for the marker, including the REF
allele.
|
int |
nGenotypes()
Returns the number of distinct genotypes, which equals
this.nAlleles()*(1 + this.nAlleles())/2 . |
int |
nIds()
Returns the number of marker identifiers.
|
int |
pos()
Returns the chromosome position coordinate.
|
java.lang.String |
toString()
Returns a string equal to the first five tab-delimited fields
of a VCF record corresponding to this marker.
|
java.lang.String chrom()
int chromIndex()
int pos()
int nIds()
java.lang.String id(int index)
index
- a marker identifier indexjava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nIds()
java.lang.String id()
this.chr() + ":" + this.pos()
otherwise.int nAlleles()
java.lang.String allele(int index)
index
- an allele indexjava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nAlleles()
java.lang.String[] alleles()
k
-th element of the returned array
is equal to this.allele(k)
.int nGenotypes()
this.nAlleles()*(1 + this.nAlleles())/2
.int end()
boolean equals(java.lang.Object obj)
true
if the specified object is a
Marker
with the same chromosome,
position, allele lists, and INFO END field, and
returns false
otherwise. Equality does not
depend on value of the VCF record ID field.equals
in class java.lang.Object
obj
- object to be compared with this
for equalitytrue
if the specified object is a
Marker
with the same chromosome,
position, and allele lists, and INFO END fieldint hashCode()
Returns the hash code value for this object. The hash code does not depend on value of the VCF record ID field. The hash code is defined by the following calculation:
int hash = 5; hash = 29 * hash + this.chromIndex(); hash = 29 * hash + this.pos(); for (int j=0, n=this.nAlleles(); j<n; ++j) { hash = 29 * hash + alleles[j].hashCode(); } hash = 29 * hash + end();
hashCode
in class java.lang.Object
int compareTo(Marker other)
String compareTo()
method.compareTo
in interface java.lang.Comparable<Marker>
other
- the Marker
to be comparedjava.lang.String toString()
toString
in class java.lang.Object