SPHM-class | R Documentation |
The SPHM class is designed to store numeric data and image objects for plotting spatial heatmaps.
SPHM(svg = NULL, bulk = NULL, cell = NULL, match = list(), output = list())
svg |
An |
bulk |
The bulk data in form of numeric |
cell |
The single-cell data in form of |
match |
The
|
output |
A |
An SPHM object.
Jianhai Zhang jzhan067@ucr.edu
Dr. Thomas Girke thomas.girke@ucr.edu
library(SummarizedExperiment)
# Import single-cell data.
sce.pa <- system.file("extdata/shinyApp/data", "cell_mouse_brain.rds",
package="spatialHeatmap")
sce <- readRDS(sce.pa)
# Pre-processing.
sce.dimred.quick <- process_cell_meta(sce,
qc.metric=list(subsets=list(Mt=rowData(sce)$featureType=='mito'), threshold=1))
colData(sce.dimred.quick)[1:3, 1:2]
sce.aggr.quick <- aggr_rep(sce.dimred.quick, assay.na='logcounts', sam.factor='label',
aggr='mean')
# Import the aSVG image.
svg.mus.brain.pa <- system.file("extdata/shinyApp/data", "mus_musculus.brain.svg",
package="spatialHeatmap")
svg.mus.brain <- read_svg(svg.mus.brain.pa)
# List for mapping single cells to bulk.
lis.match.quick <- list(hypothalamus=c('hypothalamus'), cortex.S1=c('cerebral.cortex', 'nose'))
# SPHM class for storing aSVG, bulk/sc data, and matching list.
dat.quick <- SPHM(svg=svg.mus.brain, bulk=sce.aggr.quick, cell=sce.dimred.quick,
match=lis.match.quick)
# Co-visualization plot.
# covis(data=dat.quick, ID=c('Apod'), dimred='PCA', cell.group='label',
# tar.cell=names(lis.match.quick), assay.na='logcounts', bar.width=0.11, dim.lgd.nrow=1,
# height=0.7, legend.r=1.5, legend.key.size=0.02, legend.text.size=12, legend.nrow=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.