Skip to main content

A package for analyzing cilia-driven particle motility from TrackMate data.

Project description

CiliaTracks

PyPI version Python Version

A set of computational tools for the visualization and quantitative analysis of cilia-driven particle movement, designed to process TrackMate data from high-speed video microscopy of cultured airway cells.

This package provides the functions to analyze and visualize data from TrackMate exports, complementing the research detailed in our publication on Primary Ciliary Dyskinesia (PCD).


Core Capabilities

  • Trajectory Visualization: Generate high-quality angular plots that visualize particle trajectory, displacement, and speed.

  • Feature Engineering for Classification: Automatically extract a comprehensive feature set from track data for input into our XGBoost model for classifying PCD and healthy samples. The feature set could also be used to train and develop new machine learning classifiers.

  • Standardized Image Generation for CNNs: Produce normalized trajectory images suitable as direct input for our Convolutional Neural Network (CNN) model.

  • Direct PCD Classification: Make predictions on whether a sample is from a healthy control or a PCD patient using two pre-trained models: an XGBoost model for feature-based classification and a CNN for image-based classification.

  • Automated Fiji ImageJ Script: This repostiory contains a Jython script that automates the entire particle tracking analysis workflow


Installation

There are two ways to install CiliaTracks:

Option 1: Install from PyPI (Recommended)

The easiest way to install the package is from the Python Package Index (PyPI). This will provide the latest stable release.

pip install CiliaTracks

Option 2: Install from GitHub

To get the latest development version, you can install the package directly from this GitHub repository.

pip install git+https://github.com/NicoHadas/CiliaTracks.git

Quick Start

The following example demonstrates how to generate and display a trajectory plot from TrackMate CSV files.

import CiliaTracks as CT
import matplotlib.pyplot as plt

# Define paths to your TrackMate CSV files
tracks_file = 'path/to/your/Tracks.csv'
spots_file = 'path/to/your/Spots.csv'

# Optional: Define a pixel-to-micrometer conversion factor
conversion_factor = 0.65 # e.g., 1 pixel = 0.65 µm

# Generate the trajectory plot figure
fig = CT.trajectory(
    Tracks=tracks_file, 
    Spots=spots_file, 
    Conversion=conversion_factor
)

# Display the plot interactively
plt.show()

# To save the figure
# fig.savefig('trajectory_plot.png', dpi=300, bbox_inches='tight')

Prediction Examples

The package includes pre-trained models to classify samples directly from your TrackMate data.

1. XGBoost Model Prediction

import CiliaTracks as CT

# Define paths to your TrackMate CSV files
tracks_file = 'path/to/your/Tracks.csv'
spots_file = 'path/to/your/Spots.csv'
conversion_factor = 0.65

# Get a prediction from the XGBoost model
CT.prediction_ML(
    Tracks=tracks_file,
    Spots=spots_file,
    Conversion=conversion_factor
)
# Expected output:
# Model Prediction: PCD
# Model Confidence: 98.7%

2. CNN Model Prediction

import CiliaTracks as CT

# Define paths to your TrackMate CSV files
tracks_file = 'path/to/your/Tracks.csv'
spots_file = 'path/to/your/Spots.csv'
conversion_factor = 0.65

# Get a prediction from the CNN model
CT.prediction_CNN(
    Tracks=tracks_file,
    Spots=spots_file,
    Conversion=conversion_factor
)
# Expected output:
# Model Prediction: Control
# Model Confidence: 95.2%

Example Ouputs

Trajectory Plot
Fig 1. Trajectory Plot
Displacement Plot
Fig 2. Displacement Plot
CNN Input Plot
Fig 3. CNN Input Image

Automated Fiji/ImageJ Analysis Script

This repository includes a Jython script that automates the entire TrackMate analysis process. This script will take a folder of raw AVI video files and generate the Tracks.csv and Spots.csv files required by the CiliaTracks Python package.

How to Use the Script

  1. Download script: Find the script in the Fiji_Scripts folder of this repository.

  2. Open the Script Editor in Fiji: In the main Fiji toolbar, navigate to File > New > Script

  3. Open the Script File: Select the script file you downloaded

  4. Run the Script: Click the "Run" button at the bottom of the editor

  5. Select Folders:

    a. Select the input folder containing your .avi video files

    b. Select an output folder where the resulting .csv files will be saved.

  6. Click "OK" to start the batch processing. The script will analyze all videos in the input folder and save the results.

How to Cite

If you use CiliaTracks in your research, please cite our publication:

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

ciliatracks-1.1.5.tar.gz (167.7 kB view details)

Uploaded Source

Built Distribution

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

ciliatracks-1.1.5-py3-none-any.whl (173.6 kB view details)

Uploaded Python 3

File details

Details for the file ciliatracks-1.1.5.tar.gz.

File metadata

  • Download URL: ciliatracks-1.1.5.tar.gz
  • Upload date:
  • Size: 167.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ciliatracks-1.1.5.tar.gz
Algorithm Hash digest
SHA256 8c3f836ab6293717d39dfe96b9667aee0b16549fa7f55919ca847f9feb9aedf0
MD5 4e71dc608bf2225d5c8ef3c281249f44
BLAKE2b-256 155723699318990d16d8e650bd32d044ae124b67f38c3841eb0f192e6fab554c

See more details on using hashes here.

File details

Details for the file ciliatracks-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: ciliatracks-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 173.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ciliatracks-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 815e54472ae17c8ce8704ffd14a8cd0ce72acb9e7281cff132ca154a3964c9be
MD5 235e4bd49a9483123d23b639f57e29c4
BLAKE2b-256 1d0b3e91257d67363f79910a5e25fb8ac47cf780de3cd37cf0704eb1bee0de4f

See more details on using hashes here.

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