Package org.snpeff.interval.tree
Class IntervalTreeArray
- java.lang.Object
-
- org.snpeff.interval.tree.IntervalTreeArray
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
debug
protected static Marker[]
EMPTY_MARKER_ARRAY
static int
INITIAL_CAPACITY
protected boolean
inSync
protected Marker[][]
intersectMarkers
protected int
lastIdx
protected int[]
left
protected Markers
markers
protected int[]
mid
static int
MIN_MARKERS_PER_LEAF
protected int[]
right
protected boolean
verbose
-
Constructor Summary
Constructors Constructor Description IntervalTreeArray()
IntervalTreeArray(Markers markers)
Instantiate an interval tree with a list of intervals
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Marker interval)
Add an interval object to the interval tree's listvoid
add(Markers markers)
Add all intervals to interval tree's listvoid
build()
Build the interval tree to reflect the list of intervals.protected int
build(Markers markers)
Index intervals from 'start' to 'end' (index in 'markers')Markers
getIntervals()
boolean
isEmpty()
boolean
isInSync()
Is the tree 'in sync'? If false, the tree must be 'build()' before the next queryjava.util.Iterator<Marker>
iterator()
void
load(java.lang.String fileName, Genome genome)
Load intervals from fileMarkers
query(Interval marker)
Query index to find all VCF entries intersecting 'marker' Store VCF entries in 'results'protected void
query(Interval marker, int idx, Markers results)
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 treeMarkers
stab(int point)
Perform a stabbing query, returning the interval objectsprotected void
stab(int point, int idx, Markers results)
protected void
stabIntersects(int point, int idx, Markers results)
Stab entries intersecting 'point' at node 'idx'java.lang.String
toString()
java.lang.String
toString(int idx)
java.lang.String
toStringAll()
-
-
-
Field Detail
-
MIN_MARKERS_PER_LEAF
public static final int MIN_MARKERS_PER_LEAF
- See Also:
- Constant Field Values
-
INITIAL_CAPACITY
public static final int INITIAL_CAPACITY
- See Also:
- Constant Field Values
-
EMPTY_MARKER_ARRAY
protected static final Marker[] EMPTY_MARKER_ARRAY
-
debug
protected boolean debug
-
verbose
protected boolean verbose
-
markers
protected Markers markers
-
inSync
protected boolean inSync
-
left
protected int[] left
-
right
protected int[] right
-
mid
protected int[] mid
-
intersectMarkers
protected Marker[][] intersectMarkers
-
lastIdx
protected int lastIdx
-
-
Constructor Detail
-
IntervalTreeArray
public IntervalTreeArray()
-
IntervalTreeArray
public IntervalTreeArray(Markers markers)
Instantiate an interval tree with a list of intervals
-
-
Method Detail
-
add
public void add(Marker interval)
Description copied from interface:Itree
Add an interval object to the interval tree's list
-
add
public void add(Markers markers)
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
protected int build(Markers markers)
Index intervals from 'start' to 'end' (index in 'markers')- Returns:
- Index of added item (-1 if no item was added)
-
getIntervals
public Markers getIntervals()
- Specified by:
getIntervals
in interfaceItree
-
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
public java.util.Iterator<Marker> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<Marker>
-
load
public void load(java.lang.String fileName, Genome genome)
Description copied from interface:Itree
Load intervals from file
-
query
public Markers query(Interval marker)
Query index to find all VCF entries intersecting 'marker' Store VCF entries in 'results'
-
query
protected void query(Interval marker, int idx, Markers results)
Query index to find all VCF entries intersecting 'marker', starting from node 'idx' Store VCF entries in 'results'
-
queryIntersects
protected void queryIntersects(Interval marker, int idx, Markers results)
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
public Markers stab(int point)
Description copied from interface:Itree
Perform a stabbing query, returning the interval objects
-
stab
protected void stab(int point, int idx, Markers results)
-
stabIntersects
protected void stabIntersects(int point, int idx, Markers results)
Stab entries intersecting 'point' at node 'idx'
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(int idx)
-
toStringAll
public java.lang.String toStringAll()
-
-