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 prevOverlap, int nextOverlap)
Constructs aMarkerIndices
instance from the specified data.MarkerIndices(int prevOverlap, int nextOverlap, 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
nextOverlap()
Returns the first marker index in the overlap between this marker window and the next marker window, or returnsthis.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 returnsthis.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 returnsthis.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 returnsthis.nTargMarkers()
if there is no overlap or if there are no target markers after the splice pointint
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.
-
-
-
Constructor Detail
-
MarkerIndices
public MarkerIndices(boolean[] inTarg, int prevOverlap, int nextOverlap)
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 dataprevOverlap
- the ending marker index (exclusive) for the overlap with the previous windownextOverlap
- the starting marker index (inclusive) for the overlap with the next window- Throws:
java.lang.IndexOutOfBoundsException
- ifprevOverlap < 0 || prevOverlap > inTarg.length
java.lang.IndexOutOfBoundsException
- ifnextOverlap < 0 || nextOverlap > inTarg.length
java.lang.NullPointerException
- ifinTarg==null
-
MarkerIndices
public MarkerIndices(int prevOverlap, int nextOverlap, int nMarkers)
Constructs aMarkerIndices
instance from the specified data- Parameters:
prevOverlap
- the ending marker index (exclusive) for the overlap with the previous windownextOverlap
- 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
- ifprevOverlap < 0 || prevOverlap > nMarkers
java.lang.IndexOutOfBoundsException
- ifnextOverlap < 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 returnsthis.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 returnsthis.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 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
-
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
-
-