knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(SCHNAPPs)

Overview

Shiny app for the exploration and analysis of single cell RNAseq data as it comes from 10X or MARSseq technologies or other. It is currently being developed based on user requests of the Cytometry and Biomarkers UTechS at the Institut Pasteur, Paris. The goal is to enable the users of our platform to explore their data, select cells they would like to work with and then perform the final analysis together with the bioinformatics support at Pasteur. We hope you might find it helpful as well.

Installation

if (!require("devtools"))
  install.packages("devtools")
devtools::install_github("mul118/shinyMCE")
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("BiocSingular")
install_github("C3BI-pasteur-fr/UTechSCB-SCHNAPPs")

Running schnapps

The application is started from the command line in R using schnapps().

library(SCHNAPPs)
# create example data
save(file = "filename.RData", "singleCellExperiementObject")
# use "filename.RData" with load data functionality within the shiny app
schnapps()

Optional parameters:

Load data {#loadData}

To load count data there are two formats that are accepted:

In addition cell or gene metadata can be loaded from a CSV file (optional)

A singleCellExperiment object is required, saved in a file RData object using

save(file = "filename.RData", "singleCellExperiementObject")

Load a small set of 200 cells and save to a file in the local directory

data("scEx", package = "SCHNAPPs")
save(file = "scEx.Rdata", list = "scEx")

Overview of functionality

Below is the description of the individual tabs/views with the SCHNAPPs application. During the execution of a task, a message is displayed at the lower right corner. While the message is displayed other requests will wait.

knitr::include_graphics('images/overview.png')

Side panel

knitr::include_graphics('images/loadingData.png')

Tabs

Input

Parameters

Normalization
knitr::include_graphics('images/parametersNormalization.png')
General Parameters
knitr::include_graphics('images/parametersGeneral.png')

Quickcluster from the scran package is used for clustering of cells.

TSNE plot
knitr::include_graphics('images/parametersTSNE.png')

Place to change the parameters for the tSNE calculations (Wrapper for the C++ implementation of Barnes-Hut t-Distributed Stochastic Neighbor Embedding. t-SNE is a method for constructing a low dimensional embedding of high-dimensional data, distances or similarities. Exact t-SNE can be computed by setting theta=0.0.) . Rtsne package is used. All PCA components available are used for the calculations. The number of PCs calculated is set under Parameters - General Parameters.

The 3D display is not limited to the tsne projections and thus can be used to

Umap
knitr::include_graphics('images/parametersUMAP.png')

Calculation of Umap projections. Since this can be quite time consuming there is a checkbox called “activate Umap projection” that starts the computation. When this is selected all changes in the parameters result in new executions. Thus it should be unchecked while the parameters are changed. The R package uwot is used. The description of the parameters comes directly from the package documentation.

General QC

UMI histogram
knitr::include_graphics('images/generalUMI.png')

The number of UMIs per cell are displayed as a histogram. Different samples are colored differently. This allows identifying thresholds to be used in the cell selection panel.

Sample histogram
knitr::include_graphics('images/generalSample.png')

Histgram of cells per samples. This allows verifying that the number of cells per sample is comparable.

PC variance
knitr::include_graphics('images/generalPC.png')

Variance of the first 10 principle components of the PCA are shown. This allows verifying the importance of the different PCs.

Scater QC
knitr::include_graphics('images/generalScater1.png')
knitr::include_graphics('images/generalScater2.png')

Plots the highest expressing genes based on the scater package. (scater::plotHighestExprs), colour_cells_by = "log10_total_counts" and a maximum of 50 genes is displayed. This can take quite some time to compute for larger (or even small) data sets.

Cell selection

knitr::include_graphics('images/CellSelection.png')

All selections are based on the original input data without filtering genes. In case this is needed, one can apply the gene filter, save the RData file and then apply the cell filters.

Gene selection

knitr::include_graphics('images/geneSelection1.png')
knitr::include_graphics('images/geneSelection2.png')

Co-expression

All clusters
knitr::include_graphics('images/coexpressionAll.png')
Selected
knitr::include_graphics('images/coexpressionSelected1.png')
knitr::include_graphics('images/coexpressionSelected2.png')
knitr::include_graphics('images/coexpressionSelected3.png')
Violin plot
knitr::include_graphics('images/coexpressionViolin1.png')
knitr::include_graphics('images/coexpressionViolin2.png')
SOM cluster
knitr::include_graphics('images/coexpressionSOM1.png')
knitr::include_graphics('images/coexpressionSOM2.png')

A self organizing map is calculated of all the cells. The matrix of normalized counts is used for the clustering. A square SOM with X nodes per dimension is calculated using nEpoch = 10, radius0 = 0, radiusN = 0, radiusCooling = "linear", mapType = "planar", gridType = "rectangular", scale0 = 1, scaleN = 0.01, scaleCooling = "linear" as parameters in the Rsomoclu.train function of the Rsomoclu package. globalBmus is used to identify genes that cluster together. The cluster(s) that contain the gene(s) of interest are returned.

Data Exploration

Expression
knitr::include_graphics('images/dataexplorationExpression.png')

As a convenience the following three plots are combined in one view. Most of the functionality displayed here can also be achieved using other tabs/views.

Panel plot
knitr::include_graphics('images/DataexplorationPanel.png')

2D plots of genes of interest. If the x-axis is a categorical value and the y-axis is UMI.counts the y-axis related to the count for that gene. Otherwise, all genes are used. This plots automatically creates box plots if the x-axis is a categorical value. If a categorical value is chosen for the y-axis an error message is displayed (‘min’ not meaningful for factors). Choosing barcodes as an axis can cause the computer to hang. When y-axis is set to UMI.counts the most useful values for the x-axis are sampleNames or dbCluster, which allows comparing the expression of different genes in parallel over different samples or clusters.

Subcluster analysis

DGE analysis
knitr::include_graphics('images/subclusteranalysis1.png')
knitr::include_graphics('images/subclusteranalysis2.png')

Differential gene expression analysis of selected genes.

Reused GUI elements (Modules)

Tables

knitr::include_graphics('images/table1.png')
knitr::include_graphics('images/tableSelect2.png')
knitr::include_graphics('images/tableReorder.png')
knitr::include_graphics('images/tableAll.png')

A modular table can be downloaded using the “Download Table” button.

2D plots

knitr::include_graphics('images/2Dplot1.png')
knitr::include_graphics('images/2dplotSmallGrp.png')
knitr::include_graphics('images/2dplotAddOptions.png')

Except for the Co-expression - Selected tab the selection of cells is not used.

Comments on groups:

Handling the groups is relatively complex because of the different possibilities especially with selection process within the plot. Once the group is activated (either after selecting a group in the group names dropdown or by clicking on “change current selection” the selected cells are colored red (instead of highlighted when selecting using the box/lasso select). This selection overwrites the selection in the plot. To deactivate this behaviour one has to uncheck the “show more options” check-box. Unfortunately the selection box/highlighting is removed in the plot though the selection is still used in the corresponding visualizations. This can be confusing.

Heatmaps

knitr::include_graphics('images/heatmap1.png')
knitr::include_graphics('images/heatmap2.png')
knitr::include_graphics('images/heatmap3.png')

Like most figures the heatmap is also resizable using the lower right corner that can be dragged.

The color of the samples and clusters can be changed under Parameters - general parameters.



C3BI-pasteur-fr/UTechSCB-SCHNAPPs documentation built on Jan. 11, 2020, 12:28 p.m.