Skip to main content
SearchLoginLogin or Signup

An experimental and computational workflow to characterize nematode motility behavior

We used straightforward microscopy and computational analyses to reproducibly characterize a nematode motility phenotype with interpretable features. This method should be scalable for high-throughput phenotypic screening.
Published onJan 08, 2025
An experimental and computational workflow to characterize nematode motility behavior
·

Purpose

Behavioral phenotypes can be informative discovery tools, but the generally high variability of such readouts limits their utility. As part of our microscopy toolkit, we developed and optimized a protocol to measure a motility-based behavioral phenotype in Caenorhabditis elegans. Our phenotyping results were reproducible between replicates and showed consistent differences between strains, which could enable their use in high-throughput genetic or drug screens.

We’re sharing our detailed protocol to help researchers employ nematode motility behavior as a phenotypic readout.

Share your thoughts!

Watch a video tutorial on making a PubPub account and commenting. Feel free to add line-by-line comments anywhere within this text, provide overall feedback by commenting in the box at the bottom of the page, or post about this work on social media. Please make all feedback public so other readers can benefit from the discussion. 

Background and goals

Because of the importance of disease models in biomedical research and drug development, we’re interested in leveraging evolutionary insights to identify better organismal models of human disease. Toward this goal, we developed an organismal selection framework [1] that found that PDE6D, along with several other human genes that cause monogenic retinitis pigmentosa, exhibited exceptional molecular conservation between C. elegans and humans. Mutations in PDE6D result in neurodegeneration of photoreceptor cells and progressive blindness [2]. Given this insight, we were interested in whether C. elegans with mutations in pdl-1, the conserved PDE6D homolog, could function as a low-complexity, high-throughput model of neurodegeneration in retinitis pigmentosa.

Phenotypic screening lets us discover novel regulators of traits even when our prior knowledge of the underlying biology is limited. We're developing microscopy tools to enable nondestructive phenotypic characterization of a broad range of species. One of the species-agnostic parameters we're exploring for this toolkit is motility. Motility integrates critical features of living systems, including bioenergetics, biomechanics, and response to stimuli. We’ve previously developed and published a method to characterize motility in a single-celled organism, Chlamydomonas reinhardtii [3], and are expanding this tool to Caenorhabditis elegans (C. elegans), a metazoan.

As a model/assay pair, C. elegans motility has many advantages. C. elegans is multicellular, so it captures biological traits that emerge from the coordinated behavior of several cell types in tissues or organs. However, it's still small enough for high-throughput experiments [4]. Motility data from this species can be acquired and analyzed non-destructively using light microscopy at low magnification, a broadly available tool [5]. Additionally, many computational methods are available to analyze C. elegans motility that could serve as a basis for an analytical workflow [6][7]. We sought a workflow to leverage these advantages while controlling for the high natural variability inherent to behavioral analyses. 

The problem

We wanted an end-to-end experimental and computational approach for tracking worm motility. While many researchers have developed approaches for C. elegans motility tracking, we wanted an approach that:

  1. Would allow us to track varied motility phenotypes from many different C. elegans strains without a priori knowledge of what phenotype we should expect to see.

  2. Would produce interpretable motility features. We favored approaches in which a feature intuitively describes a phenotype (i.e., worm speed).

  3. Would allow us to use our existing microscope. Some motility tracking tools require a specific imaging setup, but we didn't want to acquire new hardware and wanted to rely on basic laboratory consumables for worm handling. This has the additional benefit of making the method accessible to a broader set of researchers. 

  4. Didn't require specific dyes/stains/fluoresence to track the worms. We didn’t want to introduce additional variables into the screen [8][9].

  5. Could be adapted to high-throughput screens. While we started with a low-throughput approach, we wanted to be able to track the motility of multiple worms.

  6. Would use software that’s explicitly been built for C. elegans motility tracking (as opposed to general motility tracking [10]) and has been used in many motility tracking experiments. This would make any results we produced potentially comparable to studies that used the same analytical method and provide confidence that the software had fewer bugs or inaccuracies. We also looked for open-source tools that were easily installable, ran after installation without changes to the source code, and had a commercially compatible license.

Our solution

We set out to develop a combined experimental and computational workflow to characterize diverse strains of C. elegans with unknown motility phenotypes. We began by selecting the motility-tracking software we wanted to use to analyze our imaging data. While many tools exist for worm tracking [6][7][8][9][11][12][13][14][15][16][17][18], we found that only Tierpsy Tracker met all of the conditions we were interested in [6][7]

Using our existing hardware, we tailored our data acquisition approach to the Tierpsy tracker tool. We introduced a life stage synchronization step to make the worms more uniform and easier for Tierpsy Tracker to detect, and we designed a buffer transfer approach to minimize background artifacts that made worm detection difficult. For imaging, we developed a low-throughput assay performed on 6 cm plates using an upright microscope. We imaged multiple fields of view from each plate and took 30-second videos of each field, each containing multiple worms. These optimizations significantly improved our ability to track worm movement with the Tierpsy Tracker tool.

We then built an automated computational workflow to track motility phenotypes of individual worms from this imaging data. This workflow performs preprocessing and quality control before running the Tierpsy Tracker tool.

As a positive control for assay development, we selected a worm strain with a characterized motility phenotype to reproduce with our pipeline. We selected a mutant with a large-scale deletion in the nematode gene pdl-1 (allele gk157). We then sought to reproduce this known phenotype — increased speed and reduced dwelling [11] — in our analysis.

Why is this useful?

This approach can be used to characterize the motility of different C. elegans strains. Our experimental protocols don’t require specialized tools (except for a widefield upright microscope), and we have optimized them to generate reproducible results using our automated analysis pipeline. This pipeline is an end-to-end automated Snakemake pipeline that ingests movie files, processes them, and detects interpretable features. This pipeline can be run on a Linux computer through the command line, and we also provide an analysis approach that can be used to detect features that are significantly different between imaging conditions (such as comparing mutant worms to WT). In principle, other groups can adapt this method to study the behavioral effects of other factors, such as drugs or environmental stimuli. With further development, it could also form the basis of a high-throughput phenotypic screening approach in C. elegans, enabling the discovery of novel biological mechanisms and/or therapeutic candidates.

The method

This method enables a researcher to generate and analyze C. elegans imaging data and to process these data into a motility phenotype composed of 150 features: distinct, quantifiable parameters that capture different facets of worm motion. We have also included our protocols for culturing and genotyping worm strains, should they be useful. Figure 1 presents a visual summary of the workflow. We optimized these steps using the pdl-1(gk157) deletion mutant described above. You can find protocols associated with the experimental workflow in Figure 1, A on protocols.io. They describe this process under baseline culture conditions using 6 cm Petri dishes, but you can adapt these parameters as necessary.

Visual overview of the experimental and computational workflow, described fully in main text.
Figure 1

Experimental and computational workflow overview.

(A) Diagram of experimental setup. We expanded worms under standard culture conditions (1). We then performed a life-stage synchronization using alkaline bleach treatment to synchronize worms to the L1 larval stage (2). After growing these to adulthood (3), we use M9 buffer to transfer the worms to a fresh plate with growth medium without OP50 bacteria to facilitate clearer imaging (4). Finally, we image the synchronized adults using our upright microscope (5).

(B) Image Processing. To process images into motility measurements, we begin by converting images from Nikon format (ND2) to TIFF (1). We then apply a difference of Gaussians filter to improve worm segmentation (2). We convert these images to MOV format (3) and use Tierpsy Tracker to estimate per-worm and per-frame motility measurements for 150 initial features (4). We also produce two quality-control images. The first shows a projection of all video frames, allowing the viewer to see the full path of each worm in one image. The second compares the first frame of the Tierpsy Tracker mask to the first frame of the MOV so the viewer can see which worms Tierpsy Tracker successfully detects. Steps with dashed lines create temporary files.

Analysis. To engineer motility features and compare strains, we read in the initial Tierpsy Tracker motility measurements (1) and filter to worms detected for at least 10 consecutive seconds (2). We then take an average of the 133 relevant features to create our motility features (3). Last, we test for differences between strains using a generalized linear model (4).

Step 1: Culture worms and set up experiment

The major challenge in animal behavior assays is the inherent variability of behavioral parameters, so we sought to limit variability in the experimental set-up (Figure 1, A). The most significant way we did this was by incorporating a life-stage synchronization step at the beginning of the experiment, minimizing the confounding effects of age-related differences in body size, morphology, and motility behavior.

We began by expanding two C. elegans strains that we’d been actively culturing, N2 (wild type) and pdl-1(gk157), so that we had many gravid young adults for synchronization. Life-stage synchronization in C. elegans involves bleaching gravid adults so that they die and release their fertilized eggs, which are resistant to bleach. Younger adults are a better starting point since they have more unlaid eggs. Additionally, we avoided excessive bleach treatment to ensure that eggs didn’t become non-viable during the sync.

Once the fertilized eggs we recovered had hatched into L1 larvae, we plated these worms onto Petri dishes with OP50 and allowed them to grow for 3.5 days until reaching young adulthood. At this point, we transferred the worms to Petri dishes without OP50 for imaging.

We found that the most significant determinant of a successful analysis was maximizing uniformity of the plate background during imaging, which allows for straightforward computational segmentation of worms from background. To achieve this, we lifted worms from their culture plate with a small amount of M9 buffer. We collected the suspended worms into a tube, then stood the tube up in a rack and allowed the worms to drop to the bottom of the tube under natural gravity (rather than via centrifugation), which took about 20 minutes. Next, we removed some of the supernatant to avoid adding a high volume of liquid to the fresh plates.

Background non-uniformity arose primarily from “tracks” left by the worms in their bacterial lawn as they fed. To compensate for this, we replated worms on plates without OP50 bacteria just before imaging.

We found that manually transferring worms using platinum wire introduced additional background artifacts onto the new plate. Lifting worms from their culture plate with M9 buffer and pipetting them to transfer resulted in the most uniform background signal.

Once we’d transferred the worms to the fresh plates, we allowed them to habituate for 1 hour. This was enough time for the buffer to evaporate and for the worms to begin moving around in their new environment. In some cases, worms tended to cluster around each other, particularly if there was a bubble in the evaporating buffer. We resolved this issue by firmly tapping the plate against the lab bench, which stimulated their dispersal.

TRY IT: Our protocols for genotyping, worm culture and maintenance, bleach life-stage synchronization, and prepping worms for image acquisition are available on protocols.io.

Step 2: Acquire imaging data

Once we replated and habituated the worms, we imaged them using our upright widefield microscope. For each plate, we collected up to 25 fields of view (FOVs) when sufficient worms were present. For each FOV, we collected 30 seconds of video data at 24.5 frames per second (fps) using a Kinetix sCMOS camera. We used a Plan Apo D 4× objective with a numerical aperture of 0.20. Each frame in the resulting video file was 1,976 × 1,976 pixels at a resolution of 1.625 µm per pixel.

Step 3: Processing imaging data

SHOW ME THE DATA: Raw and processed imaging data are available in the BioImage Archive (DOI: 10.6019/S-BIAD1563).

Our video analysis workflow (Figure 1, B) produces motility phenotype estimates for 150 features. We start by converting the videos from Nikon format to TIFF format. We then apply a “difference of Gaussians filter” from scikit-image (v0.24.0, skimage.filters.difference_of_gaussians()) [19] to improve worm segmentation. This filter helps Tierpsy Tracker detect the worms. After filtering, we convert the video to MOV file format and run Tierpsy Tracker (v1.5.3a_18aaba9) to produce an initial set of 150 motility features. Each feature is measured for each worm in each frame in which the worm is detected (“results/*_featuresN.hdf5”). We use this file in downstream analysis to measure motility differences.

View the configuration file we used to run Tierpsy Tracker on GitHub (DOI: 10.5281/zenodo.14611279).

In addition to running Tierpsy Tracker, we also produce two quality-control aids. First, we make a projection from the initial TIFF file to see the full path of each worm in each video in a single image (PNG) file. The projection lets us visually count the number of worms in a field of view and develop an intuition for how the worms are moving. Second, we compare the mask generated by Tierpsy Tracker to the input MOV (by default, the first frame only) to see which worms Tierpsy Tracker is able to detect.

The analysis produced by Tierpsy Tracker and the two quality-control images are the endpoints for the automated pipeline. We performed subsequent analysis in Jupyter notebooks.

Step 4: Engineering features and comparing motility phenotypes

In the steps above, we used Tierpsy Tracker to produce raw motility measurements from videos of C. elegans. Next, we used this output to generate features that represent the movement patterns of the worms.

Tierpsy Tracker produces multiple feature read-outs that capture motility information about worms, all captured in the “results/*_featuresN.hdf5” file. This is a nested file that contains multiple named data tables. The Tierpsy Tracker paper presents analyses based on the information in the “features_stats” table [7]. This table includes features derived from all worms in a given field of view. It contains estimates for 4,539 features, including those in summary sets like TIERPSY_8 and TIERPSY_16. We chose not to use these features because they're summaries of worms in a field of view, and our fields of view are subsections of a plate, which aren't biologically meaningful subunits. Had we used these features, our statistical analysis would also have been based on field-of-view summaries instead of individual worms. Instead, we used the per-worm and per-frame information in the “timeseries_data” table. This data table contains motility measurements for 150 features (not counting “worm_index,” “timestamp,” or “well_name”). These features include overall motility measurements like “speed” and “angular_velocity,” as well as body-resolved measurements such as “relative_to_body_radial_velocity_head_tip.” They also contain time derivatives of each measured feature (“d_*”), which indicate the amount that the feature changes from the previous frame (e.g., “d_speed”). Because these features are resolved to a single worm, we chose to engineer features from these estimates. We termed this set of features “Tierpsy single-worm features.”

To create features to compare worms of different strains, we first took the absolute value of columns with directionality (where negative values indicate reverse or leftward motion, for example). We then took the mean of all measured values for each worm in each field of view. We required that Tierpsy Tracker capture a worm for at least 245 frames (10 seconds) for the worm to be included in our analysis. We use these features to compare worms of different strains and to assess the repeatability of our measurements.

View the notebook we used to engineer motility features and compare across data acquisition dates and worm strains on GitHub.

Workflow in action: Altered motility features in pdl-1 mutant worms recapitulate previously reported phenotypes

Once we optimized the workflow, we used it to analyze the motility phenotype of pdl-1(gk157). We chose to test our workflow on this strain because it has a dramatic and well-characterized motility phenotype that we sought to recapitulate with our approach.

We collected videos of wild-type (N2) and mutant (pdl-1) worms on two different days. Each day, we imaged 50 fields of view (25 FOVs per plate on two plates) per strain. After filtering to worms that we captured for at least 10 consecutive seconds (245 frames), we observed 388 worms on day one (mean 557 frames per worm) and 210 worms on day two (mean 501 frames per worm).

To analyze the data, we first removed parameters that contained only missing values or weren’t relevant for comparison (for example, orientation relative to the food edge and coordinate data). This focused our analysis on motility parameters that provide insight into the behavioral differences between strains.

Despite the inherent noisiness of animal behavior data, we identified 71 features that exhibited a statistically significant difference (linear mixed effect model, p < 0.05) between the strains. We represent a subset of these data describing whole-worm features visually in Figure 2, grouping the features according to the type of characteristic defined by the feature (motility category).

Scatter plot of motility phenotypes arranged by p-value, where some phenotypes, such as mean speed, show a significant difference between wild type and mutant.
Figure 2

Summary plot depicting a comparison of whole-body motility phenotypes for wild-type (N2) and pdl-1(gk157) C. elegans.

We calculated estimates and p-values using a linear mixed effect model where strain is a fixed effect and date of image acquisition is a random effect. A vertical dashed line represents the p-value significance cut off at p < 0.05. “Motility category” refers to groups we created that reflect the category of measurement for a motility feature. For simplicity, this figure shows motility features that were calculated from the whole worm, as opposed to specific body parts such as the neck. Motility features that are significantly different between strains are labeled. Each point on the main plot represents a statistical comparison using a linear mixed-effect model. For mean speed, we show a boxplot overlaid with individual data points for the “mean speed” for individual worms; these are the underlying data that are used to calculate the linear mixed effect model.

Comparing our data to previous reports

Once we characterized pdl-1(gk157) with our workflow, we compared our experimental results to the reported phenotype of this strain. 

The study that previously characterized pdl-1(gk157) used a broadly similar experimental setup to us, with a few critical differences. These authors captured imaging data over 15 minutes, and their worms were on plates with food during imaging. This extended imaging time was important for their purposes, since they analyzed a large set of mutant worms across different genes, and extended imaging times were required to eliminate bias from a subset of “extreme coiler” mutants [11]. Because pdl-1(gk157) wasn’t such a mutant, this particular requirement didn’t apply to our experiment. By limiting our imaging to 30 seconds, we generate less overall data, which is advantageous given the large size of raw image data files. 

The previous study’s authors also used WormTracker2 rather than Tierpsy Tracker to analyze features [11]. WormTracker2 has a license that's not permissive to commercial organizations, so we couldn't use this approach to analyze our data.

Since we defined features based on the original Tierpsy feature set and the biologically meaningful subunits in our specific experimental design, not all of our features map directly onto the WormTracker2 features used in the previous study. Nevertheless, we identified six phenotypes that did map directly onto features in our dataset (enumerated in Table 1).

Yemini et al. feature

Yemini et al. measured phenotype

Tierpsy single-worm feature

Tierpsy single-worm phenotype

Tierpsy single-worm feature description

Dwelling reduced

N2 mean: 11.004

pdl-1 mean: 8.535

Mean shift: -2.469

q-val: 0.0443

motion_mode_mean (increased)

N2 mean: 0.106

pdl-1 mean: 0.237

Estimate: 0.13

p-adj: 3.57E−04

–1 for backward motion, 0 for no motion, 1 for forward motion, averaged across all frames

Forward locomotion increased

N2 mean: 0.353

pdl-1 mean: 0.511

Mean shift: 0.158

q-val: 0.0268

speed_mean (increased)

N2 mean: 8.462

pdl-1 mean: 14.273

Estimate: 5.800

p-adj: 2.84E−17

Worm speed

Body bend frequency variant

N2 mean: 11.098

pdl-1 mean: 11.015

Mean shift: -0.0837

q-val: 0.0135

curvature_midbody_mean

N2 mean: 0.027

pdl-1 mean: 0.023

Estimate: -0.00405

p-adj: 5.39E−06

Mean curvature of the midbody

Head bend angle variant

N2 mean: 0.337

pdl-1 mean: -0.664

Mean shift: -1.001

q-val: 5.40E−04

curvature_std_neck_mean

N2 mean: 0.014

pdl-1 mean: 0.011

Estimate: -0.00308

p-adj: 1.15E−12

Standard deviation of curvature across the neck, calculated in each frame and then averaged across all frames

Nose movement variant

N2 mean: 127.864

pdl-1 mean: 162.975

Mean shift: 35.112

q-val: 0.0142

relative_to_neck_angular_
velocity_head_tip_mean

N2 mean: 0.489

pdl-1 mean: 0.653

Estimate: 0.161

p-adj: 1.20E−16

Mean angular velocity of the head tip relative to the neck

Tail bend angle variant

N2 mean: 17.077

pdl-1 mean: 16.168

Mean shift: -0.909

q-val: 3.05E−03

relative_to_hips_angular_
velocity_tail_tip_mean

N2 mean: 0.283

pdl-1 mean: 0.396

Estimate: 0.113

p-adj: 6.22E−09

Mean angular velocity of the tail tip relative to the hips

Table 1. Some previously reported effects of pdl-1 deletion on C. elegans motility and our summarized Tierpsy single-worm features that map to these phenotypes.
“Yemini et al. feature” qualitatively describes the phenotype observed by the previous study characterizing pdl-1(gk157). “Yemini et al. phenotype” shows the quantitative result the authors measured for that specific feature. “Tierpsy single-worm feature” identifies the feature in our dataset that we believe best corresponds to the phenotype described by Yemini and coauthors. “Tierpsy single-worm phenotype” shows the quantitative result we measured for the corresponding Tierpsy single-worm feature. “Tierpsy single-worm feature description” describes, in plain English, the meaning of the corresponding Tierpsy single-worm feature.
p-adj = Bonferroni-adjusted p-value. q-val = q-value. Q-values control the false discovery rate for a set of statistical tests by providing the minimum proportion of false positives among rejected hypotheses, offering a direct threshold for significance. In contrast, Bonferroni correction adjusts p-values by dividing the desired alpha level by the number of tests, controlling the family-wise error rate and reducing the likelihood of any false positives, often in a more conservative manner. While they’re different, both have a significance threshold of 0.05. “Mean shift” represents the magnitude of difference between groups based on the Wilcoxon rank-sum test. In contrast, the “estimate” refers to the change in mean phenotype between the wild type (N2) and mutant (pdl-1) strains, as determined by mixed-effects linear models controlling for acquisition date.

Among these six features, our data for pdl-1(gk157) qualitatively recapitulated previous observations. For example, we observed that speed_mean was significantly increased (p = 2.84E−17) in pdl-1 mutant worms, as did the Yemini et al. study. We present our data comparing these six features between N2 and pdl-1 mutant worms in Figure 3.

Taken together, these data demonstrate that our workflow captured an overall motility phenotype in pdl-1 mutant C. elegans

View the TSV of statistical results for all Tierpsy single-worm features on GitHub.

Box plots of motility measurements for the six features represented in Table 1, where all show a significant difference between wild type and mutant.
Figure 3

Effect of pdl-1 deletion on key motility features that directly map to previously reported phenotypes in this strain.

For the Tierpsy single-worm features in Table 1, we calculated estimates and p-values comparing wild type (N2) and mutant (pdl-1) worms using a linear mixed effect model where strain is a fixed effect and date of image acquisition is a random effect. Each box plot shows individual data points for a given feature for individual worms; these are the underlying data that are used to calculate the linear mixed effect model. The thicker lines inside the boxes represent the mean value for the feature determined for each strain. * indicates p ≤ 0.05, *** indicates p ≤ 0.001, **** indicates p ≤ 0.0001.

Additional methods

We used Arcadia themeR for data visualization [20].

We used ChatGPT to assist with background research on pdl-1 biology, write code, add comments to code, and suggest wording ideas that we then selectively incorporated. We also used ChatGPT to help reformat code by providing it with template scripts and having it adapt them for new goals, such as converting files between different formats. GitHub Copilot was also used to help write code. Additionally, we used Grammarly Business to suggest wording ideas, reformat text according to a style guide, and streamline and edit text that we wrote.

Next steps

We’ve added this workflow to our microscopy toolkit at Arcadia. We’ve also paused additional development on this method. However, there are several clear next steps to consider for anyone who’d like to develop and apply this technology further. 

To date, we’ve used this workflow to compare two strains of C. elegans side-by-side. We originally planned to increase the throughput of this assay by adapting it to a multiwell plate format, which we believe is possible with additional optimization. The buffer transfer method we developed to plate the worms on media without OP50 will simplify efforts to increase throughput.

There are also opportunities to incorporate automation into the experimental side of the workflow to maximize throughput and reproducibility. We briefly explored the possibility of automating both experimental setup and image acquisition but elected not to invest heavily in experimental automation for now.

We think this technology's most exciting application is in high-throughput phenotypic genetic or drug screening. Though we didn't progress this effort into bona fide disease modeling for retinitis pigmentosa caused by PDE6D mutation, others may be interested in pursuing this more clinical angle.


Share your thoughts!

Watch a video tutorial on making a PubPub account and commenting. Feel free to add line-by-line comments anywhere within this text, provide overall feedback by commenting in the box at the bottom of the page, or post about this work on social media. Please make all feedback public so other readers can benefit from the discussion. 


Contributors
(A–Z)
Supervision
Visualization
Conceptualization, Supervision
Methodology, Software, Validation
Conceptualization, Formal Analysis, Investigation, Methodology, Visualization, Writing
Critical Feedback, Resources
Critical Feedback, Resources
Conceptualization, Critical Feedback, Methodology, Resources
Formal Analysis, Software
Resources
Comments
0
comment
No comments here
Why not start the discussion?