plot_pca: Perform a PCA for copy number profiles

Description Usage Arguments Value Examples

Description

Perform a PCA for copy number profiles in aneuHMM objects.

Usage

1
2
plot_pca(hmms, PC1 = 1, PC2 = 2, colorBy = NULL, plot = TRUE,
  exclude.regions = NULL)

Arguments

hmms

A list of aneuHMM objects or a character vector with files that contain such objects.

PC1

Integer specifying the first of the principal components to plot.

PC2

Integer specifying the second of the principal components to plot.

colorBy

A character vector of the same length as hmms which is used to color the points in the plot.

plot

Set to FALSE if you want to return the data.frame that is used for plotting instead of the plot.

exclude.regions

A GRanges-class with regions that will be excluded from the computation of the PCA. This can be useful to exclude regions with artifacts.

Value

A ggplot object or a data.frame if plot=FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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 the PCA
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)))
plot_pca(c(lung.files, liver.files), colorBy=classes, PC1=2, PC2=4)

AneuFinder documentation built on Nov. 8, 2020, 7:44 p.m.