plot_pca {AneuFinder} | R Documentation |
Perform a PCA for copy number profiles in aneuHMM
objects.
plot_pca(hmms, PC1 = 1, PC2 = 2, colorBy = NULL, plot = TRUE, exclude.regions = NULL)
hmms |
A list of |
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 |
plot |
Set to |
exclude.regions |
A |
A ggplot
object or a data.frame if plot=FALSE
.
## 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)