Package phase

Class CodedSteps


  • public class CodedSteps
    extends java.lang.Object

    Class CodedSteps divides phased genotype data into non-overlapping intervals (the steps), indexes the unique allele sequences in each interval, and stores a map of haplotype index to allele sequence index for each interval.

    • Constructor Summary

      Constructors 
      Constructor Description
      CodedSteps​(GT targGT, GT refGT, MarkerMap map, double step, float scaleFactor, long seed)
      Constructs a new CodedSteps instance from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IndexArray get​(int step)
      Returns a map from haplotype index to allele sequence index for the specified step
      int nHaps()
      Returns the number of target and reference haplotypes.
      int nMarkers()
      Returns the number of markers
      int nSteps()
      Returns the number of steps.
      int nTargHaps()
      Returns the number of target haplotypes.
      int stepEnd​(int step)
      Returns the last marker index (exclusive) in the specified step.
      int stepStart​(int step)
      Returns the first marker index in the specified step.
      • Methods inherited from class java.lang.Object

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

      • CodedSteps

        public CodedSteps​(GT targGT,
                          GT refGT,
                          MarkerMap map,
                          double step,
                          float scaleFactor,
                          long seed)
        Constructs a new CodedSteps instance from the specified data.
        Parameters:
        targGT - the phased target genotype data
        refGT - the phased phased reference genotype data or null if there is no reference data
        map - the genetic map
        step - the step length in cM
        scaleFactor - factor by which to scale the number of steps
        seed - the random seed
        Throws:
        java.lang.IllegalArgumentException - if map.genDist().size()!=targGT.nMarkers()
        java.lang.IllegalArgumentException - if refGT != null && targGT.markers().equals(refGT.markers()) == false
        java.lang.IllegalArgumentException - if step <= 0.0 || Double.isFinite(step) == false
        java.lang.NullPointerException - if targGT == null || map == null
    • Method Detail

      • nMarkers

        public int nMarkers()
        Returns the number of markers
        Returns:
        the number of markeres
      • nHaps

        public int nHaps()
        Returns the number of target and reference haplotypes.
        Returns:
        the number of target and reference haplotypes
      • nTargHaps

        public int nTargHaps()
        Returns the number of target haplotypes.
        Returns:
        the number of target haplotypes
      • nSteps

        public int nSteps()
        Returns the number of steps.
        Returns:
        the number of steps
      • stepStart

        public int stepStart​(int step)
        Returns the first marker index in the specified step.
        Parameters:
        step - a step index
        Returns:
        the first marker index in the specified step
        Throws:
        java.lang.IllegalArgumentException - if step < 0 || step >= this.nSteps()
      • stepEnd

        public int stepEnd​(int step)
        Returns the last marker index (exclusive) in the specified step.
        Parameters:
        step - a step index
        Returns:
        the lastt marker index (exclusive) in the specified step
        Throws:
        java.lang.IllegalArgumentException - if step < 0 || step >= this.nSteps()
      • get

        public IndexArray get​(int step)
        Returns a map from haplotype index to allele sequence index for the specified step
        Parameters:
        step - a step index
        Returns:
        a map from haplotype index to allele sequence index for the specified step
        Throws:
        java.lang.IllegalArgumentException - if step < 0 || step >= this.nSteps()