Package phase
Class CodedSteps
- java.lang.Object
-
- phase.CodedSteps
-
public class CodedSteps extends java.lang.ObjectClass
CodedStepsdivides phased genotype data into non-overlapping intervals (the steps), indexes the unique allele sequences in each interval, and stores a map of haplotype index to allele sequence index for each interval.
-
-
Constructor Summary
Constructors Constructor Description CodedSteps(GT targGT, GT refGT, MarkerMap map, double step, float scaleFactor, long seed)Constructs a newCodedStepsinstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexArrayget(int step)Returns a map from haplotype index to allele sequence index for the specified stepintnHaps()Returns the number of target and reference haplotypes.intnMarkers()Returns the number of markersintnSteps()Returns the number of steps.intnTargHaps()Returns the number of target haplotypes.intstepEnd(int step)Returns the last marker index (exclusive) in the specified step.intstepStart(int step)Returns the first marker index in the specified step.
-
-
-
Constructor Detail
-
CodedSteps
public CodedSteps(GT targGT, GT refGT, MarkerMap map, double step, float scaleFactor, long seed)
Constructs a newCodedStepsinstance from the specified data.- Parameters:
targGT- the phased target genotype datarefGT- the phased phased reference genotype data ornullif there is no reference datamap- the genetic mapstep- the step length in cMscaleFactor- factor by which to scale the number of stepsseed- the random seed- Throws:
java.lang.IllegalArgumentException- ifmap.genDist().size()!=targGT.nMarkers()java.lang.IllegalArgumentException- ifrefGT != null && targGT.markers().equals(refGT.markers()) == falsejava.lang.IllegalArgumentException- ifstep <= 0.0 || Double.isFinite(step) == falsejava.lang.NullPointerException- iftargGT == null || map == null
-
-
Method Detail
-
nMarkers
public int nMarkers()
Returns the number of markers- Returns:
- the number of markeres
-
nHaps
public int nHaps()
Returns the number of target and reference haplotypes.- Returns:
- the number of target and reference haplotypes
-
nTargHaps
public int nTargHaps()
Returns the number of target haplotypes.- Returns:
- the number of target haplotypes
-
nSteps
public int nSteps()
Returns the number of steps.- Returns:
- the number of steps
-
stepStart
public int stepStart(int step)
Returns the first marker index in the specified step.- Parameters:
step- a step index- Returns:
- the first marker index in the specified step
- Throws:
java.lang.IllegalArgumentException- ifstep < 0 || step >= this.nSteps()
-
stepEnd
public int stepEnd(int step)
Returns the last marker index (exclusive) in the specified step.- Parameters:
step- a step index- Returns:
- the lastt marker index (exclusive) in the specified step
- Throws:
java.lang.IllegalArgumentException- ifstep < 0 || step >= this.nSteps()
-
get
public IndexArray get(int step)
Returns a map from haplotype index to allele sequence index for the specified step- Parameters:
step- a step index- Returns:
- a map from haplotype index to allele sequence index for the specified step
- Throws:
java.lang.IllegalArgumentException- ifstep < 0 || step >= this.nSteps()
-
-