treeFromInterval: treeFromInterval

Description Usage Arguments Value Examples

View source: R/IntervalTree.R

Description

Method for constructing interval tree for a list of Interval objects. A node in the tree is a list object. As the leftChild and rightChild of each node are nodes themselves, a binary interval tree stored in a recursive list will be produced if this function is executed successfully.

Usage

1
treeFromInterval(interval_list)

Arguments

interval_list

a list of Interval objects

Value

a list object representing a binary interval tree

Examples

1
2
3
4
5
6
7
8
i1 <- new("Interval", start=1.1,end=1.2, key="dummy1")
i2 <- new("Interval", start=-1.1,end=1.2, key="dummy2")
i3 <- new("Interval", start=-10.1,end=-1.2, key="dummy3")
i4 <- new("Interval", start=-1.1,end=1.2, key="dummy4")
i5 <- new("Interval", start=-10,end=2, key="dummy5")
i6 <- new("Interval", start=-8,end=-5, key="dummy6")
myList <- list(i1, i2, i3, i4, i5, i6)
atree <- treeFromInterval(myList)

rIntervalTree documentation built on May 2, 2019, 3:04 a.m.