Package phase
Class AlleleImputer
- java.lang.Object
-
- phase.AlleleImputer
-
public final class AlleleImputer extends java.lang.Object
Class
AlleleImputer
imputes alleles from marker allele frequencies.Instances of class
AlleleImputer
are immutable.
-
-
Constructor Summary
Constructors Constructor Description AlleleImputer(GT targ, GT ref, long seed)
Constructs a newAlleleImputer
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
imputeAllele(int marker, java.util.Random rand)
Returns an imputed allele for the specified marker.int
nMarkers()
Returns the number of markers.
-
-
-
Constructor Detail
-
AlleleImputer
public AlleleImputer(GT targ, GT ref, long seed)
Constructs a newAlleleImputer
instance from the specified data.- Parameters:
ref
- the reference genotypes, ornull
if there are nonetarg
- the target genotypesseed
- the seed for random number generation- Throws:
java.lang.IllegalArgumentException
- ifref.markers().equals(targ.markers()) == false
java.lang.NullPointerException
- iftarg == null
-
-
Method Detail
-
nMarkers
public int nMarkers()
Returns the number of markers.- Returns:
- the number of markers
-
imputeAllele
public int imputeAllele(int marker, java.util.Random rand)
Returns an imputed allele for the specified marker.- Parameters:
marker
- a marker indexrand
- a random number generator- Returns:
- an imputed allele for the specified marker
- Throws:
java.lang.IndexOutOfBoundsException
- ifmarker < 0 || marker >= this.nMarkers()
java.lang.NullPointerException
- ifrand == null
-
-