MilliMap Documentation

MilliMap is an open-source desktop application for interactive spatial omics visualization and analysis. It provides a complete code-free workflow: load spatial transcriptomics data, explore tissues in 3D, run analyses, and export reproducible results.

Code-Free

Full analysis pipeline from the GUI. No Python or R required.

Cross-Platform

Standalone builds for macOS and Windows. Linux via source install.

Multi-Format

Native support for Visium, Xenium, MERSCOPE, CosMx, CODEX, and more.

Interactive

Click a gene in a result table and the tissue view updates instantly.

Installation

Standalone App (Recommended)

Download the latest release for your platform from the GitHub Releases page. No Python installation required.

From Source

# Clone the repository
git clone https://github.com/milliomics/MilliMap.git
cd MilliMap

# Option 1: Conda (recommended)
conda env create -f setup/environment.yml
conda activate millimap

# Option 2: pip
pip install -r requirements.txt

# Launch
python src/millimap/main.py
Note

Squidpy (for spatial statistics) and GSEApy (for enrichment analysis) are optional dependencies. MilliMap will offer to install them automatically the first time you use a feature that requires them.

Loading Data

MilliMap supports multiple ways to load spatial omics data. Use File → Open or drag and drop files directly into the application window.

Quick Start

  1. Launch MilliMap. You'll see the welcome screen.
  2. Click Load Spatial Data or drag an .h5ad file into the window.
  3. For platform-specific outputs (Xenium, MERSCOPE, CosMx), select the experiment folder instead.
  4. MilliMap auto-detects the format, loads spatial coordinates, and renders the tissue.
Screenshot Welcome screen with data loading options

Automatic Detection

MilliMap inspects file extensions, headers, and folder structures to determine the data type. For most workflows you can simply point it at your data and it will do the right thing. Multi-section datasets are detected automatically from metadata fields like source, sample, batch, or fov.

Supported Formats

Platform / Format Input Notes
10x Visium Space Ranger output folder Reads filtered_feature_bc_matrix.h5 + spatial/ directory
10x Visium HD Space Ranger output folder High-resolution spots with multi-resolution binned outputs
10x Xenium Xenium output folder Cell feature matrix, cell boundaries, morphology channels (OME-TIFF)
Vizgen MERSCOPE Experiment folder Cell-by-gene matrix, transcript-level data with coordinate systems
NanoString CosMx Flat-file folder Expression matrix + cell metadata CSV files
CODEX CSV / folder Multiplexed protein data with spatial coordinates
MERFISH (MERlin) CSV + codebook Spot-based transcript detection with codebook gene mapping
AnnData .h5ad file Standard scverse format; works with any data stored in AnnData
Seurat .rds file Auto-converts via R bridge to h5ad; requires R installation
SpatialData .zarr store Multi-omics integration format with tables, images, and shapes
CSV .csv file Gene expression matrices and spot coordinates (flexible column mapping)
Loom .loom file Single-cell data in Loom format

Workspace Navigator

The workspace navigator is the sidebar on the left side of the MilliMap window. It provides a persistent view of all loaded datasets and their analysis results.

Key Features

Screenshot Workspace navigator showing multiple datasets with analysis result cards

Visualization

MilliMap renders spatial omics data as GPU-accelerated 3D point clouds using PyVista/VTK. Every cell is a point in space, colored by cluster identity, gene expression, or metadata.

View Modes

Spatial View

3D tissue-level point cloud with interactive rotation, zoom, and pan. Adjustable point size and transparency.

Embedding View

UMAP or t-SNE projection. Bidirectionally linked to spatial view — select in one, see it in the other.

Split View

Simultaneous spatial + embedding side-by-side. Selections are synchronized across both views.

Gene Expression

Color cells by expression of any gene. Switch between single-gene and co-expression (two-gene overlay) modes.

Screenshot Split view showing spatial tissue on the left and UMAP embedding on the right

Display Controls

Selection & ROI Tools

MilliMap provides multiple selection tools for defining cell populations directly on the tissue or embedding view. Selections can be saved as named Regions of Interest (ROIs) and used in downstream analyses.

Selection Methods

ROI Management

Screenshot Lasso selection on tissue with saved ROI list

Color Schemes

MilliMap includes multiple color palette options for cluster visualization:

Analysis Library

The Analysis Library is MilliMap's central hub for running analyses. It provides a visual card-based interface with 30+ analysis methods organized by category. Each card shows the method name, description, and which library it belongs to.

How it works

Click a card to see its description, then click Configure & Launch to set parameters and scope (which cells to include). Results appear as interactive cards in the workspace navigator. Double-click any result to re-open it with full Plot Controls.

Screenshot Analysis Library showing category tabs and analysis cards

Categories

Scope Selector

Every analysis in the library includes a scope selector that lets you choose which cells to include. You can run analyses on all data, specific sections, selected clusters, or named ROIs. This means you can compare spatial statistics across different tissue regions without writing any code.

Plot Controls

All result popups include a Plot Controls panel for customizing the appearance of figures: title, axis labels, font family, title/axis/tick font sizes, and (for heatmaps) colormap and colorbar label. Enable Live Preview to see changes in real-time, or click Apply to update.

Preprocessing & QC

Quality Control

MilliMap provides an interactive QC panel for filtering cells before analysis.

Normalization

Scanpy Normalize total counts per cell and apply log1p transformation. Available as a one-click operation from the Analysis Library.

Highly Variable Genes

Scanpy Select the most informative genes for downstream analysis (PCA, clustering, DEG). Configurable number of top genes.

Clustering

MilliMap supports graph-based clustering with a full automated pipeline or step-by-step manual control.

Pipeline

The one-click pipeline runs: PCA → (optional Harmony batch correction) → KNN graph → Leiden clustering → UMAP embedding. Configure each step's parameters before running or accept the defaults.

Algorithms

Advanced

Screenshot Clustering panel with pipeline controls and UMAP result

Differential Expression

MilliMap provides a full differential expression suite accessible from the DEG tab or the Analysis Library.

Comparison Modes

Result Visualization

Screenshot DEG comparison panel showing volcano plot with highlighted gene on tissue

Spatial Analysis

Squidpy MilliMap integrates the full Squidpy spatial statistics suite through the Analysis Library. All spatial analyses produce interactive results — click elements in the plots to highlight corresponding cells or regions on the tissue.

Spatially Variable Genes

Identify genes with significant spatial patterning using Moran's I (positive spatial autocorrelation) or Geary's C (spatial heterogeneity). Results appear as a sortable gene table. Click any gene to view its spatial expression pattern.

Neighborhood Enrichment

Permutation test for spatial co-localization preferences between cell types. Results are displayed as an interactive z-score heatmap. Click any cell in the heatmap to highlight that cluster pair on the tissue.

Co-occurrence

Compute pairwise co-occurrence probabilities between cell types at varying spatial distances. Produces line plots for each cluster pair showing co-occurrence ratio vs. distance. Click a curve or legend entry to highlight the corresponding pair.

Centrality Scores

Compute degree, closeness, and betweenness centrality per cluster from the spatial neighbor graph. Results appear as an interactive bar chart. Click any bar to highlight that cluster on the tissue. Use the dropdown to switch between centrality measures.

Interaction Matrix

Build and visualize the count (or normalized) matrix of spatial neighbor interactions between clusters. Displayed as a heatmap. Click a cell to highlight the interacting pair.

Ripley's Statistics

Test for spatial clustering, dispersion, or randomness per cluster using Ripley's K, L, or G functions. CSR (complete spatial randomness) simulation envelopes are shown for reference. Hover to read per-cluster values; click a curve or legend entry to highlight that cluster.

Ligand-Receptor Analysis

CellPhoneDB-style permutation test for significant ligand-receptor interactions between cell types. Results appear as a dot plot (dot size = mean expression, color = p-value). Click a dot to highlight the ligand's spatial expression and the interacting cluster pair. Adjustable p-value threshold via spinbox.

Expression by Distance

Plot mean gene expression as a function of distance from an anchor cell type. A draggable pink threshold line lets you interactively select cells within a distance cutoff and highlight them on the tissue. Click a gene in the legend to focus on it.

Screenshot Neighborhood enrichment heatmap with highlighted cluster pair on tissue

Enrichment Analysis

GO Enrichment

GSEApy Gene Ontology enrichment analysis using the Enrichr API. Input gene lists from the last DEG comparison, top markers per cluster, or a custom gene list. Supports multiple gene set libraries.

GSEA

GSEApy Gene Set Enrichment Analysis using ranked gene lists. Supports MSigDB, KEGG, Reactome, and other gene set libraries. Input ranked genes from DEG log2FC, DEG score, or rank_genes_groups.

Trajectory & Pseudotime

Diffusion Pseudotime (DPT)

Scanpy Order cells along developmental or differentiation trajectories. Requires a diffusion map embedding (computed from the Analysis Library). Results include an interactive pseudotime colorbar — drag the threshold to select and highlight cells with pseudotime below the cutoff.

PAGA

Scanpy Partition-based graph abstraction visualizes cluster-state transitions as a graph. Nodes are clusters, edges represent transition strength. Click a node to highlight that cluster on the spatial view.

Diffusion Map

Scanpy Non-linear dimensionality reduction based on Markov chain diffusion. Serves as the basis for DPT computation. Interactive embedding with clickable legend for cluster highlighting.

Gene Visualization

Scanpy MilliMap

Violin Plots

Visualize expression distributions across clusters. Click a cluster violin to highlight those cells on the spatial view and color them by expression. Ctrl+click to multi-select.

Dot Plot

Gene-by-cluster matrix where dot size indicates percentage of expressing cells and color indicates mean expression. Click a gene tick label to highlight its spatial expression.

Heatmap

Mean expression heatmap grouped by cluster for a set of genes. Click gene names to visualize their spatial patterns.

Stacked Violin

One violin per gene per cluster, stacked vertically. Compact view for comparing expression of multiple genes across clusters simultaneously.

Millini AI Assistant

MilliMap Millini is MilliMap's built-in AI assistant that translates natural-language biological questions into reproducible analysis operations. It uses function-calling to directly control MilliMap's analysis tools.

Capabilities

Example Queries

Setup

Millini supports OpenAI and Google Gemini as LLM backends. Enter your API key in the Millini settings panel. Chat history is maintained throughout the session.

Screenshot Millini chat interface with natural-language query and analysis result

Cell Annotation

MilliMap MilliMap includes a semi-automatic annotation system that scores clusters against known marker gene sets to suggest cell type identities.

How It Works

  1. Provide a set of marker genes (with optional weights) for each cell type.
  2. MilliMap scores each cluster on multiple metrics: mean expression, variance, percent expressing, and uniqueness.
  3. A weighted multi-metric ranking assigns the best-matching cell type label to each cluster.
  4. Review and adjust annotations interactively. Labels are saved in the AnnData metadata.

Batch Correction

MilliMap integrates Harmony for batch effect correction when combining data from multiple samples, experiments, or tissue sections.

Multi-Dataset Analysis

MilliMap supports loading and analyzing multiple datasets simultaneously.

Export & Reproducibility

Jupyter Notebook Export

MilliMap MilliMap records every analysis operation during your session. When you're done, export the entire session as a reproducible Jupyter notebook containing executable Scanpy and Squidpy code cells with the exact parameters you used.

Figure Export

Data Export

Morphology Overlay

MilliMap For platforms that provide morphology images (Xenium OME-TIFF), MilliMap can overlay high-resolution microscopy channels on top of the spatial point cloud.

Screenshot Spatial view with morphology channel overlay and per-channel controls

MilliMap is under active development. For bug reports, feature requests, or contributions, visit the GitHub repository. For questions, reach us at contact-millimap@milliomics.com.