This Python library is designed to enhance the performance of single-particle tracking (SPT) algorithms by leveraging Cython. The algorithm is based on the method described in the paper:
Jaqaman, K., Loerke, D., Mettlen, M. et al. Robust single-particle tracking in live-cell time-lapse sequences. Nat Methods 5, 695–702 (2008). https://doi.org/10.1038/nmeth.1237
- Cython-based Compilation: Significant performance improvements over the pure Python implementation of the tracking algorithm by compiling key parts using Cython.
- Ease of Integration: The library is designed to integrate seamlessly with existing Python codebases.
- Customizable: Users can easily customize and extend the functionality to suit their specific needs.
To install this library, you can clone the repository and install the required dependencies:
git clone https://github.com/franciscopalmeromoya/single-particle-tracking.git
cd single-particle-tracking
pip install -r requirements.txt
python setup.py build_ext --inplace
Alternatively, if you have a setup.py
configured with cythonize
, you can install it directly using:
pip install .
Here is a basic example of how to use the library in your project:
import spt
# Initialize the tracking algorithm with your parameters
tracker = spt.Tracker(skip_frames=3, max_dist=2)
# Run the tracking algorithm
results = tracker.track(data)
- Prepare Your Data: Load your time-lapse sequence data into a format compatible with the algorithm. The data must be a dataframe with columns ['frame', 'x', 'y'];
- Initialize the Tracker: Use the
spt.Tracker
class provided by the library. - Run the Tracking: Execute the
track
method to track particles.
This library leverages Cython to compile performance-critical sections of the SPT algorithm, resulting in faster execution times. Benchmarks have shown significant speedups compared to the original Python implementation, especially for large datasets.
We welcome contributions from the community! If you encounter bugs, have feature requests, or want to contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature/bugfix.
- Commit your changes and push the branch.
- Create a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you use this library in your research, please cite the original paper:
Jaqaman, K., Loerke, D., Mettlen, M. et al. Robust single-particle tracking in live-cell time-lapse sequences. Nat Methods 5, 695–702 (2008). https://doi.org/10.1038/nmeth.1237
This library builds upon the original Python implementation by Edo van Veen. We are grateful for his work, which served as the foundation for this version. If you find this library useful, please also consider acknowledging his contributions.
For questions, feedback, or support, please open an issue in the repository or contact me by email.