Package vcf
Class MarkerIndices
- java.lang.Object
-
- vcf.MarkerIndices
-
public class MarkerIndices extends java.lang.ObjectClass
MarkerIndicesstores the overlap with adjacent marker windows and the mappings between marker indices and the target marker indices.Instances of class
MarkerIndicesare immutable.
-
-
Constructor Summary
Constructors Constructor Description MarkerIndices(boolean[] inTarg, int prevOverlap, int nextOverlap)Constructs aMarkerIndicesinstance from the specified data.MarkerIndices(int prevOverlap, int nextOverlap, int nMarkers)Constructs aMarkerIndicesinstance 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.intmarkerToTargMarker(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.intnextOverlap()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.intnextSplice()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.intnextTargOverlap()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.intnextTargSplice()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 pointintprevSplice()Returns the first marker index after the splice point with the previous marker window.intprevTargSplice()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.inttargMarkerToMarker(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 aMarkerIndicesinstance from the specified data.- Parameters:
inTarg- an array whosek-th element istrueif 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.lengthjava.lang.IndexOutOfBoundsException- ifnextOverlap < 0 || nextOverlap > inTarg.lengthjava.lang.NullPointerException- ifinTarg==null
-
MarkerIndices
public MarkerIndices(int prevOverlap, int nextOverlap, int nMarkers)Constructs aMarkerIndicesinstance 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 < 0java.lang.IndexOutOfBoundsException- ifprevOverlap < 0 || prevOverlap > nMarkersjava.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
-
-