Package vcf
Class MarkerIndices
- java.lang.Object
-
- vcf.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 aMarkerIndices
instance from the specified data.MarkerIndices(int overlapEnd, int overlapStart, int nMarkers)
Constructs aMarkerIndices
instance from the specified data
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
markerToTargMarker()
Returns an array of lengththis.nMarkers()
whosek
-th element is the index of thek
-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 returnsthis.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 returnsthis.nTargMarkers()
if there is no overlap or if there are no target markers after the splice pointint
nMarkers()
Returns the number of markersint
nTargMarkers()
Returns the number of target markersint
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 lengththis.nTargMarkers()
which maps thek
-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.
-
-
-
Constructor Detail
-
MarkerIndices
public MarkerIndices(boolean[] inTarg, int overlapEnd, int overlapStart)
Constructs aMarkerIndices
instance from the specified data.- Parameters:
inTarg
- an array whosek
-th element istrue
if thek
-th marker is present in the target genotype dataoverlapEnd
- the end marker index (exclusive) of the overlap with the previous windowoverlapStart
- the start marker index (inclusive) of the overlap with the next window- Throws:
java.lang.IndexOutOfBoundsException
- ifoverlapEnd < 0 || overlapEnd > inTarg.length
java.lang.IndexOutOfBoundsException
- ifoverlapStart < 0 || overlapStart > inTarg.length
java.lang.NullPointerException
- ifinTarg==null
-
MarkerIndices
public MarkerIndices(int overlapEnd, int overlapStart, int nMarkers)
Constructs aMarkerIndices
instance from the specified data- Parameters:
overlapEnd
- the ending marker index (exclusive) for the overlap with the previous windowoverlapStart
- the starting marker index (inclusive) for the overlap with the next windownMarkers
- the number of markers- Throws:
java.lang.IllegalArgumentException
- ifnMarkers < 0
java.lang.IndexOutOfBoundsException
- ifoverlapEnd < 0 || overlapEnd > nMarkers
java.lang.IndexOutOfBoundsException
- ifoverlapStart < 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. Returnsthis.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 returnsthis.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. Returnsthis.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 returnsthis.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
- iftargetMarker < 0 || targetMarker >= this.nTargMarkers()
-
targMarkerToMarker
public int[] targMarkerToMarker()
Returns an array of lengththis.nTargMarkers()
which maps thek
-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 thek
-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
- ifmarker < 0 || marker >= this.nMarkers()
.
-
markerToTargMarker
public int[] markerToTargMarker()
Returns an array of lengththis.nMarkers()
whosek
-th element is the index of thek
-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()
whosek
-th element is the index of thek
-th marker in the list of target markers or is -1 if the marker is not present in the target data
-
-