TRex Data to Movement

Converting larval tracking data into Movement datasets, with trajectory quality control, filtering, and reports. UCL Summer School, 2026.

Figure captions:

During the UCL Summer School in 2026, I implemented a workflow that converts TRex trajectory CSV files into datasets compatible with the Movement Python package. I used larval tracking data to connect data loading with quality control, filtering, and visual inspection.

View the code and usage instructions on GitHub.

What the tool does

The loader aligns individuals by frame number, converts centroid coordinates into a position array, and calls movement.io.load_poses.from_numpy to create an xarray.Dataset. It preserves the raw trajectories and keeps experiment-specific quality control and filtering in a separate stage.

The configurable workflow selects an analysis window, checks missing frames and suspicious jumps across gaps, and filters retained trajectories. It generates trajectory plots, raw-versus-filtered comparisons, and CSV summaries of the dataset and quality-control decisions.

Workflow from TRex CSV files through conversion, quality control, filtering, and reports

Workflow diagram from my UCL presentation. Click to enlarge.

Raw and filtered X and Y trajectories in a group trial

Example group trial before and after trajectory quality control and filtering. Columns show raw and filtered data; rows show X and Y positions over time.

Example configuration

For the larval dataset, the example analyzes 20–860 seconds, excludes trajectories with more than 10% missing frames or suspicious gap transitions, interpolates gaps of at most 3 frames, and applies a 5-frame rolling median. These settings are configurable and specific to this example.

Quality-control report showing a larva's coordinate traces and filtered spatial trajectory

Example of an included trajectory, with its analysis window and spatial path.

The example data come from Mudunuri and Vogt (2025), Social behavior in Drosophila larva, University of Konstanz, distributed under CC BY 4.0. The associated publication is Mudunuri, Zadigue-Dubé and Vogt (2026).

My individual and group behavior project explores the behavioral questions and random-walk models using these data.