hc_rect-HilbertCurve-method {HilbertCurve} | R Documentation

## Add rectangles on Hilbert curve

### Description

Add rectangles on Hilbert curve

### Usage

    ## S4 method for signature 'HilbertCurve'
    hc_rect(object, ir, x1 = NULL, x2 = NULL,
        gp = gpar(fill = "red"),
        mean_mode = c("w0", "absolute", "weighted"))

### Arguments

`object` | A `HilbertCurve-class` object.
`ir` | an `IRanges` object which specifies the input intervals.
`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 rectangles. It should be specified by `gpar`. Note you cannot set `linejoin` and `lineend`.
`mean_mode` | when a segment in the curve can not be overlapped with intervals in `ir`, how to calculate the mean values for this segment. See explanation in `hc_points,HilbertCurve-method`.

### Details

Rectangles are put if a segment in the Hilbert curve overlaps with the input intervals. You cannot set the width or height of the rectangles. It is always fixed (actually it is a square).

It can be thought as the low-resolution version of `hc_layer,HilbertCurve-method`.

### Value

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

### Author(s)

Zuguang Gu <z.gu@dkfz.de>

### Examples

    hc = HilbertCurve(1, 100, level = 4, reference = TRUE)

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

[Package HilbertCurve version 1.12.0 Index]