Package phase

Class PbwtIbsData

java.lang.Object
phase.PbwtIbsData

public class PbwtIbsData extends Object

Class PbwtIbsData contains parameters and data for finding haplotypes that share an IBS segment with a target haplotype.

  • Constructor Summary

    Constructors
    Constructor
    Description
    PbwtIbsData(PhaseData phaseData, CodedSteps codedSteps)
    Constructs a new PbwtIbsData instance from the specified data.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    bufferEndStep(int endStep)
    Returns the end step (exclusive) of the end buffer segment: Math.min((endStep + this.nOverlapSteps(), this.nSteps()).
    int
    bufferStartStep(int startStep)
    Returns the start step (inclusive) of the start buffer segment: Math.max((0, startStep - this.nOverlapSteps()).
    Returns the coded steps.
    int
    endStep(int batch)
    Returns the end step (exclusive) for the specified batch: Math.min((batch+1)*this.stepsPerBatch(), this.nSteps()).
    int
    Returns the number of backoff steps
    int
    Returns the number of batches.
    int
    Returns the number of candidate haplotypes
    int
    Returns the total number of target and reference haplotypes.
    int
    Returns the number of overlap steps
    int
    Returns the number of steps.
    int
    Returns the number of target haplotypes.
    int
    startStep(int batch)
    Returns the start step (inclusive) for the specified batch: (batch * this.stepsPerbatch()).
    int
    Returns the number of steps per batch

    Methods inherited from class java.lang.Object

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

    • PbwtIbsData

      public PbwtIbsData(PhaseData phaseData, CodedSteps codedSteps)
      Constructs a new PbwtIbsData instance from the specified data.
      Parameters:
      phaseData - the current genotype phase estimates and parameter values
      codedSteps - the coded steps
      Throws:
      IllegalArgumentException - if phaseData.fpd().stage1Steps() != codedSteps.steps()
      IllegalArgumentException - if phaseData.fpd().stage1XRefGT()!=codedSteps.refHaps()
      IllegalArgumentException - if phaseData.fpd().targGT().samples()!=codedSteps.targSamples()
      NullPointerException - if phaseData == null || codedSteps == null
  • Method Details

    • codedSteps

      public CodedSteps codedSteps()
      Returns the coded steps.
      Returns:
      the codedSteps
    • nHaps

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

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

      public int nCandidates()
      Returns the number of candidate haplotypes
      Returns:
      the number of candidate haploytpes
    • nSteps

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

      public int nOverlapSteps()
      Returns the number of overlap steps
      Returns:
      the number of overlap steps
    • maxBackoffSteps

      public int maxBackoffSteps()
      Returns the number of backoff steps
      Returns:
      the number of backoff steps
    • stepsPerBatch

      public int stepsPerBatch()
      Returns the number of steps per batch
      Returns:
      the number of steps per batch
    • nBatches

      public int nBatches()
      Returns the number of batches.
      Returns:
      the number of batches
    • startStep

      public int startStep(int batch)
      Returns the start step (inclusive) for the specified batch: (batch * this.stepsPerbatch()).
      Parameters:
      batch - a batch index
      Returns:
      the start step (inclusive) for the specified batch
      Throws:
      IndexOutOfBoundsException - if (batch < 0 || batch >= this.nBatches())
    • endStep

      public int endStep(int batch)
      Returns the end step (exclusive) for the specified batch: Math.min((batch+1)*this.stepsPerBatch(), this.nSteps()).
      Parameters:
      batch - a batch index
      Returns:
      the end step (exclusive) for the specified batch
      Throws:
      IndexOutOfBoundsException - if (batch < 0 || batch >= this.nBatches())
    • bufferStartStep

      public int bufferStartStep(int startStep)
      Returns the start step (inclusive) of the start buffer segment: Math.max((0, startStep - this.nOverlapSteps()).
      Parameters:
      startStep - the start step (inclusive) of a segment
      Returns:
      the start step (inclusive) of the start buffer segment
      Throws:
      IndexOutOfBoundsException - if (startStep < 0 || startStep >= this.nSteps())
    • bufferEndStep

      public int bufferEndStep(int endStep)
      Returns the end step (exclusive) of the end buffer segment: Math.min((endStep + this.nOverlapSteps(), this.nSteps()).
      Parameters:
      endStep - the end step (exclusive) of a segment
      Returns:
      the end step (exclusive) of the end buffer segment
      Throws:
      IndexOutOfBoundsException - if (endStep <= 0 || endStep > this.nSteps())