public class HaplotypeCoder
extends java.lang.Object
Class HaplotypeCoder
indexes the observed allele sequences
in reference and target haplotype pairs for a list of consecutive markers.
Instances of class HaplotypeCoder
are immutable.
Constructor and Description |
---|
HaplotypeCoder(SampleHapPairs refHapPairs,
SampleHapPairs targetHapPairs)
Constructs a new
HaplotypeCoder instance from the specified
data. |
Modifier and Type | Method and Description |
---|---|
SampleHapPairs |
refHapPairs()
Returns the reference haplotype pairs used to construct this.
|
IntArray[] |
run(int start,
int end)
Returns a two element array whose first element maps each reference
haplotype index to the index of the allele sequence carried by that
reference haplotype, and whose second element maps each target haplotype
index to the index of the allele sequence carried by that target
haplotype.
|
SampleHapPairs |
targetHapPairs()
Returns the target haplotype pairs used to construct this.
|
public HaplotypeCoder(SampleHapPairs refHapPairs, SampleHapPairs targetHapPairs)
HaplotypeCoder
instance from the specified
data.refHapPairs
- the reference haplotype pairstargetHapPairs
- the target haplotype pairsjava.lang.IllegalArgumentException
- if
refHapPairs.markers().equals(targetHapPairs.markers()) == false
java.lang.NullPointerException
- if
refHapPairs == null || targetHapPairs == null
public SampleHapPairs refHapPairs()
public SampleHapPairs targetHapPairs()
public IntArray[] run(int start, int end)
this.refHapPairs().nHaps()
, and the size of the second
element of the returned array is this.targetHapPairs().nHaps()
start
- the first marker index (inclusive)end
- the last marker index (exclusive)java.lang.IllegalArgumentException
- if start > end
java.lang.IndexOutOfBoundsException
- if
start < 0 || end >= this.refHapPairs.nMarkers()