Class IntervalTreeOri

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<Marker>, Itree

    public class IntervalTreeOri
    extends java.lang.Object
    implements Itree, java.io.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      IntervalTreeOri()
      Instantiate a new interval tree with no intervals
      IntervalTreeOri​(Markers intervals)
      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 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()
      Build the interval tree to reflect the list of intervals, Will not run if this is currently in sync
      Markers getIntervals()  
      boolean isEmpty()  
      boolean isInSync()
      Determine whether this interval tree is currently a reflection of all intervals in the interval list
      java.util.Iterator<Marker> iterator()  
      void load​(java.lang.String fileName, Genome genome)
      Load intervals from file
      Markers query​(Interval interval)
      Perform an interval query, returning the intervals that intersect with 'interval'
      int size()
      Size: number of entries in the interval list
      Markers stab​(int point)
      Perform a stabbing query, returning the interval objects
      java.lang.String toString()  
      • 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
    • Constructor Detail

      • IntervalTreeOri

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

        public IntervalTreeOri​(Markers intervals)
        Instantiate an interval tree with a list of intervals
    • Method Detail

      • 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
      • 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 java.util.Iterator<Marker> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<Marker>
      • load

        public void load​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object