Package vcf

Interface SlidingWindow

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    RefTargSlidingWindow, TargSlidingWindow

    public interface SlidingWindow
    extends java.io.Closeable

    Interface SlidingWindow represents a sliding window of VCF records.

    Instances of class SlidingWindow are not thread-safe.

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static <E> void addToQ​(java.util.concurrent.BlockingQueue<E> q, E e)
      Adds the specified element to the specified queue.
      void close()
      Releases any I/O resources controlled by this object.
      int cumMarkers()
      Returns the number of distinct markers returned in preceding this.nextWindow() method calls.
      int cumTargMarkers()
      Returns the number of distinct target markers returned in preceding this.nextWindow() method calls.
      GeneticMap genMap()
      Returns the genetic map.
      java.util.Optional<Window> nextWindow()
      Returns the next sliding window of VCF records.
      Pedigree ped()
      Returns the target sample pedigree data.
      static <E> E takeFromQ​(java.util.concurrent.BlockingQueue<E> q)
      Takes and returns an element from the specified queue.
      Samples targSamples()
      Returns the target samples.
    • Method Detail

      • targSamples

        Samples targSamples()
        Returns the target samples.
        Returns:
        the target samples
      • ped

        Pedigree ped()
        Returns the target sample pedigree data.
        Returns:
        the target sample pedigree data
      • genMap

        GeneticMap genMap()
        Returns the genetic map.
        Returns:
        the genetic map
      • cumTargMarkers

        int cumTargMarkers()
        Returns the number of distinct target markers returned in preceding this.nextWindow() method calls.
        Returns:
        the number of distinct target markers returned in preceding this.nextWindow() method calls
      • cumMarkers

        int cumMarkers()
        Returns the number of distinct markers returned in preceding this.nextWindow() method calls.
        Returns:
        the number of distinct markers returned in preceding this.nextWindow() method calls
      • nextWindow

        java.util.Optional<Window> nextWindow()
        Returns the next sliding window of VCF records.
        Returns:
        the next sliding window of VCF records or Optional.empty() if there are no additional windows.
        Throws:
        java.lang.IllegalArgumentException - if a format error in the input data is detected
      • close

        void close()
        Releases any I/O resources controlled by this object.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • takeFromQ

        static <E> E takeFromQ​(java.util.concurrent.BlockingQueue<E> q)
        Takes and returns an element from the specified queue.
        Type Parameters:
        E - the element type
        Parameters:
        q - the queue
        Returns:
        an element from the specified queue
        Throws:
        java.lang.NullPointerException - if q == null
        java.lang.RuntimeException - if an InterruptedException is thrown while waiting to take an element
      • addToQ

        static <E> void addToQ​(java.util.concurrent.BlockingQueue<E> q,
                               E e)
        Adds the specified element to the specified queue.
        Type Parameters:
        E - the element type
        Parameters:
        q - the queue
        e - the element to be added
        Throws:
        java.lang.NullPointerException - if q == null
        java.lang.RuntimeException - if an InterruptedException is thrown while waiting to add the element