CreateSpatialPCAObject: Create the SpatialPCA object with filtering and normalization...

View source: R/SpatialPCA.R

CreateSpatialPCAObjectR Documentation

Create the SpatialPCA object with filtering and normalization step.

Description

Create the SpatialPCA object with filtering and normalization step.

Usage

CreateSpatialPCAObject(
  counts,
  location,
  covariate = NULL,
  project = "SpatialPCA",
  gene.type = "spatial",
  sparkversion = "spark",
  numCores_spark = 1,
  gene.number = 3000,
  customGenelist = NULL,
  min.loctions = 20,
  min.features = 20
)

Arguments

counts

Gene expression count matrix (matrix), the dimension is m x n, where m is the number of genes and n is the number of locations.

location

Spatial location matrix (matrix), the dimension is n x d, n is the number of locations, d is dimensin of spatial coordinates, e.g. d=2 for locations on 2D space. The rownames of locations and the colnames of count matrix should be matched.

covariate

The covariates in experiments (matrix, if any covariate included), n x q, n is the number of locations, q is the number of covariates. The rownames of covariates and the rownames of locations should be matched.

project

Name of the project (for record keeping).

gene.type

The type of genes to be used: "spatial" for spatially expressed genes; "hvg" for highly variable genes; "custom" for user specified genes, default is "spatial".

sparkversion

In spatial gene selection, specify "spark" for small sample size data for higher detection power of spatial genes, "sparkx" for large sample size data for saving time and memory.

numCores_spark

If gene.type="spatial", specify the number of CPU cores in SPARK package to use when selecting spatial genes.

gene.number

The number of top highly variable genes if gene.selection=="hvg" (use all HVG genes if this number is not specified); number of top spatially expressed genes if gene.selection=="spatial" (use all significant spatially expressed genes if this number is not specified).

customGenelist

A list of user specified genes if gene.type=="custom".

min.loctions

The features (genes) detected in at least min.loctions number of loctions, default is 20.

min.features

The locations where at least min.features number of features (genes) are detected, default is 20.

Value

Returns SpatialPCA object, with filtered and normalized gene expression matrix and corresponding location matrix.


shangll123/SpatialPCA documentation built on April 17, 2024, 3:15 a.m.