modeGating: App pre-configured to link multiple feature assay plots

Description Usage Arguments Value Examples

View source: R/modeGating.R

Description

This mode launches a Shiny App preconfigured with multiple chain-linked feature expression plots for interactive data exploration of the SingleCellExperiment or SummarizedExperiment object.

Usage

1
modeGating(se, features, plotAssay = NA_character_, ..., plotWidth = 4)

Arguments

se

An object that coercible to SingleCellExperiment-class

features

data.frame with columns named x and y that define the features on the axes of the linked plots. Plots are serially linked from the first row to the last.

plotAssay

The assay (one of assayNames(se)) to use for the plots (character vector of length either 1 or equal to nrow(features)).

...

Additional arguments passed to iSEE().

plotWidth

The grid width of linked plots (numeric vector of length either 1 or equal to nrow(features)

Value

A Shiny app object is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(scRNAseq)

# Example data ----
sce <- ReprocessedAllenData(assays="tophat_counts")
class(sce)

library(scater)
sce <- logNormCounts(sce, exprs_values="tophat_counts")

# Select top variable genes ----

plot_count <- 6
rv <- rowVars(assay(sce, "tophat_counts"))
top_var <- head(order(rv, decreasing=TRUE), plot_count*2)
top_var_genes <- rownames(sce)[top_var]

plot_features <- data.frame(
    x=head(top_var_genes, plot_count),
    y=tail(top_var_genes, plot_count),
    stringsAsFactors=FALSE
 )

# launch the app itself ----

app <- modeGating(sce, features = plot_features)
if (interactive()) {
  shiny::runApp(app, port=1234)
}

iSEEu documentation built on Nov. 8, 2020, 8:12 p.m.