A Shiny web application for visualizing gene expression throughout the development of the human brain. This tool leverages the BrainSpan Atlas of the Developing Human Brain dataset and provides a spatial interface using the ggseg package to map expression levels onto the Desikan-Killiany (DK) atlas.
- Gene Expression Mapping: Search for any HGNC gene name to see its spatial expression pattern across 5 broad developmental stages (1st Trimester to Adult).
- GSVA-Enrichr Mode: Upload a custom list of genes (gene signature) to calculate and visualize its activity across brain regions using GSVA.
- High-Quality Exports: Download brain maps in SVG or TIFF formats for publications.
- Interactive UI: Built with a modern, responsive interface using
shinythemes(Cerulean).
The application requires R (≥ 4.3.0) and several system-level dependencies for spatial data processing.
Install the required packages from CRAN, Bioconductor, and GitHub:
# CRAN
install.packages(c("shiny", "dplyr", "tidyr", "ggplot2", "shinythemes", "svglite", "shinycssloaders", "remotes", "ggseg"))
# Bioconductor
if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::install("GSVA")Before running the application, you must process the raw BrainSpan data and calculate the ontology enrichment scores. This is a two-step process based on the provided scripts:
Ensure the genes_matrix_csv/ directory contains:
expression_matrix.csvrows_metadata.csvcolumns_metadata.csv
Run the preparation script from your terminal:
Rscript preparaDados.RThis script generates dados_otimizados.rds, which includes mapped brain regions, filtered gene lists, and pre-calculated age groups.
The API also requires the ontologyssGSEA.csv file to serve the pathway visualization endpoints. This file is generated via the ETL.qmd document.
- Open
ETL.qmd(e.g., in RStudio, VSCode, or via the command line). - Ensure you have the
dados_otimizados.rdsfile from the previous step. - Run the "Ontology create dataset" code chunk inside the document.
This will load the optimized data, fetch gene sets from msigdbr, run the GSVA calculations, and output the final ontologyssGSEA.csv file to your root directory.
Once the data is prepared, you can launch the app:
shiny::runApp()The full application stack (React Frontend + Plumber API) can be easily served via Docker Compose.
The easiest way to build and run the complete application is using Docker Compose:
docker-compose up --build -dThis will automatically start both services:
- React Frontend:
http://localhost:5173 - Plumber API:
http://localhost:33857(Swagger Docs available athttp://localhost:33857/__docs__/)
Docker Compose is configured to automatically sync your code changes during development without needing full container rebuilds.
Instead of docker-compose up, use the watch command:
docker compose watchWith this running:
- Any edits saved to
plumber.Rwill instantly sync and restart the API container. - Any edits saved in the
front/directory will instantly trigger Vite's Hot Module Replacement (HMR) and update the frontend live in your browser.
If you wish to run only the backend API, you can build and run it directly:
# Build the API image
docker build -t devbrain-markers-api -f Dockerfile.api .
# Run the API container
docker run -p 33857:33857 devbrain-markers-apiData is sourced from the BrainSpan Atlas of the Developing Human Brain, specifically the RNA-Seq RPKM values averaged to genes.
Made by the MCB Lab at UFRN.
If you use this tool in your research, please cite the BrainSpan Atlas and the ggseg package.