Package phase
Class AlleleImputer
- java.lang.Object
-
- phase.AlleleImputer
-
public final class AlleleImputer extends java.lang.ObjectClass
AlleleImputerimputes alleles from marker allele frequencies.Instances of class
AlleleImputerare immutable.
-
-
Constructor Summary
Constructors Constructor Description AlleleImputer(GT targ, GT ref, long seed)Constructs a newAlleleImputerinstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intimputeAllele(int marker, java.util.Random rand)Returns an imputed allele for the specified marker.intnMarkers()Returns the number of markers.
-
-
-
Constructor Detail
-
AlleleImputer
public AlleleImputer(GT targ, GT ref, long seed)
Constructs a newAlleleImputerinstance from the specified data.- Parameters:
ref- the reference genotypes, ornullif there are nonetarg- the target genotypesseed- the seed for random number generation- Throws:
java.lang.IllegalArgumentException- ifref.markers().equals(targ.markers()) == falsejava.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
-
-