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 overlapEnd, int overlapStart)
      Constructs a MarkerIndices instance from the specified data.
      MarkerIndices​(int overlapEnd, int overlapStart, 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 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 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 nMarkers()
      Returns the number of markers
      int nTargMarkers()
      Returns the number of target markers
      int overlapEnd()
      Returns the end marker index (exclusive) of the overlap with the previous window.
      int overlapStart()
      Returns the first marker index in the overlap between this marker window and the next marker window.
      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.
      int targOverlapEnd()
      Returns the end marker index (exclusive) of the overlap with the previous window in the target data.
      int targOverlapStart()
      Returns the first marker index of the overlap between this marker window and the next marker window in the target data.
      • 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 overlapEnd,
                             int overlapStart)
        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
        overlapEnd - the end marker index (exclusive) of the overlap with the previous window
        overlapStart - the start marker index (inclusive) of the overlap with the next window
        Throws:
        java.lang.IndexOutOfBoundsException - if overlapEnd < 0 || overlapEnd > inTarg.length
        java.lang.IndexOutOfBoundsException - if overlapStart < 0 || overlapStart > inTarg.length
        java.lang.NullPointerException - if inTarg==null
      • MarkerIndices

        public MarkerIndices​(int overlapEnd,
                             int overlapStart,
                             int nMarkers)
        Constructs a MarkerIndices instance from the specified data
        Parameters:
        overlapEnd - the ending marker index (exclusive) for the overlap with the previous window
        overlapStart - 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 overlapEnd < 0 || overlapEnd > nMarkers
        java.lang.IndexOutOfBoundsException - if overlapStart < 0 || overlapStart > nMarkers
    • Method Detail

      • nMarkers

        public int nMarkers()
        Returns the number of markers
        Returns:
        the number of markers
      • nTargMarkers

        public int nTargMarkers()
        Returns the number of target markers
        Returns:
        the number of target markers
      • 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
      • overlapEnd

        public int overlapEnd()
        Returns the end marker index (exclusive) of the overlap with the previous window.
        Returns:
        the end marker index (exclusive) of the overlap with the previous window
      • overlapStart

        public int overlapStart()
        Returns the first marker index in the overlap between this marker window and the next marker window. Returns this.nMarkers() if this marker window is the last on its chromosome.
        Returns:
        the first marker index in the overlap between this marker window and the next 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
      • targOverlapEnd

        public int targOverlapEnd()
        Returns the end marker index (exclusive) of the overlap with the previous window in the target data.
        Returns:
        the end marker index (exclusive) of the overlap with the previous window in the target data
      • targOverlapStart

        public int targOverlapStart()
        Returns the first marker index of the overlap between this marker window and the next marker window in the target data. Returns this.nMarkers() if there is no overlap or if there are no target markers in the overlap.
        Returns:
        the first marker index of the overlap between this marker window and the next marker window in the target data
      • 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