Package org.snpeff.interval.tree
Class IntervalTreeArray
java.lang.Object
org.snpeff.interval.tree.IntervalTreeArray
Interval tree structure using arrays
This is slightly faster than the new IntervalTree implementation
- Author:
- pcingola
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIntervalTreeArray(Markers markers) Instantiate an interval tree with a list of intervals -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an interval object to the interval tree's listvoidAdd all intervals to interval tree's listvoidbuild()Build the interval tree to reflect the list of intervals.protected intIndex intervals from 'start' to 'end' (index in 'markers')booleanisEmpty()booleanisInSync()Is the tree 'in sync'? If false, the tree must be 'build()' before the next queryiterator()voidLoad intervals from fileQuery index to find all VCF entries intersecting 'marker' Store VCF entries in 'results'protected voidQuery index to find all VCF entries intersecting 'marker', starting from node 'idx' Store VCF entries in 'results'protected voidqueryIntersects(Interval marker, int idx, Markers results) Query entries intersecting 'marker' at node 'idx'protected voidreset()voidsetDebug(boolean debug) voidsetVerbose(boolean verbose) intsize()Size: number of entries in this treestab(int point) Perform a stabbing query, returning the interval objectsprotected voidprotected voidstabIntersects(int point, int idx, Markers results) Stab entries intersecting 'point' at node 'idx'toString()toString(int idx) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
MIN_MARKERS_PER_LEAF
public static final int MIN_MARKERS_PER_LEAF- See Also:
-
INITIAL_CAPACITY
public static final int INITIAL_CAPACITY- See Also:
-
EMPTY_MARKER_ARRAY
-
debug
protected boolean debug -
verbose
protected boolean verbose -
markers
-
inSync
protected boolean inSync -
left
protected int[] left -
right
protected int[] right -
mid
protected int[] mid -
intersectMarkers
-
lastIdx
protected int lastIdx
-
-
Constructor Details
-
IntervalTreeArray
public IntervalTreeArray() -
IntervalTreeArray
Instantiate an interval tree with a list of intervals
-
-
Method Details
-
add
Description copied from interface:ItreeAdd an interval object to the interval tree's list -
add
Description copied from interface:ItreeAdd all intervals to interval tree's list -
build
public void build()Description copied from interface:ItreeBuild the interval tree to reflect the list of intervals. Must not run if this is currently in sync -
build
Index intervals from 'start' to 'end' (index in 'markers')- Returns:
- Index of added item (-1 if no item was added)
-
getIntervals
- Specified by:
getIntervalsin interfaceItree
-
isEmpty
public boolean isEmpty() -
isInSync
public boolean isInSync()Description copied from interface:ItreeIs the tree 'in sync'? If false, the tree must be 'build()' before the next query -
iterator
-
load
Description copied from interface:ItreeLoad intervals from file -
query
Query index to find all VCF entries intersecting 'marker' Store VCF entries in 'results' -
query
Query index to find all VCF entries intersecting 'marker', starting from node 'idx' Store VCF entries in 'results' -
queryIntersects
Query entries intersecting 'marker' at node 'idx' -
reset
protected void reset() -
setDebug
public void setDebug(boolean debug) -
setVerbose
public void setVerbose(boolean verbose) -
size
public int size()Description copied from interface:ItreeSize: number of entries in this tree -
stab
Description copied from interface:ItreePerform a stabbing query, returning the interval objects -
stab
-
stabIntersects
Stab entries intersecting 'point' at node 'idx' -
toString
-
toString
-
toStringAll
-