Package vcf

Class Window


  • public class Window
    extends java.lang.Object
    Interface Window1 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 new Window1 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 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 lastWindow()
      Returns true if this window is the last window in the analysis, and returns false 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 new Window1 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
        targGT - the target genotype data
        refGT - the reference genotype data or null if there is no reference genotype data
        Throws:
        java.lang.IllegalArgumentException - if markerIndices.nTargMarkers() != targGT.nMarkers()
        java.lang.IllegalArgumentException - if refGT != null && markerIndices.nMarkers() != refGT.nMarkers()
        java.lang.NullPointerException - if genMap == 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()
        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 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 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 Window1.ZERO_FREQ_ARRAY if the allele has no carriers, and the the element will be empty and equal to Window1.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