multi_gene_pca: Combine multiple continuous variables through PCA

View source: R/multi_gene_pca.R

multi_gene_pcaR Documentation

Combine multiple continuous variables through PCA

Description

PCA is performed on cont_mat, the matrix of multiple continuous features. The first PC is returned, representing the dominant spatial signature of the feature set. Its direction is negated if necessary so that the majority of coefficients across features are positive (when the features are highly correlated, this encourages spots with higher values to represent areas of higher expression of the features).

Usage

multi_gene_pca(cont_mat)

Arguments

cont_mat

A matrix() with spots as rows and 2 or more continuous variables as columns.

Value

A numeric() vector with one element per spot, summarizing the multiple continuous variables.

Author(s)

Nicholas J. Eagles

See Also

Other functions for summarizing expression of multiple continuous variables simultaneously: multi_gene_sparsity(), multi_gene_z_score()


LieberInstitute/spatialLIBD documentation built on April 21, 2024, 6:47 p.m.