plot_densities: Plot sample-specific densities.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot_densities.R

Description

plot_densities returns a ggplot object with the sample-specific density estimates, for a specified cluster and gene.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_densities(
  x,
  name_assays_expression = "logcounts",
  name_cluster = "cluster_id",
  name_sample = "sample_id",
  name_group = "group_id",
  cluster,
  gene,
  group_level = FALSE
)

Arguments

x

a SummarizedExperiment or a SingleCellExperiment object.

name_assays_expression

a character ("logcounts" by default), indicating the name of the assays(x) element which stores the expression data (i.e., assays(x)$name_assays_expression). We strongly encourage using normalized data, such as counts per million (CPM) or log-CPM.

name_cluster

a character ("cluster_id" by default), indicating the name of the colData(x) element which stores the cluster id of each cell (i.e., colData(x)$name_colData_cluster).

name_sample

a character ("sample_id" by default), indicating the name of the colData(x) element which stores the sample id of each cell (i.e., colData(x)$name_colData_sample).

name_group

a character ("group_id" by default), indicating the name of the colData(x) element which stores the group id of each cell (i.e., colData(x)$name_colData_group).

cluster

a character, indicating the name of the cluster to plot.

gene

a character, indicating the name of the gene to plot.

group_level

a logical, indicating whether to plot group-level (if TRUE) or sample-level curves (if FALSE).

Value

A ggplot object.

Author(s)

Simone Tiberi simone.tiberi@uzh.ch

See Also

distinct_test, plot_cdfs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("Kang_subset", package = "distinct")
Kang_subset

plot_densities(x = Kang_subset,
               gene = "ISG15",
               cluster = "Dendritic cells",
               name_assays_expression = "logcounts",
               name_cluster = "cell",
               name_sample = "sample_id",
               name_group = "stim")

distinct documentation built on Nov. 8, 2020, 8:20 p.m.