Skip to main content

PyPI Development Status Python Version License Actions Status Code style: black


Pycellin

Pycellin is a graph-based Python framework to easily manipulate and extract information from cell tracking data, at the single-cell level. In pycellin, cell lineages are modeled intuitively by directed rooted trees. Graph nodes represent cells at a specific point in time and space, and graph edges represent the time and space displacement of the cells. Please note that while pycellin is built to support cell division events, it does not authorize cell merging events: a cell at a specific timepoint cannot have more than one parent.

Pycellin provides predefined properties related to cell morphology, cell motion and tracking that can be automatically added to enrich lineages. More predefined properties will be implemented in the future. The framework also facilitates the creation of new properties defined by the user to accommodate the wide variety of experiments and biological questions.

Pycellin can read from and write to:

More tracking formats will progressively be supported.

Although pycellin was designed with bacteria / cell lineages in mind, it can be used with more diverse tracking data. The main requirement is that the data can be modeled by directed rooted trees, meaning no merging event.

Installation

Pycellin supports Python 3.10 and above. It is tested with Python 3.10 and 3.14 on the latest versions of Ubuntu, Windows and MacOS. Please let me know if you encounter any compatibility issue with a different combination.

It is recommended to install pycellin in a conda or mamba environment.

  1. Check that conda/mamba is already installed by typing either conda or mamba in a terminal. If not, follow the installation instructions on Miniforge.

  2. Create a Python environment dedicated to pycellin:

    conda create -n my_env_pycellin
    
  3. Activate the environment:

    conda activate my_env_pycellin
    
  4. Install pycellin via PyPI:

    pip install pycellin
    

    or if you want to install the optional test related dependencies use instead:

    pip install pycellin[test]
    
  5. You're good to go!

Code Example

import pycellin

# Import data from an external tool, here TrackMate.
xml_path = "sample_data/Ecoli_growth_on_agar_pad.xml"
model = pycellin.load_TrackMate_XML(xml_path)

# Plot the cell lineages.
for lin in model.get_cell_lineages():
    plot(lin)

# Compute and plot the cell cycle lineages.
model.add_cycle_data()
for clin in model.get_cycle_lineages():
    plot(clin)

# Enrich your lineages with additional predefined properties.
model.add_pycellin_properties([
    "rod_length", 
    "rod_width",
    "cell_displacement", 
    "cell_speed", 
    "branch_mean_speed",
    "relative_age",
    "division_time", 
    "cycle_completeness",
    ])
model.update()

# Export the enriched data as dataframes...
cell_df = model.to_cell_dataframe()
link_df = model.to_link_dataframe()
cycle_df = model.to_cycle_dataframe()
lineage_df = model.to_lineage_dataframe()

# ... or export back to TrackMate...
pycellin.export_TrackMate_XML(
    model,
    "sample_data/Ecoli_growth_on_agar_pad_enriched.xml",
    units={
        "spatialunits": model.get_space_unit(),
        "temporalunits": model.get_time_unit(),
    },
    propagate_cycle_props=True,
)

# ... or to another file format.
pycellin.export_GEFF(
    model,
    "sample_data/Ecoli_growth_on_agar_pad_enriched.geff",
    time_axes=["POSITION_T"],
    space_axes=["cell_x", "cell_y", "cell_z"],
    variable_length_props=["ROI_coords"],
) 

Usage

Please note that the following notebooks are still a work in progress. There may be some mistakes in the code and some sections might move from one notebook to another.

Notebook Description Level State
Getting started The basics of pycellin, through examples Beginner WIP
Managing properties How to add, compute and remove properties from a model Beginner WIP
Working with TrackMate data How pycellin can work with TrackMate, through an example Beginner WIP
Creating a model from scratch How to manually create a pycellin model, including its lineages Advanced Stub
Custom properties How to create user-defined properties and augment a model with them Advanced WIP

Credits and references

Metadata

Release files for pycellin 0.5.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 pycellin 0.5.1
File Size Uploaded
pycellin-0.5.1.tar.gz 119.8 kB Details

Built distribution (wheel)

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

Total release size: 251.7 kB

Release files / pycellin-0.5.1.tar.gz

Download URL pycellin-0.5.1.tar.gz
Size 119.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7f9d98e228363095449c16765b9b379690283af844ea88af8b81684a5b212924
BLAKE2b-256 checksum
How to use checksums
ab487e276dbf2aa1fb2876029e1700d6d01bbfd6df1d7ea1987fcc64ca82bbad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 30, 2026.

Transparency log

Release files / pycellin-0.5.1-py3-none-any.whl

Download URL pycellin-0.5.1-py3-none-any.whl
Size 132.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ffae8728ece48b55dbcee251e85c3d25eb996fa7c9bb2c693c35ef5c922df46
BLAKE2b-256 checksum
How to use checksums
78b1290402c0f072b3aac072aa1d1a4c4ee354e27e0f37d8fde147957e61f3f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

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

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