public class RestrictedDag
extends java.lang.Object
Class RestrictedDag
is a wrapper for a Dag
object that stores segments of identity by descent.
Instances of class RestrictedDag
are immutable.
Constructor and Description |
---|
RestrictedDag(SampleHapPairs haps,
float[] weights,
int nInitLevels,
float scale,
double ibdLength,
double ibdExtend)
Constructs a
RestrictedDag instance. |
Modifier and Type | Method and Description |
---|---|
Dag |
dag()
Returns the DAG.
|
SampleHapPairs |
sampleHaps()
Returns the haplotypes used to construct
this . |
DiploidStates |
singleStates(int sample)
Returns the permitted states for the specified sample.
|
public RestrictedDag(SampleHapPairs haps, float[] weights, int nInitLevels, float scale, double ibdLength, double ibdExtend)
RestrictedDag
instance.haps
- the sample haplotypesweights
- an array of length hapPairs.nHaps()
whose j
-th element is the weight for the j
-th haplotypenInitLevels
- the number of initial levels to readscale
- a parameter that multiplicatively scales the node
similarity thresholdibdLength
- the minimum length of an IBD segmentibdExtend
- the length by which an IBD segment will be extendedjava.lang.IllegalArgumentException
- if hapPairs.nMarkers() == 0
java.lang.IllegalArgumentException
- if
weights.length != 2*haps.nSamples()
java.lang.IllegalArgumentException
- if
(weights[j] <= 0 || Float.isFinite(weights[j]) == false)
for any j
satisfying (0 <= j && j < weights.length)
java.lang.IllegalArgumentException
- if nInitLevels < 1
java.lang.IllegalArgumentException
- if
Double.isFinite(scale) == false || scale <= 0
java.lang.IllegalArgumentException
- if
ibdLength < 0 || ibdExtend < 0
java.lang.NullPointerException
- if
hapPairs == null || weights == null
public SampleHapPairs sampleHaps()
this
.this
public Dag dag()
public DiploidStates singleStates(int sample)
sample
- the sample indexjava.lang.IndexOutOfBoundsException
- if
sample < 0 || sample >= haps.nSamples()