runPCA: Calculate Principal Components on the cell-cisTopic...

View source: R/PlotCells.R

runPCAR Documentation

Calculate Principal Components on the cell-cisTopic distributions

Description

Calculate Principal Components (PCs) on the cell-cisTopic distributions

Usage

runPCA(object, target, method = "Z-score", seed = 123, ...)

Arguments

object

Initialized cisTopic object, after the object@selected.model has been filled.

target

Whether dimensionality reduction should be applied on cells ('cell') or regions (region). Note that for speed and clarity reasons, dimesionality reduction on regions will only be done using the regions assigned to topics with high confidence (see binarizecisTopics()).

method

Select the method for processing the cell assignments: 'Z-score' and 'Probability'. In the case of regions, an additional method, 'NormTop' is available (see getRegionScores()).

...

See prcomp from the package stats.

Details

'Z-score' computes the Z-score for each topic assingment per cell/region. 'Probability' divides the topic assignments by the total number of assignments in the cell/region in the last iteration plus alpha. If using 'NormTop', regions are given an score defined by: \beta_{w, k} (\log \beta_{w,k} - 1 / K \sum_{k'} \log \beta_{w,k'}).

Value

Returns a cisTopic object with a list of PCA information stored in object@dr$cell$PCA or object@dr$region$PCA.

Slots

loadings

Matrix whose columns contain eigenvectors

sdev

Standard deviations of the PCs

var.coord

Coordinates of the variables (correlation between the variables and the PCs)

var.cos2

Cos2 of the variables. Measures their representation quality.

var.contrib

Contributions of the variables to the PCs

ind.coord

Coordinates of individuals

ind.cos2

Cos2 of the individuals

ind.contrib

Contributions of the individuals to the PCs

eigs

Eigenvalues, which measure the variability retained per PC

variance.explained

Percentage of variance explained by each component


aertslab/cisTopic documentation built on April 6, 2024, 9:31 p.m.