Package phase
Class Stage2Haps
java.lang.Object
phase.Stage2Haps
Class Stage2Haps
stores phased genotypes.
Instances of Stage2Haps
are thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionStage2Haps
(PhaseData phaseData) Constructs a newStage2Haps
instance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionfpd()
Returns the input data for phasing that is the same in each iteration.void
setPhasedGT
(int marker, int sample, int a1, int a2) Sets the phased genotype if the specified marker was not phased in the first stage.toBasicGT
(int start, int end) Returns aBasicGT
instance containing phased genotypes for the specified markers.GTRec[]
toGTRecs
(int start, int end) Returns aGTRec[]
instance containing phased genotypes for the specified markers.
-
Constructor Details
-
Stage2Haps
Constructs a newStage2Haps
instance from the specified data.- Parameters:
phaseData
- the current genotype phase estimates and parameter values- Throws:
NullPointerException
- ifphaseData == null
-
-
Method Details
-
fpd
Returns the input data for phasing that is the same in each iteration.- Returns:
- the input data for phasing that is the same in each iteration
-
setPhasedGT
public void setPhasedGT(int marker, int sample, int a1, int a2) Sets the phased genotype if the specified marker was not phased in the first stage. The contract for this method is unspecified if the specified alleles are inconsistent withthis.fpd().targGT()
.- Parameters:
marker
- a marker indexsample
- a sample indexa1
- the first allele indexa2
- the second allele index- Throws:
IndexOutOfBoundsException
- ifmarker < 0 || marker >= this.fpd().targGT().markers().size()
IndexOutOfBoundsException
- ifsample < 0 || sample >= this.fpd().targGT().samples().size()
IndexOutOfBoundsException
- ifa1 < 0 || a1 >= this.fpd().targGT().markers().marker(marker).nAlleles()
IndexOutOfBoundsException
- ifa2 < 0 || a2 >= this.fpd().targGT().markers().marker(marker).nAlleles()
-
toBasicGT
Returns aBasicGT
instance containing phased genotypes for the specified markers.- Parameters:
start
- the starting marker index (inclusive)end
- the ending marker index (exclusive)- Returns:
- a
BasicGT
instance containing phased genotypes for the specified range of marker indices - Throws:
IndexOutOfBoundsException
- ifstart < 0 || end > this.nMarkers()
IllegalArgumentException
- ifstart >= end
-
toGTRecs
Returns aGTRec[]
instance containing phased genotypes for the specified markers.- Parameters:
start
- the starting marker index (inclusive)end
- the ending marker index (exclusive)- Returns:
- a
GTRec[]
instance containing phased genotypes for the specified range of marker indices - Throws:
IndexOutOfBoundsException
- ifstart < 0 || end > this.nMarkers()
IllegalArgumentException
- ifstart >= end
-