addReducedDims: Add scplainer Component Analysis Results

View source: R/ScpModel-Utils.R

addReducedDimsR Documentation

Add scplainer Component Analysis Results

Description

The function will add the component results computed by scpComponentAnalysis() to a SingleCellExperiment's reducedDims slot, to all using the many scater functions, such as scater::plotReducedDim(), scater::plotTSNE(), ...

Usage

addReducedDims(sce, x)

Arguments

sce

An instance of class SingleCellExperiment.

x

A List of DataFrames containing principal components, as procudes by scpComponentAnalysis().

Value

A SingleCellExperiment with updated reducedDims.

Author(s)

Laurent Gatto and Christophe Vanderaa

Examples


library("scater")
data("leduc_minimal")
leduc_minimal$cell <- rownames(colData(leduc_minimal))
pcs <- scpComponentAnalysis(
   leduc_minimal, method = "ASCA",
   effects = "SampleType")$bySample

reducedDims(leduc_minimal)
leduc_minimal <- addReducedDims(leduc_minimal, pcs)
reducedDims(leduc_minimal)
plotReducedDim(leduc_minimal, dimred = "ASCA_SampleType",
               colour_by = "SampleType")
leduc_minimal <- runTSNE(leduc_minimal, dimred = "ASCA_SampleType")
plotTSNE(leduc_minimal, colour_by = "SampleType")

UCLouvain-CBIO/scp documentation built on May 5, 2024, 1:17 a.m.