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[] clusterStart,
int[] clusterEnd,
int nThreads)
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 |
clusterEnd(int cluster)
Returns the index of the last marker (exclusive) in the specified
marker cluster.
|
int |
clusterStart(int cluster)
Returns the index of the first marker (inclusive) in the specified
marker cluster.
|
int |
nClusters()
Returns the number of marker clusters.
|
int |
nMarkers(int segment)
Return the number of markers in the specified chromosome segment.
|
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 |
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[] clusterStart, int[] clusterEnd, int nThreads)
RefHapSegs
instance from the specified data.refHapPairs
- the reference haplotype pairsclusterStart
- an array whose j
-th element is the
starting reference marker index (inclusive) for the j
-th
marker clusterclusterEnd
- an array whose j
-th element is the
ending reference marker index (exclusive) for the j
-th
marker clusternThreads
- the number of threads to use during object constructionjava.lang.IllegalArgumentException
- if
clusterStart.length != clusterEnd.length
java.lang.IllegalArgumentException
- if
clusterStart.length > 0 && clusterStart[0] < 0
java.lang.IllegalArgumentException
- if
clusterEnd.length > 0 && clusterEnd[clusterEnd.length - 1] > nMarkers
java.lang.IllegalArgumentException
- if
clusterStart[j] >= clusterEnd[j]
for some j
satisfying
0 <= j && j < clusterStart.length
java.lang.IllegalArgumentException
- if
clusterStart[j] < clusterEnd[j-1]
for some j
satisfying
1 <= j && j < clusterStart.length
java.lang.IllegalArgumentException
- if nThreads < 0
java.lang.NullPointerException
- if
refHapPairs == null || clusterStart == null || clusterEnd == 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 clusterStart(int cluster)
cluster
- an index of a marker clusterjava.lang.IndexOutOfBoundsException
- if
cluster < 0 || cluster >= this.nClusters
public int clusterEnd(int cluster)
cluster
- an index of a marker clusterjava.lang.IndexOutOfBoundsException
- if
cluster < 0 || cluster >= this.nClusters()
public int nClusters()