public class Weights
extends java.lang.Object
Class Weights
represents per-haplotype weights.
Weights
are immutable.Constructor and Description |
---|
Weights(NuclearFamilies fam)
Constructs a new
Weights instance with a weight of 1.0f
for all samples. |
Weights(NuclearFamilies fam,
float nonRefWt)
Constructs a new
Weights instance with a weight of 1.0f
for reference samples, and a weight of nonRefWt for
non-reference samples. |
Modifier and Type | Method and Description |
---|---|
NuclearFamilies |
families()
Returns the parent-offspring relationships.
|
float[] |
get(HapPairs haps)
Returns an array of length
haps.nHaps() with
per-haplotype weights. |
float |
nonRefWt()
Returns the non-reference sample weight.
|
public Weights(NuclearFamilies fam)
Weights
instance with a weight of 1.0f
for all samples.fam
- the parent-offspring relationshipsjava.lang.NullPointerException
- if fam == null
public Weights(NuclearFamilies fam, float nonRefWt)
Weights
instance with a weight of 1.0f
for reference samples, and a weight of nonRefWt
for
non-reference samples. Non-reference samples are samples
which are not present in fam.samples()
.fam
- the parent-offspring datanonRefWt
- the non-reference sample weightjava.lang.IllegalArgumentException
- if
nonRefWt < 0.0f || nonRefWt > 1.0f || Float.isNaN(nonRefWt)
java.lang.NullPointerException
- if fam == null
public float[] get(HapPairs haps)
haps.nHaps()
with
per-haplotype weights. Array elements 2*j
and 2*j + 1
are the weights for the first and second haplotype in the
j
-th haplotype pair. Reference haplotypes are assigned
a weight of 1.0f
. Non-reference haplotypes are assigned
a weight of this.nonRefWt()
if the haplotype is not
inherited from a parent in the sample, and a weight of 0.01f
if the haplotype is inherited from a parent in the sample.
The first haplotype in the offspring is required to be the transmitted
transmitted haplotype for a parent-offspring duo.haps
- an array of haplotype pairsjava.lang.NullPointerException
- if hapPairs == null
public NuclearFamilies families()
public float nonRefWt()