Package imp
Class HaplotypeCoder
- java.lang.Object
-
- imp.HaplotypeCoder
-
public class HaplotypeCoder extends java.lang.Object
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
Constructors Constructor Description HaplotypeCoder(RefGT restrictRefGT, GT phasedTarg)
Constructs a newHaplotypeCoder
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RefGT
refHapPairs()
Returns the phased reference genotypes at the target markers.IndexArray
run(int start, int end)
Returns an array mapping haplotype indices to allele sequence indices in the specified marker interval.GT
targHapPairs()
Returns the phased target genotypes.
-
-
-
Constructor Detail
-
HaplotypeCoder
public HaplotypeCoder(RefGT restrictRefGT, GT phasedTarg)
Constructs a newHaplotypeCoder
instance from the specified data.- Parameters:
restrictRefGT
- the phased reference genotypes at the target markersphasedTarg
- the phased target genotypes- Throws:
java.lang.IllegalArgumentException
- ifrefHapPairs.markers().equals(targetHapPairs.markers()) == false
java.lang.NullPointerException
- ifrefHapPairs == null || targetHapPairs == null
-
-
Method Detail
-
refHapPairs
public RefGT refHapPairs()
Returns the phased reference genotypes at the target markers.- Returns:
- the phased reference genotypes at the target markers
-
targHapPairs
public GT targHapPairs()
Returns the phased target genotypes.- Returns:
- the phased target genotypes
-
run
public IndexArray run(int start, int end)
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:
java.lang.IllegalArgumentException
- ifstart >= end
java.lang.IndexOutOfBoundsException
- ifstart < 0 || end >= this.refHapPairs.nMarkers()
-
-