Skip to content

ReconST: Optimal Gene Panel Selection for Targeted Spatial Transcriptomics Experiments

Workflow of ReconST

1. Introduction

Existing single-cell resolution spatial transcriptomics platforms (such as MERFISH, seqFISH, and Xenium) do not generate transcriptome-wide gene expression profiles but rather target a limited subset of genes. Therefore, a crucial question is how to select a gene that can optimally recaptitulate the whole-transcriptome information structure.

ReconST is a data-driven framework for designing optimal gene panels for targeted spatial transcriptomics experiments. The method uses a paired-scRNAseq dataset as input information, and outputs a gene set of any given size that best preserves the overall gene expression patterns. This achieved by training a gated autoencoder to identify the most informative genes for reconstructing the full transcriptome information. ReconST is implemented as a lightweight Python package with a simple, reproducible workflow for model training, gene-ranking, and exporting panels compatible with modern spatial transcriptomics platforms.

Key Features

  • Automated end-to-end gene selection.

  • Compact and interpretable gene panels

  • Generally applicable to any biological system and technological platform.

  • Scalable to large datasets (such as whole mouse brain atlas data).

  • Easy-to-use Python API

Citation

Lu, H., et al. "Optimal Gene Panel Selection for Targeted Spatial Transcriptomics Experiments." bioRxiv (2025): 2025-10.

2. Installation

Install directly from GitHub:

pip install git+https://github.com/haoranlustat/ReconST.git

3. Quick Start

import reconst
from reconst import (
    FeatureScreeningAutoencoder,
    prepare_common_genes,
    create_data_loader,
    train_model,
    evaluate_model,
    select_genes,
)

# 1) Prepare shared gene set
common_genes = prepare_common_genes(sc_adata, merfish_adata)

# 2) Build dataloader
loader = create_data_loader(sc_adata[:, common_genes], batch_size=256)

# 3) Train gated autoencoder
model = FeatureScreeningAutoencoder(n_genes=len(common_genes))
train_model(model, loader, n_epochs=1000)

# 4) Select top genes
selected_genes = select_genes(model, top_k=200)

# 5) Optional: evaluate on spatial data
metrics = evaluate_model(model, merfish_adata[:, common_genes])

4. Tutorials

A complete working example tutorial: Example.ipynb

5. Method Overview

ReconST uses a gated autoencoder architecture to identify genes that best reconstruct the full transcriptome when compressed to a small panel. A learnable gating layer assigns an importance weight to each gene, and an L1 sparsity penalty encourages most gates to approach zero so that the model focuses on a compact, informative subset of genes.

During training, the gated expression matrix is passed through an encoder–decoder network that learns a low-dimensional representation and reconstructs the original expression profile. Genes with consistently high gate values are considered informative, while those with near-zero weights are excluded. After convergence, the final gene panel is obtained from the non-zero gates or by selecting the top-ranked genes. This end-to-end formulation provides a simple and scalable way to learn biologically meaningful gene panels suitable for targeted spatial transcriptomics.

6. License

ReconST is released under the MIT License.