View source: R/CNVMetricsInternalMethods.R
plotOneMetric | R Documentation |
Plot one heatmap of one set of metrics present in a
a CNVMetric
object.
plotOneMetric(metric, type, colorRange, show_colnames, silent, ...)
metric |
a |
type |
a |
show_colnames |
a |
silent |
a |
... |
further arguments passed to
|
a gtable
object containing the heatmap for the specified
metric.
Astrid DeschĂȘnes
The default method pheatmap::pheatmap()
.
## Load required package to generate the samples
require(GenomicRanges)
## Create a GRangesList object with 3 samples
## The stand of the regions doesn't affect the calculation of the metric
demo <- GRangesList()
demo[["sample01"]] <- GRanges(seqnames = "chr1",
ranges = IRanges(start = c(1905048, 4554832, 31686841),
end = c(2004603, 4577608, 31695808)), strand = "*",
state = c("AMPLIFICATION", "AMPLIFICATION", "DELETION"))
demo[["sample02"]] <- GRanges(seqnames = "chr1",
ranges = IRanges(start = c(1995066, 31611222, 31690000),
end = c(2204505, 31689898, 31895666)), strand = c("-", "+", "+"),
state = c("AMPLIFICATION", "AMPLIFICATION", "DELETION"))
## The amplified region in sample03 is a subset of the amplified regions
## in sample01
demo[["sample03"]] <- GRanges(seqnames = "chr1",
ranges = IRanges(start = c(1906069, 4558838),
end = c(1909505, 4570601)), strand = "*",
state = c("AMPLIFICATION", "DELETION"))
## Calculating Sorensen metric
metric <- calculateOverlapMetric(demo, method="sorensen")
## Plot amplification metrics using darkorange color
CNVMetrics:::plotOneMetric(metric, type="AMPLIFICATION",
colorRange=c("white", "darkorange"), show_colnames=FALSE, silent=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.