Description Usage Arguments Details Value Examples
View source: R/dimension_reduction.R
runs a Principal Component Analysis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
gobject |
giotto object |
expression_values |
expression values to use |
reduction |
cells or genes |
name |
arbitrary name for PCA run |
genes_to_use |
subset of genes to use for PCA |
return_gobject |
boolean: return giotto object (default = TRUE) |
center |
center data first (default = FALSE) |
scale_unit |
scale features before PCA (default = FALSE) |
ncp |
number of principal components to calculate |
method |
which implementation to use |
rev |
do a reverse PCA |
verbose |
verbosity of the function |
... |
additional parameters for PCA (see details) |
See prcomp_irlba
and PCA
for more information about other parameters.
genes_to_use = NULL: will use all genes from the selected matrix
genes_to_use = <hvg name>: can be used to select a column name of
highly variable genes, created by (see calculateHVG
)
genes_to_use = c('geneA', 'geneB', ...): will use all manually provided genes
giotto object with updated PCA dimension recuction
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 1. create giotto object
expr_path = system.file("extdata", "seqfish_field_expr.txt", package = 'Giotto')
loc_path = system.file("extdata", "seqfish_field_locs.txt", package = 'Giotto')
VC_small <- createGiottoObject(raw_exprs = expr_path, spatial_locs = loc_path)
# 2. normalize giotto
VC_small <- normalizeGiotto(gobject = VC_small, scalefactor = 6000)
VC_small <- addStatistics(gobject = VC_small)
# 3. dimension reduction
VC_small <- calculateHVG(gobject = VC_small)
VC_small <- runPCA(gobject = VC_small)
plotPCA(VC_small)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.