scale: get x scale breaks and labels

Description Usage Arguments Value Author(s) Examples

Description

get x scale breaks and labels for GRanges with different coordintes(currently only "truncate_gaps" and "genome" supported).

Usage

1
2
 ## S4 method for signature 'GRanges'
getXScale(obj, type = c("default", "all", "left", "right"))

Arguments

obj

a GRanges object. "coord" in metadata shows proper coordinates transformation for this object.

type

types of labels for transformed data.

Value

list of breaks and labels.

Author(s)

Tengfei Yin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(GenomicRanges)
gr1 <- GRanges("chr1", IRanges(start = c(100, 300, 600),
                               end = c(200, 400, 800)))
shrink.fun1 <- shrinkageFun(gaps(gr1), max.gap = maxGap(gaps(gr1), 0.15))
shrink.fun2 <- shrinkageFun(gaps(gr1), max.gap = 0)
s1 <- shrink.fun1(gr1)
getXScale(s1)
#  coord:genome
set.seed(1)
gr1 <- GRanges("chr1", IRanges(start = as.integer(runif(20, 1, 100)),
width = 5))
gr2 <- GRanges("chr2", IRanges(start = as.integer(runif(20, 1, 100)),
width = 5))
gr <- c(gr1, gr2)
gr.t <- transformToGenome(gr, space.skip = 1)
getXScale(gr.t)

lawremi/biovizBase documentation built on Dec. 21, 2021, 9:42 a.m.