prepareLabels: prepareLabels

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Prepare the Labels to plot.

Usage

1

Arguments

labels

(character) labels to plot. (defaults to NULL)

x

(list or GRangesList) The list or GRangesList where extracting the labels

Value

prepareLabels return a vector with the same length as the length of x. If labels is NULL and x have names, it will return the names of x. If there are not names it will return numbers as labels. If labes is not NULL, prepareLabels will cut or recycle the names as needed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#List of GRanges
seg.data <- list(a = regioneR::toGRanges(data.frame(chr = c("chr1", "chr1", "chr2", "chr5"), start = c(0,50000,8014630,14523572), end = c(48953, 7023664,9216331,153245687), lrr = c(NA,0.25,1.5,NA),baf = c(1.5,2.5,NA,6), id = c("rs52456","rs52457","rs52458","rs52459"))),
                    b=regioneR::toGRanges(data.frame(chr = c("chr1", "chr1", "chr2", "chr5"), start = c(0,50000,8014630,14523572), end = c(48953, 7023664,9216331,153245687), lrr = c(2.5,NA,1.5,0.25), baf = c(1.5,2.5,NA,6), id = c("rs52456","rs52457","rs52458","rs52459"))))
prepareLabels(x = seg.data)

#GRangesList
seg.data <- GRangesList(a = regioneR::toGRanges(data.frame(chr = c("chr1", "chr1", "chr2", "chr5"), start = c(0,50000,8014630,14523572), end = c(48953, 7023664,9216331,153245687), lrr = c(NA,0.25,1.5,NA), baf = c(1.5,2.5,NA,6), id = c("rs52456","rs52457","rs52458","rs52459"))),
                        b = regioneR::toGRanges(data.frame(chr = c("chr1", "chr1", "chr2", "chr5"), start = c(0,50000,8014630,14523572), end = c(48953, 7023664,9216331,153245687), lrr = c(2.5,NA,1.5,0.25), baf = c(1.5,2.5,NA,6), id = c("rs52456","rs52457","rs52458","rs52459"))))

prepareLabels(x = seg.data)

CopyNumberPlots documentation built on Nov. 8, 2020, 6:51 p.m.