Data Integrator (Python API)
Classes | Public Member Functions | Static Public Attributes | List of all members
cls.StaticRTree.CStaticRTree Class Reference

1D static R-tree. More...

Classes

class  _CIntv
 Test class. More...
 

Public Member Functions

def __init__ (s)
 
def __str__ (s)
 
def Initialize (s, intervals)
 Feed the object with interval data. More...
 
def IntersectPoint (s, pos)
 Query which intervals intersect with a given point. More...
 
def IntersectInterval (s, begin, end)
 Query which intervals intersect with a given closed interval. More...
 
def ClosestInterval (s, pos)
 Get the closest interval to a position. More...
 

Static Public Attributes

 mode
 
 tree = CStaticRTree();
 
 i1
 
 i2 = _CIntv("i2", 5, 12);
 
 i3 = _CIntv("i3", 14,17);
 
def rslt = tree.IntersectInterval(16, 1000);
 
 g = CHSEnsgenes(CPaths());
 
list onChr
 

Detailed Description

1D static R-tree.

Tree is constructed once from a set of intervals. No insert or delete
functions are available. Based on ideas presented by Martin Davis at
http://lin-ear-th-inking.blogspot.it/2007/06/packed-1-dimensional-r-tree.html

Constructor & Destructor Documentation

◆ __init__()

def cls.StaticRTree.CStaticRTree.__init__ (   s)

Member Function Documentation

◆ __str__()

def cls.StaticRTree.CStaticRTree.__str__ (   s)

◆ ClosestInterval()

def cls.StaticRTree.CStaticRTree.ClosestInterval (   s,
  pos 
)

Get the closest interval to a position.

    This method is the most generic query that can be done on an
    interval. It also has the most possible outcomes: If the query
    position is contained in interval(s), they will be reported. If it is
    outside any interval, the closest will be reported. However, if there
    are two or more closest intervals, all of them will reported.
    @param pos  Position to be queried.
    @return @c List of @c Tuples (@c interval, @c distance). The @c
    interval is the data item itself as supplied to the @ref Initialize
    method and @c distance is the (unsigned) distance from @c pos to the
    interval border. If it is set to 0, the interval covers the point.

◆ Initialize()

def cls.StaticRTree.CStaticRTree.Initialize (   s,
  intervals 
)

Feed the object with interval data.

    This function is used to import data into the tree. The method should
    be called only once, as there is no update process for the static
    R-tree.
    @param  intervals @c List of objects with interval-like
    properties. Each object is required to have a @c GetBegin() and a
    @c GetEnd() method in order to determine its borders.

◆ IntersectInterval()

def cls.StaticRTree.CStaticRTree.IntersectInterval (   s,
  begin,
  end 
)

Query which intervals intersect with a given closed interval.

    @param begin  Start position of query interval.
    @param end  End position (inclusive) of the query interval.
    @return @c List of intervals that intersect with the query interval.

◆ IntersectPoint()

def cls.StaticRTree.CStaticRTree.IntersectPoint (   s,
  pos 
)

Query which intervals intersect with a given point.

    @param pos  Position to be queried.
    @return @c List of intervals that include this position.

Member Data Documentation

◆ g

cls.StaticRTree.CStaticRTree.g = CHSEnsgenes(CPaths());
static

◆ i1

cls.StaticRTree.CStaticRTree.i1
static

◆ i2

cls.StaticRTree.CStaticRTree.i2 = _CIntv("i2", 5, 12);
static

◆ i3

cls.StaticRTree.CStaticRTree.i3 = _CIntv("i3", 14,17);
static

◆ mode

cls.StaticRTree.CStaticRTree.mode
static

◆ onChr

list cls.StaticRTree.CStaticRTree.onChr
static
Initial value:
= [x for x in g.values() if x.Chrom=="22" and \
x.Biotype=="protein_coding"];

◆ rslt

def cls.StaticRTree.CStaticRTree.rslt = tree.IntersectInterval(16, 1000);
static

◆ tree

cls.StaticRTree.CStaticRTree.tree = CStaticRTree();
static

The documentation for this class was generated from the following file: