R/show_cn_group_profile.R
show_cn_group_profile.Rd
Show Summary Copy Number Profile for Sample Groups
show_cn_group_profile(
data,
groups = NULL,
fill_area = TRUE,
cols = NULL,
chrs = paste0("chr", c(1:22, "X")),
genome_build = c("hg19", "hg38", "T2T", "mm10", "mm9", "ce11"),
cutoff = 2L,
resolution_factor = 1L,
force_y_limit = TRUE,
highlight_genes = NULL,
repel = FALSE,
nrow = NULL,
ncol = NULL,
return_plotlist = FALSE
)
a CopyNumber
object or a data.frame containing
at least 'chromosome', 'start', 'end', 'segVal', 'sample' these columns.
a named list or a column name for specifying groups.
default is TRUE
, fill area with colors.
length-2 colors for AMP and DEL.
chromosomes start with 'chr'.
genome build version, used when data
is a data.frame
, should be 'hg19' or 'hg38'.
copy number value cutoff for splitting data into AMP and DEL.
The values equal to cutoff are discarded. Default is 2
, you can also set
a length-2 vector, e.g. c(2, 2)
.
an integer to control the resolution.
When it is 1
(default), compute frequency in each cytoband.
When it is 2
, use compute frequency in each half cytoband.
default is TRUE
, force multiple plots
gene list to highlight. have same y ranges. You can also set a length-2 numeric value.
if TRUE
(default is FALSE
), repel highlight genes to
avoid overlap.
number of rows in the plot grid when multiple samples are selected.
number of columns in the plot grid when multiple samples are selected.
default is FALSE
, if TRUE
, return a plot list instead of a combined plot.
a (list of) ggplot
object.
load(system.file("extdata", "toy_copynumber.RData",
package = "sigminer", mustWork = TRUE
))
p1 <- show_cn_group_profile(cn)
p1
# \donttest{
ss <- unique(cn@data$sample)
p2 <- show_cn_group_profile(cn, groups = list(a = ss[1:5], b = ss[6:10]))
p2
p3 <- show_cn_group_profile(cn,
groups = list(g1 = ss[1:5], g2 = ss[6:10]),
force_y_limit = c(-1, 1), nrow = 2
)
p3
## Set custom cutoff for custom data
data <- cn@data
data$segVal <- data$segVal - 2L
p4 <- show_cn_group_profile(data,
groups = list(g1 = ss[1:5], g2 = ss[6:10]),
force_y_limit = c(-1, 1), nrow = 2,
cutoff = c(0, 0)
)
p4
## Add highlight gene
p5 <- show_cn_group_profile(cn, highlight_genes = c("TP53", "EGFR"))
p5
# }