identify significant principal components (PCs) using an screeplot (a.k.a. elbowplot)
screePlot(
gobject,
spat_unit = NULL,
feat_type = NULL,
dim_reduction_name = NULL,
name = deprecated(),
expression_values = c("normalized", "scaled", "custom"),
reduction = c("cells", "feats"),
method = c("irlba", "exact", "random", "factominer"),
rev = FALSE,
feats_to_use = NULL,
center = FALSE,
scale_unit = FALSE,
ncp = 100,
ylim = c(0, 20),
verbose = TRUE,
show_plot = NULL,
return_plot = NULL,
save_plot = NULL,
save_param = list(),
default_save_name = "screePlot",
...
)
giotto object
spatial unit (e.g. "cell")
feature type (e.g. "rna", "dna", "protein")
name of PCA
deprecated
expression values to use
cells or features
which implementation to use
do a reverse PCA
subset of features to use for PCA
center data before PCA
scale features before PCA
numeric. max number of principal components to plot
numeric. y-axis limits on scree plot
be verbose
logical. show plot
logical. return ggplot object
logical. save the plot
list of saving parameters, see
showSaveParameters
default save name for saving, don't change, change save_name in save_param
additional arguments to pca function, see runPCA
ggplot object for scree method
Screeplot works by plotting the explained variance of each
individual PC in a barplot allowing you to identify which PC provides a
significant contribution (a.k.a 'elbow method').
Screeplot will use an available pca object, based on the parameter 'name',
or it will create it if it's not available (see runPCA
)
g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#> python already initialized in this session
#> active environment : '/usr/bin/python3'
#> python version : 3.10
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#> "/usr/bin/python3"
screePlot(g)
#> PCA with name: pca already exists and will be used for the screeplot