Package vcf

Class RestrictedVcfWindow

java.lang.Object
vcf.RestrictedVcfWindow
All Implemented Interfaces:
Closeable, AutoCloseable

public class RestrictedVcfWindow extends Object implements Closeable

Class RestrictedVcfWindow represents a sliding window of VCF records.

Instances of class RestrictedVcfWindow are not thread.safe.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a new RestrictedVcfWindow instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    advanceWindow(Markers nextMarkers)
    Advances the sliding marker window, and returns the advanced window as a GTRec[] object.
    void
    Releases any I/O resources controlled by this object.
    int
    Returns the number of VCF records in the union of the current window and all previous windows.
    Returns the file from which VCF records are read, or returns null if the source is standard input.
    int
    Returns the number of samples.
    int
    Returns the number of VCF records in the overlap between the current window and the previous window.
    Returns the list of samples.
    Returns a string representation of this.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • advanceWindow

      public GTRec[] advanceWindow(Markers nextMarkers)
      Advances the sliding marker window, and returns the advanced window as a GTRec[] object. The returned array will have length markers.nMarkers(). Markers not found in the data source will have null entries in the returned array.
      Parameters:
      nextMarkers - the set of markers in the advanced window
      Returns:
      the advanced marker window
      Throws:
      IllegalArgumentException - if markers.nMarkers() == 0
      IllegalArgumentException - if any two of the specified markers are on different chromosomes
      IllegalArgumentException - if specified markers are inconsistent with a sliding marker window
      IllegalArgumentException - if the specified markers do not advance the current marker window
      IllegalArgumentException - if a format error is detected in a VCF record
      IllegalArgumentException - if the input data does not contain any of the specified markers
      NullPointerException - if nextMarkers == null
    • file

      public File file()
      Returns the file from which VCF records are read, or returns null if the source is standard input.
      Returns:
      the file from which VCF records are read, or null if the source is standard input
    • samples

      public Samples samples()
      Returns the list of samples.
      Returns:
      the list of samples
    • nSamples

      public int nSamples()
      Returns the number of samples.
      Returns:
      the number of samples
    • overlap

      public int overlap()
      Returns the number of VCF records in the overlap between the current window and the previous window. Returns 0 if the current window is the first window.
      Returns:
      the number of VCF records in the overlap between the current window and the previous window
    • cumMarkerCnt

      public int cumMarkerCnt()
      Returns the number of VCF records in the union of the current window and all previous windows.
      Returns:
      the number of VCF records in the union of the current window and all previous windows
    • close

      public void close()
      Releases any I/O resources controlled by this object.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • toString

      public String toString()
      Returns a string representation of this. The exact details of the representation are unspecified and subject to change.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this