extractData | R Documentation |
colData
Extract normalized expression and colData
Extract normalized (i.e. log2 CPM) expression and colData
from dreamletProcessedData
extractData(x, assay, cols = colnames(colData(x)), genes = rownames(x))
## S4 method for signature 'dreamletProcessedData,character'
extractData(
x,
assay,
cols = colnames(colData(x)),
genes = rownames(assay(x, assay))
)
x |
|
assay |
assay to extract |
cols |
columns in |
genes |
genes to extract from |
data.frame
or DataFrame
of merged expression and colData
library(muscat)
library(SingleCellExperiment)
data(example_sce)
# create pseudobulk for each sample and cell cluster
pb <- aggregateToPseudoBulk(example_sce,
assay = "counts",
cluster_id = "cluster_id",
sample_id = "sample_id",
verbose = FALSE
)
# voom-style normalization
res.proc <- processAssays(pb, ~group_id)
# Extract all:
# Extract tibble of colData merged with expression.
# variables and genes are stored as columns, samples as rows
df_merge <- extractData(res.proc, "B cells")
# first few columns
df_merge[, 1:6]
# Extract subset:
df_merge <- extractData(res.proc, "B cells", cols = "group_id", genes = c("SSU72", "U2AF1"))
df_merge
# Boxplot of expression
boxplot(SSU72 ~ group_id, df_merge)
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.