Interface Data
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
AllData,TargetData
public interface Data extends java.io.CloseableInterfaceDatarepresents a sliding window of target VCF records or a sliding window of reference and target VCF records.
-
-
Field Summary
Fields Modifier and Type Field Description static IntArrayHIGH_FREQ_ARRAYstatic IntArrayZERO_FREQ_ARRAY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadvanceWindow()Advances the sliding window of VCF records.booleancanAdvanceWindow()Returnstrueif the sliding window of VCF records can advance and returnsfalseotherwise.IntArray[][]carriers(int maxCarriers)Returns the indices of the reference and target carriers for each low-frequency allele at the target data markers.voidclose()Releases any I/O resources controlled by this object.GeneticMapgenMap()Returns the genetic map.booleanlastWindowOnChrom()Returnstrueif the current window of VCF records is the last window for the chromosome and returnsfalseotherwise.MarkerIndicesmarkerIndices()Return aMarkerIndicesinstance which stores the overlap with the current marker window and adjacent marker windows and the mappings between marker indices and target marker indices.intnMarkers()Returns the number of markers in the current window.intnMarkersSoFar()Returns the number of markers in the union of the current window and all previous windows.intnTargMarkersSoFar()Returns the number of target VCF records in the union of the current window and all previous windows.Pedigreeped()Returns the pedigree.java.util.Optional<RefGT>refGT()Returns the optional phased, nonmissing reference genotype data for the current window.java.util.Optional<RefGT>restrictRefGT()Returns the optional phased, nonmissing reference genotype data for the target data markers in the current window.GTtargGT()Returns the genotype likelihoods for the target samples restricted to the target data markers in the current window.intwindowIndex()Returns the current window index.
-
-
-
Method Detail
-
ped
Pedigree ped()
Returns the pedigree.- Returns:
- the pedigree
-
genMap
GeneticMap genMap()
Returns the genetic map.- Returns:
- the genetic map
-
lastWindowOnChrom
boolean lastWindowOnChrom()
Returnstrueif the current window of VCF records is the last window for the chromosome and returnsfalseotherwise.- Returns:
trueif the current window of VCF records is the last window for the chromosome
-
canAdvanceWindow
boolean canAdvanceWindow()
Returnstrueif the sliding window of VCF records can advance and returnsfalseotherwise.- Returns:
trueif the sliding window of VCF records can advance
-
advanceWindow
void advanceWindow()
Advances the sliding window of VCF records.- Throws:
java.lang.IllegalArgumentException- if a format error in the input data is detectedjava.lang.IllegalStateException- ifthis.canAdvanceWindow() == false
-
windowIndex
int windowIndex()
Returns the current window index. The first window has index 1.- Returns:
- the current window index
-
nTargMarkersSoFar
int nTargMarkersSoFar()
Returns the number of target VCF records in the union of the current window and all previous windows.- Returns:
- the number of target VCF records in the union of the current window and all previous windows
-
nMarkers
int nMarkers()
Returns the number of markers in the current window.- Returns:
- the number of markers in the current window
-
nMarkersSoFar
int nMarkersSoFar()
Returns the number of markers in the union of the current window and all previous windows.- Returns:
- the number of markers in the union of the current window and all previous windows
-
targGT
GT targGT()
Returns the genotype likelihoods for the target samples restricted to the target data markers in the current window. The returnedGLinstance will contain no markers ifthis.advanceWindow()has not yet been invoked.- Returns:
- the genotype likelihoods for the target samples restricted to the target data markers in the current window
-
refGT
java.util.Optional<RefGT> refGT()
Returns the optional phased, nonmissing reference genotype data for the current window.- Returns:
- the optional phased, nonmissing reference genotype data for the current window
-
restrictRefGT
java.util.Optional<RefGT> restrictRefGT()
Returns the optional phased, nonmissing reference genotype data for the target data markers in the current window.- Returns:
- the optional phased, nonmissing reference genotype data for the target data markers in the current window
-
carriers
IntArray[][] carriers(int maxCarriers)
Returns the indices of the reference and target carriers for each low-frequency allele at the target data markers. 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. An element of the returned array will be empty and equal to
Data.ZERO_FREQ_ARRAYif the allele has no carriers, and the the element will be empty and equal toData.HIGH_FREQ_ARRAYif the number of carriers of the allele exceeds the specified maximum number of carriers.The list of carriers for the
k-th allele of thej-th target marker are stored in entry(j, k)of the returned array. if the number of carriers is less than or equal to the specified maximum number of carriers.- Parameters:
maxCarriers- the maximum number of carriers in any list of the returned array.- Returns:
- the indices of the reference and target carriers for each low-frequency allele
-
markerIndices
MarkerIndices markerIndices()
Return aMarkerIndicesinstance which stores the overlap with the current marker window and adjacent marker windows and the mappings between marker indices and target marker indices.- Returns:
- a
MarkerIndicesinstance
-
close
void close()
Releases any I/O resources controlled by this object.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-