The UCSC Cell Browser is a web application for interactive exploration of single-cell datasets, supporting expression queries, dimensionality reduction plots, cluster annotations, and marker gene tables.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/satijalab/seurat-wrappers/llms.txt
Use this file to discover all available pages before exploring further.
ExportToCellbrowser() converts a Seurat object into the file format expected by Cell Browser, and can optionally build and launch a local Cell Browser instance.
Source: UCSC Cell BrowserAuthors: Maximilian Haeussler, Nikolay Markov, Brian Raney, and Lucas Seninge
Installation
Cell Browser is a Python package and must be installed separately from SeuratWrappers:reticulate package. Make sure R’s reticulate is pointed at the Python environment where cellbrowser is installed.
Key Functions
ExportToCellbrowser()— Exports a Seurat object to a directory of Cell Browser input files. Optionally builds the static website and starts a local web server.StopCellbrowser()— Stops a running Cell Browser web server launched from R.
How It Works
ExportToCellbrowser() writes the following files to the output directory:
exprMatrix.tsv.gz(ormatrix.mtx.gzfor large matrices) — expression matrix<reduction>.coords.tsv— cell embeddings for each requested reductionmeta.tsv— cell metadatamarkers.tsv— cluster marker genes (computed or user-supplied)cellbrowser.conf— auto-generated Cell Browser configuration file
cb.dir is specified, the function additionally runs cbBuild to produce a static HTML/JSON website. If port is also set, a local web server is started and the browser is opened automatically.
ExportToCellbrowser Parameters
The Seurat object to export.
Output directory for the exported Cell Browser input files. Created if it does not exist.
Name for the dataset in the Cell Browser UI. Defaults to the Seurat project name.
Names of reductions to export. If
NULL, all reductions present in the object are exported. Only the first two dimensions of each reduction are used.Path to a pre-computed marker gene file to include. If
NULL and skip.markers = FALSE, markers are looked up in object@misc$markers or computed with FindAllMarkers.Number of top markers per cluster to include when computing markers automatically.
Which expression matrix to export. Options:
"counts", "data", "scale.data".Export the matrix in
.mtx.gz format instead of TSV. Automatically enabled for matrices that exceed R’s maximum dense matrix size.Name of the metadata field containing cluster assignments.
Directory where the Cell Browser static website (HTML/JSON) should be built. Requires
cellbrowser to be available via reticulate.Port on which to start the Cell Browser web server after export. Requires
cb.dir to be set.Metadata columns to include. Defaults to all columns.
Human-readable display names for the exported metadata fields. Must be the same length as
meta.fields.If
TRUE, skip marker gene export entirely.If
TRUE, skip exporting the expression matrix.If
TRUE, skip exporting cell metadata.If
TRUE, skip exporting dimensionality reduction coordinates.Workflow
Export to Cell Browser
Export the object, build the static website, and launch a local server:This writes all input files to
out/, builds the static website in cb_out/, and opens the Cell Browser at http://localhost:8080 in your default browser.Export Without Launching a Server
To export files only without building the website or starting a server:cbBuild command-line tool and copied to any web server.
Supplying Pre-Computed Markers
If you have already runFindAllMarkers, you can save the results and pass them in:
Selecting Metadata Fields
Control which metadata columns appear in the Cell Browser UI:Python Environment Configuration
If reticulate cannot find thecellbrowser module, configure the Python environment explicitly before calling ExportToCellbrowser: