public class RefHapHash
extends java.lang.Object
Class RefHapHash
stores a hash code for each haplotype
in a sublist of reference haplotypes. The hash code is computed
from the allele sequence carried by the reference haplotype.
Instances of class RefHapHash
are immutable.
Constructor | Description |
---|---|
RefHapHash(java.util.concurrent.atomic.AtomicReferenceArray<StateProbs> stateProbs,
int targMarker,
RefGT refHapPairs,
int start,
int end) |
Constructs a new
RefHapHash instance for the specified data. |
Modifier and Type | Method | Description |
---|---|---|
int |
end() |
Returns the ending reference marker index (exclusive)
for the reference haplotype allele sequences.
|
int |
hap(int index) |
Return the specified haplotype in the sublist of reference haplotypes.
|
int |
hap2Index(int hap) |
Returns the index of the specified haplotype in the sublist of
reference haplotypes.
|
int |
hash(int index) |
Return a hash code computed from the allele sequence
of the specified haplotype in the sublist of reference haplotypes.
|
int |
nHaps() |
Returns the size of the sublist of reference haplotypes.
|
RefGT |
refGT() |
Returns the phased reference genotypes.
|
void |
setAlleles(int index,
int[] alleles) |
Copies the alleles between
this.start() (inclusive) and
this.end() (exclusive) of the specified haplotype in the sublist
of reference haplotypes to the specified array. |
int |
start() |
Returns the starting reference marker index (inclusive)
for the reference haplotype allele sequences.
|
int |
targMarker() |
Returns the target marker.
|
public RefHapHash(java.util.concurrent.atomic.AtomicReferenceArray<StateProbs> stateProbs, int targMarker, RefGT refHapPairs, int start, int end)
RefHapHash
instance for the specified data.
The sublist of reference haplotypes is the ordered list of distinct
reference haplotypes with stored state probability data at the specified
target marker in the stateProbs
parameter.stateProbs
- HMM state probabilities at the genotyped
markers in the target samplestargMarker
- a target marker indexrefHapPairs
- the reference haplotypesstart
- the starting reference marker index (inclusive) for
the reference haplotype allele sequencesend
- the ending reference marker index (exclusive) for the
reference haplotype allele sequencesjava.lang.IndexOutOfBoundsException
- if targMarker < 0
java.lang.IndexOutOfBoundsException
- if there exists a j
satisfying
(0 <= j && j < stateProbs.size()) &&
(targMarker >= stateProbs.get(j).nMarkers())
java.lang.IllegalArgumentException
- if
start < 0 || start >= end || end > refHapPairs.nMarkers()
java.lang.NullPointerException
- if
stateProbs == null || refHapPairs == null
java.lang.NullPointerException
- if there exists a j
satisfying
(0 <= j && j < stateProbs.size()) && (stateProbs.get(j) == null)
public int targMarker()
public RefGT refGT()
public int start()
public int end()
public void setAlleles(int index, int[] alleles)
this.start()
(inclusive) and
this.end()
(exclusive) of the specified haplotype in the sublist
of reference haplotypes to the specified array.index
- an index in the sublist of reference haplotypesalleles
- the array to which haplotype alleles will be copiedjava.lang.IllegalArgumentException
- if
alleles.length < (this.end() - this.start())
java.lang.NullPointerException
- if alleles == null
public int nHaps()
public int hap2Index(int hap)
hap
- a reference haplotype indexpublic int hap(int index)
index
- an index in the sublist of reference haplotypespublic int hash(int index)
this.start()
(inclusive) and
this.end()
(exclusive).index
- an index in the sublist of reference haplotypes