1D static R-tree.
More...
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
◆ __init__()
def cls.StaticRTree.CStaticRTree.__init__ |
( |
|
s | ) |
|
◆ __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.
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
The documentation for this class was generated from the following file: