Class IntervalTreeArray

java.lang.Object
org.snpeff.interval.tree.IntervalTreeArray
All Implemented Interfaces:
Iterable<Marker>, Itree

public class IntervalTreeArray extends Object implements Itree
Interval tree structure using arrays This is slightly faster than the new IntervalTree implementation
Author:
pcingola
  • 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

      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
    • mid

      protected int[] mid
    • intersectMarkers

      protected Marker[][] intersectMarkers
    • lastIdx

      protected int lastIdx
  • Constructor Details

    • IntervalTreeArray

      public IntervalTreeArray()
    • IntervalTreeArray

      public IntervalTreeArray(Markers markers)
      Instantiate an interval tree with a list of intervals
  • Method Details

    • add

      public void add(Marker interval)
      Description copied from interface: Itree
      Add an interval object to the interval tree's list
      Specified by:
      add in interface Itree
    • add

      public void add(Markers markers)
      Description copied from interface: Itree
      Add all intervals to interval tree's list
      Specified by:
      add in interface Itree
    • 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
      Specified by:
      build in interface Itree
    • 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 interface Itree
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Itree
    • 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
      Specified by:
      isInSync in interface Itree
    • iterator

      public Iterator<Marker> iterator()
      Specified by:
      iterator in interface Iterable<Marker>
    • load

      public void load(String fileName, Genome genome)
      Description copied from interface: Itree
      Load intervals from file
      Specified by:
      load in interface Itree
    • query

      public Markers query(Interval marker)
      Query index to find all VCF entries intersecting 'marker' Store VCF entries in 'results'
      Specified by:
      query in interface Itree
      Returns:
      All intervals that intersect 'interval'
    • 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
      Specified by:
      size in interface Itree
    • stab

      public Markers stab(int point)
      Description copied from interface: Itree
      Perform a stabbing query, returning the interval objects
      Specified by:
      stab in interface Itree
      Returns:
      All intervals intersecting 'point'
    • 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 String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(int idx)
    • toStringAll

      public String toStringAll()