Package phase

Class Stage2Haps

java.lang.Object
phase.Stage2Haps

public class Stage2Haps extends Object

Class Stage2Haps stores phased genotypes.

Instances of Stage2Haps are thread-safe.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Stage2Haps(PhaseData phaseData)
    Constructs a new Stage2Haps instance from the specified data.
  • Method Summary

    Modifier and Type
    Method
    Description
    fpd()
    Returns the input data for phasing that is the same in each iteration.
    void
    setPhasedGT(int marker, int sample, int a1, int a2)
    Sets the phased genotype if the specified marker was not phased in the first stage.
    toBasicGT(int start, int end)
    Returns a BasicGT instance containing phased genotypes for the specified markers.
    toGTRecs(int start, int end)
    Returns a GTRec[] instance containing phased genotypes for the specified markers.

    Methods inherited from class java.lang.Object

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

    • Stage2Haps

      public Stage2Haps(PhaseData phaseData)
      Constructs a new Stage2Haps instance from the specified data.
      Parameters:
      phaseData - the current genotype phase estimates and parameter values
      Throws:
      NullPointerException - if phaseData == null
  • Method Details

    • fpd

      public FixedPhaseData fpd()
      Returns the input data for phasing that is the same in each iteration.
      Returns:
      the input data for phasing that is the same in each iteration
    • setPhasedGT

      public void setPhasedGT(int marker, int sample, int a1, int a2)
      Sets the phased genotype if the specified marker was not phased in the first stage. The contract for this method is unspecified if the specified alleles are inconsistent with this.fpd().targGT().
      Parameters:
      marker - a marker index
      sample - a sample index
      a1 - the first allele index
      a2 - the second allele index
      Throws:
      IndexOutOfBoundsException - if marker < 0 || marker >= this.fpd().targGT().markers().size()
      IndexOutOfBoundsException - if sample < 0 || sample >= this.fpd().targGT().samples().size()
      IndexOutOfBoundsException - if a1 < 0 || a1 >= this.fpd().targGT().markers().marker(marker).nAlleles()
      IndexOutOfBoundsException - if a2 < 0 || a2 >= this.fpd().targGT().markers().marker(marker).nAlleles()
    • toBasicGT

      public BasicGT toBasicGT(int start, int end)
      Returns a BasicGT instance containing phased genotypes for the specified markers.
      Parameters:
      start - the starting marker index (inclusive)
      end - the ending marker index (exclusive)
      Returns:
      a BasicGT instance containing phased genotypes for the specified range of marker indices
      Throws:
      IndexOutOfBoundsException - if start < 0 || end > this.nMarkers()
      IllegalArgumentException - if start >= end
    • toGTRecs

      public GTRec[] toGTRecs(int start, int end)
      Returns a GTRec[] instance containing phased genotypes for the specified markers.
      Parameters:
      start - the starting marker index (inclusive)
      end - the ending marker index (exclusive)
      Returns:
      a GTRec[] instance containing phased genotypes for the specified range of marker indices
      Throws:
      IndexOutOfBoundsException - if start < 0 || end > this.nMarkers()
      IllegalArgumentException - if start >= end