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](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.0.0.tar.gz (12.3 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.0.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ciliatracks-1.0.0.tar.gz
Algorithm Hash digest
SHA256 422a912864c76dac8b122e62b5896fb7562946ebb8fa969ae698ea0cd0fcfb01
MD5 6f28d8af39e94c3af02966e91fc83473
BLAKE2b-256 50477912bb3816be667ec914bfbb78a2d95bcd755cc776e868767fa59d28ac97

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ciliatracks-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3022a1f26b1dae2dbad91e7c65f3f32b5419d7fc3715df3237c487ea6d950a88
MD5 5118396aec808503cac1beeefe9e059e
BLAKE2b-256 50cc85ee20b16da5cbdf523d6ec87b4c1c92366959724508b624e17e87de3e30

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