Package vcf

Class Window

java.lang.Object
vcf.Window

public class Window extends Object
Class 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
    Modifier and Type
    Field
    Description
    static final IntArray
    An array that replaces an array of allele counts for a marker with high minor allele frequency.
    static final IntArray
    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 new Window instance from the specified data.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    Returns the genetic map.
    Return a MarkerIndices 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
    Returns true if this window is the last window in the analysis, and returns false otherwise.
    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.
    Returns the input genotypes for the target samples in this window.
    int
    Returns the index of this window.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 Details

    • Window

      public Window(GeneticMap genMap, int windowIndex, boolean lastWindow, MarkerIndices markerIndices, RefGT refGT, BasicGT targGT)
      Constructs a new Window instance from the specified data.
      Parameters:
      genMap - the genetic map
      windowIndex - the window index
      lastWindow - true if this window is the last window in the analysis
      markerIndices - marker indices of overlap regions and splice points
      refGT - the reference genotype data or null if there is no reference genotype data
      targGT - the target genotype data
      Throws:
      IllegalArgumentException - if markerIndices.nTargMarkers() != targGT.nMarkers()
      IllegalArgumentException - if refGT != null && markerIndices.nMarkers() != refGT.nMarkers()
      NullPointerException - if genMap == null || markerIndices == null || targGT == null
  • Method Details

    • 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()
      Returns true if this window is the last window in the analysis, and returns false 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 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 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 a MarkerIndices 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 Window.ZERO_FREQ_ARRAY if the allele has no carriers, and the the element will be empty and equal to Window.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 the j-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