Class Window
Window
represents a sliding window of target VCF records
or a sliding window of reference and target VCF records.
Instances of class Window
are immutable.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWindow
(GeneticMap genMap, int windowIndex, boolean lastWindow, MarkerIndices markerIndices, RefGT refGT, BasicGT targGT) Constructs a newWindow
instance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionIntArray[][]
carriers
(int maxCarriers) Returns the indices of the reference and target carriers for each low-frequency allele at the target data markers.int
Returns the chromosome index for the markers in this window.genMap()
Returns the genetic map.indices()
Return aMarkerIndices
instance which stores the overlap and splice points between this window and the preceding and next windows, and the map between reference and target marker indices.boolean
Returnstrue
if this window is the last window in the analysis, and returnsfalse
otherwise.refGT()
Returns the optional phased, nonmissing input genotypes for the reference samples in this window.Returns the optional phased, nonmissing input genotypes for the reference samples restricted to the target data markers in this window.targGT()
Returns the input genotypes for the target samples in this window.int
Returns the index of this window.
-
Field Details
-
ZERO_FREQ_ARRAY
An array that replaces an array of allele counts for a monomorphic marker. -
HIGH_FREQ_ARRAY
An array that replaces an array of allele counts for a marker with high minor allele frequency.
-
-
Constructor Details
-
Window
public Window(GeneticMap genMap, int windowIndex, boolean lastWindow, MarkerIndices markerIndices, RefGT refGT, BasicGT targGT) Constructs a newWindow
instance from the specified data.- Parameters:
genMap
- the genetic mapwindowIndex
- the window indexlastWindow
-true
if this window is the last window in the analysismarkerIndices
- marker indices of overlap regions and splice pointsrefGT
- the reference genotype data ornull
if there is no reference genotype datatargGT
- the target genotype data- Throws:
IllegalArgumentException
- ifmarkerIndices.nTargMarkers() != targGT.nMarkers()
IllegalArgumentException
- ifrefGT != null && markerIndices.nMarkers() != refGT.nMarkers()
NullPointerException
- ifgenMap == null || markerIndices == null || targGT == null
-
-
Method Details
-
genMap
Returns the genetic map.- Returns:
- the genetic map
-
chromIndex
public int chromIndex()Returns the chromosome index for the markers in this window.- Returns:
- the chromosome index for the markers in this window
-
lastWindow
public boolean lastWindow()Returnstrue
if this window is the last window in the analysis, and returnsfalse
otherwise.- Returns:
true
if this window is the last window in the analysis
-
windowIndex
public int windowIndex()Returns the index of this window. The first window has index 1.- Returns:
- the index of this window.
-
targGT
Returns the input genotypes for the target samples in this window.- Returns:
- the input genotypes for the target samples in this window
-
refGT
Returns the optional phased, nonmissing input genotypes for the reference samples in this window.- Returns:
- the optional phased, nonmissing input genotypes for the reference samples in this window
-
restrictRefGT
Returns the optional phased, nonmissing input genotypes for the reference samples restricted to the target data markers in this window.- Returns:
- the optional phased, nonmissing input genotypes for the reference samples restricted to the target data markers in this window
-
indices
Return aMarkerIndices
instance which stores the overlap and splice points between this window and the preceding and next windows, and the map between reference and target marker indices.- Returns:
- the
MarkerIndices
for this window
-
carriers
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
Window.ZERO_FREQ_ARRAY
if the allele has no carriers, and the the element will be empty and equal toWindow.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
-