Last data update: 2014.03.03

R: Plot aneuploidy state
heatmapAneuploidiesR Documentation

Plot aneuploidy state

Description

Plot a heatmap of aneuploidy state for multiple samples. Samples can be clustered and the output can be returned as data.frame.

Usage

heatmapAneuploidies(hmms, ylabels = NULL, cluster = TRUE,
  as.data.frame = FALSE)

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.

cluster

If TRUE, the samples will be clustered by similarity in their CNV-state.

as.data.frame

If TRUE, instead of a plot, a data.frame with the aneuploidy state for each sample will be returned.

Value

A ggplot object or a data.frame, depending on option as.data.frame.

Author(s)

Aaron Taudt

Examples

## Get results from a small-cell-lung-cancer
folder <- system.file("extdata", "primary-lung", "hmms", package="AneuFinderData")
files <- list.files(folder, full.names=TRUE)
## Plot the ploidy state per chromosome
heatmapAneuploidies(files, cluster=FALSE)
## Return the ploidy state as data.frame
df <- heatmapAneuploidies(files, cluster=FALSE, as.data.frame=TRUE)
head(df)

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/heatmapAneuploidies.Rd_%03d_medium.png", width=480, height=480)
> ### Name: heatmapAneuploidies
> ### Title: Plot aneuploidy state
> ### Aliases: heatmapAneuploidies
> 
> ### ** Examples
> 
> ## Get results from a small-cell-lung-cancer
> folder <- system.file("extdata", "primary-lung", "hmms", package="AneuFinderData")
> files <- list.files(folder, full.names=TRUE)
> ## Plot the ploidy state per chromosome
> heatmapAneuploidies(files, cluster=FALSE)
Loading univariate HMMs from files ... 0.59s
finding most frequent state for each sample and chromosome ... 11.06s
> ## Return the ploidy state as data.frame
> df <- heatmapAneuploidies(files, cluster=FALSE, as.data.frame=TRUE)
Loading univariate HMMs from files ... 0.17s
finding most frequent state for each sample and chromosome ... 9.54s
> head(df)
                sample 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
1 AvdB150303_I_001.bam 4 2 5 2 2 2 2 2 2  2  3  2  5  4  1  2  3  4  3  4  2  3
2 AvdB150303_I_002.bam 4 2 5 2 2 2 2 2 2  2  3  2  5  4  1  2  3  5  3  4  2  2
3 AvdB150303_I_003.bam 3 1 5 2 2 3 3 2 1  2  3  3  9  2  1  2  4  5  6  6  2  1
4 AvdB150303_I_004.bam 4 2 2 2 2 2 2 2 2  2  3  2  5  4  1  2  3  5  3  4  2  3
5 AvdB150303_I_005.bam 4 2 4 2 2 2 2 2 2  3  3  2  4  4  0  1  3  4  3  3  1  2
6 AvdB150303_I_006.bam 4 2 5 2 2 2 2 2 2  2  3  2  2  3  1  2  3  5  3  4  2  3
  X
1 4
2 4
3 4
4 5
5 4
6 4
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>