Package phase

Class FixedPhaseData

java.lang.Object
phase.FixedPhaseData

public class FixedPhaseData extends Object

Class FixedPhaseData stores immutable data for a marker window. The definition of low-frequency markers is determined by the Par.rare() method and FixedPhaseData.MAX_HIFREQ_PROP field.

Instances of class FixedPhaseData are immutable.

  • Constructor Summary

    Constructors
    Constructor
    Description
    FixedPhaseData(Par par, Pedigree ped, Window window, GT phasedOverlap)
    Constructs a new FixedPhaseData instance from the specified data.
  • Method Summary

    Modifier and Type
    Method
    Description
    carriers(int marker, int allele)
    Returns the indices of the reference and target samples for the specified low-frequency allele.
    float
    Returns the minimum cM step length for composite reference haplotype construction.
    boolean
    isLowFreq(int marker, int allele)
    Returns true if the specified allele is a low-frequency allele, and returns false otherwise.
    map()
    Returns the genetic map for the markers.
    int
    Return the sum of the number of reference and target haplotypes.
    int
    Returns the number of initial markers that have phased target genotypes due to overlap with the previous marker window.
    par()
    Return the analysis parameters.
    ped()
    Returns the parent-offspring relationships.
    int
    prevStage1Marker(int marker)
    Returns the index of the closest stage1 marker (in the list of stage1 markers) with position less than or equal to the position of the specified marker, or 0 if no such stage1 marker exists.
    float
    prevStage1Wt(int marker)
    Returns the linear interpolation weight associated with the preceding stage1 marker (see this.prevStage1Marker(marker)).
    Returns the optional phased, nonmissing reference genotypes.
    Returns the IBS2 data for the stage1 markers.
    Returns a list whose j-th element is the estimated minor allele frequency of the j-th the stage1 marker.
    Returns the genetic map for the stage1 markers.
    int
    Returns the number of stage1 markers that have phased target genotypes due to overlap with the previous window.
    Returns the optional phased, nonmissing reference genotypes for the stage1 markers.
    Returns a partition of the stage1 markers into a sequence of sets of consecutive markers (the steps).
    Returns the input target genotypes at the stage1 markers.
    Returns a map from stage1 marker index to marker index
    Returns the optional phased, nonmissing reference genotypes for the stage1 markers.
    Returns the input target genotypes.
    int
    Returns the index of the marker window.

    Methods inherited from class java.lang.Object

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

    • FixedPhaseData

      public FixedPhaseData(Par par, Pedigree ped, Window window, GT phasedOverlap)
      Constructs a new FixedPhaseData instance from the specified data.
      Parameters:
      par - the analysis parameters
      ped - the pedigree data for the target samples
      window - input data for the next marker window
      phasedOverlap - initial phased target genotypes due to overlap with the previous window or null if there are no initial phased target genotypes
      Throws:
      IllegalArgumentException - if (phasedOverlap != null && phasedOverlap.isPhased() == false)
      IllegalArgumentException - if (phasedOverlap != null && data.targGT().samples().equals(phasedOverlap.samples()) == false)
      IllegalArgumentException - if (phasedOverlap != null && data.targGT().nMarkers() < phasedOverlap.nMarkers())
      IllegalArgumentException - if (phasedOverlap != null && phasedOverlap.marker(j).equals(data.targGT().marker(j) == false) for some j satisfying (0 <= j && j <= overlapHaps.nMarkers())
      NullPointerException - if (par == null || genMap == null || data == null)
  • Method Details

    • par

      public Par par()
      Return the analysis parameters.
      Returns:
      the analysis parameters
    • window

      public int window()
      Returns the index of the marker window.
      Returns:
      the index of the marker window
    • ped

      public Pedigree ped()
      Returns the parent-offspring relationships.
      Returns:
      the parent-offspring relationships
    • map

      public MarkerMap map()
      Returns the genetic map for the markers.
      Returns:
      the genetic map for the markers
    • restrictedRefGT

      public Optional<RefGT> restrictedRefGT()
      Returns the optional phased, nonmissing reference genotypes.
      Returns:
      the optional phased, nonmissing reference genotypes
    • targGT

      public GT targGT()
      Returns the input target genotypes. The returned allele data is stored in marker-major order.
      Returns:
      the input target genotypes
    • overlap

      public int overlap()
      Returns the number of initial markers that have phased target genotypes due to overlap with the previous marker window.
      Returns:
      the number of initial markers that have phased target genotypes due to overlap with the previous marker window
    • stage1Map

      public MarkerMap stage1Map()
      Returns the genetic map for the stage1 markers.
      Returns:
      the genetic map for the stage1 markers
    • ibsStep

      public float ibsStep()
      Returns the minimum cM step length for composite reference haplotype construction.
      Returns:
      the minimum cM step length for composite reference haplotype construction
    • stage1Steps

      public Steps stage1Steps()
      Returns a partition of the stage1 markers into a sequence of sets of consecutive markers (the steps).
      Returns:
      a partition of the stage1 markers into a sequence of sets of consecutive markers (the steps)
    • stage1RefGT

      public Optional<RefGT> stage1RefGT()
      Returns the optional phased, nonmissing reference genotypes for the stage1 markers. The returned allele data is stored in marker-major order.
      Returns:
      the optional phased, nonmissing reference genotypes for the stage1 markers
    • stage1XRefGT

      public Optional<XRefGT> stage1XRefGT()
      Returns the optional phased, nonmissing reference genotypes for the stage1 markers. The returned allele data is stored in haplotype-major order.
      Returns:
      the optional phased, nonmissing reference genotypes for the stage1 markers
    • stage1TargGT

      public GT stage1TargGT()
      Returns the input target genotypes at the stage1 markers. The returned allele data is stored in marker-major order.
      Returns:
      the input target genotypes at the stage1 markers
    • stage1Maf

      public FloatArray stage1Maf()
      Returns a list whose j-th element is the estimated minor allele frequency of the j-th the stage1 marker.
      Returns:
      the estimated stage1 minor allele frequencies
    • stage1Overlap

      public int stage1Overlap()
      Returns the number of stage1 markers that have phased target genotypes due to overlap with the previous window.
      Returns:
      the number of stage1 markers that have phased target genotypes due to overlap with the previous window
    • nHaps

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

      public IntArray stage1To2()
      Returns a map from stage1 marker index to marker index
      Returns:
      a map from stage1 marker index to marker index
    • stage1Ibs2

      public Ibs2 stage1Ibs2()
      Returns the IBS2 data for the stage1 markers.
      Returns:
      the IBS2 data for the stage1 markers
    • carriers

      public IntArray carriers(int marker, int allele)
      Returns the indices of the reference and target samples for the specified low-frequency allele. The reference sample indices will be shifted by the number of target samples. so that the first reference sample will have an index equal to the number of target samples. The returned list will be sorted in order of increasing sample index. The returned array will be empty and equal to vcf.Data.ZERO_FREQ_ARRAY if the allele has no carriers, and the returned array will be empty and equal to vcf.Data.HIGH_FREQ_ARRAY if the allele is not a low-frequency allele.
      Parameters:
      marker - a marker index
      allele - an allele index for the specified marker
      Returns:
      the indices of the reference and target samples that the specified low-frequency allele
      Throws:
      IndexOutOfBoundsException - if marker < 0 || marker >= this.targGT().nMarkers()
      IndexOutOfBoundsException - if allele < 0 || allele >= this.targGT().marker(marker).nAlleles()
    • isLowFreq

      public boolean isLowFreq(int marker, int allele)
      Returns true if the specified allele is a low-frequency allele, and returns false otherwise.
      Parameters:
      marker - a marker index
      allele - an allele index for the specified marker
      Returns:
      true if the specified allele is a low-frequency allele
      Throws:
      IndexOutOfBoundsException - if marker < 0 || marker >= this.targGT().nMarkers()
      IndexOutOfBoundsException - if allele < 0 || allele >= this.targGT().marker(marker).nAlleles()
    • prevStage1Marker

      public int prevStage1Marker(int marker)
      Returns the index of the closest stage1 marker (in the list of stage1 markers) with position less than or equal to the position of the specified marker, or 0 if no such stage1 marker exists.
      Parameters:
      marker - a marker index
      Returns:
      the index of the closest preceding stage1 marker
      Throws:
      IndexOutOfBoundsException - if marker < 0 || marker >= this.targGT().nMarkers()
    • prevStage1Wt

      public float prevStage1Wt(int marker)
      Returns the linear interpolation weight associated with the preceding stage1 marker (see this.prevStage1Marker(marker)).
      Parameters:
      marker - a marker index
      Returns:
      the linear interpolation weight associated with the preceding stage1 marker
      Throws:
      IndexOutOfBoundsException - if marker < 0 || marker >= this.targGT().nMarkers()