Welcome to ExSeq-Toolbox, a comprehensive Python package for Expansion Microscopy RNA Sequencing (ExSeq). This toolkit enables researchers to create spatially-precise, three-dimensional maps of RNA localization sites within biological tissues at unprecedented resolution.
ExSeq-Toolbox provides a complete workflow for ExSeq data analysis, from raw image processing to final spatial transcriptomics results. The package is modular, allowing researchers to use individual components or run complete pipelines.
- Data Preparation & Configuration - Set up experiment parameters and data organization
- Image Alignment - Register multi-round imaging data with sub-pixel precision
- Puncta Detection - Extract RNA molecules from aligned image volumes
- Spatial Analysis - Map RNA locations and assign gene identities
- Visualization - Generate spatial transcriptomics maps and visualizations
- Multi-scale alignment for precise image registration
- GPU-accelerated processing for high-throughput analysis
- Flexible data formats supporting various microscopy platforms
- Comprehensive visualization tools for spatial transcriptomics
- Modular architecture enabling custom analysis pipelines
# Clone the repository
git clone https://github.com/RuihanZhang2015/ExSeq-Toolbox.git
cd ExSeq-Toolbox
# Install dependencies
pip install .
# For GPU acceleration (optional)
pip install -r requirements_gpu.txt
from exm.args.args import Args
from exm.align.align import volumetric_alignment
from exm.puncta.extract import extract
# Configure your experiment
args = Args()
args.set_params(
raw_data_path='/path/to/your/data/',
spacing=[0.4, 1.625, 1.625],
channel_names=['640', '594', '561', '488', '405']
)
# Run the complete pipeline
# 1. Align images
volumetric_alignment(args=args)
# 2. Extract RNA puncta
extract(args=args)
# 3. Analyze spatial transcriptomics
# (Additional analysis steps...)
ExSeq-Toolbox provides ready-to-use wrapper scripts that guide you through the complete data processing pipeline. These scripts are located in examples/wrappers/
and can be customized for your specific experiment.
Before running the wrappers, ensure your data follows this structure:
raw_data_directory/
βββ code0/
β βββ raw_fov0.h5
β βββ raw_fov1.h5
β βββ raw_fov2.h5
β βββ ...
βββ code1/
β βββ raw_fov0.h5
β βββ raw_fov1.h5
β βββ ...
βββ ...
Important: Each raw_fov{}.h5
file should contain datasets named by channel wavelength (e.g., '640', '594', '561', '488', '405').
# Copy and modify the parameter configuration script
cp examples/wrappers/1_pipeline_parameter.py my_experiment_config.py
Edit my_experiment_config.py
to set your parameters:
raw_data_path
: Path to your raw data directoryspacing
: Pixel spacing [Z, Y, X] in micrometerschannel_names
: Your fluorescence channel wavelengthscodes
: Number of imaging roundsfovs
: Fields of view to process
# Copy and modify the alignment script
cp examples/wrappers/2_volume_alignment.py my_alignment.py
Edit my_alignment.py
with your configuration file path, then run:
python my_alignment.py
# Copy and modify the evaluation script
cp examples/wrappers/3_alignment_evaluation.py my_evaluation.py
Run to assess alignment quality and visualize results.
# Copy and modify the puncta extraction script
cp examples/wrappers/4_puncta_extraction.py my_puncta_extraction.py
Configure GPU/CPU settings and run:
python my_puncta_extraction.py
# Copy and modify the basecalling script
cp examples/wrappers/5_puncta_basecalling.py my_basecalling.py
Run to assign gene identities to detected puncta and map them to nuclei.
For a complete workflow, run the scripts in sequence:
# 1. Set up your experiment parameters
python my_experiment_config.py
# 2. Align your image volumes
python my_alignment.py
# 3. Evaluate alignment quality
python my_evaluation.py
# 4. Extract RNA puncta
python my_puncta_extraction.py
# 5. Assign gene identities
python my_basecalling.py
After running the complete pipeline, you'll have:
- Aligned image volumes for each field of view
- Extracted puncta coordinates with intensity measurements
- Gene assignments for each detected RNA molecule
- Spatial transcriptomics maps showing gene expression patterns
- Quality metrics and visualization plots
- GPU Acceleration: Set
use_gpu=True
in puncta extraction for faster processing - Memory Management: Adjust
chunk_size
for large datasets - Quality Control: Modify threshold parameters based on your data quality
- Parallel Processing: Increase
parallel_processes
for faster alignment
- Memory Issues: Reduce
chunk_size
or process fewer FOVs simultaneously - Alignment Failures: Check image quality and adjust alignment parameters
- Missing Puncta: Verify channel names and adjust detection thresholds
- Gene Assignment Errors: Ensure your gene list CSV is properly formatted
Comprehensive documentation is available at ExSeq Toolbox Documentation, including:
- Installation guides and system requirements
- Tutorial notebooks with example datasets
- API reference for all functions and classes
- Workflow examples for different research applications
- Troubleshooting guides and best practices
We welcome contributions from the research community! Please see our Contributing Guidelines for details on:
- Reporting bugs and feature requests
- Submitting code improvements
- Adding new analysis modules
- Improving documentation
If you use ExSeq-Toolbox in your research, please cite:
[Citation information to be added]
Distributed under the MIT License. See LICENSE for more information.
For questions, bug reports, or feature requests, please:
- Open an issue on our GitHub repository
- Check our documentation
- Join our community discussions