This function performs principal component analysis based on cell-type-specific gene expression of spatial microregions.
Usage
GetPCList(
mergedncem,
min.cells = 3,
min.features = 5,
nfeatures = 3000,
ncores = 1,
do.scale = TRUE
)
Arguments
- mergedncem
A matrix of cell-type-specific gene expression data, with rows representing genes and columns representing spatial microregions by cell type.
- min.cells
Integer, minimum number of non-zero counts required per gene to retain the gene in the analysis. Default is 3.
- min.features
Integer, minimum number of features (genes) required per spatial microregion to retain the microregion in the analysis. Default is 5.
- nfeatures
Integer, number of variable features to select for PCA. Default is 3000.
- ncores
Integer, number of cores to use for parallel processing. Default is 1.
- do.scale
Logical, whether to scale data before performing PCA. Default is TRUE.
Value
A named list of matrices, where each matrix contains the PCs for a specific cell type. Cell types with insufficient data are excluded from the result.
Details
The function first filters the input matrix based on the specified minimum number of cells and features. It then creates Seurat objects for each cell type, normalizes the data, identifies variable features, scales the data, and performs PCA. The resulting PCs for each cell type are returned as a list.