MetaWorm: An Integrative Data-Driven Model Simulating <i>C. elegans</i> Brain, Body and Environment Interactions — part 3/6

Cleaned-text code points [30273, 45292). Bibliography omitted here; source.md includes it.

Fig 4. Connecting multi-compartmental neuron models in the neural network model.
A. Synapse and gap junction adjacency matrices of the neurons from published data10,11. Matrix
elements represent the total number of electron microscopy series capturing synapses (or gap
junctions) between two neurons. The color indicates the series number. The order of cells in rows
and columns corresponds to Supplementary Table S4. B. Distribution of distances between
centroids coordinates of neurites at connected synapse (upper) and gap junction (lower) locations.
Experimental data (red/blue bars) from a published paper13 is fitted by two inverse Gaussian
distributions (black/red lines). Random data (yellow/green bars) is produced following the fitted
inverse Gaussian distributions. C. Similar to B, with red and blue histograms indicating
distributions in our neural network model constructed in our model. D. 3D visualization of a
synapse (cyan) between RIBR (pre-synaptic, yellow) and AIBL (post-synaptic, blue). E. 3D
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

visualization of a gap junction (yellow) between RIVR (red) and SMDVR (blue). F. 3D
visualization of clusters of synapses (cyan) and gap junctions (yellow) between PQR (blue) and
A V AR(red).
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

Fig 5. Neural network model of C. elegans fitted to functional map in biological experiment.
A. Pearson correlation matrix of neurons in simulation and experiment24. The simulation matrix
was derived from our optimized neural network model. Red and cyan color indicate positive and
negative correlation coefficients, which were calculated by membrane potentials of two neurons.
B. Membrane potentials of 65 neurons, each represented in a separate row. Principal component
(PC0, PC1, PC2) weights of each neuron are shown by the bar plots on the right. Neurons were
sorted by PC1 weights. Color of the bars indicates the reported role of the neuron in locomotion
from published research24 (blue: forward neurons, red: backward neurons, green: turning motor
neurons, black: no clear role).
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

Fig 6. A biomechanical body model of C. elegans.
A. Schematic diagram of C. elegans body model. The body was composed of tetrahedrons. 96
muscle cells along 4 muscle strings were serving as actuators for soft body deformation. Different
colors on muscles indicate distinct muscle cells. The body was situated in a large 3D fluid
environment and can move in the environment. Projective dynamics functions were used as the
soft body solver, and simplified hydrodynamics calculated thrust force and drag force on the body
surface. B. Internal view of the body model, consisting of 4 muscle strings: ventral right (VR),
ventral left (VL), dorsal right (DR), dorsal left (DL). C. Triangulated tetrahedron mesh of the body.
D. Four muscle strings: VR (green), VL (yellow), DR (red) and DL (blue). Color intensity reflects
the strength of muscle contraction, with high intensity indicating contraction and transparent
intensity indicating relaxation. E. Tetrahedrons driven by four muscle strings: VR (green), VL
(yellow), DR (red) and DL (blue). F. Deformation of the soft body. Blue tetrahedrons are increase
their volume, while red ones are decreasing. G-H. Thrust force (G) and drag force (H) on body
surface. Red indicates strong force and blue indicates weak force. I. Positions and velocities of the
body at four moments. The body was moving from left to right. Color indicates velocities, with
red representing fast, blue representing slow.
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

Fig 7. Quantification of body’s behavior.
A. Schematic diagram of Target Body Reference Coordinate System (TBRCS) to quantify
behavior stably. The standard body and SBCS are depicted on the left. The target body and
TBRCS are illustrated on the right. Matching points (magenta dots) are positioned on both the
standard and target body. Magenta lines links the corresponding points on two body. The
transformation matrix M is obtained through singular value decomposition, enabling the
conversion from SBCS to TBRCS. The trajectory of the target body center (orange line) exhibits a
zigzag pattern, whereas the trajectory of TBRCS (green line) is smooth. B. Tracking body
movement with TBRCS. 17 tracking points were defined on the surface of both the standard body
and the target body. Magenta lines represent relative positions, while blue arrows indicate relative
velocities. Coordinate systems of the head on standard body and target body are drawn out to
display translation and rotation of the head on target body. C. Trajectories of 17 tracking points on
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

the body. D. Steering angle θ of the body. The velocity vector is depicted as the yellow arrow, and
the XYZ axes of TBRCS are represented by red-green-blue arrows. θ is defined as the angle
between the red arrow and the yellow arrow and remains stable over time. E-F. Relative positions
(E) and velocities (F) of 17 tracking points on the body during the movement.
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

Fig 8. The closed-loop 3D simulation of C. elegans locomotion behavior.
A. The information flow diagram of the closed-loop interaction between neural network model
and body & environment model. B. Comparison of C. elegans trajectory during forward
locomotion in simulation (left) and experiment (right, from a published article45). C. Input current
injected to sensory neurons during locomotion. D. Left, neural network model of C. elegans. Right,
membrane potentials of all motor neurons in the model during locomotion. E. Left, the body
model with 96 muscle cells. Right, the activation signals of all muscle cells during locomotion.
The dashed red line indicates that the activation signal shifting from head to tail.
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

Fig 9. Graphical User Interface (GUI) of MetaWorm.
Graphical User Interface (GUI) of MetaWorm, including: the neural network of C. elegans where
the color indicates membrane potentials, a C. elegans body actively moving towards a food source
(E. coli population) in the 3D fluid environment, the locomotion trajectory, activations of four
muscle strings extending from head to tail.
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

Fig 10. Synthetic perturbation of on the neural network model in MetaWorm.
A. Column 1: Schematic diagram illustrates connections between two neurons in the neural
network model. Ball and stick denote soma and neurite, respectively. Rectangles with solid
and dashed lines indicate synapses and gap junctions. Rectangles with different colors
represent different connections. The width of rectangles signifies connection weights. The
depicted connections between this neuron pair represent all connections in the neural network
model. Column 2: Pearson correlation matrix of neurons during simulation of the neural
network model. Column 3: Locomotion behavior of the C. elegans body controlled by the
neural network model in Column 1. Column 4: Relative position of 3D tracking points on
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

head (blue), center (orange) and tail (green) of the C. elegans body. Column 5: Relative
velocity of a 3D tracking point on head of C. elegans body. B-G. Diagrams represented as in
A, but with different perturbation types: (B) Removal of neurites from all neurons in the
neural network model, relocating connections onto the soma, (C) shuffling the location of
connections on neurites while fixing source and target neurons, (D) shuffling the weights of
synapses while fixing their locations, (E) shuffling the weights of gap junctions while fixing
their locations, (F) removal of all synapses in the neural network model, (G) removal of all
gap junctions in the neural network model. These perturbations are sequenced based on their
distance to the control group in terms of the Pearson Correlation matrix (B: closest, G:
farthest).
Acknowledgements
Funding: this research was funded by National Key R&D Program of China (2020AAA0105200)
Author Information
Contributions
M.D.Z. developed the neural network model module, designed and conducted experiments, and
interpreted results. N.W. developed the body & environment module. H.X.M. and L.M. developed
the 3D neural visualization software. X.R.J. and M.D.Z. collected experimental data for
constructing the neural network model. X.Y .M.and M.D.Z. optimized the connection algorithm
and rewrote the code of the neural network model module for open source. G.H. developed the
optimization algorithm for the multi-compartmental neural network model. M.D.Z., N.W., and
X.R.J. wrote the article. K.D. reviewed the research and provided advice. L.M. supervised the
research, coordinated and conceptualized the study, and contributed to writing the article. All
authors participated in the paper revision process.
Corresponding authors
Correspondence to Lei Ma (malei@baai.ac.cn)
Ethics declarations
The authors declare no competing interests.
Reference
1 Billeh, Y. N. et al. Systematic integration of structural and functional data into multi-scale
models of mouse primary visual cortex. Neuron 106, 388-403. e318 (2020).
2 Hjorth, J. J. et al. The microcircuits of striatum in silico. Proceedings of the National
Academy of Sciences 117, 9554-9565 (2020).
3 Markram, H. et al. Reconstruction and simulation of neocortical microcircuitry. Cell 163,
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint

456-492 (2015).
4 Lobato-Rios, V. et al. NeuroMechFly, a neuromechanical model of adult Drosophila
melanogaster. Nature Methods 19, 620-627 (2022).
5 Merel, J. et al. in International Conference on Learning Representations (2020).
6 Sarma, G. P. et al. OpenWorm: overview and recent advances in integrative biological
simulation of <i>Caenorhabditis elegans</i>. Philosophical Transactions of the Royal
Society B: Biological Sciences 373, 20170382, doi:doi:10.1098/rstb.2017.0382 (2018).
7 Urai, A. E., Doiron, B., Leifer, A. M. & Churchland, A. K. Large-scale neural recordings call
for new insights to link brain and behavior. Nature Neuroscience 25, 11-19,
doi:10.1038/s41593-021-00980-9 (2022).
8 Zador, A. et al. Catalyzing next-generation Artificial Intelligence through NeuroAI.
Nature Communications 14, 1597 (2023).
9 Roth, E., Sponberg, S. & Cowan, N. J. A comparative approach to closed-loop
computation. Current Opinion in Neurobiology 25, 54-62,
doi:https://doi.org/10.1016/j.conb.2013.11.005 (2014).
10 White, J. G., Southgate, E., Thomson, J. N. & Brenner, S. The structure of the nervous
system of the nematode Caenorhabditis elegans. Philos Trans R Soc Lond B Biol Sci 314,
1-340 (1986).
11 Cook, S. J. et al. Whole-animal connectomes of both Caenorhabditis elegans sexes.
Nature 571, 63-71, doi:10.1038/s41586-019-1352-7 (2019).
12 Witvliet, D. et al. Connectomes across development reveal principles of brain maturation.
Nature 596, 257-261, doi:10.1038/s41586-021-03778-8 (2021).
13 Ruach, R., Ratner, N., Emmons, S. W. & Zaslaver, A. The synaptic organization in the
<i>Caenorhabditis elegans</i> neural network suggests significant local
compartmentalized computations. Proceedings of the National Academy of Sciences
120, e2201699120, doi:doi:10.1073/pnas.2201699120 (2023).
14 Brittin, C. A., Cook, S. J., Hall, D. H., Emmons, S. W. & Cohen, N. A multi-scale brain map
derived from whole-brain volumetric reconstructions. Nature 591, 105-110,
doi:10.1038/s41586-021-03284-x (2021).
15 Venkatachalam, V. et al. Pan-neuronal imaging in roaming Caenorhabditis elegans.
Proceedings of the National Academy of Sciences 113, E1082-E1088 (2016).
16 Li, H. et al. Fast whole - body motor neuron calcium imaging of freely moving
Caenorhabditis elegans without coverslip pressed. Cytometry Part A 99, 1143-1157
(2021).
17 Chronis, N., Zimmer, M. & Bargmann, C. I. Microfluidics for in vivo imaging of neuronal
and behavioral activity in Caenorhabditis elegans. Nature methods 4, 727-731 (2007).
18 Kato, S. et al. Global Brain Dynamics Embed the Motor Command Sequence of
<em>Caenorhabditis elegans</em>. Cell 163, 656-669, doi:10.1016/j.cell.2015.09.034
(2015).
19 Husson, S. J., Gottschalk, A. & Leifer, A. M. Optogenetic manipulation of neural activity in
C. elegans: From synapse to circuits and behaviour. Biology of the Cell 105, 235-250,
doi:https://doi.org/10.1111/boc.201200069 (2013).
20 Randi, F., Sharma, A., Dvali, S. & Leifer, A. A functional connectivity atlas of C. elegans
measured by neural activation. Bulletin of the American Physical Society (2023).
(which was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. 
The copyright holder for this preprintthis version posted March 10, 2024. ; https://doi.org/10.1101/2024.02.22.581686doi: bioRxiv preprint