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

# S3 method for SCTAssay
levels(x)

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

Arguments

x

An SCTAssay object

value

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

Value

levels: SCT model names

levels<-: x with updated SCT model names

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

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 SCTAssay from an Assay

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

if (FALSE) { # SCTAssay objects are generated from SCTransform pbmc_small <- SCTransform(pbmc_small) } # SCTAssay objects are generated from SCTransform pbmc_small <- SCTransform(pbmc_small)
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> | | | 0%
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: NaNs produced
#> Warning: iteration limit reached
#> Warning: NaNs produced
#> Warning: iteration limit reached
#> Warning: NaNs produced
#> Warning: iteration limit reached
#> Warning: NaNs produced
#> Warning: iteration limit reached
#> Warning: NaNs produced
#> Warning: iteration limit reached
#> Warning: NaNs produced
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> Warning: iteration limit reached
#> | |======================================================================| 100%
#> Second step: Get residuals using fitted parameters for 220 genes
#> | | | 0% | |======================================================================| 100%
#> Computing corrected count matrix for 220 genes
#> | | | 0% | |======================================================================| 100%
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.3818898 secs
#> Determine variable features
#> Place corrected count matrix in counts slot
#> Centering data matrix
#> Set default assay to SCT
pbmc_small[["SCT"]]
#> SCTAssay data with 220 features for 80 cells, and 1 SCTModel(s) #> Top 10 variable features: #> NKG7, PPBP, GNLY, PF4, GNG11, HLA-DRA, GZMA, CCL5, PRF1, S100A9
if (FALSE) { # Query and change SCT model names levels(pbmc_small[['SCT']]) levels(pbmc_small[['SCT']]) <- '3' levels(pbmc_small[['SCT']]) }