stat_reduce-method: Reduce an object.

Description Usage Arguments Value Author(s) See Also Examples

Description

Reduce GRanges, IRanges or TxDb object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'GRanges'
stat_reduce(data, ...,
           xlab, ylab, main,
           drop.empty.ranges = FALSE,
           min.gapwidth = 1L,
           facets = NULL, geom = NULL)

## S4 method for signature 'IRanges'
stat_reduce(data, ...,
           xlab, ylab, main,
           drop.empty.ranges = FALSE,
           min.gapwidth = 1L,
           with.inframe.attrib=FALSE,
           facets = NULL, geom = NULL)

## S4 method for signature 'TxDbOREnsDb'
stat_reduce(data, ...)

Arguments

data

GRanges, IRanges or TxDb object.

...

passed to aesthetics mapping.

xlab

x label.

ylab

y label.

main

title.

drop.empty.ranges

pass to reduce function.

min.gapwidth

pass to reduce function.

with.inframe.attrib

pass to reduce function.

facets

pass to reduce function.

geom

geometric type.

Value

a ggplot object.

Author(s)

Tengfei Yin

See Also

reduce.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
set.seed(1)
N <- 1000
library(GenomicRanges)

gr <- GRanges(seqnames =
              sample(c("chr1", "chr2", "chr3"),
                     size = N, replace = TRUE),
              IRanges(
                      start = sample(1:300, size = N, replace = TRUE),
                      width = sample(70:75, size = N,replace = TRUE)),
              strand = sample(c("+", "-", "*"), size = N,
                replace = TRUE),
              value = rnorm(N, 10, 3), score = rnorm(N, 100, 30),
              sample = sample(c("Normal", "Tumor"),
                size = N, replace = TRUE),
              pair = sample(letters, size = N,
                replace = TRUE))

ggplot(gr) + stat_reduce()
autoplot(gr, stat = "reduce")
strand(gr) <- "*"
ggplot(gr) + stat_reduce()

library(TxDb.Hsapiens.UCSC.hg19.knownGene)
data(genesymbol, package = "biovizBase")
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
## made a track comparing full/reduce stat.
ggplot(txdb) + stat_reduce(which = genesymbol["RBM17"])

ggbio documentation built on Nov. 8, 2020, 5:04 p.m.