sortCols,vpDF-method | R Documentation |
Sort variance partition statistics
## S4 method for signature 'vpDF'
sortCols(
x,
FUN = sum,
decreasing = TRUE,
last = c("Residuals", "Measurement.error"),
...
)
x |
object returned by |
FUN |
function giving summary statistic to sort by. Defaults to sum |
decreasing |
logical. Should the sorting be increasing or decreasing? |
last |
columns to be placed on the right, regardless of values in these columns |
... |
other arguments to sort |
data.frame
with columns sorted by mean value, with Residuals in last column
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)
# variance partitioning analysis
vp <- fitVarPart(res.proc, ~group_id)
# Summarize variance fractions genome-wide for each cell type
plotVarPart(sortCols(vp))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.