Class IntervalTree

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

public class IntervalTree extends Object implements Itree, Serializable
An Interval Tree is essentially a map from intervals to objects, which can be queried for all data associated with a particular interval of point
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected IntervalNode
     
    protected boolean
     
    protected Markers
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiate a new interval tree with no intervals
    IntervalTree(Markers intervals)
    Instantiate an interval tree with a list of intervals
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Marker interval)
    Add an interval object to the interval tree's list Note: Marks the tree as 'not inSync', but will not rebuild the tree until the next query or call to build
    void
    add(Markers markers)
    Add all intervals to interval tree's list Note: Marks the tree as 'not inSync', but will not rebuild the tree until the next query or call to build
    void
    Build the interval tree to reflect the list of intervals, Will not run if this is currently in sync
     
    boolean
     
    boolean
    Determine whether this interval tree is currently a reflection of all intervals in the interval list
     
    void
    load(String fileName, Genome genome)
    Load intervals from file
    query(Interval interval)
    Perform an interval query, returning the intervals that intersect with 'interval'
    int
    Size: number of entries in the interval list
    stab(int point)
    Perform a stabbing query, returning the interval objects
     

    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

    • intervals

      protected Markers intervals
    • inSync

      protected boolean inSync
  • Constructor Details

    • IntervalTree

      public IntervalTree()
      Instantiate a new interval tree with no intervals
    • IntervalTree

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

    • add

      public void add(Marker interval)
      Add an interval object to the interval tree's list Note: Marks the tree as 'not inSync', but will not rebuild the tree until the next query or call to build
      Specified by:
      add in interface Itree
      Parameters:
      interval - the interval object to add
    • add

      public void add(Markers markers)
      Add all intervals to interval tree's list Note: Marks the tree as 'not inSync', but will not rebuild the tree until the next query or call to build
      Specified by:
      add in interface Itree
    • build

      public void build()
      Build the interval tree to reflect the list of intervals, Will not run if this is currently in sync
      Specified by:
      build in interface Itree
    • getIntervals

      public Markers getIntervals()
      Specified by:
      getIntervals in interface Itree
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Itree
    • isInSync

      public boolean isInSync()
      Determine whether this interval tree is currently a reflection of all intervals in the interval list
      Specified by:
      isInSync in interface Itree
      Returns:
      true if no changes have been made since the last build
    • 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 interval)
      Perform an interval query, returning the intervals that intersect with 'interval'
      Specified by:
      query in interface Itree
      Returns:
      All intervals that intersect 'interval'
    • size

      public int size()
      Size: number of entries in the interval list
      Specified by:
      size in interface Itree
    • stab

      public Markers stab(int point)
      Perform a stabbing query, returning the interval objects
      Specified by:
      stab in interface Itree
      Returns:
      All intervals intersecting 'point'
    • toString

      public String toString()
      Overrides:
      toString in class Object