This vignette consists of a series of (independent) hands-on recipes, aimed at exploring the capabilities of 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 (PBMC3k).
library(iSEE)
library(iSEEu)
<- readRDS("pbmc3k.rds") 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.
Organization
button in the top right corner of the app.
initial
argument to iSEE()
.
<- iSEE(sce)
app ::runApp(app) shiny
Organization
button in the top right corner of the app, and then click on Organize panels
.
x
next to all the panels that you want to remove (all but the Reduced dimension plot 1
, Column data plot 1
and Row data plot 1
).
Width
dropdown menu.
Apply settings
.
<- iSEE(sce, initial = list(
app ReducedDimensionPlot(PanelWidth = 3L),
RowDataPlot(PanelWidth = 4L),
ColumnDataPlot(PanelWidth = 5L)
))
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.
ColumnDataPlot
panel.
Cluster
column of colData(sce)
.
labels_fine
column of colData(sce)
(more coarse-grained assignments are provided in the labels_main
column).
ColumnDataPlot
panel spanning the full application window)
<- iSEE(sce, initial = list(ColumnDataPlot(PanelWidth = 12L)))
app ::runApp(app) shiny
ColumnDataPlot
panel, click to expand the Data parameters
collapsible box.
Column of interest (Y-axis)
, select the label column (e.g., labels_fine
).
X-axis
, select Column data
, and under Column of interest (X-axis)
, select Cluster
.
<- iSEE(sce, initial = list(
app ColumnDataPlot(PanelWidth = 12L, XAxis = "Column data",
XAxisColumnData = "Cluster", YAxis = "labels_fine")
))
Using the PBMC3k data set, display both the tSNE and UMAP representations next to each other.
ReducedDimensionPlot
panels.
reducedDimNames(sce)
lists the available representations).
ReducedDimensionPlot
panels, each spanning half the application window)
<- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L),
app ReducedDimensionPlot(PanelWidth = 6L)))
::runApp(app) shiny
ReducedDimensionPlot
panel, click to expand the Data parameters
collapsible box.
Type
selection box, choose TSNE
.
ReducedDimensionPlot
panel, repeat the procedure but instead select UMAP
.
<- iSEE(sce, initial = list(
app ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE"),
ReducedDimensionPlot(PanelWidth = 6L, Type = "UMAP")
))
Using the PBMC3k data set, plot the distribution of the logcount values for the gene CD74
in each of the clusters.
FeatureAssayPlot
panel.
FeatureAssayPlot
panel, spanning the full application window)
<- iSEE(sce, initial = list(FeatureAssayPlot(PanelWidth = 12L)))
app ::runApp(app) shiny
FeatureAssayPlot
panel, click to expand the Data parameters
collapsible box.
Y-axis feature
, type or select CD74
.
X-axis
, select Column data
, and under Column of interest (X-axis)
, select Cluster
.
<- iSEE(sce, initial = list(
app FeatureAssayPlot(PanelWidth = 12L, XAxis = "Column data",
YAxisFeatureName = "CD74", XAxisColumnData = "Cluster")
))
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)
).
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
).
ReducedDimensionPlot
panels, each spanning half the application window)
<- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L),
app ReducedDimensionPlot(PanelWidth = 6L)))
::runApp(app) shiny
ReducedDimensionPlot
panel, click to expand the Data parameters
collapsible box and under Type
, choose TSNE
.
ReducedDimensionPlot
panel, click to expand the Visual parameters
collapsible box.
Color
checkbox is ticked.
Color by
, select Column data
.
Cluster
.
ReducedDimensionPlot
panel, repeat the procedure but instead select log10_total
.
<- iSEE(sce, initial = list(
app ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
ColorBy = "Column data",
ColorByColumnData = "Cluster"),
ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
ColorBy = "Column data",
ColorByColumnData = "log10_total")
))
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
.
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
).
ReducedDimensionPlot
panels, each spanning half the application window)
<- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L),
app ReducedDimensionPlot(PanelWidth = 6L)))
::runApp(app) shiny
ReducedDimensionPlot
panel, click to expand the Data parameters
collapsible box and under Type
, choose TSNE
.
ReducedDimensionPlot
panel, click to expand the Visual parameters
collapsible box.
Color
checkbox is ticked.
Color by
, select Feature name
.
CD3D
.
ReducedDimensionPlot
panel, repeat the procedure but instead select CD79B
.
<- iSEE(sce, initial = list(
app ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
ColorBy = "Feature name",
ColorByFeatureName = "CD3D"),
ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
ColorBy = "Feature name",
ColorByFeatureName = "CD79B")
))
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.
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
).
ReducedDimensionPlot
panels, each spanning half the application window)
<- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L),
app ReducedDimensionPlot(PanelWidth = 6L)))
::runApp(app) shiny
ReducedDimensionPlot
panel, click to expand the Data parameters
collapsible box and under Type
, choose TSNE
.
ReducedDimensionPlot
panel, click to expand the Visual parameters
collapsible box.
Size
checkbox is ticked.
Size by
, select None
.
ReducedDimensionPlot
panel, click to expand the Visual parameters
collapsible box.
Size
and Point
checkboxes are ticked.
Size by
, select None
.
Point opacity
, drag the slider to 0.2.
<- iSEE(sce, initial = list(
app ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
PointSize = 0.5),
ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
PointSize = 3, PointAlpha = 0.2)
))
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.
ReducedDimensionPlot
panels.
reducedDimNames(sce)
lists the available representations).
FeatureAssayPlot
panel.
Selection parameters
collapsible box.
FeatureAssayPlot
panel and one ReducedDimensionPlot
panel, each spanning half the application window)
<- iSEE(sce, initial = list(FeatureAssayPlot(PanelWidth = 6L),
app ReducedDimensionPlot(PanelWidth = 6L)))
::runApp(app) shiny
FeatureAssayPlot
panel, click to expand the Data parameters
collapsible box and under Y-axis feature
, type or select CD3D
.
X-axis
, select Column data
, and under X-axis column data
, select Cluster
.
FeatureAssayPlot
panel, use the mouse to drag a rectangle around all points with a logcount expression value (y-axis) between approximately 0.5 and 4.
ReducedDimensionPlot
panel, click to expand the Data parameters
collapsible box and under Type
, choose TSNE
.
ReducedDimensionPlot
panel, further click to expand the Visual parameters
collapsible box, make sure that the Color
checkbox is ticked. Under Color by
, select Column data
. In the dropdown menu that appears, type or select Cluster
.
ReducedDimensionPlot
panel, click to expand the Selection parameters
collapsible box.
Receive column selection from
, select Feature assay plot 1
.
<- iSEE(sce, initial = list(
app 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",
ColumnSelectionSource = "FeatureAssayPlot1")
))
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)?
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.
FeatureAssayPlot
panel and one ColumnDataPlot
panel, each spanning half of the application window)
<- iSEE(sce, initial = list(FeatureAssayPlot(PanelWidth = 6L),
app ColumnDataPlot(PanelWidth = 6L)))
::runApp(app) shiny
FeatureAssayPlot
panel, click to expand the Data parameters
collapsible box.
Y-axis feature
, type or select CD79A
.
X-axis
, select Feature name
, and under X-axis feature
, type or select CD74
.
ColumnDataPlot
panel, click to expand the Data parameters
collapsible box.
Column of interest (Y-axis)
, type or select labels_main
.
X-axis
, select Column data
, and under Column of interest (X-axis)
, select Cluster
.
FeatureAssayPlot
panel, use the mouse to drag a rectangle around all points co-expressing CD79A
and CD74
.
ColumnDataPlot
panel, click to expand the Selection parameters
collapsible box.
Receive column selection from
, select Feature assay plot 1
.
ColumnDataPlot
panel, click to expand the Visual parameters
collapsible box.
Color by
, select Column selection
.
<- iSEE(sce, initial = list(
app 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",
ColorBy = "Column selection")
))
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.
labels_fine
column of colData(sce)
(more coarse-grained assignments are provided in the labels_main
column).
iSEEu::modeReducedDim()
.
<- modeReducedDim(sce, colorBy = "labels_main") app
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.
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.
<- data.frame(
tour 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)
<- iSEE(sce, initial = list(
app ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
ColorBy = "Feature name",
ColorByFeatureName = "CD3D"),
ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
ColorBy = "Feature name",
ColorByFeatureName = "CD79B")),
tour = tour)
The main focus of iSEE is exploration of pre-calculated results. This is reflected in the default set of panels, which all rely on reading and displaying information stored in the SummarizedExperiment
object. However, it is also possible to construct custom panels, which can perform arbitrarily complex analyses. Providing a middle ground, the iSEEu package contains some custom panel types that can perform basic analysis, such as a simple test for differential expression between selected groups of samples. It is worth noting that although there is not a single, ‘always-optimal’ way of doing this type of analysis, the panel type provides a quick way of characterizing a set of samples via the set of upregulated genes.
Using the PBMC3k data set, display a tSNE representation colored by the cluster assignment, as well as a dynamic marker table that displays genes that are differentially expressed between sets of interactively selected cells in the tSNE plot. Select the smallest cluster in the bottom of the plot and find the genes most strongly upregulated compared to the other cells.
ReducedDimensionPlot
panels.
reducedDimNames(sce)
lists the available representations).
DynamicMarkerTable
panel).
iSEE()
) you need to provide the panel class to the extra
argument of iSEE()
, unless you specify the panel in the initial
argument.
ReducedDimensionPlot
panel and one DynamicMarkerTable
panel, each spanning half of the application window). Note that in order to access the DynamicMarkerTable
panel type, the iSEEu package must be loaded into your R session.
library(iSEEu)
<- iSEE(sce, initial = list(ReducedDimensionPlot(PanelWidth = 6L),
app DynamicMarkerTable(PanelWidth = 6L)))
::runApp(app) shiny
Organize panels
button, you can launch iSEE with the default set of panels. In this case, make sure to provide the DynamicMarkerTable
to the extra
argument, so that it will show up as an option when you add new panels. If you take this approach, click on the Organization
button in the top right corner of the app, and then click on Organize panels
and set up the desired interface.
<- iSEE(sce, extra = list(DynamicMarkerTable()))
app ::runApp(app) shiny
ReducedDimensionPlot
panel, click to expand the Data parameters
collapsible box.
Type
, type or select TSNE
.
Visual parameters
collapsible box.
Color
checkbox is ticked.
Color by
, select Column data
.
Cluster
.
DynamicMarkerTable
panel, click to expand the Selection parameters
collapsible box.
Receive column selection from
, select Reduced dimension plot 1
.
<- iSEE(sce, initial = list(
app ReducedDimensionPlot(PanelWidth = 6L, Type = "TSNE",
ColorBy = "Column data",
ColorByColumnData = "Cluster",
BrushData = list(xmin = -20, xmax = 5,
ymin = -40, ymax = -15,
mapping = list(x = "X", y = "Y",
colour = "ColorBy"),
direction = "xy",
brushId = "ReducedDimensionPlot1_Brush",
outputId = "ReducedDimensionPlot1")),
DynamicMarkerTable(PanelWidth = 6L,
ColumnSelectionSource = "ReducedDimensionPlot1"))
)
sessionInfo()
#> R version 4.1.2 (2021-11-01)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur 10.16
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
#> attached base packages:
#> [1] stats4 stats graphics grDevices utils datasets methods
#> [8] base
#>
#> other attached packages:
#> [1] iSEEu_1.6.0 iSEE_2.6.0
#> [3] SingleCellExperiment_1.16.0 SummarizedExperiment_1.24.0
#> [5] Biobase_2.54.0 GenomicRanges_1.46.1
#> [7] GenomeInfoDb_1.30.0 IRanges_2.28.0
#> [9] S4Vectors_0.32.3 BiocGenerics_0.40.0
#> [11] MatrixGenerics_1.6.0 matrixStats_0.61.0
#> [13] BiocStyle_2.22.0
#>
#> loaded via a namespace (and not attached):
#> [1] nlme_3.1-153 bitops_1.0-7 fontawesome_0.2.2
#> [4] doParallel_1.0.16 RColorBrewer_1.1-2 tools_4.1.2
#> [7] bslib_0.3.1 utf8_1.2.2 R6_2.5.1
#> [10] DT_0.20 vipor_0.4.5 mgcv_1.8-38
#> [13] DBI_1.1.1 colorspace_2.0-2 GetoptLong_1.0.5
#> [16] tidyselect_1.1.1 compiler_4.1.2 shinyjs_2.0.0
#> [19] DelayedArray_0.20.0 colourpicker_1.1.1 sass_0.4.0
#> [22] scales_1.1.1 stringr_1.4.0 digest_0.6.29
#> [25] rmarkdown_2.11 XVector_0.34.0 pkgconfig_2.0.3
#> [28] htmltools_0.5.2 highr_0.9 fastmap_1.1.0
#> [31] htmlwidgets_1.5.4 rlang_0.4.12 GlobalOptions_0.1.2
#> [34] shiny_1.7.1 shape_1.4.6 jquerylib_0.1.4
#> [37] generics_0.1.1 jsonlite_1.7.2 dplyr_1.0.7
#> [40] RCurl_1.98-1.5 magrittr_2.0.1 GenomeInfoDbData_1.2.7
#> [43] Matrix_1.4-0 Rcpp_1.0.7 munsell_0.5.0
#> [46] fansi_0.5.0 lifecycle_1.0.1 rintrojs_0.3.0
#> [49] stringi_1.7.6 yaml_2.2.1 zlibbioc_1.40.0
#> [52] grid_4.1.2 parallel_4.1.2 promises_1.2.0.1
#> [55] ggrepel_0.9.1 shinydashboard_0.7.2 crayon_1.4.2
#> [58] miniUI_0.1.1.1 lattice_0.20-45 splines_4.1.2
#> [61] circlize_0.4.13 knitr_1.36 ComplexHeatmap_2.10.0
#> [64] pillar_1.6.4 igraph_1.2.9 rjson_0.2.20
#> [67] codetools_0.2-18 glue_1.5.1 evaluate_0.14
#> [70] BiocManager_1.30.16 png_0.1-7 vctrs_0.3.8
#> [73] httpuv_1.6.3 foreach_1.5.1 gtable_0.3.0
#> [76] purrr_0.3.4 clue_0.3-60 assertthat_0.2.1
#> [79] ggplot2_3.3.5.9000 xfun_0.28 mime_0.12
#> [82] xtable_1.8-4 later_1.3.0 viridisLite_0.4.0
#> [85] tibble_3.1.6 iterators_1.0.13 cluster_2.1.2
#> [88] shinyWidgets_0.6.2 ellipsis_0.3.2 shinyAce_0.4.1