ShinyCell Portal Export
Package a Seurat object into a shareable ShinyCell app
What it does
This workflow exports a pre-analyzed Seurat object into a ShinyCell application. It generates the app files needed for interactive exploration of metadata, embeddings, and gene expression outside the notebook environment and packages them into a directory that can be archived for deployment.
When to use it
Use this workflow when analysis is already complete and the next goal is to share results with collaborators through a hosted viewer. It is a deployment-oriented utility rather than a preprocessing or modeling workflow, and it is most useful once the Seurat object is already cleaned, annotated, and ready to present.
Prerequisites
- Source folder:
scRNAseq_ShinyCell_portal - Main files:
- Required package:
ShinyCell - Input: a pre-analyzed Seurat object saved as
.qsave
Steps
Point the notebook at the .qsave object you want to publish
The notebook uses a small sample_list vector to define the Seurat objects that should feed the app. In the committed example, that list contains ./combined, which is then read as combined.qsave.
Build the ShinyCell configuration and review metadata choices
After loading the object, the notebook creates a ShinyCell config object and leaves several optional customization hooks in comments. These include deleting metadata columns, renaming metadata for display, and changing color mappings before the app is written out.
seu <- qs::qread(paste0(this_sample_name, ".qsave"))
scConf1 <- createConfig(seu)
# scConf1 <- delMeta(scConf1, c("orig.ident", "RNA_snn_res.0.2"))This is the part of the workflow where presentation choices happen, so it is worth reviewing the metadata fields before generating files for collaborators.
Generate the ShinyCell app files with the desired defaults
The core export step writes the app bundle into shinyAppMulti/, including default genes and the embedding coordinates that should appear first in the app.
makeShinyFiles(
seu,
scConf1,
gex.assay = "RNA",
gex.slot = "data",
gene.mapping = TRUE,
shiny.prefix = this_display_name,
shiny.dir = "shinyAppMulti/",
default.gene1 = "Nrgn",
default.gene2 = "Gad1",
default.multigene = c("Nrgn", "Gad1", "Gad2"),
default.dimred = c("UMAP_1", "UMAP_2")
)The committed example uses hard-coded default genes (Nrgn, Gad1, Gad2) and the RNA assay’s data slot, which are practical defaults to revisit for a different project.
Build the multi-sample wrapper and archive the app directory for deployment
The notebook finishes by generating the Shiny code wrapper. The README instructs users to archive shinyAppMulti/ and coordinate deployment to the BMBL server.
makeShinyCodesMulti(
shiny.title = "scRNAseq AD",
shiny.footnotes = "",
shiny.prefix = gsub(" ", "_", basename(sample_list)),
shiny.headers = gsub(" ", "_", basename(sample_list)),
shiny.dir = "shinyAppMulti/"
)Gotchas / notes
- This workflow assumes the Seurat object is already fully annotated and ready for sharing; it does not perform any upstream analysis.
- The committed example uses hard-coded default genes and a fixed output directory that you will usually want to review before deployment.
- There are no committed local screenshots in this folder, but the README includes a live demo link that shows the intended type of end result.
- Deployment is still a manual handoff in the committed materials: archive
shinyAppMulti/and coordinate server deployment separately.