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 TypeMethodDescriptionvoid
Add an interval object to the interval tree's listvoid
Add all intervals to interval tree's listvoid
build()
Build the interval tree to reflect the list of intervals.protected int
Index intervals from 'start' to 'end' (index in 'markers')boolean
isEmpty()
boolean
isInSync()
Is the tree 'in sync'? If false, the tree must be 'build()' before the next queryiterator()
void
Load intervals from fileQuery index to find all VCF entries intersecting 'marker' Store VCF entries in 'results'protected void
Query index to find all VCF entries intersecting 'marker', starting from node 'idx' Store VCF entries in 'results'protected void
queryIntersects
(Interval marker, int idx, Markers results) Query entries intersecting 'marker' at node 'idx'protected void
reset()
void
setDebug
(boolean debug) void
setVerbose
(boolean verbose) int
size()
Size: number of entries in this treestab
(int point) Perform a stabbing query, returning the interval objectsprotected void
protected void
stabIntersects
(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, wait
Methods 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:Itree
Add an interval object to the interval tree's list -
add
Description copied from interface:Itree
Add all intervals to interval tree's list -
build
public void build()Description copied from interface:Itree
Build 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:
getIntervals
in interfaceItree
-
isEmpty
public boolean isEmpty() -
isInSync
public boolean isInSync()Description copied from interface:Itree
Is the tree 'in sync'? If false, the tree must be 'build()' before the next query -
iterator
-
load
Description copied from interface:Itree
Load 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:Itree
Size: number of entries in this tree -
stab
Description copied from interface:Itree
Perform a stabbing query, returning the interval objects -
stab
-
stabIntersects
Stab entries intersecting 'point' at node 'idx' -
toString
-
toString
-
toStringAll
-