Package phase
Class Stage2Haps
- java.lang.Object
-
- phase.Stage2Haps
-
public class Stage2Haps extends java.lang.Object
Class
Stage2Haps
stores phased genotypes.Instances of
Stage2Haps
are thread-safe.
-
-
Constructor Summary
Constructors Constructor Description Stage2Haps(PhaseData phaseData)
Constructs a newStage2Haps
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FixedPhaseData
fpd()
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.BasicGT
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 Detail
-
Stage2Haps
public Stage2Haps(PhaseData phaseData)
Constructs a newStage2Haps
instance from the specified data.- Parameters:
phaseData
- the current genotype phase estimates and parameter values- Throws:
java.lang.NullPointerException
- ifphaseData == null
-
-
Method Detail
-
fpd
public FixedPhaseData 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:
sample
- a sample indexmarker
- a marker indexa1
- the first allele indexa2
- the second allele index- Throws:
java.lang.IndexOutOfBoundsException
- ifmarker < 0 || marker >= this.fpd().targGT().markers().size()
java.lang.IndexOutOfBoundsException
- ifsample < 0 || sample >= this.fpd().targGT().samples().size()
java.lang.IndexOutOfBoundsException
- ifa1 < 0 || a1 >= this.fpd().targGT().markers().marker(marker).nAlleles()
java.lang.IndexOutOfBoundsException
- ifa2 < 0 || a2 >= this.fpd().targGT().markers().marker(marker).nAlleles()
-
toBasicGT
public BasicGT toBasicGT(int start, int end)
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:
java.lang.IndexOutOfBoundsException
- ifstart < 0 || end > this.nMarkers()
java.lang.IllegalArgumentException
- ifstart >= end
-
toGTRecs
public GTRec[] toGTRecs(int start, int end)
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:
java.lang.IndexOutOfBoundsException
- ifstart < 0 || end > this.nMarkers()
java.lang.IllegalArgumentException
- ifstart >= end
-
-