Package phase
Class CodedSteps
- java.lang.Object
-
- phase.CodedSteps
-
public class CodedSteps extends java.lang.Object
Class
CodedSteps
divides 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 newCodedSteps
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexArray
get(int step)
Returns a map from haplotype index to allele sequence index for the specified stepint
nHaps()
Returns the number of target and reference haplotypes.int
nMarkers()
Returns the number of markersint
nSteps()
Returns the number of steps.int
nTargHaps()
Returns the number of target haplotypes.int
stepEnd(int step)
Returns the last marker index (exclusive) in the specified step.int
stepStart(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 newCodedSteps
instance from the specified data.- Parameters:
targGT
- the phased target genotype datarefGT
- the phased phased reference genotype data ornull
if 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()) == false
java.lang.IllegalArgumentException
- ifstep <= 0.0 || Double.isFinite(step) == false
java.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()
-
-