Hierarchical sparse coding in the sensory system of Caenorhabditis elegans
See allHide authors and affiliations
Contributed by Paul W. Sternberg, December 15, 2014 (sent for review July 6, 2014)

Significance
We investigated how a numerically and spatially compact nematode nervous system encodes information about the world. A library of transgenic worms expressing a genetically encoded calcium indicator in each type of sensory neuron was constructed and used to assay neural activity in response to various chemical stimuli to compile a functional map of a sensory system. We find that the sensory system uses hierarchical sparse coding, a strategy that mitigates the limited size and the shallow structure of the neural network. Also, this is a timely study that significantly adds to the communal effort and enthusiasm in obtaining functional maps of the connectome.
Abstract
Animals with compact sensory systems face an encoding problem where a small number of sensory neurons are required to encode information about its surrounding complex environment. Using Caenorhabditis elegans worms as a model, we ask how chemical stimuli are encoded by a small and highly connected sensory system. We first generated a comprehensive library of transgenic worms where each animal expresses a genetically encoded calcium indicator in individual sensory neurons. This library includes the vast majority of the sensory system in C. elegans. Imaging from individual sensory neurons while subjecting the worms to various stimuli allowed us to compile a comprehensive functional map of the sensory system at single neuron resolution. The functional map reveals that despite the dense wiring, chemosensory neurons represent the environment using sparse codes. Moreover, although anatomically closely connected, chemo- and mechano-sensory neurons are functionally segregated. In addition, the code is hierarchical, where few neurons participate in encoding multiple cues, whereas other sensory neurons are stimulus specific. This encoding strategy may have evolved to mitigate the constraints of a compact sensory system.
To forage for resources and avoid harm, living organisms must obtain information about their environment and map it onto their sensory system. Natural environments often contain rich information consisting of many different stimuli. Nonetheless, various sensory systems use only a small fraction of the neurons for the encoding task, a principle also known as sparse coding (1⇓⇓⇓⇓⇓⇓–8). Encoding capacity can be significantly large in sensory systems consisting of many thousands of neurons, but animals with a compact neural network face an encoding problem. For example, nematodes, which inhabit a very broad range of environments and which account for nearly 80% of all individual animals on earth, have a small compact neural network; specifically, Caenorhabditis elegans hermaphrodites have 302 neurons (9), Ascaris suum females have 298 neurons (10), and other species have a similar number of neurons. Moreover, the C. elegans connectome shows that the neural network is highly connected, as over 90% of the network is linked due to gap junctions (11). This feature of the network further accentuates the encoding capacity problem that these animals face.
Here we use the nematode C. elegans as experimental preparation, making use of their essentially invariant anatomy, fully mapped connectome (9, 12), and well-characterized chemosensory system (13) to understand how environmental cues are encoded by a compact sensory system. We begin by introducing our comprehensive library of transgenic worms, where each line reports activity in individual sensory neurons. Subjecting this library to various stimuli, we reveal that even small compact neural systems use “sparse coding.” In addition, we find a hierarchical functional organization as well as functional segregation between the two main sensory modalities: chemo- and mechano-sensation.
Results and Discussion
To measure sensory system activity in a single neuron resolution, we generated a library of transgenic worms, where each strain encodes the calcium indicator GCaMP3 (circularly permuted green fluorescent protein-calmodulin-M13 peptide version 3) (14) in individual types of sensory neurons. The library, comprising 19 strains, includes the vast majority of the sensory system: It contains 15 types of chemosensory neurons representing 34 individual neurons and 11 types of mechanosensory neurons representing 24 individual neurons. The full list of the neurons as well as the description of the transgenic lines is found in Fig. 1 and Table S1.
A comprehensive library of transgenic animals expressing GCaMP3 (14) in single types of sensory neurons. (A–D) Individual chemosensory neurons with left and right distinction. (E–N) Chemosensory neurons types in which both right and left neurons are tagged. Because the left and right neurons are located on different focal planes, usually one of them can be observed in each of the images. (O and P) Dopaminergic neurons. (Q–V) Mechanosensory neurons. (W–X) Phasmid chemosensory neurons. Full details of the transgenic lines are given in Table S1.
We next measured activity of each of the sensory neurons in response to several chemical cues using a microfluidic device, the “Olfactory chip” (15). We chose to assay volatile and soluble attractants (Isoamyl alcohol, diacetyl, NaCl, pH 9, and Escherichia coli supernatant) or repellents (1 M Glycerol, pH 5), all of which are well-known stimulants of C. elegans (13, 16, 17). For each stimulus, we assayed neural activity following stimulus presentation (ON step) and removal (OFF step). In addition, we assayed the response of sensory neurons to blue light (485 nm), a known aversive stimulus to C. elegans worms (18, 19). This large-scale single neuron resolution analysis was then compiled into a comprehensive functional map of the sensory system (Fig. 2).
A functional map of the sensory system reveals a hierarchical sparse code. Rows correspond to individual neurons and columns to stimuli. Each stimulus was tested for an ON and OFF response, and at least five worms were tested for each stimulus. Neural activity as indicated by Ca2+ imaging is color-coded: blue, decrease; green, no response; red, increase. The dopaminergic neurons anterior deirid neuron class E (ADE), cephalic neurons (CEP), and post-deirid neuron class E (PDE) are a subgroup of the mechanosensory neurons.
In our analyses, we considered neurons to be activated only if their GCaMP fluorescent signal was increased by at least 20% or decreased by at least 15% during the 7 s following the ON or OFF step, respectively. We set the threshold to 20%, as control measurements, in which the ON/OFF steps included switching between two streams containing the same buffer solution (no stimulus), showed a typical variability of ∼10%. Moreover, to determine if a neuron genuinely responded to a given stimulus, we considered the rise and fall in neural activity only during the first 7 s following the change. This strict criterion precludes the possibility of assigning spontaneous neural activity as a true response.
Strikingly, we found that only a small fraction of the chemosensory neurons is activated in each of the conditions tested (Fig. 2). A minimal fraction of ∼5% of the chemosensory system is activated in response to a single volatile cue (e.g., isoamyl alcohol, IAA), and as many as 40% of the chemosensory neurons are activated when presented with a rich complex stimulus such as a supernatant of a 3-d-old E. coli growth medium (Fig. 3).
Sparse coding; only a small fraction of the neurons responds to each of the stimuli. Blue circles denote the fraction of neurons that changed their activity at each condition. The order of the circles matches the order of the conditions shown in Fig. 2. Pairs of blue circles correspond to on/off responses, except for the case of pH 5 or 9. Black circles denote the results simulating signal propagation in the network. The four circles correspond to whether one, two, three, or four sensory neurons are directly activated by the stimulus (simulations).
Importantly, we find that the vast majority of the chemosensory neurons were activated in at least one of the stimuli studied. Thus, the observed sparseness is genuine and cannot be interpreted as a lack of calcium signals due to possible aberrant GCaMP expression or that these transgenes somehow impair neural activity. Only two types of chemosensory neurons, namely the phasmid neurons PHA (phasmid neuron A) and PHB (phasmid neuron B), did not respond to any of the conditions tested. Because these neurons are expressed in the tail of the worm, we repeated the assays, this time inserting the worms into the microfluidic chamber with their tails forward such that the tail comes in direct contact with the flowing stimulus (in all previous assays described, the tip of the nose was protruding out to contact the stimulus). In both orientations, either heads or tails forward, we did not detect a response from these neurons.
In addition to detecting neural activity from the vast majority of the chemosensory neurons, we also successfully detected calcium signals in mechanosensory neurons in which we expressed Channelrhodopsin (Fig. 4). Together, these widely observed responses exclude the possibility that sparseness could result from impaired activity of the GCaMP-expressing neurons.
The mechanosensory system is functionally segregated from the chemosensory system. (A) The transgenic animal expressing Channelrhodopsin (ChR2) and GCaMP3 in mechanosensory neurons and GCaMP3 in AWCON, syEx1211[mec-4::ChR2-mCherry, mec-4::GCaMP3, str-2::GCAMP3; pha-1::PHA-1]; pha-1(e2123ts); him-5(e1490), strain PS6421. (B) Light-induced activation of the mechanosensory neurons. Activation of Channelrhodopsin and calcium imaging begin at time point zero, when light (480 nm) is turned on. (C) Light activation of the mechanosensory neurons does not elicit activity in AWCON, a neuron that is at the top of the functional hierarchy of the chemosensory system.
The small fraction of activated neurons may come as a surprise given the high connectivity of the network. For example, Majewska and Yuste calculated that when looking at the graph of neurons connected by gap junctions only, over 90% of the neurons are coupled either directly or indirectly, via any number of coupled neurons (11). Moreover, a recent assembly of the network assigned many more gap junctions and synapses (12), so the connectivity may be even higher than estimated. Indeed, simulations of signal propagation in the network suggest that the vast majority of the neurons are expected to participate in stimulus encoding (Fig. 3 and Fig. S1; see Materials and Methods for a detailed description of the simulations). Our experimental findings, however, reveal that encoding is sparse (Figs. 2 and 3). There are several advantages to using a sparse encoding strategy of environmental stimuli (1⇓⇓–4, 8): It allows storing a greater number of representations as well as newly acquired memories (5, 20), and it is also energy efficient (21). This parsimony is particularly relevant given that C. elegans worms frequently face dire conditions (22) with limited resources and consequently evolved various strategies to alleviate energy deficits (23).
The compiled functional map (Fig. 2) also reveals a functional hierarchy: Few neurons respond to most chemical cues tested, whereas other neurons are more stimulus-specific. This functional hierarchy cannot be explained by network anatomy as the neurons at the top of the hierarchy are not hubs of the network but rather have an average number of synaptic partners (Fig. S2). Of particular interest are the amphid wing cell C (AWC) chemosensory neurons, which respond to most stimuli (Fig. 2). Moreover, we found that AWC also mildly responds to the change in the flow direction in the absence of a chemical stimulus (Fig. S3). This moderate activation (∼20%), however, is significantly lower than the activation observed in response to the different chemical stimuli, indicating that the ubiquitous response to those chemicals is genuine (Fig. S3).
This ubiquitous response has functional behavioral significance, as genetically ablated AWC worms (24) show impaired chemotactic behavior to a variety of chemical stimuli (17), including stimuli assayed in this study (Fig. S4), and therefore play a key role in the correct encoding of many different stimuli.
Sparseness and functional hierarchy are design features common in neural systems with several layers of information processing (5, 11). Revealing these features of the C. elegans nervous system at the sensory level itself suggests that signal processing and integration may be already implemented at the sensory level itself or at the interface between the sensory and the interneuron level. Indeed, sensory neurons have been shown to be specialized to compute and temporally differentiate chemosensory cues (25, 26). Moreover, the structure of the neural network is shallow: We analyzed the C. elegans neural network and found that the average shortest path from each of the chemosensory neurons (at the sensory periphery) to the motor neurons (the most downstream elements in the nervous system) is 3.5 ± 0.8 synapses. Thus, signal integration at the sensory periphery could be particularly beneficial in the case of C. elegans given the small size and shallow structure of its nervous system. Indeed, the chemosensory neuron AWCON (“ON” denotes expression of the str-2 gene, which encodes a seven transmembrane receptor) was shown to act as an interneuron downstream of the primary salt-sensing amphid sensory neuron class E (ASE) neurons (27), and C. elegans chemotactic behavior can be controlled by manipulating a single pair of amphid interneuron class Y (AIY) interneurons that are postsynaptic to AWC (28).
In addition, the functional map suggests that the chemosensory system is functionally segregated from the mechanosensory system: None of the 11 mechanosensory neuron types, comprising 24 individual mechanosensory neurons (out of 30 in total), was activated upon chemical stimulation (Fig. 2). This functional segregation is probably bidirectional, as stimulating key mechanosensory neurons did not elicit a response in AWCON, the chemosensory neuron at the top of the functional hierarchy (Fig. 4). The functional segregation cannot be predicted based on the available connectome alone, as the two sensory modalities are anatomically intertwined, suggesting that activity of a neuron from one modality is also likely to activate a neuron from the other modality. Thus, although the anatomical proximity and the intertwined wiring may suggest a potential cross-talk between the two modalities, our functional dynamics data demonstrate that the two modalities are functionally separated despite the possibility of massive neuropeptide modulation.
The compiled functional map (Fig. 2) consists of several stimuli, each tested at a single concentration. It would be interesting to perform an in-depth analysis to quantitate how each of the neurons responds to varying concentrations of the stimuli using dedicated high-throughput microfluidic devices as has been done for amphid wing neuron class A (AWA) (29). Modulating stimulus concentration may somewhat change the ensemble of encoding sensory neurons, often to include the amphid sensilla neuron class H (ASH) polymodal neuron if high concentrations of a known chemoattractant are used (e.g., NaCl and diacetyl) (30, 31). However, addition of a few more neurons to the encoding ensemble is unlikely to change the observed sparse response, as these stimuli are encoded using less than 30% (5–30%) of the sensory neurons.
We addressed the encoding problem by looking at the population of responding neurons. A more sophisticated and fine-tuned encoding may lie in the relative response time among the different neurons. Because neural response latencies are expected to be very short (presumably less than a second), accurate high-temporal measurements should be made in animals expressing GCaMP in several neurons. In this regard, it will be interesting to elucidate which neurons are the primary direct sensors to the chemical cue and which are secondary, postsynaptic neurons. Addressing these questions will be possible by crossing with neural transmission mutants, such as unc-31 or unc-13.
Here we have shown that the C. elegans sensory system represents environmental stimuli using sparse codes, a strategy that may mitigate the network’s size and structural constraints. How can sparseness arise in a network with such a high degree of connectedness where over 90% of the network is linked due to gap junctions only (11)? One possible mechanism can be attributed to the hub-and-spoke network motif that can suppress network activity through shunting (32, 33). In addition, we have shown that the chemosensory system is segregated from the mechanosensory system and that it has a functional hierarchy: Few neurons participate in encoding a broad range of stimuli, whereas other neurons are stimuli-specific. The functional hierarchy suggests that sensory information may be integrated at the sensory layer itself, as was also observed in refs. 27, 28, thus overcoming the network’s shallow small size structure.
Materials and Methods
Library Construction.
We used GCaMP3 (14) for the construction of the comprehensive library. Promoters used to drive expression in individual sensory neurons are given in Table S1. All constructs were fusion PCR products injected into a pha-1 background [either e2123 or a double mutant of pha-1(e2123); him-5(e1490), PS6421]. In general, we injected a mix of 10–50 ng/µL of the fusion PCR product together with 70–80 ng/µL of the pha-1 rescue construct. In a few cases where we observed defective progeny, we generated transgenic animals by injecting lower concentrations of the fusion PCR (1–5 ng/µL). The full list of the strains generated in this study is given in Table S1.
Calcium Imaging.
To apply the various chemical stimuli in an ON/OFF manner while immobilizing the worms for calcium imaging, we used the “olfactory chamber” (15). The chemical stimuli included 10−4 IAA, 10−4 diacetyl, 50 mM NaCl, 1 M Glycerol, pH 5 and pH 9, and supernatant from a 3-d-old E. coli (strain OP 50) culture. We used two inverted fluorescent microscope setups: (i) Zeiss Axiovert equipped with an IXON397 EMCCD camera (Andor) and (ii) Olympus IX83 equipped with a Evolved EMCCD camera (Photometrics). Exposure time ranged from 100 ms to 500 ms depending on the intensity of the signal in the various neurons. In a typical experiment, we subjected the worm to the control stream for 10 s and then switched to the stimulus stream (an ON step). An OFF step was done by switching the stimulus stream to the control stream. Importantly, for each tested condition, we replaced the microfluidic chip as well as all of the connecting tubes with new, unused ones. This ensured that no traces of contaminating cues will be flowing together with the tested stimulus. Moreover, to prevent possible accumulation of contaminating bacteria, we replaced all of the tubing setup every 2–3 d, and excessively washed the chips periodically even if we repeated the experiment with the same stimulus.
A minimum of five measurements was performed for each neuron per condition. In cases where the signal (∆F/F) was low and close to background level, we increased the number of neurons assayed. We determined that a neuron was activated (increased calcium levels) or inhibited (decreased calcium levels) if ∆F/F > 20% or ∆F/F < 15%, respectively. This threshold is based on control experiments (without applying stimuli) in which fluorescence fluctuated by ∼10%. To determine whether a neuron responded to the stimulus and to avoid accounting for stochastic calcium changes, we considered only the change in the first 7 s following the switch in the condition. When imaging from neurons sensitive to the blue light (480 nm), we first allowed the worms to adapt to the light for 2–3 min before switching between the chemical streams. These neurons included ASH, amphid sensillum neuron class K (ASK), amphid sensory neuron with dual ciliated endings (ADL), amphid sensillum neuron class J (ASJ), and inner labial neuron class 2 (IL2).
To test whether activation of selected mechano-sensory neurons activate AWCON, the sensory neuron at the top of the functional hierarchy (Fig. 2), we generated a transgenic worm (PS6421) expressing channelrhodopsin (ChR2–mCherry) and GCaMP3 in a subset of mechano-sensory neurons as well as GCaMP3 in AWCON: syEx1211[mec-4::ChR2, mec-4::GCaMP3, str-2::GCAMP3]; pha-1(e2123ts); him-5(e1490). L4 hermaphroditic worms were grown on OP 50 supplemented with 200 µM of all-transretinal (Sigma) for 1–2 d in the dark (34). Blue light (480 nm) was used to activate channelrhodopsin, in which case GCaMP signal was clearly elevated in the mechano-sensory neurons. To image AWCON and the distant mechanosensory neurons simultaneously, we used a 20× magnification (Fig. 4A).
Network-Wide Simulations of Signal Propagation.
We simulated signal propagation in the network to estimate the fraction of neurons expected to change their activity in response to activation of individual chemosensory neurons. Although network connectivity is available (9, 12), the sign of the vast majority of the synapses (e.g., excitatory/inhibitory) is unknown. To overcome this limitation, we used a brute force approach simulating signal flow in tens of thousands of randomly generated networks where network connectivity was left intact, but synapses were randomly assigned as excitatory or inhibitory with varying probabilities. This approach ensures that the simulations will cover a broad space of the possible networks. The aim of these simulations is merely to estimate the fraction of neurons with changed activity rather than predicting the neural ensemble encoding a given stimulus.
The simulations were performed by initially activating one, two, three, or four sensory neurons at a time (Fig. 3) and then propagating the signal in the network over discrete time points in an analog fashion: At each time point, an excitatory synapse added one activity unit to the postsynaptic neurons, and inhibitory synapses decreased one activity unit from postsynaptic neurons. Gap junctions were enabled to transmit neural activity with a probability of 0.5, as gap junctions can be rectifying synapses transmitting signal in one direction only. Signal was propagated in the network according to these rules until the number of activated neurons reached a steady state (after ∼10 time points), after which we calculated the fraction of neurons that changed their activity during the time-evolved simulations (Fig. 3 and Fig. S1).
Chemotaxis Assays.
We found that the AWCON chemosensory neuron responds to a broad panel of chemical cues. To test whether this ubiquitous response also has functional behavioral significance, we performed chemotaxis assays of AWCON genetically ablated worms (24). Although worms’ attraction to IAA is known to be mediated by AWC neurons, diacetyl and NaCl that are sensed by AWA and ASE neurons, respectively, are not known as AWC-mediated chemoattractants (13, 35, 36). We therefore compared intact worms to AWCON genetically ablated worms for their potential to be attracted to these cues (Fig. S4).
We used a standard protocol for the chemotaxis assays, where worms were placed at the center of a plate and a stimulus and control are spotted on two opposing sides two centimeters from the worms. NaCl was spotted on the agar 20 h and 4 h before the assay to generate sharp gradients according to ref. 37. This spotting protocol generates sharper gradients that drop by approximately an order of magnitude 1 cm away from the source. Two microliters with the corresponding concentrations of IAA and diacetyl were spotted on the plate lid immediately before the assay. In general, we used concentrations that are higher than the ones used in the microfluidic calcium imaging experiments to generate effective sharp gradients along the trajectories of the worms. In addition, effective sensing and chemotaxis along gradients may require higher concentrations of the stimulus as opposed to the lower concentrations required to elicit a response in a switch-like ON/OFF manner as used in the microfluidic experiments. Chemotaxis Index was calculated using the standard formula (Nst – Nctrl)/(Nst + Nctrl) after 3–5 min from the beginning of the assay.
Acknowledgments
We thank Piali Sengupta for sharing the genetically ablated AWCON strain (PY7502). The research leading to these results has received funding from the European Research Council under the European Union’s Seventh Framework Programme (FP/2007-2013) and European Research Council Grant Agreement 336803. Initial stages of this research were supported by the Caltech Center for Biological Circuit Design. P.W.S. is an investigator of the Howard Hughes Medical Institute, which supported this work.
Footnotes
- ↵1To whom correspondence may be addressed. Email: pws{at}caltech.edu or alonzas{at}mail.huji.ac.il.
Author contributions: A.Z. and P.W.S. designed research; A.Z., I.L., O.S., S.G., and L.Y. performed research; A.Z. contributed new reagents/analytic tools; A.Z. analyzed data; and A.Z. and P.W.S. wrote the paper.
The authors declare no conflict of interest.
This article contains supporting information online at www.pnas.org/lookup/suppl/doi:10.1073/pnas.1423656112/-/DCSupplemental.
Freely available online through the PNAS open access option.
References
- ↵.
- Vinje WE,
- Gallant JL
- ↵
- ↵.
- Perez-Orive J, et al.
- ↵
- ↵
- ↵
- ↵
- ↵.
- Papadopoulou M,
- Cassenaer S,
- Nowotny T,
- Laurent G
- ↵.
- White JG,
- Southgate E,
- Thomson JN,
- Brenner S
- ↵.
- Holland C
- ↵
- ↵
- ↵.
- Bargmann CI
- ↵
- ↵
- ↵
- ↵
- ↵
- ↵
- ↵
- ↵.
- Niven JE,
- Laughlin SB
- ↵
- ↵
- ↵.
- Beverly M,
- Anbil S,
- Sengupta P
- ↵
- ↵.
- Thiele TR,
- Faumont S,
- Lockery SR
- ↵
- ↵
- ↵.
- Larsch J,
- Ventimiglia D,
- Bargmann CI,
- Albrecht DR
- ↵
- ↵.
- Taniguchi G,
- Uozumi T,
- Kiriyama K,
- Kamizaki T,
- Hirotsu T
- ↵
- ↵
- ↵
- ↵
- ↵
- ↵.
- Pierce-Shimomura JT,
- Morse TM,
- Lockery SR
Citation Manager Formats
Article Classifications
- Biological Sciences
- Neuroscience