Learn R Programming

Seurat (version 5.0.3)

SCTAssay-class: The SCTModel Class

Description

The SCTModel object is a model and parameters storage from SCTransform. It can be used to calculate Pearson residuals for new genes.

The SCTAssay object contains all the information found in an Assay object, with extra information from the results of SCTransform

Usage

# S3 method for SCTAssay
levels(x)

# S3 method for SCTAssay levels(x) <- value

Value

levels: SCT model names

levels<-: x with updated SCT model names

Arguments

x

An SCTAssay object

value

New levels, must be in the same order as the levels present

Slots

feature.attributes

A data.frame with feature attributes in SCTransform

cell.attributes

A data.frame with cell attributes in SCTransform

clips

A list of two numeric of length two specifying the min and max values the Pearson residual will be clipped to. One for vst and one for SCTransform

umi.assay

Name of the assay of the seurat object containing UMI matrix and the default is RNA

model

A formula used in SCTransform

arguments

other information used in SCTransform

median_umi

Median UMI (or scale factor) used to calculate corrected counts

SCTModel.list

A list containing SCT models

Get and set SCT model names

SCT results are named by initial run of SCTransform in order to keep SCT parameters straight between runs. When working with merged SCTAssay objects, these model names are important. levels allows querying the models present. levels<- allows the changing of the names of the models present, useful when merging SCTAssay objects. Note: unlike normal levels<-, levels<-.SCTAssay allows complete changing of model names, not reordering.

Creating an <code>SCTAssay</code> from an <code>Assay</code>

Conversion from an Assay object to an SCTAssay object by is done by adding the additional slots to the object. If from has results generated by SCTransform from Seurat v3.0.0 to v3.1.1, the conversion will automagically fill the new slots with the data

See Also

Assay

Assay

Examples

Run this code
if (FALSE) {
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
}

if (FALSE) {
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
pbmc_small[["SCT"]]
}

if (FALSE) {
# Query and change SCT model names
levels(pbmc_small[['SCT']])
levels(pbmc_small[['SCT']]) <- '3'
levels(pbmc_small[['SCT']])
}

Run the code above in your browser using DataLab