Abstract
Animal behaviour is often quantified through subjective, incomplete variables that mask essential dynamics. Here, we develop a maximally predictive behavioural-state space from multivariate measurements, in which the full instantaneous state is smoothly unfolded as a combination of short-time posture sequences. In the off-food behaviour of the roundworm Caenorhabditis elegans, we discover a low-dimensional state space dominated by three sets of cyclic trajectories corresponding to the worm’s basic stereotyped motifs: forward, backward and turning locomotion. We find similar results in the on-food behaviour of foraging worms and npr-1 mutants. In contrast to this broad stereotypy, we find variability in the presence of locally unstable dynamics with signatures of deterministic chaos: a collection of unstable periodic orbits together with a positive maximal Lyapunov exponent. The full Lyapunov spectrum is symmetric with positive, chaotic exponents driving variability balanced by negative, dissipative exponents driving stereotypy. The symmetry is indicative of damped–driven Hamiltonian dynamics underlying the worm’s movement control.
This is a preview of subscription content, access via your institution
Access options
Access Nature and 54 other Nature Portfolio journals
Get Nature+, our best-value online-access subscription
$29.99 / 30 days
cancel any time
Subscribe to this journal
Receive 12 print issues and online access
$209.00 per year
only $17.42 per issue
Buy this article
- Purchase on Springer Link
- Instant access to full article PDF
Prices may be subject to local taxes which are calculated during checkout
Similar content being viewed by others
Data availability
Posture-mode time series for all worms analysed here are publicly available: https://bitbucket.org/tosifahamed/behavioral-state-space. Original image data for the foraging and escape-response datasets were analysed previously37 and are available from the Dryad Digital Repository: https://doi.org/10.5061/dryad.t0m6p. Data for N2 worms on food and npr-1 mutants were collected from an open-access dataset84 and analysed to solve for coiled postures11. All other data that support the plots within this paper and other findings of this study are available from the corresponding author upon reasonable request.
Code availability
Code for all analysis reported here was written in MATLAB83 and is publicly available: https://bitbucket.org/tosifahamed/behavioral-state-space.
References
Berman, G. J. Measuring behavior across scales. BMC Biol. 16, 23 (2018).
Newell, K. & Corcos, D. Variability and Motor Control (Human Kinetics, 1993); https://books.google.co.jp/books?id=gUgQAQAAMAAJ
Maye, A., Hsieh, C.-h, Sugihara, G. & Brembs, B. Order in spontaneous behavior. PloS ONE 2, e443 (2007).
Moore, T. Y., Cooper, K. L., Biewener, A. A. & Vasudevan, R. Unpredictability of escape trajectory explains predator evasion ability and microhabitat preference of desert rodents. Nat. Commun. 8, 440 (2017).
Krakauer, J. W., Ghazanfar, A. A., Gomez-Marin, A., MacIver, M. A. & Poeppel, D. Neuroscience needs behavior: correcting a reductionist bias. Neuron 93, 480–490 (2017).
Cowan, N. J. et al. Feedback control as a framework for understanding tradeoffs in biology. Am. Zool. 54, 223–237 (2014).
Aguilar, J. et al. A review on locomotion robophysics: the study of movement at the intersection of robotics, soft matter and dynamical systems. Rep. Prog. Phys. 79, 110001 (2016).
Brown, A. E. X. & de Bivort, B. Ethology as a physical science. Nat. Phys. 14, 653–657 (2018).
Alexander, M. et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nat. Neurosci. 21, 1281–1289 (2018).
Talmo D, P. et al. Fast animal pose estimation using deep neural networks. Nat. Methods 16, 117–125 (2019).
Hebert, L., Ahamed, T., Costa, A. C., O’Shaughnessy, L. & Stephens, G. J. WormPose: image synthesis and convolutional networks for pose estimation in C. elegans. Preprint at https://www.biorxiv.org/content/early/2020/07/10/2020.07.09.193755 (2020).
Graving, J. M. et al. DeepPoseKit: a software toolkit for fast and robust animal pose estimation using deep learning. eLife 8, e47994 (2019).
Wiltschko, A. B. et al. Mapping sub-second structure in mouse behavior. Neuron 88, 1121–1135 (2015).
Berman, G. J., Choi, D. M., Bialek, W. & Shaevitz, J. W. Mapping the stereotyped behaviour of freely moving fruit flies. J. R. Soc. Interface 11, 20140672–12 (2014).
Stephens, G. J., Johnson-Kerner, B., Bialek, W. & Ryu, W. S. Dimensionality and dynamics in the behavior of C. elegans. PLoS Comput. Biol. 4, e1000028 (2008).
Szigeti, B., Deogade, A. & Webb, B. Searching for motifs in the behaviour of larval Drosophila melanogaster and Caenorhabditis elegans reveals continuity between behavioural states. J. R. Soc. Interface 12, 20150899 (2015).
Steven W, F. et al. Serotonin and the neuropeptide PDF initiate and extend opposing behavioral states in C. elegans. Cell 154, 1023–1035 (2013).
Strogatz, S. H. Nonlinear Dynamics and Chaos with Student Solutions Manual: with Applications to Physics, Biology, Chemistry, and Engineering (CRC Press, 2018).
Nolte, D. D. The tangled tale of phase space. Phys. Today 63, 33–38 (2010).
Durbin, J. & Koopman, S. J. Time Series Analysis by State Space Methods (Oxford Univ. Press, 2012).
Palis, J. & de Melo, W. Geometric Theory of Dynamical Systems (Springer, 1982).
Casdagli, M., Eubank, S., Farmer, J. D. & Gibson, J. State space reconstruction in the presence of noise. Physica D 51, 52–98 (1991).
Broomhead, D. S. & King, G. P. Extracting qualitative dynamics from experimental data. Physica D 20, 217–236 (1986).
Sugihara, G. & May, R. M. Nonlinear forecasting as a way of distinguishing chaos from measurement error in time series. Nature 344, 734 (1990).
Tajima, S., Yanagawa, T., Fujii, N. & Toyoizumi, T. Untangling brain-wide dynamics in consciousness by cross-embedding. PLoS Comput. Biol. 11, e1004537 (2015).
Kantz, H. & Schreiber, T. Nonlinear Time Series Analysis Vol. 7 (Cambridge Univ. Press, 2004).
Read, P. Phase portrait reconstruction using multivariate singular systems analysis. Physica D 69, 353–365 (1993).
Ye, H. & Sugihara, G. Information leverage in interconnected ecosystems: overcoming the curse of dimensionality. Science 353, 922–925 (2016).
Packard, N. H., Crutchfield, J. P., Farmer, J. D. & Shaw, R. S. Geometry from a time series. Phys. Rev. Lett. 45, 712 (1980).
Takens, F. Detecting strange attractors in turbulence. Dyn. Syst. Turbul. 898, 366–381 (1981).
Hyvärinen, A. Fast and robust fixed-point algorithms for independent component analysis. IEEE Trans. Neural Netw. 10, 626–634 (1999).
Gibson, J. F., Doyne Farmer, J., Casdagli, M. & Eubank, S. An analytic approach to practical state space reconstruction. Physica D 57, 1–30 (1992).
Lorenz, E. Predictability: a problem partly solved. In Seminar on Predictability, 4–8 September 1995 Vol. 1, 1–18 (ECMWF, 1995); https://www.ecmwf.int/node/10829
Aurell, E., Boffetta, G., Crisanti, A., Paladin, G. & Vulpiani, A. Predictability in the large: an extension of the concept of Lyapunov exponent. J. Phys. A 30, 1–26 (1997).
Judd, K. & Mees, A. Embedding as a modeling problem. Physica D 120, 273–286 (1998).
Stephens, G. J., Bueno de Mesquita, M., Ryu, W. S. & Bialek, W. Emergence of long timescales and stereotyped behaviors in Caenorhabditis elegans. Proc. Natl Acad. Sci. USA 108, 7286–7289 (2011).
Broekmans, O. D., Rodgers, J. B., Ryu, W. S. & Stephens, G. J. Resolving coiled shapes reveals new reorientation behaviors in C. elegans. eLife 5, e17227 (2016).
Croll, N. A. Behavioural analysis of nematode movement. Adv. Parasitol. 13, 71–122 (1975).
Costa, A. C., Ahamed, T. & Stephens, G. J. Adaptive, locally linear models of complex dynamics. Proc. Natl Acad. Sci. USA 116, 1501–1510 (2019).
Schwarz, R. F., Branicky, R., Grundy, L. J., Schafer, W. R. & Brown, A. E. X. Changes in postural syntax characterize sensory modulation and natural variation of C. elegans locomotion. PLoS Comput. Biol. 11, e1004322 (2015).
Gomez-Marin, A., Stephens, G. J. & Brown, A. E. X. Hierarchical compression of Caenorhabditis elegans locomotion reveals phenotypic differences in the organization of behaviour. J. R. Soc. Interface 13, 20160466 (2016).
Donnelly, J. L. et al. Monoaminergic orchestration of motor programs in a complex C. elegans behavior. PLoS Biol. 11, e1001529 (2013).
Gray, J. M., Hill, J. J. & Bargmann, C. I. A circuit for navigation in Caenorhabditis elegans. Proc. Natl Acad. Sci. USA 102, 3184–3191 (2005).
Ben Arous, J., Laffont, S. & Chatenay, D. Molecular and sensory basis of a food related two-state behavior in C. elegans. PLoS ONE 4, e7584 (2009).
Stern, S., Kirst, C. & Bargmann, C. I. Neuromodulatory control of long-term behavioral patterns and individuality across development. Cell 171, 1649–1662 (2017).
Banks, J., Brooks, J., Cairns, G., Davis, G. & Stacey, P. On Devaney’s definition of chaos. Am. Math. Mon. 99, 332–334 (1992).
So, P., Francis, J. T., Netoff, T. I., Gluckman, B. J. & Schiff, S. J. Periodic orbits: a new language for neuronal dynamics. Biophys. J. 74, 2776–2785 (1998).
Mishra, N., Hasse, M., Biswal, B. & Singh, H. P. Reliability of unstable periodic orbit based control strategies in biological systems. Chaos 25, 043104 (2015).
Pei, X. & Moss, F. Characterization of low-dimensional dynamics in the crayfish caudal photoreceptor. Nature 379, 618 (1996).
Schiff, S. J. et al. Controlling chaos in the brain. Nature 370, 615 (1994).
Lathrop, D. P. & Kostelich, E. J. Characterization of an experimental strange attractor by periodic orbits. Phys. Rev. A 40, 4028 (1989).
Barrio, R., Dena, A. & Tucker, W. A database of rigorous and high-precision periodic orbits of the Lorenz model. Comput. Phys. Commun. 194, 76–83 (2015).
Cvitanović, P. Invariant measurement of strange sets in terms of cycles. Phys. Rev. Lett. 61, 2729 (1988).
Pierce-Shimomura, J. T., Morse, T. M. & Lockery, S. R. The fundamental role of pirouettes in Caenorhabditis elegans chemotaxis. J. Neurosci. 19, 9557–9569 (1999).
Gjorgjieva, J., Biron, D. & Haspel, G. Neurobiology of Caenorhabditis elegans locomotion: where do we stand? Bioscience 64, 476–486 (2014).
Pikovsky, A. & Politi, A. Lyapunov Exponents: a Tool to Explore Complex Dynamics (Cambridge Univ. Press, 2016).
Young, L.-S. Dimension, entropy and Lyapunov exponents. Ergod. Theory Dyn. Syst. 2, 109–124 (1982).
Frederickson, P., Kaplan, J. L., Yorke, E. D. & Yorke, J. A. The Liapunov dimension of strange attractors. J. Differ. Equ. 49, 185–207 (1983).
Sprott, J. C. Elegant Chaos (World Scientific, 2010).
Dressler, U. Symmetry property of the Lyapunov spectra of a class of dissipative dynamical systems with viscous damping. Phys. Rev. A 38, 2103 (1988).
Dettmann, C. P. & Morriss, G. Proof of Lyapunov exponent pairing for systems at constant kinetic energy. Phys. Rev. E 53, R5545 (1996).
Loveless, J., Lagogiannis, K. & Webb, B. Modelling the mechanics of exploration in larval Drosophila. PLoS Comput. Biol. 15, e1006635 (2019).
Kato, S. et al. Global brain dynamics embed the motor command sequence of Caenorhabditis elegans. Cell 163, 656–669 (2015).
Chen, X., Randi, F., Leifer, A. M. & Bialek, W. Searching for collective behavior in a small brain. Phys. Rev. E 99, 052418 (2019).
Cook, S. J. et al. Whole-animal connectomes of both Caenorhabditis elegans sexes. Nature 571, 63–71 (2019).
Gao, S. et al. Excitatory motor neurons are local oscillators for backward locomotion. eLife 7, e29915 (2018).
Xu, T. et al. Descending pathway facilitates undulatory wave propagation in Caenorhabditis elegans through gap junctions. Proc. Natl Acad. Sci. USA 115, E4493–E4502 (2018).
Revzen, S. & Guckenheimer, J. M. Finding the dimension of slow dynamics in a rhythmic system. J. R. Soc. Interface 9, 957–971 (2011).
Jackson, E. A. The OPCL control method for entrainment, model-resonance, and migration actions on multiple-attractor systems. Chaos 7, 550–559 (1997).
Fang-Yen, C. et al. Biomechanical analysis of gait adaptation in the nematode Caenorhabditis elegans. Proc. Natl Acad. Sci. USA 107, 20323–20328 (2010).
Backholm, M., Kasper, A., Schulman, R., Ryu, W. & Dalnoki-Veress, K. The effects of viscosity on the undulatory swimming dynamics of C. elegans. Phys. Fluids 27, 091901 (2015).
Butler, V. J. et al. A consistent muscle activation strategy underlies crawling and swimming in Caenorhabditis elegans. J. R. Soc. Interface 12, 20140963 (2015).
Boyle, J. H., Berri, S. & Cohen, N. Gait modulation in C. elegans: an integrated neuromechanical model. Front. Comput. Neurosci. 6, 10 (2012).
Wen, Q. et al. Proprioceptive coupling within motor neurons drives C. elegans forward locomotion. Neuron 76, 750–761 (2012).
Daems, D. & Nicolis, G. Entropy production and phase space volume contraction. Phys. Rev. E 59, 4000 (1999).
Bollt, E. M. & Santitissadeekorn, N. Applied and Computational Measurable Dynamics Vol. 18 (SIAM, 2013).
Brennan, C. & Proekt, A. A quantitative model of conserved macroscopic dynamics predicts future motor commands. eLife 8, e46814 (2019).
Pérez-Hernández, G., Paul, F., Giorgino, T., De Fabritiis, G. & Noé, F. Identification of slow molecular order parameters for Markov model construction. J. Chem. Phys. 139, 015102 (2013).
Brunton, S. L. & Kutz, J. N. Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control (Cambridge Univ. Press, 2019).
Farmer, J. D. & Sidorowich, J. J. Predicting chaotic time series. Phys. Rev. Lett. 59, 845 (1987).
Xing, E. P., Jordan, M. I., Russell, S. J. & Ng, A. Y. Distance metric learning with application to clustering with side-information. In Advances in Neural Information Processing Systems 15 521–528 (MIT Press, 2003).
Pathak, J., Lu, Z., Hunt, B. R., Girvan, M. & Ott, E. Using machine learning to replicate chaotic attractors and calculate Lyapunov exponents from data. Chaos 27, 121102 (2017).
MATLAB v.9.3.0 (R2017b) (MathWorks, 2017).
Javer, A. et al. An open-source platform for analyzing and sharing worm-behavior data. Nat. Methods 15, 645–646 (2018).
Sulston, J. E. & Brenner, S. The DNA of C. elegans. Genetics 77, 95–104 (1974).
Brenner, S. The genetics of Caenorhabditis elegans. Genetics 77, 71–94 (1974).
Yemini, E., Kerr, R. A. & Schafer, W. R. Preparation of samples for single-worm tracking. Cold Spring Harb. Protoc. 2011, 1475–1479 (2011).
Casdagli, M., Sauer, T. & Yorke, J. A. Embedology. J. Stat. Phys. 65, 579–616 (1991).
Stark, J., Broomhead, D. S., Davies, M. & Huke, J. Delay embeddings for forced systems. II. Stochastic forcing. J. Nonlinear Sci. 13, 519–577 (2003).
Muldoon, M. R., Broomhead, D. S., Huke, J. P. & Hegger, R. Delay embedding in the presence of dynamical noise. Dyn. Stab. Syst. 13, 175–186 (1998).
Stark, J. Delay embeddings for forced systems. I. Deterministic forcing. J. Nonlinear Sci. 9, 255–332 (1999).
Huke, J. P. & Broomhead, D. S. Embedding theorems for non-uniformly sampled dynamical systems. Nonlinearity 20, 2205 (2007).
Deyle, E. R. & Sugihara, G. Generalized theorems for nonlinear state space reconstruction. PLoS ONE 6, e18295 (2011).
Lorenz, E. N. Deterministic nonperiodic flow. J. Atmos. Sci. 20, 130–148 (1963).
Vautard, R. & Ghil, M. Singular spectrum analysis in nonlinear dynamics, with applications to paleoclimatic time series. Physica D 35, 395–424 (1989).
Farmer, J. D. Information dimension and the probabilistic structure of chaos. Z. Naturforsch. A 37, 1304–1326 (1982).
Kennel, M. B., Brown, R. & Abarbanel, H. D. I. Determining embedding dimension for phase-space reconstruction using a geometrical construction. Phys. Rev. A 45, 3403–3411 (1992).
Hammel, S. M., Yorke, J. A. & Grebogi, C. Do numerical orbits of chaotic dynamical processes represent true orbits? J. Complex. 3, 136–145 (1987).
Nusse, H. E. & Yorke, J. A. Is every approximate trajectory of some process near an exact trajectory of a nearby process? Commun. Math. Phys. 114, 363–379 (1988).
Pawelzik, K. & Schuster, H. Unstable periodic orbits and prediction. Phys. Rev. A 43, 1808 (1991).
Badii, R. et al. Progress in the analysis of experimental chaos through periodic orbits. Rev. Mod. Phys. 66, 1389 (1994).
Kantz, H. A robust method to estimate the maximal Lyapunov exponent of a time series. Phys. Lett. A 185, 77–87 (1994).
Deyle, E. R., May, R. M., Munch, S. B. & Sugihara, G. Tracking and forecasting ecosystem interactions in real time. Proc. R. Soc. B 283, 20152258 (2016).
Abarbanel, H. D. I., Brown, R. & Kennel, M. B. Variation of Lyapunov exponents on a strange attractor. J. Nonlinear Sci. 1, 175–199 (1991).
Abarbanel, H. D. I., Brown, R. & Kennel, M. B. Local Lyapunov exponents computed from observed data. J. Nonlinear Sci. 2, 343–365 (1992).
Guckenheimer, J. & Holmes, P. Nonlinear Oscillations, Dynamical Systems, and Bifurcations of Vector Fields (Springer, 1983).
Acknowledgements
We thank D. Jordan, I. Etheredge and A. Celani for comments. L. Hebert (OIST Graduate University) developed the custom machine-learning solution for pose estimation of worms in on-food conditions. We would also like to express our gratitude to I. Maruyama for his support during the project. This work was supported by OIST Graduate University (T.A., G.J.S.), a programme grant from the Netherlands Organization for Scientific Research (A.C.C., G.J.S.), Vrije Universiteit Amsterdam (G.J.S.) and the Japan Society for the Promotion of Science (T.A.).
Author information
Authors and Affiliations
Contributions
T.A., A.C.C. and G.J.S. designed the research, performed the research, analysed the data and wrote the paper.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Extended data
Extended Data Fig. 1 The predictability Tpred as a function of K and m for N = 12 individual worms.
a, Tpred as a functon of K. b, Tpred as a function of m. We find similar curves across worms, despite the differences in their detailed dynamics. Note that while the distance metric in the SVD space (b) and the space of delays (a) is different, which could result in inconsistencies in the estimation of Tpred, we find only minor differences between the maximum Tpred in the two cases (gray bar in B). Inset shows the normalized singular value spectrum, which does not have a clear cutoff for any worm. c, Expanded inset in B showing the normalized singular value spectrum. d, State space captures a commonly observed sequence where long reversals transition to forward via a deep body bends seen here as a large excitation in Xt2 as the reversal ends. Here we see that the blue (backward) and red (forward) bundles are smoothly connected via a large transient along the turning mode \({X}_{{t}_{2}}\) (data from the example worm in Fig. 3b–e).
Extended Data Fig. 2 Dominant state space modes are stable across different embedding dimensions, with distinct groups independently capturing forward, reversal and turning behaviors.
a–c, Behavioral modes estimated for the worm in Fig. 3 for dimensions, m = 6 (a), m = 7 (b), and m = 8 (c); embedding window is set to K = 12 frames. The modes retain their interpretability across dimensions. In a 6-dimensional embedding, there are two forward, two backward and two turning modes. In 7 dimensions one of the turning modes further splits into an omega-turn like mode (\({\Gamma }_{{t}_{3}}\)) and a delta-turn like mode (\({\Gamma }_{{t}_{1}}\)), while \({\Gamma }_{{t}_{2}}\) changes little. Furthermore, the reversal modes are more separable in 7 dimensions. The 8-dimensional state space retains the forward, reversal and turning dynamics along with an additional and subtle head-bending.
Extended Data Fig. 3 The ensemble embedding across all N = 12 worms is constructed from their concatenated posture time series and characterized by \(K^*=10\) and \(m^*=7\).
a–b, Tpred as a function of K and m. We set \(K^*=10\), approximately when Tpred begins to decrease, and show Tpred(m) at this \(K^*\). We show the resulting modes for m = 6 and the gray bar denotes \(T_{pred}(K = K^*)\). c, m = 7 (d), and m = 8 (e), and these are qualitatively similar to those obtained from our representative worm of Extended Data Fig. 2. The additional modes present for embeddings greater than \(m^*=7\) offer only minor improvements in predictability.
Extended Data Fig. 4 Ensemble embedding for different values of K and m.
a–c, Behavioral modes estimated from the ensemble for K = 5, and dimensions, m = 6 (a), m = 7 (b), and m = 8 (c). d–f, Same as above but for K = 15. The modes are qualitatively similar across this variation.
Extended Data Fig. 5 The dominant off-food modes are similar to those of on-food roaming behavior and on-food behavior of npr-1 mutant worms.
We analyze a collection of N = 25 on-food ‘roaming’ N2 worms, N = 25 on-food ‘dwelling’ N2 worms, and N = 7 on-food mutant npr-1 worms from an open access dataset84 (Methods, see also Extended Data Fig. 10a). We show Tpred(m) for (a) on-food N2 roaming worms and (b) on-food npr-1 mutants. c–d, Kymographs of the \(m^*=7\) primary modes from roaming and npr-1 worms coincide, both with each other and with the off-food N2 modes in Fig. 3. The similarity of these embeddings provide new, posture-scale evidence that the NPR-1 mutation overrides the switch to dwelling45. e–f, The combined embedding of roaming-dwelling on-food behavior exhibits an additional ~ 6 modes with small but notable additional Tpred, which was also observed in off-food behavior in the ensemble embedding, Extended Data Fig. 3, and for some individual worms, Extended Data Fig. 1b.
Extended Data Fig. 6 Maximum Lyapunov exponent for different worms and the full Lyapunov spectrum in different embedding dimensions.
a, To quantify the state space divergence we plot the logarithm of the average distance between a trajectory and its nearest neighbors, averaged over several starting reference trajectories. For each worm we find that, after a transient, there is linear region showing exponential divergence. The slope of the linear region provides an estimate of the maximal Lyapunov exponent λmax and the positive exponents are an indication of chaos in worm behavior. b–d, Lyapunov spectra computed from reconstructions of worm behavior in different embedding dimensions. Conjugate pairing of Lyapunov exponents is robustly observed in dimensions 6 and above.
Extended Data Fig. 7 Detecting periodic orbits in the Lorenz System.
a–e, We compare UPO trajectories for the Lorenz system computed from high precision numerical estimates52 (red) with periodic orbits detected using our recurrence based approach (grey) (only 3 UPOs are shown for period 5). The closely-matching trajectories also exhibit agreement between the Floquet exponents estimated from analytical Jacobians (red text) and Local Lyapunov exponents obtained from the estimated Jacobians (grey text). Note that in (e), a fixed point (period-0 orbit) can only be detected by neighboring spiraling trajectories, leading to an overestimation of the exponent. f, Boxplot comparing the entire distribution of Floquet exponents for UPOs up to period 10 (red bars denote the median).
Extended Data Fig. 8 Recurrence Function and Period-1 UPOs.
a, The recurrence function ϵ(r, t) from the same worm in Fig. 3 for 120 frames and 5000 closest recurrences (top). Local minima of this function at times t*, as seen in the average 〈ϵ(r, t)〉r shown below correspond to close recurrences and identify periodic orbits of length t*. The first local minimum is the smallest period pmin, which is 37 frames in this example. For a given value of r, ϵ(r, t*) gives the distance threshold at which we must look to find a periodic orbit of length t*. b, Probability distribution of phase velocities \(\dot{\phi }\) and third eigenworm coefficient a3, which is proportional to mean body curvature, across all period-1 orbits of duration pmin from all worms in the dataset. We see two clusters corresponding to forward and backward locomotion, as well as orbits with a dorsal or ventral bias (for example orbits at bottom right and top left). c, Example period-1 orbits from the same worm in (a) corresponding to forward (top) and backward (bottom) locomotion.
Extended Data Fig. 9 Example E(τ) curves.
a, Error curves are plotted for different embedding dimensions for the Lorenz system state space reconstruction \((K^* = 25)\). b, Error curves in different embedding dimensions for the sample worm in Fig. 3b–e. Better embeddings lead to a lower error curve. The ratio of the area between these curves and the saturation value es to es estimates Tpred. c, A schematic showing the fixed point algorithm for robust estimation of the asymptote es, and the area Δ.
Extended Data Fig. 10 Roaming/dwelling states and further embedding details.
a, Centroid speed and angular speed (averaged in 10 s windows) for the collection of worms used in the N2 on food dataset (red and blue) and the npr-1 dataset (black).We initially collected 150 recordings of N2 worms crawling on food-full plates from an open dataset84. From these, we selected 25 worms with a large fraction of dwelling states (blue) and 25 worms with a large fraction of roaming states (red), defined as in17. We downsample the data to 3 Hz (consistent with17), and average the centroid speed and angular speed in 10 s windows. Roaming and dwelling states are identified by a threshold defined by the line y = x/450 in the plane defined by x, the angular speed, and y, the centroid speed. Points above the line (high speed and low angular speed) are classified as roaming, while points below the line (low speed and high angular speed) are classified as dwelling. Data from npr-1 mutants (black) show predominantly roaming behavior, consistent with previous reports45. b, Example of the one step error, E(1, Nb) curve used to pick the number of nearest neighbors. This was calculated on the same worm as in Fig. 3b–e. c, A transient can be seen For the Lorenz system before the linear regime indicating exponential growth of local finite-sized perturbations (sized ≈ 10−4) begins. d, Transient decreases when perturbations of size ≈ 10−8 are used.
Supplementary information
Rights and permissions
About this article
Cite this article
Ahamed, T., Costa, A.C. & Stephens, G.J. Capturing the continuous complexity of behaviour in Caenorhabditis elegans. Nat. Phys. 17, 275–283 (2021). https://doi.org/10.1038/s41567-020-01036-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1038/s41567-020-01036-8
This article is cited by
-
Generative learning for nonlinear dynamics
Nature Reviews Physics (2024)
-
Caenorhabditis elegans foraging patterns follow a simple rule of thumb
Communications Biology (2023)
-
Fast detection of slender bodies in high density microscopy data
Communications Biology (2023)
-
Megapixel camera arrays enable high-resolution animal tracking in multiwell plates
Communications Biology (2022)
-
Recurrence eigenvalues of movements from brain signals
Brain Informatics (2021)