plotExprsFreqVsMean {scater} | R Documentation

## Plot frequency of expression against mean expression level

### Description

Plot frequency of expression against mean expression level

### Usage

    plotExprsFreqVsMean(object, feature_set = NULL, feature_controls = NULL,
      shape = 1, alpha = 0.7, show_smooth = TRUE, se = TRUE, ...)

### Arguments

`object` | an `SingleCellExperiment` object.
`feature_set` | character, numeric or logical vector indicating a set of features to plot. If character, entries must all be in `rownames(object)`. If numeric, values are taken to be indices for features. If logical, vector is used to index features and should have length equal to `nrow(object)`. If `NULL`, then the function checks if feature controls are defined. If so, then only feature controls are plotted, if not, then all features are plotted.
`feature_controls` | character, numeric or logical vector indicating a set of features to be used as feature controls for computing technical dropout effects. If character, entries must all be in `rownames(object)`. If numeric, values are taken to be indices for features. If logical, vector is used to index features and should have length equal to `nrow(object)`. If `NULL`, then the function checks if feature controls are defined. If so, then these feature controls are used.
`shape` | (optional) numeric scalar to define the plotting shape.
`alpha` | (optional) numeric scalar (in the interval 0 to 1) to define the alpha level (transparency) of plotted points.
`show_smooth` | logical, should a smoothed fit through feature controls (if available; all features if not) be shown on the plot? Lowess used if a small number of feature controls. For details see `geom_smooth`.
`se` | logical, should standard error (confidence interval) be shown for smoothed fit?
`...` | further arguments passed to `plotMetadata` (should only be `size`, if anythin).

### Details

This function plots gene expression frequency versus mean expression level, which can be useful to assess the effects of technical dropout in the dataset. We fit a non-linear least squares curve for the relationship between expression frequency and mean expression and use this to define the number of genes above high technical dropout and the numbers of genes that are expressed in at least 50 of genes to be treated as feature controls can be specified, otherwise any feature controls previously defined are used.

### Value

a ggplot plot object

### Examples

    data("sc_example_counts")
    data("sc_example_cell_info")
    example_sce <- SingleCellExperiment(
    assays = list(counts = sc_example_counts),
    colData = sc_example_cell_info)
    example_sce <- normalize(example_sce)

    example_sce <- calculateQCMetrics(example_sce,
                                     feature_controls = list(set1 = 1:500))
    plotExprsFreqVsMean(example_sce)

    example_sce <- calculateQCMetrics(
    example_sce, feature_controls = list(controls1 = 1:20,
                                          controls2 = 500:1000),
                                          cell_controls = list(set_1 = 1:5,
                                          set_2 = 31:40))
    plotExprsFreqVsMean(example_sce)

[Package scater version 1.6.3 Index]