Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SarcAsM logo

A Python package for comprehensive analysis of sarcomere structure and function in cardiomyocytes

Supported Python versions Python package index bioRxiv Preprint Documentation Status GitHub release

Overview

SarcAsM (Sarcomere Analysis Multitool) is an AI-powered Python package for cardiomyocyte sarcomere analysis. It enables precise multilevel structural and functional assessment of sarcomeres in microscopy images and movies, making it suitable for drug screening, disease phenotyping, and biomechanical studies.

For details, check out our preprint:

Daniel Haertter, Lara Hauke, Til Driehorst, Kengo Nishi, Jaden Long, Malte Tiburcy, Branimir Berecic, et al. 2025. “SarcAsM: AI-Based Multiscale Analysis of Sarcomere Organization and Contractility in Cardiomyocytes.” bioRxiv. https://doi.org/10.1101/2025.04.29.650605.

➡️ Documentation: https://sarcasm.readthedocs.io/

💾 Download App (Windows/MacOS): https://github.com/danihae/SarcAsM/releases

⚙️ Python Package: https://pypi.org/project/sarc-asm

Table of Contents

Features

  • Robust AI-based sarcomere feature detection in microscopy images
  • Comprehensive multilevel analysis of sarcomere structure
    • Z-bands morphometrics and lateral alignment
    • Sarcomere lengths and orientations (sarcomere 'vectors')
    • Myofibril lengths and shape
    • Cell-level myofibril domains
  • High-precision tracking of individual and average sarcomere motion with ~20 nm accuracy
  • Functional analysis of sarcomere contraction dynamics
  • App with interactive Graphical User Interface (GUI)
  • Comprehensive Python API for integration into custom workflows
  • Batch processing capabilities for high-throughput analysis

Graphical abstract

Summary of SarcAsM workflow and analyzed features

Installation of Python package

The easiest way to install SarcAsM is via pip:

pip install sarc-asm

Option 2: Installation from GitHub

For the latest development version:

pip install git+https://github.com/danihae/sarcasm.git

We strongly recommend creating a dedicated conda environment to avoid dependency conflicts:

conda create -y -n sarcasm-env python=3.12
conda activate sarcasm-env
pip install sarc-asm

Note: The full installation usually takes less than 5 minutes, depending on your internet connection. For computers equipped with an NVIDIA GPU, ensure the installed PyTorch and CUDA toolkit versions are compatible. See PyTorch installation instructions for details.

Usage

Test data for getting started can be found here.

Python Package

After installation, SarcAsM can be imported and used in your Python scripts or Jupyter notebooks:

# Example workflow for structural analysis
from sarcasm import SarcAsM, Export

# Load an image or movie
sarc = SarcAsM("path/to/your/image_or_movie.tif")

# Detect sarcomeres
sarc.detect_sarcomeres()

# Analyze sarcomere length and orientations (sarcomere 'vectors')
sarc.analyze_sarcomere_vectors()

# Analyze Z-bands
sarc.analyze_z_bands()

# Analyze myofibrils
sarc.analyze_myofibrils()

# Analyze domains
sarc.analyze_sarcomere_domains()

# Export data to xlsx file (summary statistics per frame; the full results live in the
# sibling <name>.ome.zarr store next to the tif)
Export.export_structure_data('/path/to/xlsx/file.xlsx', sarc)

Tip: Control logging verbosity with the log_level parameter:

# Verbose output for troubleshooting
sarc = SarcAsM("file.tif", log_level='DEBUG')

# Quiet mode - only warnings and errors  
sarc = SarcAsM("file.tif", log_level='WARNING')

Check out quickstart_demo.ipynb in the repository root or our documentation for a practical introduction to SarcAsM's functionalities.

Upgrading from 0.5? SarcAsM 1.0 is a breaking release: Structure became SarcAsM, the manual line-of-interest motion workflow was replaced by 2D sarcomere tracking, results now live in a single .ome.zarr store, and result keys changed. Analyses from 0.5 have to be recomputed; see the changelog and the key migration table.

App

SarcAsM GUI Workflow

SarcAsM includes an app with intuitive Graphical User Interface (GUI) built with Napari for interactive analysis and visualization.

How to Run the App:

There are two main ways to run the SarcAsM App:

  1. Standalone Applications (Recommended for ease of use):

    • Pre-built applications for Windows (.exe) and macOS (.app) are available for download directly from the GitHub Releases page.
    • This method does not require a separate Python installation.
    • Note: As mentioned in the release notes, these are early versions, and the initial startup might take some time. The Windows version currently uses CPU only.
  2. From your Python Environment (Recommended for developers or API users):

    • If you have installed SarcAsM into a Python environment (e.g., via pip or conda from the source), you can launch the GUI using this command:
    # After activating your environment (e.g., conda activate sarcasm-env)
    python -m sarcasm_app
    
    • Alternatively, you can run ./sarcasm_app/__main__.py directly from the SarcAsM root directory if the necessary dependencies are in your PYTHONPATH.

Documentation

Detailed documentation, including tutorials, API reference, and usage examples, can be found at:

https://sarcasm.readthedocs.io/

Additional resources:

Contributing

We welcome contributions from the community! If you'd like to contribute to SarcAsM:

  • Development Guide: See docs/development.md for detailed instructions on setting up your development environment, running tests, code quality standards, and publishing releases.
  • Quick Start for Developers:
    git clone https://github.com/danihae/SarcAsM.git
    cd SarcAsM
    
    # Using uv (recommended)
    uv sync --all-groups
    
    # Or using pip 25.1+ with dependency groups
    pip install -e . --group dev
    
    # Run tests
    pytest
    
  • Please follow the contribution workflow outlined in the development guide
  • Ensure all tests pass and code quality checks are met before submitting pull requests

Support

If you encounter any issues, have questions, or want to suggest improvements:

  • Please check the online documentation first.
  • If the issue persists, open an issue on our GitHub repository. Provide as much detail as possible, including steps to reproduce the problem, error messages, and your operating system/environment details.

Citation

If you use SarcAsM in your research, please cite our preprint for now (peer-reviewed publication will follow):

Daniel Haertter, Lara Hauke, Til Driehorst, Kengo Nishi, Jaden Long, Malte Tiburcy, Branimir Berecic, et al. 2025. “SarcAsM: AI-Based Multiscale Analysis of Sarcomere Organization and Contractility in Cardiomyocytes.” bioRxiv. https://doi.org/10.1101/2025.04.29.650605.

License

This software is patent pending (Patent Application No. DE 10 2024 112 939.5, Priority Date: 8.5.2024).

Academic and Non-Commercial Use

This software is free for academic and non-commercial use. Users are granted a non-exclusive, non-transferable license to use the software for research, educational, and other non-commercial purposes.

Commercial Use Restrictions

Commercial use of this software is strictly prohibited without obtaining a separate license agreement. This includes but is not limited to:

  • Using the software in a commercial product or service
  • Using the software to provide services to third parties
  • Reselling or redistributing the software

For commercial licensing inquiries, please contact:

MBM ScienceBridge GmbH, Hans-Adolf-Krebs-Weg 1, 37077 Göttingen, Germany, https://sciencebridge.de/en/

All rights not expressly granted are reserved. Unauthorized use may result in legal action.

Metadata

Release files for sarc-asm 1.0.0b1

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

Source distribution (sdist)

Source distribution for sarc-asm 1.0.0b1
File Size Uploaded
sarc_asm-1.0.0b1.tar.gz 73.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sarc-asm 1.0.0b1
File Interpreter ABI Platform
sarc_asm-1.0.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 147.3 MB

Release files / sarc_asm-1.0.0b1.tar.gz

Download URL sarc_asm-1.0.0b1.tar.gz
Size 73.6 MB
Tags Source
SHA-256 checksum
How to use checksums
bce2c551fd53f3c286ea1e1c88e080fe4091aaaec8c92fa9aeecc3a05934e11f
BLAKE2b-256 checksum
How to use checksums
a48546cf9f5c5c19af9d4f82686d50e6ad75671302cdf9a36cfb3da60e854ca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / sarc_asm-1.0.0b1-py3-none-any.whl

Download URL sarc_asm-1.0.0b1-py3-none-any.whl
Size 73.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9be8a6c6e4b28b93ed454504a669a3359dd67f9cc1a27149efca5ba3d5c6c81c
BLAKE2b-256 checksum
How to use checksums
a2eb67aa745f1d5bc710c72f79fcd37748b2fce00398eeaae8b4d80d793d5aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0b1 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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