cadnano.pointquadtree module

derived from MIT licensed https://github.com/mdrasmus/compbio/blob/master/rasmus/quadtree.py adds in joins and ability to remove nodes

class Quadtree(x, y, size, min_size=4)

Bases: cadnano.pointquadtree.QuadtreeBase

getSize()
insertNode(node)
queryNode(node, distance, scale_factor=1.0)
queryPoint(query_point, distance)
removeNode(node)
class QuadtreeBase(x, y, size, min_size, parent=None, depth=0)

Bases: object

QuadTreeBase that has a configurable lower size limit of a box set class min_size before using with:

Quadtree.min_size = my_min_size

QuadTrees can have both nodes and children Quadtrees if a node’s rect spans a given Quadtree’s center

MAX_DEPTH = 20
SPLIT_THRESHOLD = 10
findNodeByNode(query_node)

look for the exact node assumes same node doesn’t exist more than once in Quadtree return the Node and the nodes parent

findNodeByRect(rect)

look for the exact node assumes same node doesn’t exist more than once in Quadtree return the Node and the nodes parent

getDepth()
getSize()
insertIntoChildren(node)
insertNode(node)
join()
query(point, rect, distance, node_results)
queryRect(rect, node_results)
rect(scale_factor=1.0)
removeNode(node)
resize()
split()
allClose(a, b)
v2Distance(a, b)