PCA_plotter: This function allows you to plot PCA

View source: R/pca.R

PCA_plotterR Documentation

This function allows you to plot PCA

Description

This function allows you to plot PCA

Usage

PCA_plotter(se, nfeature, color, shape, assays, xaxisPC, yaxisPC,
log_option = FALSE)

Arguments

se

SummarizedExperiment object

nfeature

number of features

color

choose a color

shape

choose a shape

assays

array of assay names from se

xaxisPC

the PC to plot as the x axis

yaxisPC

the PC to plot as the y axis

log_option

TRUE if data should be logged before plotting (recommended for sequencing counts), FALSE if data should not be logged (for instance, data is already logged); FALSE by default

Value

List containing PCA info, PCA variance and PCA plot

Examples

library(scran)
se <- mockSCE()
se_object_ComBat_Seq <- BatchQC::batch_correct(se, method = "ComBat-Seq",
                                            assay_to_normalize = "counts",
                                            batch = "Mutation_Status",
                                            covar = "Treatment",
                                            output_assay_name =
                                                "ComBat_Seq_Corrected")
pca_plot <- BatchQC::PCA_plotter(se = se_object_ComBat_Seq,
                            nfeature = 2, color = "Mutation_Status",
                            shape = "Treatment",
                            assays = c("counts", "ComBat_Seq_Corrected"),
                            xaxisPC = 1, yaxisPC = 2, log_option = FALSE)
pca_plot$plot
pca_plot$var_explained


compbiomed/BatchQC documentation built on Nov. 16, 2024, 5:47 a.m.