Package phase

Class BestMatch


  • public class BestMatch
    extends java.lang.Object

    Class BestMatch has methods for finding a haplotype that shares a long IBS sequence containing a specified genomic interval with a target haplotype and that originates from a sample which carries a rare variant in the specified genomic interval that is also carried by the target sample.

    Instances of BestMatch are immutable.

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int[] bwdMatch​(int step)
      Returns an array mapping each target haplotype to a matching haplotype.
      CodedSteps codedSteps()
      Returns the coded steps.
      int[] fwdMatch​(int step)
      Returns an array mapping each target haplotype to a matching haplotype.
      • Methods inherited from class java.lang.Object

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

      • BestMatch

        public BestMatch​(PhaseData phaseData)
        Constructs a new BestMatch instance from the specified data
        Parameters:
        phaseData - the input data for the next phase update
        Throws:
        java.lang.IllegalArgumentException - if fpd.hiFreqTargGT() != codedSteps.phaseData().targGT()
        java.lang.NullPointerException - if phaseData == null
    • Method Detail

      • codedSteps

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

        public int[] fwdMatch​(int step)
        Returns an array mapping each target haplotype to a matching haplotype. The target and mathching haplotypes must originate from distinct samples that carry a shared low frequency variant in a specified genomic interval and that share a long IBS sequence in the forward direction containing the specified genomic interval. The target haplotype is mapped to -1 if no such matching haplotype exists.
        Parameters:
        step - a step index
        Returns:
        return an array mapping each target haplotypes to a matching haplotype or to -1
        Throws:
        java.lang.IndexOutOfBoundsException - if step < 0 || step >= this.codedSteps().nSteps()
      • bwdMatch

        public int[] bwdMatch​(int step)
        Returns an array mapping each target haplotype to a matching haplotype. The target and mathching haplotypes must originate from distinct samples that carry a shared low frequency variant in a specified genomic interval and that share a long IBS sequence in the backward direction containing the specified genomic interval. The target haplotype is mapped to -1 if no such matching haplotype exists.
        Parameters:
        step - a step index
        Returns:
        return an array mapping each target haplotypes to a matching haplotype or to -1
        Throws:
        java.lang.IndexOutOfBoundsException - if step < 0 || step >= this.codedSteps().nSteps()