A package for analyzing cilia-driven particle motility from TrackMate data.
Project description
CiliaTracks
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
|
Fig 1. Trajectory Plot |
Fig 2. Displacement 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
-
Download script: Find the script in the Fiji_Scripts folder of this repository.
-
Open the Script Editor in Fiji: In the main Fiji toolbar, navigate to File > New > Script
-
Open the Script File: Select the script file you downloaded
-
Run the Script: Click the "Run" button at the bottom of the editor
-
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.
-
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ciliatracks-1.1.2.tar.gz.
File metadata
- Download URL: ciliatracks-1.1.2.tar.gz
- Upload date:
- Size: 166.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
934708597825c85010a635c795bee8330cc6369a3e9425dd82a700f63fbfef39
|
|
| MD5 |
38f2c7265c2b590a63345a6fb3579514
|
|
| BLAKE2b-256 |
996153ea0c9df4725e4fb58d24b17526fd3181811fce71c6266c2ba93724fc16
|
File details
Details for the file ciliatracks-1.1.2-py3-none-any.whl.
File metadata
- Download URL: ciliatracks-1.1.2-py3-none-any.whl
- Upload date:
- Size: 172.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e64e6074802d1ec3c3078d113f88e7a69035df03202180dbe58efb3620d334e0
|
|
| MD5 |
ba59611c085f98086966b31d7bdcef67
|
|
| BLAKE2b-256 |
83b5a931b6ac619b1a830cde29b67882990b8d6550b4c34fe7487afb4c263b79
|