Package phase
Class FixedPhaseData
- java.lang.Object
-
- phase.FixedPhaseData
-
public class FixedPhaseData extends java.lang.ObjectClass
FixedPhaseDatastores immutable data for a marker window. The definition of low-frequency markers is determined by thePar.rare()method andFixedPhaseData.MAX_HIFREQ_PROPfield.Instances of class
FixedPhaseDataare immutable.
-
-
Constructor Summary
Constructors Constructor Description FixedPhaseData(Par par, GeneticMap genMap, Data data, GT phasedOverlap)Constructs a newFixedPhaseDatainstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntArraycarriers(int marker, int allele)Returns the indices of the reference and target samples for the specified low-frequency allele.floaterr()Return the allele mismatch emission probability.Ibs2hiFreqIbs2()Returns the IBS2 data for the high-frequency markers.IntArrayhiFreqIndices()Returns the indices of the high-frequency markers.MarkerMaphiFreqMap()Returns the genetic map for the high-frequency markers.inthiFreqOverlap()Returns the number of initial high-frequency markers that have phased target genotypes due to overlap with the previous window.RefGThiFreqRefGT()Returns the phased, nonmissing reference genotypes for the high-frequency markers ornullif there are no reference samples.GThiFreqTargGT()Returns the input target genotypes at the high-frequency markers.booleanisLowFreq(int marker, int allele)Returnstrueif the specified allele is a low-frequency allele, and returnsfalseotherwise.MarkerMapmap()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.Parpar()Return the analysis parameters.Pedigreeped()Returns the parent-offspring relationships.intprevHiFreqMarker(int marker)Returns the index of the closest high-frequency marker with position less than or equal to the position of the specified marker, or 0 if no such high-frequency marker exists.floatprevWt(int marker)Returns the linear interpolation weight for the high-frequency marker with indexthis.prevHiFreqMarker(marker).RefGTrefGT()Returns the input phased, nonmissing reference genotypes ornullif there are no reference samples.GTtargGT()Returns the input target genotypes.intwindow()Returns the index of the marker window.
-
-
-
Constructor Detail
-
FixedPhaseData
public FixedPhaseData(Par par, GeneticMap genMap, Data data, GT phasedOverlap)
Constructs a newFixedPhaseDatainstance from the specified data.- Parameters:
par- the analysis parametersgenMap- the genetic mapdata- input data for the current marker windowphasedOverlap- initial phased target genotypes due to overlap with the previous window ornullif there are no initial phased target genotypes- Throws:
java.lang.IllegalArgumentException- if(phasedOverlap != null && phasedOverlap.isPhased() == false)java.lang.IllegalArgumentException- if(phasedOverlap != null && data.targGT().samples().equals(phasedOverlap.samples()) == false)java.lang.IllegalArgumentException- if(phasedOverlap != null && data.targGT().nMarkers() < phasedOverlap.nMarkers())java.lang.IllegalArgumentException- if(phasedOverlap != null && phasedOverlap.marker(j).equals(data.targGT().marker(j) == false)for somejsatisfying(0 <= j && j <= overlapHaps.nMarkers())java.lang.NullPointerException- if(par == null || genMap == null || data == null)
-
-
Method Detail
-
par
public Par 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
public Pedigree ped()
Returns the parent-offspring relationships.- Returns:
- the parent-offspring relationships
-
map
public MarkerMap map()
Returns the genetic map for the markers.- Returns:
- the genetic map for the markers
-
refGT
public RefGT refGT()
Returns the input phased, nonmissing reference genotypes ornullif there are no reference samples.- Returns:
- the input phased, nonmissing reference genotypes
or
nullif there are no reference samples
-
targGT
public GT targGT()
Returns the input target genotypes.- 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
-
hiFreqMap
public MarkerMap hiFreqMap()
Returns the genetic map for the high-frequency markers.- Returns:
- the genetic map for the high-frequency markers
-
hiFreqRefGT
public RefGT hiFreqRefGT()
Returns the phased, nonmissing reference genotypes for the high-frequency markers ornullif there are no reference samples.- Returns:
- the phased, nonmissing reference genotypes for the high-frequency
markers or
nullif there are no reference samples
-
hiFreqTargGT
public GT hiFreqTargGT()
Returns the input target genotypes at the high-frequency markers.- Returns:
- the input target genotypes at the high-frequency markers
-
hiFreqOverlap
public int hiFreqOverlap()
Returns the number of initial high-frequency markers that have phased target genotypes due to overlap with the previous window.- Returns:
- the number of initial high-frequency 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
-
err
public float err()
Return the allele mismatch emission probability.- Returns:
- the allele mismatch emission probability
-
hiFreqIndices
public IntArray hiFreqIndices()
Returns the indices of the high-frequency markers.- Returns:
- the indices of the high-frequency markers
-
hiFreqIbs2
public Ibs2 hiFreqIbs2()
Returns the IBS2 data for the high-frequency markers.- Returns:
- the IBS2 data for the high-frequency markers
-
carriers
public IntArray carriers(int marker, int allele)
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:
java.lang.IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()java.lang.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:
java.lang.IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()java.lang.IndexOutOfBoundsException- ifallele < 0 || allele >= this.targGT().marker(marker).nAlleles()
-
prevHiFreqMarker
public int prevHiFreqMarker(int marker)
Returns the index of the closest high-frequency marker with position less than or equal to the position of the specified marker, or 0 if no such high-frequency marker exists.- Parameters:
marker- a marker index- Returns:
- the index of the closest hi-frequency marker with position less than or equal to the position of the specified marker, or 0 if no such high-frequency marker exists
- Throws:
java.lang.IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()
-
prevWt
public float prevWt(int marker)
Returns the linear interpolation weight for the high-frequency marker with indexthis.prevHiFreqMarker(marker).- Parameters:
marker- a marker index- Returns:
- the linear interpolation weight for the high-frequency marker
with index
this.prevHiFreqMarker(marker) - Throws:
java.lang.IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()
-
-