Skip to main content

Graph-based framework to manipulate and analyze cell lineages from cell tracking data

Project description

Build 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 acyclic graphs (DAG). 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 features related to cell morphology, cell motion and tracking that can be automatically added to enrich lineages. More predefined features will be implemented in the future. The framework also facilitates the creation of new features defined by the user to accommodate the wide variety of experiments and biological questions.

Pycellin can read from and write to TrackMate XML and Cell Tracking Challenge text file formats. More tracking formats will progressively be supported.

While Pycellin has been designed with bacteria / cell lineages in mind, it could be used with more diverse tracking data provided the few conditions below are enforced:

  • the tracking data can be modeled by a DAG, meaning no merging event
  • time must flow homogeneously, i.e. all the edges of a lineage graph must represent the same elapsed time.

Installation

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

You can install Pycellin from PyPI:

pip install pycellin

To install Pycellin with the optional test related dependencies:

pip install pycellin[test]

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 features.
model.add_pycellin_features([
    "cell_length", 
    "cell_width",
    "cell_displacement", 
    "cell_speed", 
    "branch_mean_speed",
    "relative_age",
    "division_time", 
    "division_rate",
    "cell_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()

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 features How to add, compute and remove features 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 features How to create user-defined features and augment a model with them Advanced WIP

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycellin-0.3.5b3.tar.gz (64.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycellin-0.3.5b3-py3-none-any.whl (71.3 kB view details)

Uploaded Python 3

File details

Details for the file pycellin-0.3.5b3.tar.gz.

File metadata

  • Download URL: pycellin-0.3.5b3.tar.gz
  • Upload date:
  • Size: 64.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pycellin-0.3.5b3.tar.gz
Algorithm Hash digest
SHA256 7c50becd3763a2bc8d7c7c83efc2d3329731349d4e956a4b5162f299b52a43a6
MD5 a2c5648ce92f3943d6b354eafb7febc2
BLAKE2b-256 ee60c2a91c35c0ae5edf77d1365a0c08a1c9d0eff29ab794df2aa3f1da39343b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycellin-0.3.5b3.tar.gz:

Publisher: deploy.yml on Image-Analysis-Hub/pycellin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycellin-0.3.5b3-py3-none-any.whl.

File metadata

  • Download URL: pycellin-0.3.5b3-py3-none-any.whl
  • Upload date:
  • Size: 71.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pycellin-0.3.5b3-py3-none-any.whl
Algorithm Hash digest
SHA256 c8b66d17b05837cc3cead1d0e66c37ed8a9382128633415a44ff739360ffe151
MD5 a647c2407777caee39da7a2f4b244df8
BLAKE2b-256 7f7bed4621ddef93bc202777d47f6fed3495c71d1f23eac33e556165f36d4778

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycellin-0.3.5b3-py3-none-any.whl:

Publisher: deploy.yml on Image-Analysis-Hub/pycellin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page