Package phase
Class FixedPhaseData
java.lang.Object
phase.FixedPhaseData
Class FixedPhaseData stores immutable data for a
marker window. The definition of low-frequency markers is
determined by the Par.rare() method and
FixedPhaseData.MAX_HIFREQ_PROP field.
Instances of class FixedPhaseData are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionFixedPhaseData(Par par, Pedigree ped, Window window, GT phasedOverlap) Constructs a newFixedPhaseDatainstance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptioncarriers(int marker, int allele) Returns the indices of the reference and target samples for the specified low-frequency allele.floatibsStep()Returns the minimum cM step length for composite reference haplotype construction.booleanisLowFreq(int marker, int allele) Returnstrueif the specified allele is a low-frequency allele, and returnsfalseotherwise.map()Returns the genetic map for the markers.intnHaps()Return the sum of the number of reference and target haplotypes.intoverlap()Returns the number of initial markers that have phased target genotypes due to overlap with the previous marker window.par()Return the analysis parameters.ped()Returns the parent-offspring relationships.intprevStage1Marker(int marker) Returns the index of the closest stage1 marker (in the list of stage1 markers) with position less than or equal to the position of the specified marker, or 0 if no such stage1 marker exists.floatprevStage1Wt(int marker) Returns the linear interpolation weight associated with the preceding stage1 marker (seethis.prevStage1Marker(marker)).Returns the optional phased, nonmissing reference genotypes.Returns the IBS2 data for the stage1 markers.Returns a list whosej-th element is the estimated minor allele frequency of thej-th the stage1 marker.Returns the genetic map for the stage1 markers.intReturns the number of stage1 markers that have phased target genotypes due to overlap with the previous window.Returns the optional phased, nonmissing reference genotypes for the stage1 markers.Returns a partition of the stage1 markers into a sequence of sets of consecutive markers (the steps).Returns the input target genotypes at the stage1 markers.Returns a map from stage1 marker index to marker indexReturns the optional phased, nonmissing reference genotypes for the stage1 markers.targGT()Returns the input target genotypes.intwindow()Returns the index of the marker window.
-
Constructor Details
-
FixedPhaseData
Constructs a newFixedPhaseDatainstance from the specified data.- Parameters:
par- the analysis parametersped- the pedigree data for the target sampleswindow- input data for the next marker windowphasedOverlap- initial phased target genotypes due to overlap with the previous window ornullif there are no initial phased target genotypes- Throws:
IllegalArgumentException- if(phasedOverlap != null && phasedOverlap.isPhased() == false)IllegalArgumentException- if(phasedOverlap != null && data.targGT().samples().equals(phasedOverlap.samples()) == false)IllegalArgumentException- if(phasedOverlap != null && data.targGT().nMarkers() < phasedOverlap.nMarkers())IllegalArgumentException- if(phasedOverlap != null && phasedOverlap.marker(j).equals(data.targGT().marker(j) == false)for somejsatisfying(0 <= j && j <= overlapHaps.nMarkers())NullPointerException- if(par == null || genMap == null || data == null)
-
-
Method Details
-
par
Return the analysis parameters.- Returns:
- the analysis parameters
-
window
public int window()Returns the index of the marker window.- Returns:
- the index of the marker window
-
ped
Returns the parent-offspring relationships.- Returns:
- the parent-offspring relationships
-
map
Returns the genetic map for the markers.- Returns:
- the genetic map for the markers
-
restrictedRefGT
Returns the optional phased, nonmissing reference genotypes.- Returns:
- the optional phased, nonmissing reference genotypes
-
targGT
Returns the input target genotypes. The returned allele data is stored in marker-major order.- Returns:
- the input target genotypes
-
overlap
public int overlap()Returns the number of initial markers that have phased target genotypes due to overlap with the previous marker window.- Returns:
- the number of initial markers that have phased target genotypes due to overlap with the previous marker window
-
stage1Map
Returns the genetic map for the stage1 markers.- Returns:
- the genetic map for the stage1 markers
-
ibsStep
public float ibsStep()Returns the minimum cM step length for composite reference haplotype construction.- Returns:
- the minimum cM step length for composite reference haplotype construction
-
stage1Steps
Returns a partition of the stage1 markers into a sequence of sets of consecutive markers (the steps).- Returns:
- a partition of the stage1 markers into a sequence of sets of consecutive markers (the steps)
-
stage1RefGT
Returns the optional phased, nonmissing reference genotypes for the stage1 markers. The returned allele data is stored in marker-major order.- Returns:
- the optional phased, nonmissing reference genotypes for the stage1 markers
-
stage1XRefGT
Returns the optional phased, nonmissing reference genotypes for the stage1 markers. The returned allele data is stored in haplotype-major order.- Returns:
- the optional phased, nonmissing reference genotypes for the stage1 markers
-
stage1TargGT
Returns the input target genotypes at the stage1 markers. The returned allele data is stored in marker-major order.- Returns:
- the input target genotypes at the stage1 markers
-
stage1Maf
Returns a list whosej-th element is the estimated minor allele frequency of thej-th the stage1 marker.- Returns:
- the estimated stage1 minor allele frequencies
-
stage1Overlap
public int stage1Overlap()Returns the number of stage1 markers that have phased target genotypes due to overlap with the previous window.- Returns:
- the number of stage1 markers that have phased target genotypes due to overlap with the previous window
-
nHaps
public int nHaps()Return the sum of the number of reference and target haplotypes.- Returns:
- the sum of the number of reference and target haplotypes
-
stage1To2
Returns a map from stage1 marker index to marker index- Returns:
- a map from stage1 marker index to marker index
-
stage1Ibs2
Returns the IBS2 data for the stage1 markers.- Returns:
- the IBS2 data for the stage1 markers
-
carriers
Returns the indices of the reference and target samples for the specified low-frequency allele. The reference sample indices will be shifted by the number of target samples. so that the first reference sample will have an index equal to the number of target samples. The returned list will be sorted in order of increasing sample index. The returned array will be empty and equal tovcf.Data.ZERO_FREQ_ARRAYif the allele has no carriers, and the returned array will be empty and equal tovcf.Data.HIGH_FREQ_ARRAYif the allele is not a low-frequency allele.- Parameters:
marker- a marker indexallele- an allele index for the specified marker- Returns:
- the indices of the reference and target samples that the specified low-frequency allele
- Throws:
IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()IndexOutOfBoundsException- ifallele < 0 || allele >= this.targGT().marker(marker).nAlleles()
-
isLowFreq
public boolean isLowFreq(int marker, int allele) Returnstrueif the specified allele is a low-frequency allele, and returnsfalseotherwise.- Parameters:
marker- a marker indexallele- an allele index for the specified marker- Returns:
trueif the specified allele is a low-frequency allele- Throws:
IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()IndexOutOfBoundsException- ifallele < 0 || allele >= this.targGT().marker(marker).nAlleles()
-
prevStage1Marker
public int prevStage1Marker(int marker) Returns the index of the closest stage1 marker (in the list of stage1 markers) with position less than or equal to the position of the specified marker, or 0 if no such stage1 marker exists.- Parameters:
marker- a marker index- Returns:
- the index of the closest preceding stage1 marker
- Throws:
IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()
-
prevStage1Wt
public float prevStage1Wt(int marker) Returns the linear interpolation weight associated with the preceding stage1 marker (seethis.prevStage1Marker(marker)).- Parameters:
marker- a marker index- Returns:
- the linear interpolation weight associated with the preceding stage1 marker
- Throws:
IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()
-