pbMDS {CATALYST} | R Documentation |
Pseudobulk-level Multi-Dimensional Scaling (MDS) plot computed on median marker expressions in each sample.
pbMDS( x, by = c("sample_id", "cluster_id", "both"), k = "meta20", dims = c(1, 2), features = NULL, assay = "exprs", fun = c("median", "mean", "sum"), color_by = switch(by, sample_id = "condition", "cluster_id"), label_by = if (by == "sample_id") "sample_id" else NULL, shape_by = NULL, size_by = is.null(shape_by), pal = if (color_by == "cluster_id") .cluster_cols else NULL )
x |
|
by |
character string specifying whether to aggregate
by |
k |
character string specifying which clustering to use when
|
dims |
two numeric scalars indicating which dimensions to plot. |
features |
character string specifying which features to include
for computation of reduced dimensions; valid values are
|
assay |
character string specifying which assay data to use;
valid values are |
fun |
character string specifying which summary statistic to use. |
color_by |
character string specifying a
non-numeric cell metadata column to color by;
valid values are |
label_by |
character string specifying a
non-numeric cell metadata column to label by;
valid values are |
shape_by |
character string specifying a
non-numeric cell metadata column to shape by;
valid values are |
size_by |
logical specifying whether points should be sized by the number of cells that went into aggregation; i.e., the size of a give sample, cluster or cluster-sample instance. |
pal |
character vector of colors to use;
NULL for default |
a ggplot
object.
Helena L Crowell helena.crowell@uzh.ch
Nowicka M, Krieg C, Crowell HL, Weber LM et al. CyTOF workflow: Differential discovery in high-throughput high-dimensional cytometry datasets. F1000Research 2017, 6:748 (doi: 10.12688/f1000research.11622.1)
data(PBMC_fs, PBMC_panel, PBMC_md) sce <- prepData(PBMC_fs, PBMC_panel, PBMC_md) sce <- cluster(sce) # sample-level pseudobulks # including state-markers only pbMDS(sce, by = "sample_id", features = "state") # cluster-level pseudobulks # including type-features only pbMDS(sce, by = "cluster_id", features = "type") # pseudobulks by cluster-sample # including all features pbMDS(sce, by = "both", k = "meta12", shape_by = "condition", size_by = TRUE)