Package vcf

Interface Data

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    AllData, TargetData

    public interface Data
    extends java.io.Closeable
    Interface Data represents a sliding window of target VCF records or a sliding window of reference and target VCF records.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void advanceWindowCm()
      Advances the sliding window of VCF records.
      Samples allSamples()
      Returns a list of all target and reference samples.
      boolean canAdvanceWindow()
      Returns true if the sliding window of VCF records can advance and returns false otherwise.
      void close()
      Releases any I/O resources controlled by this object.
      GeneticMap genMap()
      Returns the genetic map.
      boolean lastWindowOnChrom()
      Returns true if the current window of VCF records is the last window for the chromosome and returns false otherwise.
      int markerIndex​(int targetMarker)
      Returns the marker index corresponding to the specified target data marker.
      Markers markers()
      Returns the list of markers in the current window.
      int nAllSamples()
      Returns the total number of reference and target samples.
      int nextOverlapStart()
      Returns the first marker index in the overlap between this marker window and the next marker window.
      int nMarkers()
      Returns the number of markers in the current window.
      int nMarkersSoFar()
      Returns the number of markers in the union of the current window and all previous windows.
      int nRefSamples()
      Returns the number of reference samples.
      int nTargetMarkers()
      Returns the number of target data markers in the current window.
      int nTargetMarkersSoFar()
      Returns the number of target VCF records in the union of the current window and all previous windows.
      int nTargetSamples()
      Returns the number of target samples.
      int overlap()
      Returns the number of VCF records in the overlap between the current window and the previous window.
      Pedigree ped()
      Returns the pedigree.
      RefGT refGT()
      Returns the phased, nonmissing reference genotype data for the current window, or null if there are no reference data
      java.util.List<HapPair> refHapPairs()
      Returns a list of the reference haplotype pairs for the current window.
      Samples refSamples()
      Returns the list of reference samples, or null if there are no reference samples.
      java.util.List<HapPair> restrictedRefHapPairs()
      Returns a list of reference haplotype pairs that are restricted to the target data markers in the current window.
      RefGT restrictRefGT()
      Returns the phased, nonmissing reference genotype data for the target data markers in the current window.
      int targetMarkerIndex​(int marker)
      Returns the target data marker index corresponding to the specified marker, or returns -1 if no corresponding target data marker exists.
      Markers targetMarkers()
      Returns the list of target data markers in the current window.
      int targetOverlap()
      Returns the number of target data markers in the overlap between the current marker window and the previous marker window.
      Samples targetSamples()
      Returns the list of target samples.
      GT targGT()
      Returns the genotype likelihoods for the target samples restricted to the target data markers in the current window.
      int windowIndex()
      Returns the current window index.
    • Method Detail

      • ped

        Pedigree ped()
        Returns the pedigree.
        Returns:
        the pedigree
      • genMap

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

        boolean lastWindowOnChrom()
        Returns true if the current window of VCF records is the last window for the chromosome and returns false otherwise.
        Returns:
        true if the current window of VCF records is the last window for the chromosome
      • canAdvanceWindow

        boolean canAdvanceWindow()
        Returns true if the sliding window of VCF records can advance and returns false otherwise.
        Returns:
        true if the sliding window of VCF records can advance
      • advanceWindowCm

        void advanceWindowCm()
        Advances the sliding window of VCF records.
        Throws:
        java.lang.IllegalArgumentException - if a format error in the input data is detected
        java.lang.IllegalStateException - if this.canAdvanceWindow() == false
      • windowIndex

        int windowIndex()
        Returns the current window index. The first window has index 1.
        Returns:
        the current window index
      • targetOverlap

        int targetOverlap()
        Returns the number of target data markers in the overlap between the current marker window and the previous marker window. Returns 0 if the current marker window is the first marker window.
        Returns:
        the number of target data markers in the overlap between the current marker window and the previous marker window
      • overlap

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

        int nextOverlapStart()
        Returns the first marker index in the overlap between this marker window and the next marker window. Returns this.nMarkers() if the next marker window is from a different chromosome.
        Returns:
        the first marker index in the overlap between this marker window and the next marker window
      • nTargetMarkers

        int nTargetMarkers()
        Returns the number of target data markers in the current window.
        Returns:
        the number of target data markers in the current window
      • nTargetMarkersSoFar

        int nTargetMarkersSoFar()
        Returns the number of target VCF records in the union of the current window and all previous windows.
        Returns:
        the number of target VCF records in the union of the current window and all previous windows
      • targetMarkers

        Markers targetMarkers()
        Returns the list of target data markers in the current window.
        Returns:
        the list of target data markers in the current window
      • nMarkers

        int nMarkers()
        Returns the number of markers in the current window.
        Returns:
        the number of markers in the current window
      • nMarkersSoFar

        int nMarkersSoFar()
        Returns the number of markers in the union of the current window and all previous windows.
        Returns:
        the number of markers in the union of the current window and all previous windows
      • markers

        Markers markers()
        Returns the list of markers in the current window.
        Returns:
        the list of markers in the current window
      • targetMarkerIndex

        int targetMarkerIndex​(int marker)
        Returns the target data marker index corresponding to the specified marker, or returns -1 if no corresponding target data marker exists. Indices are with respect to the current window.
        Parameters:
        marker - a marker index
        Returns:
        the target data marker index corresponding to the specified marker, or returns -1 if no corresponding target data marker exists
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
      • markerIndex

        int markerIndex​(int targetMarker)
        Returns the marker index corresponding to the specified target data marker. Indices are with respect to the current window.
        Parameters:
        targetMarker - a target data marker index
        Returns:
        the marker index corresponding to the specified target data marker
        Throws:
        java.lang.IndexOutOfBoundsException - if targetMarker < 0 || targetMarker >= this.nTargetMarkers()
      • nTargetSamples

        int nTargetSamples()
        Returns the number of target samples.
        Returns:
        the number of target samples
      • targetSamples

        Samples targetSamples()
        Returns the list of target samples.
        Returns:
        the list of target samples
      • nRefSamples

        int nRefSamples()
        Returns the number of reference samples.
        Returns:
        the number of reference samples
      • refSamples

        Samples refSamples()
        Returns the list of reference samples, or null if there are no reference samples.
        Returns:
        the list of reference samples, or null if there are no reference samples
      • nAllSamples

        int nAllSamples()
        Returns the total number of reference and target samples.
        Returns:
        the total number of reference and target samples
      • allSamples

        Samples allSamples()
        Returns a list of all target and reference samples. Target samples are listed first in the same order as the list returned by this.targetSamples(). Reference samples are listed last in the same order as the list returned by this.refSamples().
        Returns:
        a list of all target and reference samples
      • targGT

        GT targGT()
        Returns the genotype likelihoods for the target samples restricted to the target data markers in the current window. The returned GL instance will contain no markers if this.advanceWindow() has not yet been invoked.
        Returns:
        the genotype likelihoods for the target samples restricted to the target data markers in the current window
      • restrictedRefHapPairs

        java.util.List<HapPair> restrictedRefHapPairs()
        Returns a list of reference haplotype pairs that are restricted to the target data markers in the current window. The returned list will be empty if there are no reference samples or if this.advanceWindow() has not yet been invoked.
        Returns:
        a list of reference haplotype pairs that are restricted to the target data markers
      • refHapPairs

        java.util.List<HapPair> refHapPairs()
        Returns a list of the reference haplotype pairs for the current window. The returned list will be empty if there are no reference samples or if this.advanceWindow() has not yet been invoked.
        Returns:
        a list of the reference haplotype pairs
      • refGT

        RefGT refGT()
        Returns the phased, nonmissing reference genotype data for the current window, or null if there are no reference data
        Returns:
        the reference genotype data for the current window or null if there are no reference data
      • restrictRefGT

        RefGT restrictRefGT()
        Returns the phased, nonmissing reference genotype data for the target data markers in the current window. Returns null if there are no reference data
        Returns:
        the reference genotype data for the target data markers in the current window or null if there are no reference data
      • 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