TRACER Tutorial

Reconstructing biologically coherent cellular profiles from imaging-based spatial transcriptomics.

TRACER is in active development. This page outlines what the method does and how a typical analysis is structured; installation commands and example data links will be finalized with the public code release. For the methodological details, see the preprint.
On this page
Overview  ·  Installation  ·  Inputs  ·  Quick start  ·  Outputs  ·  Citing

Overview

Imaging-based spatial transcriptomics (e.g., Xenium, MERFISH, CosMx) localizes individual transcripts in tissue, but assigning those transcripts to cells depends on segmentation that can produce mixed or incomplete cellular profiles — transcripts bleeding across boundaries, or cells whose nuclei are never detected.

TRACER refines cellular representations by leveraging two signals already present in the data: gene–gene coherence (which genes tend to co-occur in real cell types) and spatial co-localization of transcripts. It does this without external annotations or a reference atlas, resolving mixed profiles and reconstructing partial cells to give a more complete and biologically coherent picture of the tissue.

Installation

TRACER is implemented in Python. The public code release is expected alongside peer-reviewed publication; installation instructions and a PyPI/GitHub link will appear here at that time. In the meantime, see the preprint for methodological details, or contact the lab for early access.

Inputs

TRACER expects per-transcript spatial data with, at minimum, a gene label and spatial coordinates, optionally with an initial cell assignment from segmentation.

InputDescription
Transcript tablePer-molecule records: gene, x, y (and z if available)
Initial segmentationOptional cell IDs from a segmentation method, to be refined
Cell / nucleus centroidsOptional, used to anchor reconstruction of partial cells

Quick start

A typical analysis proceeds in three conceptual steps:

# 1. Load imaging-based spatial transcriptomics data
import tracer

data = tracer.load_transcripts("sample_transcripts.csv")

# 2. Run TRACER to refine and reconstruct cellular profiles
result = tracer.run(data)

# 3. Export refined cell-by-gene profiles for downstream analysis
result.to_anndata("tracer_cells.h5ad")
The API names above are illustrative. The released package will ship runnable notebooks on example data.

Outputs

TRACER returns refined cell-by-gene profiles — including reconstructed partial cells — in a standard single-cell container (e.g., AnnData) ready for clustering, cell typing, and downstream spatial analysis with tools such as SpaceMarkers.

Citing TRACER

Yuan L, Zheng Y, Zhang S, Beroukhim R, Deshpande A. Reconstructing biologically coherent cellular profiles from imaging-based spatial transcriptomics. bioRxiv (2026). biorxiv.org/10.64898/2026.03.08.710395