Skip to main content

Albis: simulation of multi-resolution and multi-dimensional spatial transcriptomics data

Albis is a Python package for simulating spatial-transcriptomics data at cell, bin, and spot resolutions. It builds a three-dimensional tissue model, generates gene-expression counts and transcript locations, and aggregates them into observations across tissue sections.

The resulting datasets include spatial coordinates and known simulation ground truth, making them useful for developing and evaluating methods such as spatial clustering, cell-type composition estimation, and slice alignment. Outputs are returned as AnnData objects for use in Python analysis workflows and can be saved as .h5ad files.

Features

  • Multiple resolutions: generate cell-level observations, regular bins, or spatial spots with configurable sizes and spacing.
  • Multiple sectioning directions: slice a 3D tissue model along the X, Y, or Z axis, retaining both 2D and 3D spatial coordinates.
  • Configurable tissue composition: control spatial domains, cell types, and cell-type mixtures within domains.
  • Technical variation: introduce slice-specific batch effects and coordinate rotations and translations for alignment experiments.
  • Ground-truth annotations: retain domain and cell-type labels and composition information for evaluating downstream analyses.
  • Reproducible workflows: set random seeds, inspect simulation summaries, and visualize results with built-in plotting functions.

The current simulator uses spherical tissue geometry with a central domain and surrounding wedge-shaped domains. See the GitHub documentation for the supported parameters and their interpretation.

Installation

pip install albis

Requires Python 3.10 or newer. Plotting dependencies are included in the standard installation.

Quick start

Generate a small example, inspect it, plot its spatial domains, and save it:

import albis as ab

adata = ab.example_data(seed=2025)
print(ab.describe(adata))

figure = ab.plot(adata, view="2d", color="domain_true", slice_id=1)
figure.savefig("albis_example.png", dpi=150, bbox_inches="tight")

ab.save(adata, "albis_example.h5ad")

Use ab.generate_data() to configure a simulation, including its output resolution ("cell", "bin", or "spot"), sectioning axis, number of slices, and tissue composition. Lower-level functions provide access to the tissue-generation and sectioning steps.

Documentation and tutorials

Full documentation and worked examples are maintained on GitHub:

License

Albis is distributed under the MIT license.

Release files for albis 0.1.1

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

Source distribution (sdist)

Source distribution for albis 0.1.1
File Size Uploaded
albis-0.1.1.tar.gz 35.7 kB Details

Built distribution (wheel)

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

Total release size: 64.0 kB

Release files / albis-0.1.1.tar.gz

Download URL albis-0.1.1.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a7215efcdd911ffad2134eb878e460117f8d0438f3425f50107469e133ee8978
BLAKE2b-256 checksum
How to use checksums
3a8065f47988bdc2569974b025af4784a907dbae62d4c25bb4e58b25f6a98178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.9

Release files / albis-0.1.1-py3-none-any.whl

Download URL albis-0.1.1-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4de4f578a7b48be5937a53a727971df3555b468b1306e55059d0c089336bdbf3
BLAKE2b-256 checksum
How to use checksums
01bca5c798aac0f72c3f3dd59b0efb6cfb5ee3f8883acc12ef9530f8f90d771f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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