plotOneMetric: Plot one graph related to one set of metrics.

View source: R/CNVMetricsInternalMethods.R

plotOneMetricR Documentation

Plot one graph related to one set of metrics.

Description

Plot one heatmap of one set of metrics present in a a CNVMetric object.

Usage

plotOneMetric(metric, type, colorRange, show_colnames, silent, ...)

Arguments

metric

a CNVMetric object containing the metrics calculated by calculateOverlapMetric.

type

a character string indicating which graph to generate. This should be (an unambiguous abbreviation of) one of "AMPLIFICATION" or "DELETION" or "LOG2RATIO".

show_colnames

a boolean specifying if column names are be shown.

silent

a boolean specifying if the plot should not be drawn.

...

further arguments passed to pheatmap::pheatmap() method.

Value

a gtable object containing the heatmap for the specified metric.

Author(s)

Astrid DeschĂȘnes

See Also

The default method pheatmap::pheatmap().

Examples


## 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)


adeschen/CNVMetrics documentation built on July 19, 2023, 10:24 p.m.