Skip to main content

PyPI Development Status Python Version License Actions Status Documentation Status Ruff


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.

Each cell lineage can also be viewed as a cell cycle lineage, or cycle lineage for short, where a node represents a whole cell cycle, from the cell just after a division to the next division, instead of a cell at a specific point in time. You can then measure things at both levels, e.g. the speed of a cell between two timepoints or the duration of a cell cycle.

With Pycellin, you can:

  • Enrich your lineages with predefined properties related to cell morphology, motion, timing, lineage topology and intensity. pc.get_pycellin_cell_lineage_properties() and pc.get_pycellin_cycle_lineage_properties() list them all. More predefined properties will be implemented in the future.
  • Create your own properties, to accommodate the wide variety of experiments and biological questions.
  • Explore your lineages, by plotting a property along their branches, or the mean of a property over time.
  • Edit your lineages and merge datasets that share the same time and space calibration.
  • Get your data as pandas DataFrames, with one row per cell, link between cells, cell cycle or lineage, or write your data to common tracking file formats.

Pycellin can read from and write to:

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. So while Pycellin is built to support cell divisions, it does not fully support cell fusions, also called merging events: a cell at a specific timepoint cannot have more than one parent. Please correct them in your tracking software before using Pycellin. Data with fusions can still be read, with a warning: get_fusions() then lists them and you can correct them with remove_link(), but until you do, crashes and incorrect results can occur.

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, from PyPI:

pip install pycellin

The documentation details each step, and how to install the example notebooks or the development tools.

Upgrading from 0.5.1? Version 0.6.0 renames many functions, methods and arguments, without aliases: for example, load_TrackMate_XML() is now read_trackmate_xml(). Pickle files written with 0.5.1 can't be read anymore either. The changelog lists all the changes.

Code Example

import pycellin as pc

# Read data from an external tool, here TrackMate.
xml_path = "sample_data/Ecoli_growth_on_agar_pad.xml"
model = pc.read_trackmate_xml(xml_path)

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

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

# Enrich your lineages with additional predefined properties.
model.add_pycellin_properties(
    [
        "rod_length",
        "rod_width",
        "cell_displacement",
        "cell_speed",
        "cycle_mean_speed",
        "relative_age",
        "interdivision_time",
        "is_complete_cycle",
    ]
)
model.update()

# Get 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 write it back to TrackMate for visualization...
pc.write_trackmate_xml(
    model,
    "sample_data/Ecoli_growth_on_agar_pad_enriched.xml",
    propagate_cycle_props=True,
)

# ... or to another file format.
pc.write_geff(
    model,
    "sample_data/Ecoli_growth_on_agar_pad_enriched.geff",
    propagate_cycle_props=True,
)

Usage

The documentation holds the API reference. Until its user guide is complete, these notebooks show how to use Pycellin:

Notebook Description Level
Getting started The basics of Pycellin, through examples Beginner
Managing properties How to add, compute and remove properties Beginner
Custom properties How to create user-defined properties and add them to your lineages Advanced

Credits and references

Metadata

Release files for pycellin 0.6.0

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.6.0
File Size Uploaded Provenance Actions
pycellin-0.6.0.tar.gz 233.7 kB With provenance Details for pycellin-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 479.6 kB

Release files / pycellin-0.6.0.tar.gz

Download URL pycellin-0.6.0.tar.gz
Size 233.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0133ce51966c8f3c2ee0ed139542c2b79819ba464cc7c1679112bcc8632c6545
BLAKE2b-256 checksum
How to use checksums
90c51e090a09ed9621bd8904bfc8d396e3bb5b9babe0a21378704042686abab2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

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

Download URL pycellin-0.6.0-py3-none-any.whl
Size 245.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
180c1a88b1f01669fd02e550c8d23c33e53f11a2aeacf59e6f039ad30ba1ccb1
BLAKE2b-256 checksum
How to use checksums
49fe0793b83d7bb868fb23c257a2b7c77a1d9ae6161921dd754c4d526638371d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for pycellin 0.6.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pycellin-0.6.0.tar.gz

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 Nov 19, 2026.

Transparency log

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.

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