Package phase
Class BestMatch
- java.lang.Object
-
- phase.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.
-
-
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.
-
-
-
Constructor Detail
-
BestMatch
public BestMatch(PhaseData phaseData)
Constructs a newBestMatch
instance from the specified data- Parameters:
phaseData
- the input data for the next phase update- Throws:
java.lang.IllegalArgumentException
- iffpd.hiFreqTargGT() != codedSteps.phaseData().targGT()
java.lang.NullPointerException
- ifphaseData == 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
- ifstep < 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
- ifstep < 0 || step >= this.codedSteps().nSteps()
-
-