View source: R/CNVMetricsMethods.R
plotMetric | R Documentation |
CNVMetric
objectThis function plots one heatmap (or two heatmaps) of the
metrics present in
a CNVMetric
object. For the overlapping metrics, the user can select
to print the heatmap related to amplified or deleted regions or both. The
NA
values present in the metric matrix are transformed into zero for
the creation of the heatmap.
plotMetric(
metric,
type = "ALL",
colorRange = c(c("white", "darkblue")),
show_colnames = FALSE,
silent = TRUE,
...
)
metric |
a |
type |
a single |
colorRange |
a |
show_colnames |
a |
silent |
a |
... |
further arguments passed to
|
a gtable
object containing the heatmap(s) of the specified
metric(s).
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 both amplification and deletion metrics
plotMetric(metric, type="ALL")
## Extra parameters, used by pheatmap(), can also be passed to the function
## Here, we have the metric values print to the cell while the
## row names and column names are removed
plotMetric(metric, type="DELETION", show_rownames=FALSE,
show_colnames=FALSE, main="deletion", display_numbers=TRUE,
number_format="%.2f")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.