Class Window
- java.lang.Object
-
- vcf.Window
-
public class Window extends java.lang.Object
InterfaceWindow1
represents a sliding window of target VCF records or a sliding window of reference and target VCF records.Instances of class
Window1
are immutable.
-
-
Field Summary
Fields Modifier and Type Field Description static IntArray
HIGH_FREQ_ARRAY
An array that replaces an array of allele counts for a marker with high minor allele frequency.static IntArray
ZERO_FREQ_ARRAY
An array that replaces an array of allele counts for a monomorphic marker.
-
Constructor Summary
Constructors Constructor Description Window(GeneticMap genMap, int windowIndex, boolean lastWindow, MarkerIndices markerIndices, RefGT refGT, BasicGT targGT)
Constructs a newWindow1
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntArray[][]
carriers(int maxCarriers)
Returns the indices of the reference and target carriers for each low-frequency allele at the target data markers.int
chromIndex()
Returns the chromosome index for the markers in this window.GeneticMap
genMap()
Returns the genetic map.MarkerIndices
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
lastWindow()
Returnstrue
if this window is the last window in the analysis, and returnsfalse
otherwise.java.util.Optional<RefGT>
refGT()
Returns the optional phased, nonmissing input genotypes for the reference samples in this window.java.util.Optional<RefGT>
restrictRefGT()
Returns the optional phased, nonmissing input genotypes for the reference samples restricted to the target data markers in this window.BasicGT
targGT()
Returns the input genotypes for the target samples in this window.int
windowIndex()
Returns the index of this window.
-
-
-
Field Detail
-
ZERO_FREQ_ARRAY
public static final IntArray ZERO_FREQ_ARRAY
An array that replaces an array of allele counts for a monomorphic marker.
-
HIGH_FREQ_ARRAY
public static final IntArray HIGH_FREQ_ARRAY
An array that replaces an array of allele counts for a marker with high minor allele frequency.
-
-
Constructor Detail
-
Window
public Window(GeneticMap genMap, int windowIndex, boolean lastWindow, MarkerIndices markerIndices, RefGT refGT, BasicGT targGT)
Constructs a newWindow1
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 pointstargGT
- the target genotype datarefGT
- the reference genotype data ornull
if there is no reference genotype data- Throws:
java.lang.IllegalArgumentException
- ifmarkerIndices.nTargMarkers() != targGT.nMarkers()
java.lang.IllegalArgumentException
- ifrefGT != null && markerIndices.nMarkers() != refGT.nMarkers()
java.lang.NullPointerException
- ifgenMap == null || markerIndices == null || targGT == null
-
-
Method Detail
-
genMap
public GeneticMap 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
public BasicGT targGT()
Returns the input genotypes for the target samples in this window.- Returns:
- the input genotypes for the target samples in this window
-
refGT
public java.util.Optional<RefGT> 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
public java.util.Optional<RefGT> 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
public MarkerIndices 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
public 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
Window1.ZERO_FREQ_ARRAY
if the allele has no carriers, and the the element will be empty and equal toWindow1.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
-
-