getPCA {singleCellTK} | R Documentation

## Perform PCA on a SingleCellExperiment Object A wrapper to runPCA function to compute principal component analysis (PCA) from a given SingleCellExperiment object.

### Description

Perform PCA on a SingleCellExperiment Object A wrapper to runPCA function to compute principal component analysis (PCA) from a given SingleCellExperiment object.

### Usage

    getPCA(
      inSCE,
      useAssay = "logcounts",
      useAltExp = NULL,
      reducedDimName = "PCA",
      ndim = 50,
      scale = TRUE,
      ntop = NULL
    )

### Arguments

`inSCE` | Input SingleCellExperiment object.
`useAssay` | Assay to use for PCA computation. If `useAltExp` is specified, `useAssay` has to exist in `assays(altExp(inSCE, useAltExp))`. Default `"logcounts"`
`useAltExp` | The subset to use for PCA computation, usually for the selected.variable features. Default `NULL`.
`reducedDimName` | Name to use for the reduced output assay. Default `"PCA"`.
`ndim` | Number of principal components to obtain from the PCA computation. Default `50`.
`scale` | Logical scalar, whether to standardize the expression values. Default `TRUE`.
`ntop` | Number of top features to use as a further variable feature selection. Default `NULL`.

### Value

A SingleCellExperiment object with PCA computation updated in `reducedDim(inSCE, reducedDimName)`.

### Examples

    data(scExample, package = "singleCellTK")
    sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
    logcounts(sce) <- log(counts(sce) + 1)
    sce <- getPCA(sce, ntop = 500)

[Package singleCellTK version 2.0.0 Index]