pcaVariances-set: Set PCA variances

pcaVariances<-R Documentation

Set PCA variances

Description

Set PCA variances

Usage

pcaVariances(x, ...) <- value

Arguments

x

SCtkE object

...

other parameters

value

PCA variances DataFrame()

Value

A SCtkExperiment object with the pcaVariances slot set.

Examples

data("mouseBrainSubsetSCE")
pcaVariances(mouseBrainSubsetSCE)
#getPCA() sets the pcaVariances
newSCE <- getPCA(mouseBrainSubsetSCE, useAssay = "counts")

#alternatively, set the pcaVariances directly
pca <- prcomp(assay(mouseBrainSubsetSCE, "logcounts"))
percentVar <- pca$sdev ^ 2 / sum(pca$sdev ^ 2)
pcaVariances(mouseBrainSubsetSCE) <- DataFrame(percentVar)

mmkhan19/singleCellTK documentation built on March 22, 2022, 7:43 a.m.