knitr::opts_chunk$set( echo = TRUE, cache = FALSE, collapse = TRUE, comment = "#>", crop = NA ) suppressPackageStartupMessages({ require(BiocStyle) }) htmltools::tagList(rmarkdown::html_dependency_font_awesome())
SCREENSHOT <- function(x, ...) knitr::include_graphics(x)
This vignette consists of a series of (independent) hands-on recipes, aimed at exploring the capabilities of r Biocpkg("iSEE")
both interactively and programmatically.
Each recipe consists of a short task and a screen shot of the desired appearance of the app instance that should be created.
For each recipe, we provide a set of hints, as well as detailed instructions on how to solve the task both interactively (by clicking in the app) and programmatically (by directly setting up and launching the desired app instance).
For a general overview of the default iSEE
panels, we refer to the overview vignette.
For all the details about the panel classes and the associated slots, we refer to the help pages for the respective panel class (e.g., ?ReducedDimensionPlot
).
Before starting with the recipes, we need to load the required packages and the demo data set.
library(iSEE) library(iSEEu) library(iSEEWorkshopEuroBioc2020) sce <- load_demo_sce("pbmc3k") sce
Using the pbmc3k
data set, create an app that contains only a reduced dimension plot panel, a row data plot panel and a column data plot panel. The widths of the three panels should be 3, 4 and 5 units, respectively.
Hints
Organization
button in the top right corner of the app.initial
argument to iSEE()
.str()
function on any instance of a panel object, e.g. str(ReducedDimensionPlot())
.
Solution (interactively)
app <- iSEE(sce) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( ReducedDimensionPlot(PanelWidth = 3L), RowDataPlot(PanelWidth = 4L), ColumnDataPlot(PanelWidth = 5L) ))
SCREENSHOT("screenshots/recipe_01.png", delay=20)
Using the pbmc3k
data set, visualize the cell type assignment against the cluster membership, with the aim to identify the predominant cell type in each cluster. In this case, since both cell annotations are categorical, iSEE
will generate a so called Hinton plot.
Hints
ColumnDataPlot
panel.Cluster
column of colData(sce)
.labels_fine
column of colData(sce)
(more coarse-grained assignments are provided in the labels_main
column).iSEE
will automatically determine the plot type depending on the type of selected variables.
Solution (interactively)
ColumnDataPlot
panel spanning the full application window)
app <- iSEE(sce, initial = list(ColumnDataPlot(PanelWidth = 12L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, list( ColumnDataPlot(PanelWidth = 12L, XAxis = "Column data", YAxis = "labels_fine", XAxisColumnData = "Cluster") ))
SCREENSHOT("screenshots/recipe_02.png", delay=20)
Using the pbmc3k
data set, display both the tSNE and UMAP representations next to each other.
Hints
ReducedDimensionPlot
panels.reducedDimNames(sce)
lists the available representations).
Solution (interactively)
ReducedDimensionPlot
panels, each spanning half the application window)
app <- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L), ReducedDimensionPlot(PanelWidth = 6L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE"), ReducedDimensionPlot(PanelWidth = 6L, Type = "UMAP") ))
SCREENSHOT("screenshots/recipe_03.png", delay=20)
Using the pbmc3k
data set, plot the distribution of the logcount values for the gene CD74
in each of the clusters.
Hints
FeatureAssayPlot
panel.
Solution (interactively)
FeatureAssayPlot
panel, spanning the full application window)
app <- iSEE(sce, initial = list(FeatureAssayPlot(PanelWidth = 12L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( FeatureAssayPlot(PanelWidth = 12L, XAxis = "Column data", YAxisFeatureName = "CD74", XAxisColumnData = "Cluster") ))
SCREENSHOT("screenshots/recipe_04.png", delay=20)
Using the pbmc3k
data set, display two tSNE representations next to each other. In the first one, color the cells by the cluster label. In the second one, color the cells by the log10 of the total UMI count (log10_total
column of colData(sce)
).
Hints
ReducedDimensionPlot
panels.reducedDimNames(sce)
lists the available representations).Cluster
column of colData(sce)
.Visual parameters
collapsible box. To display or hide the possible options, check the corresponding checkboxes (Color
, Shape
, Size
, Point
).
Solution (interactively)
ReducedDimensionPlot
panels, each spanning half the application window)
app <- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L), ReducedDimensionPlot(PanelWidth = 6L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", ColorBy = "Column data", ColorByColumnData = "Cluster"), ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", ColorBy = "Column data", ColorByColumnData = "log10_total") ))
SCREENSHOT("screenshots/recipe_05.png", delay=20)
Using the pbmc3k
data set, display two tSNE representations next to each other. In the first one, color the cells by the logcounts expression level of CD3D
. In the second one, color the cells by the logcounts expression level of CD79B
.
Hints
ReducedDimensionPlot
panels.reducedDimNames(sce)
lists the available representations).Visual parameters
collapsible box. To display or hide the possible options, check the corresponding checkboxes (Color
, Shape
, Size
, Point
).
Solution (interactively)
ReducedDimensionPlot
panels, each spanning half the application window)
app <- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L), ReducedDimensionPlot(PanelWidth = 6L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", ColorBy = "Feature name", ColorByFeatureName = "CD3D"), ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", ColorBy = "Feature name", ColorByFeatureName = "CD79B") ))
SCREENSHOT("screenshots/recipe_06.png", delay=20)
Using the pbmc3k
data set, display two tSNE representations next to each other. In the first one, set the point size to 0.5. In the second one, set the point size to 3 and the opacity to 0.2.
Hints
ReducedDimensionPlot
panels.reducedDimNames(sce)
lists the available representations).Visual parameters
collapsible box. To display or hide the possible options, check the corresponding checkboxes (Color
, Shape
, Size
, Point
).
Solution (interactively)
ReducedDimensionPlot
panels, each spanning half the application window)
app <- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L), ReducedDimensionPlot(PanelWidth = 6L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", PointSize = 0.5), ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", PointSize = 3, PointAlpha = 0.2) ))
SCREENSHOT("screenshots/recipe_07.png", delay=20)
Using the pbmc3k
data set, display the expression (logcounts) of CD3D
across the assigned clusters, as well as a tSNE representation colored by the cluster label. Select all cells with a logcount expression value of CD3D
between (approximately) 0.5 and 4, and highlight these in the tSNE plot by means of transparency.
Hints
ReducedDimensionPlot
panels.reducedDimNames(sce)
lists the available representations).FeatureAssayPlot
panel.Selection parameters
collapsible box.
Solution (interactively)
FeatureAssayPlot
panel and one ReducedDimensionPlot
panel, each spanning half the application window)
app <- iSEE(sce, initial = list(FeatureAssayPlot(PanelWidth = 6L), ReducedDimensionPlot(PanelWidth = 6L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( FeatureAssayPlot(PanelWidth = 6L, BrushData = list(xmin = 0, xmax = 15, ymin = 0.5, ymax = 4, mapping = list(x = "X", y = "Y", group = "GroupBy"), direction = "xy", brushId = "FeatureAssayPlot1_Brush", outputId = "FeatureAssayPlot1"), XAxis = "Column data", XAxisColumnData = "Cluster", YAxisFeatureName = "CD3D"), ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", ColorBy = "Column data", ColorByColumnData = "Cluster", SelectionEffect = "Transparent", ColumnSelectionSource = "FeatureAssayPlot1") ))
SCREENSHOT("screenshots/recipe_08.png", delay=20)
Using the pbmc3k
data set, create a scatter plots displaying the (logcounts) expression values of CD79A
vs CD74
, as well as a Hinton plot of the cluster and cell type assignment annotations. Select the cells co-expressing CD79A
and CD74
in the scatter plot. Which cell type/cluster(s) do these correspond to (color these points in the Hinton plot)?
Hints
FeatureAssayPlot
panel.ColumnDataPlot
panel.Cluster
column of colData(sce)
. Coarse-grained cell type labels are available in the labels_main
column.Selection parameters
collapsible box.
Solution (interactively)
FeatureAssayPlot
panel and one ColumnDataPlot
panel, each spanning half of the application window)
app <- iSEE(sce, initial = list(FeatureAssayPlot(PanelWidth = 6L), ColumnDataPlot(PanelWidth = 6L))) shiny::runApp(app)
Solution (programmatically)
app <- iSEE(sce, initial = list( FeatureAssayPlot(PanelWidth = 6L, XAxis = "Feature name", YAxisFeatureName = "CD79A", XAxisFeatureName = "CD74", BrushData = list( xmin = 0.3, xmax = 7, ymin = 0.3, ymax = 7, mapping = list(x = "X", y = "Y", colour = "ColorBy"), direction = "xy", brushId = "FeatureAssayPlot1_Brush", outputId = "FeatureAssayPlot1")), ColumnDataPlot(PanelWidth = 6L, XAxis = "Column data", YAxis = "labels_main", XAxisColumnData = "Cluster", ColumnSelectionSource = "FeatureAssayPlot1", SelectionEffect = "Color") ))
SCREENSHOT("screenshots/recipe_09.png", delay=20)
iSEEu
Using the pbmc3k
data set, load iSEEu
and use the modeReducedDim
mode to open an app displaying all the reduced dimension representations stored in the SingleCellExperiment object. Color the representations by the cell type assignment.
Hints
labels_fine
column of colData(sce)
(more coarse-grained assignments are provided in the labels_main
column).iSEEu::modeReducedDim()
.
Solution (programmatically)
app <- modeReducedDim(sce, colorBy = "labels_main")
SCREENSHOT("screenshots/recipe_10.png", delay=20)
Using the pbmc3k
data set, display two tSNE representations next to each other. In the first one, color the cells by the logcounts expression level of CD3D
. In the second one, color the cells by the logcounts expression level of CD79B
. Also include a small tour that starts with a welcome message, next walks through the two panels, giving an informative message for each, and finally ends with a concluding message to the user.
Hints
ReducedDimensionPlot
panels.reducedDimNames(sce)
lists the available representations).Visual parameters
collapsible box. To display or hide the possible options, check the corresponding checkboxes (Color
, Shape
, Size
, Point
).tour
argument to iSEE()
.element
and intro
. The element
column contains the names of UI elements, prefixed by a hash sign. More details, including how to find the name of a particular UI elements, can be found in the Configuring iSEE apps
vignette of iSEE
.
Solution (programmatically)
tour <- data.frame( element = c( "#Welcome", "#ReducedDimensionPlot1", "#ReducedDimensionPlot2", "#Conclusion"), intro = c( "Welcome to this tour!", "This is the first reduced dimension plot", "And here is the second one", "Thank you for taking this tour!"), stringsAsFactors = FALSE) app <- iSEE(sce, initial = list( ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", ColorBy = "Feature name", ColorByFeatureName = "CD3D"), ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE", ColorBy = "Feature name", ColorByFeatureName = "CD79B")), tour = tour)
SCREENSHOT("screenshots/recipe_11.png", delay=20)
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.