Skip to main content

Twocan

A Bayesian optimization framework for multimodal registration of highly multiplexed single-cell spatial proteomics data

Documentation Status Python 3.8+ License: CC BY-NC-SA 4.0 PyPI version

Overview

Twocan automatically finds optimal parameters for registering images from different spatial proteomics technologies using Bayesian optimization. Instead of manually tuning preprocessing and registration parameters, Twocan efficiently explores the parameter space to find the best registration for your data.

Key Features:

  • 🔧 Automated parameter optimization for image registration
  • 🧠 Bayesian optimization via Optuna for efficient search
  • 🔬 Support for multiple spatial proteomics modalities (IF, IMC, FISH, IMS)
  • 📊 Built-in quality metrics and visualization tools
  • 🎯 Extensible framework for custom objectives and preprocessors

Quick Start

Installation

# Install from PyPI
pip install twocan

# Or install from source
git clone https://github.com/camlab-bioml/twocan.git
cd twocan
pip install .

Basic Usage

import twocan as tc

# Load your images
moving_img = tc.read_image("moving.tif") 
fixed_img = tc.read_image("fixed.tif")

# Create estimator and optimize
estimator = tc.RegEstimator(moving_img, fixed_img)
study = estimator.optimize(n_trials=100)

# Get best transformation
best_transform = tc.pick_best_registration(study)

Documentation

📚 Full Documentation

Examples & Notebooks

Check out the notebooks/ directory for comprehensive examples:

  • Basic registration with default settings
  • Custom preprocessing for different modalities
  • Advanced optimization strategies
  • Saving and loading registration results

Citation

If you use Twocan in your research, please cite:

@software{harrigan2024twocan,
  title={Twocan: A Bayesian optimization framework for multimodal registration},
  author={Harrigan, Caitlin F.},
  year={2024},
  url={https://github.com/camlab-bioml/twocan}
}

License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License - see the LICENSE file for details.

Support

Metadata

Release files for twocan 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twocan 0.1.2
File Size Uploaded Provenance Actions
twocan-0.1.2.tar.gz 80.4 kB Without provenance Details for twocan-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for twocan 0.1.2
File Interpreter ABI Platform Actions
twocan-0.1.2-py3-none-any.whl Python 3 none any Details for twocan-0.1.2-py3-none-any.whl

Total release size: 146.1 kB

Release files / twocan-0.1.2.tar.gz

Download URL twocan-0.1.2.tar.gz
Size 80.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cee0667fa39ce1c2a89ec67a0edc128757ca9e64fe75e8e3a03a3f23f99d2bbd
BLAKE2b-256 checksum
How to use checksums
f6c689e6776dc1a0efd5a49128940ed2713c6c554e5595387e49611a45a416a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / twocan-0.1.2-py3-none-any.whl

Download URL twocan-0.1.2-py3-none-any.whl
Size 65.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
381d7a8dda7dcb3d100f8a7ccc5bdc85235cacab1abd6aeb9dc5d610bd4865e0
BLAKE2b-256 checksum
How to use checksums
98f71b1dc1e80831667d8af38773e51d2a61ec82ec79016226d3a774dcb68a34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Security for twocan 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page