plot_cdfs {distinct} | R Documentation

## Plot sample-specific CDFs.

### Description

`plot_cdfs` returns a `ggplot` object with the sample-specific cumulative density function (CDF) estimates, for a specified cluster and gene.

### Usage

    plot_cdfs(
      x,
      name_assays_expression = "logcounts",
      name_cluster = "cluster_id",
      name_sample = "sample_id",
      name_group = "group_id",
      cluster,
      gene,
      group_level = FALSE,
      pad = TRUE,
      size = 0.75
    )

### 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).
`pad` | a logical element indicating whether to plot the lines of the CDF when 0 and 1 (TRUE) or not (FALSE).
`size` | a numeric argument defining the width of lines, passed to `stat_ecdf`.

### Value

A `ggplot` object.

### Author(s)

Simone Tiberi simone.tiberi@uzh.ch

### See Also

`distinct_test`, `plot_densities`

### Examples

    data("Kang_subset", package = "distinct")
    Kang_subset

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

[Package distinct version 1.4.1 Index]