Developing Mouse Visual Cortex Gene Expression Viewer
The Developing Mouse Visual Cortex Gene Expression Viewer is an interactive R Shiny application for exploring pseudobulk gene expression and the fraction of cells expressing each gene across developmental age, developmental stage, cell type, donor, library, and anatomical metadata. Users can identify candidate genes from a sortable statistics table, retrieve genes from public AWS storage, apply multiple simultaneous filters, create trajectory, heatmap, dot, violin or boxplot, and two-gene correlation views, and share configured analyses through bookmarked URLs.
The underlying resource is part of the Allen Brain Cell Atlas, an open-science platform for visualizing and analyzing multimodal single-cell data across the mammalian brain.
Launch the interactive viewer
Trajectory, heatmap, dot, violin, and two-gene correlation views.
Stack any number of categorical and numeric metadata filters.
Plot-specific tests follow the selected expression or fraction-expressing metric.
Only requested gene partitions are read and cached.
Data
Scientific source
The viewer is based on the data resource associated with:
Gao, Y., van Velthoven, C. T. J., Lee, C., et al. Continuous cell-type diversification in mouse visual cortex development. Nature (2025). View the publication DOI.
Source documentation, notebooks, manifests, expression matrices, metadata, and taxonomy annotations are available through the Developing Mouse Visual Cortex dataset documentation and the ABC Atlas Access Python package.
Pseudobulk expression
The app uses a pseudobulk AnnData source generated from the raw Developing Mouse Visual Cortex single-cell count matrix. Raw counts were summed separately for each combination of library_label and cluster_alias. Each row is a library-by-cluster observation, each column is a gene, and each value in X is the summed raw count across contributing cells. A matching sparse number_of_cells_expressing layer records how many source cells have a raw count greater than zero for each gene and pseudobulk observation.
number_of_cellsrecords the total number of cells contributing to each pseudobulk observation.number_of_cells_expressingprovides the numerator used to calculate the fraction of cells expressing a selected gene.- Observation metadata retain library, donor, developmental age, anatomy, and cell-taxonomy annotations. The app also derives a categorical
stagefield, assigning embryonic ages toembryonicand postnatal ages topostnatal. - Large source files and the intermediate ABC Atlas cache are not distributed through GitHub.
Gene-level Parquet files
The pseudobulk source was converted into a gene-partitioned Parquet resource. Each gene is stored under counts_by_gene/gene=<gene_key>/ with sample_id, summed_counts, and number_of_cells_expressing. The app opens only the selected partition and supports one or multiple Parquet files in that directory. If detection counts are unavailable in an older partition, expression views continue to work and the dot plot falls back to expression-based sizing.
Expression is displayed as counts per million (CPM):
CPM scaling factor = 1,000,000 / total counts across all genes in the pseudobulk observation
CPM for a selected gene = summed counts × CPM scaling factor
Users may display CPM or ln(CPM + 1), calculate the fraction of cells expressing a gene as number_of_cells_expressing / number_of_cells, and exclude zero-count observations. For grouped dot-plot values, fractions are weighted correctly by summing expressing-cell counts and total-cell counts before division.
Metadata and value sets
obs_metadata.parquetcontains pseudobulk metadata and uniquesample_idvalues.gene_map.parquetmaps gene symbols to filesystem-safe partition keys.CPM_scaling.csvcontains row-aligned CPM scaling factors.value_sets.csvsupplies authoritative label order and colors for categorical metadata.table_column_definitions.csvsupplies on-hover definitions for statistics-table headers.www/tokens.csv, when present withtoken,type, andnamecolumns, supplies the searchable biological glossary in the sidebar.
Values absent from value_sets.csv are retained and assigned distinct fallback colors.
AWS storage and access
The app anonymously reads lightweight metadata and statistics at startup and retrieves expression only for selected genes. No AWS credentials are required. Current test data are in the public TEST_dev_mouse S3 prefix.
Using the viewer
Left control panel
The left panel controls gene retrieval, stacked filtering, expression scaling, and plot configuration. Filter and plot controls appear after the first gene has loaded.
Gene
- Type a gene symbol or select a gene from the statistics table.
- Select Get gene data.
- The app reads the selected partition, joins counts to metadata by
sample_id, calculates CPM, and stores the result in an in-memory cache. - After selecting a gene, a button links to Plot in ABC Atlas.
The selector starts empty, displays an example gene, and does not require deleting a prefilled value.
Filter and scale
- Filter metadata can add any number of simultaneous filters.
- Categorical fields use multi-select value controls; selections within a field use OR.
- Numeric fields use range sliders.
- Filters across fields are combined with AND.
- Discard observations with zero counts removes observations with no counts for the selected gene.
- Gene metric switches supported plots between gene expression and the fraction of cells expressing the gene.
- Plot ln(CPM + 1) switches between transformed and untransformed CPM when expression is selected.
- Use automatic expression limits can be disabled to enter manual minimum and maximum values. Values outside the selected range are squished to the bounds; fraction-expressing views use a 0-to-1 scale.
Plot controls
- Plot type selects one of five visualizations.
- Plot-specific controls configure dimensions, facets, colors, trend lines, pagination, plot height, counts, and observation display. Hover over dropdown labels for concise control definitions.
- Generate plot captures the current settings, creates the plot, and opens the plotting tab.
- Share this view creates a URL bookmark containing the selected gene or genes, active filters, and plot configuration. Opening the link restores the state, retrieves the required gene data, and regenerates the plot.
- Reset plot options restores defaults.
- The optional alphabetical glossary below the plot controls supports exact lookup of abbreviations used in cell-type and anatomical labels.
Application tabs
Select gene of interest
This tab contains a sortable table of gene-level exploratory statistics, including expression magnitude, developmental change, regional and subclass specificity, fraction-expressing summaries, and gene type. Numeric fields retain numeric sorting and range filters. Gene symbols link to GeneCards, and hovering over a defined column header displays its description.
Exact-value multi-select filters are provided below the table for gene_symbol, max_ROI, max_subclass, and gene_type. Selections within one field use OR; filters across fields use AND. Gene-symbol filtering uses the underlying plain symbol rather than the displayed GeneCards link. Selecting a table row places the gene into the Gene symbol control.
Plot gene of interest
The plotting tab supports five visualization types with matching plot-specific statistical summaries.
Trajectory across development
The trajectory plot displays expression or fraction expressing across an ordered progression variable. Developmental ages are biologically ordered; visual gaps are capped to compress large unsampled intervals while retaining endpoint padding.
- Facet by can separate groups or show all data together.
- Color by can overlay a categorical field or use one color.
- Trend line supports LOESS, linear fit, or no fit.
- Show individual observations toggles pseudobulk points.
- Facets per row, Height per facet, Facets per page, and Page Number keep large faceted views readable. Tall plots remain vertically scrollable.
- Each eligible facet receives a Spearman monotonic-trend test using the displayed metric; facet p-values are BH corrected.
Heatmap of mean expression
The heatmap displays mean expression or mean fraction expressing for every occupied combination of two dimensions.
- Tile color represents the selected gene metric.
- Show number of observations optionally labels each tile with its contributing observation count.
- Automatically calculated or manually selected limits apply to the fill scale.
- A sparse rook-neighbor Moran's I test with 999 permutations summarizes autocorrelation of the displayed metric across the current ordered matrix.
Dot plot of mean expression
The dot plot uses the same two-dimensional grouping as the heatmap. Dot color represents mean expression, while dot area represents the weighted fraction of cells expressing the gene. Min. dot size and Max. dot size control the displayed size range without changing the underlying proportions; combinations with no data remain absent. The note below the plot reports separate sparse rook-neighbor Moran's I tests with 999 permutations for expression and fraction expressing.
Violin plot with observations
The distribution plot shows expression or fraction-expressing distributions across horizontal-axis groups and second-dimension facets.
- Distribution display switches between violin and boxplot representations.
- Show individual observations toggles the overlaid pseudobulk points; white points and error bars show means and standard errors.
- Groups with fewer than two observations are omitted.
- Facets per row, Height per facet, Facets per page, and Page Number limit the size of each rendered image while preserving the complete filtered analysis.
- Each eligible facet receives a Kruskal-Wallis test across horizontal-axis groups using the displayed metric; facet p-values are BH corrected across all eligible facets, not only the current page.
Two-gene correlation
This plot compares two separately retrieved genes across matched sample_id values after applying active filters. The selected metric can be ln(CPM + 1) or fraction expressing.
- Use Gene 2nd gene data to retrieve the comparison gene through the same lazy reader and cache.
- Points can be colored by metadata and are sized by
log10(number_of_cells)when cell counts are available. - Min. dot size and Max. dot size adjust the correlation-point size range.
- Shared automatic or manual limits apply equally to both axes.
- The plot is square with equal axis spacing.
- An optional orthogonal total-least-squares line is invariant to swapping the x and y genes.
- Expression mode reports Pearson R; fraction-expressing mode reports Spearman rho. The corresponding p-value appears in the plot title.
Plot-specific exploratory statistics
- Trajectory: per-facet Spearman rho for monotonic progression in expression or fraction expressing, with BH correction across eligible facets.
- Heatmap: sparse rook-neighbor Moran's I with a one-sided 999-permutation p-value for autocorrelation of the displayed metric.
- Dot: separate sparse rook-neighbor Moran's I tests for mean expression and fraction expressing.
- Violin or boxplot: per-facet Kruskal-Wallis tests of the displayed metric across horizontal-axis groups, with BH correction.
- Two-gene correlation: Pearson correlation for expression and Spearman correlation for fraction expressing.
Running the app
Most users should use the hosted viewer. The repository also supports local development and reproducible deployment.
Requirements
- R 4.3.3 or a compatible R installation;
- S3 support in
arrow; shiny,bslib,arrow,dplyr,ggplot2,scales,shinycssloaders,cachem,DT, andjsonlite;- internet access to the public AWS prefix.
The app uses renv.lock to record tested package versions.
Local setup
- Clone the mouse-developing-vis-app repository.
- Open RStudio in
code/shiny/. - Restore dependencies from
renv.lock.
install.packages("renv")
renv::restore()
Run the app
setwd("code/shiny")
shiny::runApp(".")
Repository structure
.
├── .github/workflows/deploy-connect.yml
├── code/
│ ├── data-preparation scripts
│ └── shiny/
│ ├── app.R
│ ├── table_column_definitions.csv
│ ├── renv.lock
│ └── www/
│ ├── Developing_Mouse_Visual_Cortex_logo.png
│ ├── allen_institute_logo.svg
│ └── tokens.csv
├── index.html
├── README.md
└── requirements.txt
Large expression files, pseudobulk sources, metadata, and gene statistics remain outside GitHub in external data assets and public AWS storage.
Citation
If you use the viewer or underlying data, cite the source study:
Gao, Y., van Velthoven, C. T. J., Lee, C., et al. Continuous cell-type diversification in mouse visual cortex development. Nature (2025). View the publication DOI.
Please also report the viewer version or Git commit and the public-data access date.
Feedback and support
Questions, bug reports, and suggestions are welcome. Open a GitHub issue or contact Jeremy Miller.
How the app was made
The Rebuilding and Deployment Guide documents the reproducible workflow used to prepare the pseudobulk and Parquet resources, publish data to AWS, run the Shiny app, deploy to Posit Connect, and configure automated deployment.
Acknowledgements
The underlying resource was generated through extensive experimental, computational, taxonomy, data-access, and publication efforts. We acknowledge the teams responsible for data generation, quality control, analysis, taxonomy construction, ABC Atlas Access, public cloud hosting, reproducible workflows, and application deployment.