Pytaxis is a Python package for analysis of movies of swimming bacteria. Read the tutorial for details on how to use the package. If you use pytaxis for published research, please cite this paper to credit the authors.
Py-taxis consists of three modules:
- image - image processing module, uses OpenCV to detect bacteria in each frame of the movie and trackpy to connect coordinates into trajectories.
- proc - trajectory analysis module, allows to calculate instantaneous parameters of the trajectories, filter spurious trajectories and detect distinct motility states (e.g. runs and tumbles) using Hidden Markov model implemented in hmmlearn.
- plot - contains various handy plotting functions.
The workflow below illustrates different stages of data analysis from detecting bacteria to assigning motility states.
Trajectory in blue belongs to a swimming bacterium, while trajectory in red - to a bacterium stuck to the glass surface. Such circular trajectories are removed at the filtering stage of data analsys in order to minimize noise due to erroneous assignment of motility states.