hc_text-HilbertCurve-method: Add text to Hilbert curve

Description Usage Arguments Details Value Author(s) Examples

Description

Add text to Hilbert curve

Usage

1
2
## S4 method for signature 'HilbertCurve'
hc_text(object, ir, labels, x1 = NULL, x2 = x1, gp = gpar(), ...)

Arguments

object

A HilbertCurve-class object.

ir

an IRanges object that contains positions which correspond to text. The middle point of the interval will be the position of the text.

labels

text corresponding to intervals in ir.

x1

if start positions are not integers, they can be set by x1.

x2

if end positions are not integers, they can be set by x2.

gp

graphic parameters for text. It should be specified by gpar.

...

pass to grid.text. E.g. you can set text justification by just here.

Details

The text is added correspoding to the middle of each interval in ir.

Value

A data frame which contains coordinates (in the 2D space) of text.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

1
2
3
4
5
6
7
8
9
hc = HilbertCurve(1, 100, level = 4, reference = TRUE)

x = sort(sample(100, 20))
s = x[1:10*2 - 1]
e = x[1:10*2]
ir = IRanges(s, e)

labels = sample(letters, length(ir), replace = TRUE)
hc_text(hc, ir, labels = labels)

eilslabs/HilbertCurve documentation built on May 16, 2019, 1:23 a.m.