Package vcf

Class MarkerIndices


  • public class MarkerIndices
    extends java.lang.Object

    Class MarkerIndices stores the overlap with adjacent marker windows and the mappings between marker indices and the target marker indices.

    Instances of class MarkerIndices are immutable.

    • Constructor Summary

      Constructors 
      Constructor Description
      MarkerIndices​(boolean[] inTarg, int prevOverlap, int nextOverlap)
      Constructs a MarkerIndices instance from the specified data.
      MarkerIndices​(int prevOverlap, int nextOverlap, int nMarkers)
      Constructs a MarkerIndices instance from the specified data
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int[] markerToTargMarker()
      Returns an array of length this.nMarkers() whose k-th element is the index of the k-th marker in the list of target markers or is -1 if the marker is not present in the target data.
      int markerToTargMarker​(int marker)
      Returns the index of the specified marker in the target data, or returns -1 if the marker is not present in the target data.
      int nextOverlap()
      Returns the first marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() the next marker window is from a different chromosome.
      int nextSplice()
      Returns the first marker index after the splice point between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no markers after the splice point.
      int nextTargOverlap()
      Returns the first target marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no target markers in the overlap.
      int nextTargSplice()
      Returns the first target marker index after the splice point between this marker window and the next marker window, or returns this.nTargMarkers() if there is no overlap or if there are no target markers after the splice point
      int prevSplice()
      Returns the first marker index after the splice point with the previous marker window.
      int prevTargSplice()
      Returns the first target marker index after the splice point with the previous marker window.
      int[] targMarkerToMarker()
      Returns an array of length this.nTargMarkers() which maps the k-th marker in the list of target data markers to the index of the marker in the list of reference data markers.
      int targMarkerToMarker​(int targetMarker)
      Returns the index of the specified marker in the reference data markers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MarkerIndices

        public MarkerIndices​(boolean[] inTarg,
                             int prevOverlap,
                             int nextOverlap)
        Constructs a MarkerIndices instance from the specified data.
        Parameters:
        inTarg - an array whose k-th element is true if the k-th marker is present in the target genotype data
        prevOverlap - the ending marker index (exclusive) for the overlap with the previous window
        nextOverlap - the starting marker index (inclusive) for the overlap with the next window
        Throws:
        java.lang.IndexOutOfBoundsException - if prevOverlap < 0 || prevOverlap > inTarg.length
        java.lang.IndexOutOfBoundsException - if nextOverlap < 0 || nextOverlap > inTarg.length
        java.lang.NullPointerException - if inTarg==null
      • MarkerIndices

        public MarkerIndices​(int prevOverlap,
                             int nextOverlap,
                             int nMarkers)
        Constructs a MarkerIndices instance from the specified data
        Parameters:
        prevOverlap - the ending marker index (exclusive) for the overlap with the previous window
        nextOverlap - the starting marker index (inclusive) for the overlap with the next window
        nMarkers - the number of markers
        Throws:
        java.lang.IllegalArgumentException - if nMarkers < 0
        java.lang.IndexOutOfBoundsException - if prevOverlap < 0 || prevOverlap > nMarkers
        java.lang.IndexOutOfBoundsException - if nextOverlap < 0 || nextOverlap > nMarkers
    • Method Detail

      • nextOverlap

        public int nextOverlap()
        Returns the first marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() 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
      • nextTargOverlap

        public int nextTargOverlap()
        Returns the first target marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no target markers in the overlap.
        Returns:
        the first target marker index in the overlap between this marker window and the next marker window
      • prevSplice

        public int prevSplice()
        Returns the first marker index after the splice point with the previous marker window. Returns 0 if the current marker window is the first marker window.
        Returns:
        the first marker index after the splice point with the previous marker window
      • prevTargSplice

        public int prevTargSplice()
        Returns the first target marker index after the splice point with the previous marker window. Returns 0 if the current marker window is the first marker window.
        Returns:
        the first target marker index after the splice point with the previous marker window
      • nextSplice

        public int nextSplice()
        Returns the first marker index after the splice point between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no markers after the splice point.
        Returns:
        the first marker index after the next splice point
      • nextTargSplice

        public int nextTargSplice()
        Returns the first target marker index after the splice point between this marker window and the next marker window, or returns this.nTargMarkers() if there is no overlap or if there are no target markers after the splice point
        Returns:
        the first target marker index after the next splice point
      • targMarkerToMarker

        public int targMarkerToMarker​(int targetMarker)
        Returns the index of the specified marker in the reference data markers.
        Parameters:
        targetMarker - index of a marker in the list of target data markers
        Returns:
        the index of the specified marker in the reference data markers
        Throws:
        java.lang.IndexOutOfBoundsException - if targetMarker < 0 || targetMarker >= this.nTargMarkers()
      • targMarkerToMarker

        public int[] targMarkerToMarker()
        Returns an array of length this.nTargMarkers() which maps the k-th marker in the list of target data markers to the index of the marker in the list of reference data markers.
        Returns:
        an array of length this.nTargMarkers() which maps the k-th marker in the list of target data markers to the index of the marker in the list of reference data markers
      • markerToTargMarker

        public int markerToTargMarker​(int marker)
        Returns the index of the specified marker in the target data, or returns -1 if the marker is not present in the target data.
        Parameters:
        marker - index of a marker in the reference data
        Returns:
        the index of the specified marker in the target data, or returns -1 if the marker is not present in the target data
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers().
      • markerToTargMarker

        public int[] markerToTargMarker()
        Returns an array of length this.nMarkers() whose k-th element is the index of the k-th marker in the list of target markers or is -1 if the marker is not present in the target data.
        Returns:
        an array of length this.nMarkers() whose k-th element is the index of the k-th marker in the list of target markers or is -1 if the marker is not present in the target data