Learn R Programming

SoupX (version 1.6.2)

setSoupProfile: Set soup profile

Description

Manually sets or updates the soup profile for a SoupChannel object.

Usage

setSoupProfile(sc, soupProfile)

Value

An updated SoupChannel object with the soup profile set.

Arguments

sc

A SoupChannel object.

soupProfile

A data.frame with columns est containing the fraction of soup for each gene, counts containing the total counts for each gene and with row names corresponding to the row names of sc$toc.

Examples

Run this code
#Suppose only table of counts is available
toc = Seurat::Read10X(system.file('extdata','toyData','filtered_gene_bc_matrices','GRCh38',
                                  package='SoupX'))
#Suppress calculating soup profile automatically
sc = SoupChannel(toc,toc,calcSoupProfile=FALSE)
#And add manually
rowSums = Matrix::rowSums
soupProf = data.frame(row.names = rownames(toc),est=rowSums(toc)/sum(toc),counts=rowSums(toc))
sc = setSoupProfile(sc,soupProf)

Run the code above in your browser using DataLab