Interface Data
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
AllData
,TargetData
public interface Data extends java.io.Closeable
InterfaceData
represents 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 IntArray
HIGH_FREQ_ARRAY
static IntArray
ZERO_FREQ_ARRAY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
advanceWindow()
Advances the sliding window of VCF records.boolean
canAdvanceWindow()
Returnstrue
if the sliding window of VCF records can advance and returnsfalse
otherwise.IntArray[][]
carriers(int maxCarriers)
Returns the indices of the reference and target carriers for each low-frequency allele at the target data markers.void
close()
Releases any I/O resources controlled by this object.GeneticMap
genMap()
Returns the genetic map.boolean
lastWindowOnChrom()
Returnstrue
if the current window of VCF records is the last window for the chromosome and returnsfalse
otherwise.MarkerIndices
markerIndices()
Return aMarkerIndices
instance which stores the overlap with the current marker window and adjacent marker windows and the mappings between marker indices and target marker indices.int
nMarkers()
Returns the number of markers in the current window.int
nMarkersSoFar()
Returns the number of markers in the union of the current window and all previous windows.int
nTargMarkersSoFar()
Returns the number of target VCF records in the union of the current window and all previous windows.Pedigree
ped()
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.GT
targGT()
Returns the genotype likelihoods for the target samples restricted to the target data markers in the current window.int
windowIndex()
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()
Returnstrue
if the current window of VCF records is the last window for the chromosome and returnsfalse
otherwise.- Returns:
true
if the current window of VCF records is the last window for the chromosome
-
canAdvanceWindow
boolean canAdvanceWindow()
Returnstrue
if the sliding window of VCF records can advance and returnsfalse
otherwise.- Returns:
true
if 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 returnedGL
instance 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_ARRAY
if the allele has no carriers, and the the element will be empty and equal toData.HIGH_FREQ_ARRAY
if 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 aMarkerIndices
instance 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
MarkerIndices
instance
-
close
void close()
Releases any I/O resources controlled by this object.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-