Skip to contents

The following is an example of usage of the widget with a Seurat object loaded from the SeuratData package.

First, install the dependencies:

install.packages("devtools")
devtools::install_github("vitessce/vitessce-r")
devtools::install_github('satijalab/seurat-data')

Load the dataset, create the Vitessce configuration vc, and render the widget by calling vc$widget():

library(vitessce)
library(SeuratData)

SeuratData::InstallData("pbmc3k")
data("pbmc3k.final")
force(pbmc3k.final)

vc <- VitessceConfig$new("My config")
dataset <- vc$add_dataset("My dataset")
dataset <- dataset$add_object(SeuratWrapper$new(pbmc3k.final))
scatterplot <- vc$add_view(dataset, Component$SCATTERPLOT, mapping = "pca")
vc$layout(scatterplot)
vc$widget(theme = "light")