plotExprsFreqVsMean: Plot frequency of expression against mean expression level

Description Usage Arguments Details Value Examples

View source: R/qc.R

Description

Plot frequency of expression against mean expression level

Usage

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

Arguments

object

an SCESet object.

feature_set

character, numeric or logical vector indicating a set of features to plot. If character, entries must all be in featureNames(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 featureNames(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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data=sc_example_cell_info)
rownames(pd) <- pd$Cell
ex_sceset <- newSCESet(countData=sc_example_counts, phenoData=pd)
ex_sceset <- calculateQCMetrics(ex_sceset)
plotExprsFreqVsMean(ex_sceset)

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

dynverse/scaterlegacy documentation built on Feb. 17, 2020, 5:07 a.m.