public final class IbdSegment
extends java.lang.Object
Class IbdSegment represents a pair of IBD haplotype segments.
Instances of class IbdSegment are immutable.
| Constructor and Description |
|---|
IbdSegment(IntPair hapPair,
Marker start,
Marker end,
float score,
int startIndex,
int endIndex)
Constructs an new
IbdSegment instance from the specified data. |
| Modifier and Type | Method and Description |
|---|---|
Marker |
end()
Returns the ending marker (inclusive).
|
int |
endIndex()
Returns the ending marker index (inclusive) or -1 if the ending
marker index is unknown.
|
boolean |
equals(java.lang.Object o)
Compares the specified object with this
IbdSegment for
equality. |
int |
hap1()
Returns the first haplotype index.
|
int |
hap2()
Returns the second haplotype index.
|
IntPair |
hapPair()
Returns the ordered pair of haplotype indices.
|
int |
hashCode()
Returns the hash code value for this object.
|
float |
score()
Returns the IBD segment score.
|
Marker |
start()
Returns the starting marker (inclusive).
|
int |
startIndex()
Returns the starting marker index (inclusive) or -1 if the starting
marker index is unknown.
|
java.lang.String |
toString()
Returns a string representation of
this. |
public IbdSegment(IntPair hapPair, Marker start, Marker end, float score, int startIndex, int endIndex)
IbdSegment instance from the specified data.hapPair - an ordered pair of haplotype indicesstart - the starting marker for the IBD segment (inclusive)end - the ending marker for the IBD segment (inclusive)score - the score for the IBD segmentstartIndex - the starting marker index (inclusive) or -1 if
the starting marker index is unknownendIndex - the ending marker index (inclusive) or -1 if
the ending marker index is unknownjava.lang.IllegalArgumentException - if
hapPair.first() < 0 || hapPair.second() <= hapPair.first()java.lang.IllegalArgumentException - if
start.chromIndex() != end.chromIndex() || end.pos() < start.pos()java.lang.IllegalArgumentException - if
startIndex < -1 || endIndex < -1java.lang.IllegalArgumentException - if Float.isNaN(score) == truejava.lang.NullPointerException - if
hapPair == null || start == null || end == nullpublic boolean equals(java.lang.Object o)
IbdSegment for
equality. Returns true if the specified object is an
IbdSegment instance and if this IbdSegment is
equal to the specified IbdSegment, and returns
false otherwise. Two IbdSegment instances
are equal if they have equal ordered pairs of haplotype indices,
equal starting and ending markers, and equal scores.equals in class java.lang.Objecto - the reference object with which to comparetrue if this IbdSegment is
equal to the specified object.public int hashCode()
Returns the hash code value for this object. The hash code does not
depend on the values of this.startIndex() or
this.endIndex(). The hash code is defined by the following
calculation:
int hash = 5;
hash = 67 * hash + this.hapPair().hashCode();
hash = 67 * hash + this.start().hashCode();
hash = 67 * hash + this.end().hashCode();
hash = 67 * hash + Float.floatToIntBits(this.score());
hashCode in class java.lang.Objectpublic int hap1()
public int hap2()
public IntPair hapPair()
public Marker start()
public Marker end()
public float score()
public int startIndex()
public int endIndex()
public java.lang.String toString()
this. The exact
details of the representation are unspecified and subject to change.toString in class java.lang.Objectthis