public class RefHapSegs
extends java.lang.Object
Class RefHapSegs
represents reference haplotypes that span
segments determined by non-overlapping clusters of markers.
Instances of class RefHapSegs
are immutable.
Constructor and Description |
---|
RefHapSegs(SampleHapPairs refHapPairs,
int[] segStart,
int[] segEnd)
Constructs a new
RefHapSegs instance from the specified data. |
Modifier and Type | Method and Description |
---|---|
int |
allele(int segment,
int marker,
int seq)
Return the specified reference haplotype allele.
|
int |
nMarkers(int segment)
Return the number of markers in the specified chromosome segment.
|
int |
nSegs()
Returns the number of marker segments..
|
int |
nSeq(int segment)
Return the number of distinct reference allele sequences in the
specified chromosome segment.
|
SampleHapPairs |
refHapPairs()
Returns the reference haplotype pairs.
|
int |
segEnd(int segment)
Returns the index of the last marker (exclusive) in the specified
marker segment.
|
int |
segStart(int segment)
Returns the index of the first marker (inclusive) in the specified
marker segment.
|
int |
seq(int segment,
int hap)
Return the index of the allele sequence in the specified chromosome
segment for the specified reference haplotype.
|
public RefHapSegs(SampleHapPairs refHapPairs, int[] segStart, int[] segEnd)
RefHapSegs
instance from the specified data.refHapPairs
- the reference haplotype pairssegStart
- an array whose j
-th element is the
starting reference marker index (inclusive) for the j
-th
segment of markerssegEnd
- an array whose j
-th element is the
ending reference marker index (exclusive) for the j
-th
segment of markersjava.lang.IllegalArgumentException
- if
segStart.length != segEnd.length
java.lang.IllegalArgumentException
- if
(segStart[j] < 0 || segStart[j] >= segEnd[j]
|| segEnd[j] >= refHapPairs.nMarkers())
for some j
satisfying
0 <= j && j < segStart.length
java.lang.NullPointerException
- if
refHapPairs == null || segStart == null || segEnd == null
public SampleHapPairs refHapPairs()
public int nSeq(int segment)
segment
- index of a chromosome segment determined by
the marker clustersjava.lang.IndexOutOfBoundsException
- if
segment < 0 || segment > this.nClusters()
public int nMarkers(int segment)
segment
- index of a chromosome segment determined by
the marker clustersjava.lang.IndexOutOfBoundsException
- if
segment < 0 || segment > this.nClusters()
public int seq(int segment, int hap)
segment
- index of a chromosome segment determined by
the marker clustershap
- a haplotype indexjava.lang.IndexOutOfBoundsException
- if
segment < 0 || segment > this.nClusters()
java.lang.IndexOutOfBoundsException
- if
hap < 0 || hap >= this.refHapPairs().nHaps()
public int allele(int segment, int marker, int seq)
segment
- index of a chromosome segment determined by
the marker clustersmarker
- index of a marker in the specified intervalseq
- index of a reference allele sequence in the specified
intervaljava.lang.IndexOutOfBoundsException
- if
segment < 0 || segment > this.nClusters()
java.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers(interval)
java.lang.IndexOutOfBoundsException
- if
seq < 0 || seg >= this.nSeq(segment)
public int nSegs()
public int segStart(int segment)
segment
- an index of a marker segmentjava.lang.IndexOutOfBoundsException
- if
segment < 0 || segment >= this.nSegs()
public int segEnd(int segment)
segment
- an index of a marker segmentjava.lang.IndexOutOfBoundsException
- if
segment 0 || segment >= this.nSegs()