Package imp
Class HaplotypeCoder
java.lang.Object
imp.HaplotypeCoder
Class HaplotypeCoder
indexes the observed allele sequences
in phased reference and target genotype data in a chromosome interval.
Instances of class HaplotypeCoder
are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionHaplotypeCoder
(RefGT restrictRefGT, GT phasedTarg) Constructs a newHaplotypeCoder
instance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionReturns the phased reference genotypes at the target markers.run
(int start, int end) Returns an array mapping haplotype indices to allele sequence indices in the specified marker interval.Returns the phased target genotypes.
-
Constructor Details
-
HaplotypeCoder
Constructs a newHaplotypeCoder
instance from the specified data.- Parameters:
restrictRefGT
- the phased reference genotypes at the target markersphasedTarg
- the phased target genotypes- Throws:
IllegalArgumentException
- ifrefHapPairs.markers().equals(targetHapPairs.markers()) == false
NullPointerException
- ifrefHapPairs == null || targetHapPairs == null
-
-
Method Details
-
refHapPairs
Returns the phased reference genotypes at the target markers.- Returns:
- the phased reference genotypes at the target markers
-
targHapPairs
Returns the phased target genotypes.- Returns:
- the phased target genotypes
-
run
Returns an array mapping haplotype indices to allele sequence indices in the specified marker interval. The target haplotype indices are shifted by the number of reference haplotypes in the returned array. Thus the first target haplotype index isthis.refHapPairs.nHaps()
and the last target haplotype index is(this.refHapPairs.nHaps() + this.targHapPairs().nHaps() - 1)
.- Parameters:
start
- the first marker index (inclusive)end
- the last marker index (exclusive)- Returns:
- an array mapping haplotype indices to allele sequence indices
- Throws:
IllegalArgumentException
- ifstart >= end
IndexOutOfBoundsException
- ifstart < 0 || end >= this.refHapPairs.nMarkers()
-