Last data update: 2014.03.03

R: Genome wide heatmap of CNV-state
heatmapGenomewideR Documentation

Genome wide heatmap of CNV-state

Description

Plot a genome wide heatmap of copy number variation state. This heatmap is best plotted to file, because in most cases it will be too big for cleanly plotting it to screen.

Usage

heatmapGenomewide(hmms, ylabels = NULL, classes = NULL,
  classes.color = NULL, file = NULL, cluster = TRUE, plot.SCE = TRUE,
  hotspots = NULL)

Arguments

hmms

A list of aneuHMM objects or files that contain such objects.

ylabels

A vector with labels for the y-axis. The vector must have the same length as hmms. If NULL the IDs from the aneuHMM objects will be used.

classes

A character vector with the classification of the elements on the y-axis. The vector must have the same length as hmms. If specified the clustering algorithm will try to display similar categories together in the dendrogram.

classes.color

A (named) vector with colors that are used to distinguish classes. Names must correspond to the unique elements in classes.

file

A PDF file to which the heatmap will be plotted.

cluster

Either TRUE or FALSE, indicating whether the samples should be clustered by similarity in their CNV-state.

plot.SCE

Logical indicating whether SCE events should be plotted.

hotspots

A GRanges object with coordinates of genomic hotspots (see hotspotter).

Value

A ggplot object or NULL if a file was specified.

Examples

## Get results from a small-cell-lung-cancer
lung.folder <- system.file("extdata", "primary-lung", "hmms", package="AneuFinderData")
lung.files <- list.files(lung.folder, full.names=TRUE)
## Get results from the liver metastasis of the same patient
liver.folder <- system.file("extdata", "metastasis-liver", "hmms", package="AneuFinderData")
liver.files <- list.files(liver.folder, full.names=TRUE)
## Plot a clustered heatmap
classes <- c(rep('lung', length(lung.files)), rep('liver', length(liver.files)))
labels <- c(paste('lung',1:length(lung.files)), paste('liver',1:length(liver.files)))
heatmapGenomewide(c(lung.files, liver.files), ylabels=labels, classes=classes,
                 classes.color=c('blue','red'))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(AneuFinder)
Loading required package: GenomicRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: cowplot
Loading required package: ggplot2

Attaching package: 'cowplot'

The following object is masked from 'package:ggplot2':

    ggsave

Loading required package: AneuFinderData
Loading AneuFinder
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/AneuFinder/heatmapGenomewide.Rd_%03d_medium.png", width=480, height=480)
> ### Name: heatmapGenomewide
> ### Title: Genome wide heatmap of CNV-state
> ### Aliases: heatmapGenomewide
> 
> ### ** Examples
> 
> ## Get results from a small-cell-lung-cancer
> lung.folder <- system.file("extdata", "primary-lung", "hmms", package="AneuFinderData")
> lung.files <- list.files(lung.folder, full.names=TRUE)
> ## Get results from the liver metastasis of the same patient
> liver.folder <- system.file("extdata", "metastasis-liver", "hmms", package="AneuFinderData")
> liver.files <- list.files(liver.folder, full.names=TRUE)
> ## Plot a clustered heatmap
> classes <- c(rep('lung', length(lung.files)), rep('liver', length(liver.files)))
> labels <- c(paste('lung',1:length(lung.files)), paste('liver',1:length(liver.files)))
> heatmapGenomewide(c(lung.files, liver.files), ylabels=labels, classes=classes,
+                  classes.color=c('blue','red'))
Loading univariate HMMs from files ... 1.25s
Getting segments ... 5.09s
Making consensus template ... 6.31s
clustering ... 0.07s
reordering ...
Elapsed time = 0.02599573 secs 
Transforming coordinates ... 1.6s
Making the plot ... 5.65s
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>