Package imp

Class 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 new HaplotypeCoder 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HaplotypeCoder

        public HaplotypeCoder​(RefGT restrictRefGT,
                              GT phasedTarg)
        Constructs a new HaplotypeCoder instance from the specified data.
        Parameters:
        restrictRefGT - the phased reference genotypes at the target markers
        phasedTarg - the phased target genotypes
        Throws:
        java.lang.IllegalArgumentException - if refHapPairs.markers().equals(targetHapPairs.markers()) == false
        java.lang.NullPointerException - if refHapPairs == 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 is this.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 - if start >= end
        java.lang.IndexOutOfBoundsException - if start < 0 || end >= this.refHapPairs.nMarkers()