true_bulk: Assign true bulk to cells in 'colData' slot.

View source: R/true_bulk.R

true_bulkR Documentation

Assign true bulk to cells in colData slot.

Description

In co-clustering, assign true bulk to cells in colData slot.

Usage

true_bulk(sce, df.match)

Arguments

sce

A SingleCellExperiment of clustered single cell data.

df.match

The matching table between cells and true bulk.

Value

A SingleCellExperiment object.

Author(s)

Jianhai Zhang jzhan067@ucr.edu
Dr. Thomas Girke thomas.girke@ucr.edu

References

Morgan M, Obenchain V, Hester J, Pagès H (2021). SummarizedExperiment: SummarizedExperiment container. R package version 1.24. 0, https://bioconductor.org/packages/SummarizedExperiment.

Examples

# Matching table.
match.mus.brain.pa <- system.file("extdata/shinyApp/data", "match_mouse_brain_cocluster.txt", package="spatialHeatmap")
df.match.mus.brain <- read.table(match.mus.brain.pa, header=TRUE, row.names=1, sep='\t')
df.match.mus.brain

# Create random data matrix.
df.random <- matrix(rexp(30), nrow=5)
dimnames(df.random) <- list(paste0('gene', seq_len(nrow(df.random))), c('cere', 'cere', 'hipp', 'hipp', 'corti.sub', 'corti.sub'))

library(SingleCellExperiment); library(S4Vectors)
cell.refined <- SingleCellExperiment(assays=list(logcounts=df.random), colData=DataFrame(cell=colnames(df.random)))

#cell.refined <- true_bulk(cell.refined, df.match.mus.brain)
#colData(cell.refined)

# See detailed example in the "coclus_meta" function by running "?coclus_meta".

jianhaizhang/spatialHeatmap documentation built on July 31, 2024, 2:59 a.m.