The C.elegans AWA Olfactory Neuron Fires Calcium-Mediated All-or-None Action Potentials

We find, unexpectedly, that C. elegans neurons can encode information through regenerative all-or-none action potentials. In a survey of current-voltage relationships in C. elegans neurons, we discovered that AWA olfactory neurons generate membrane potential spikes with defining characteristics of action potentials. Ion substitution experiments, pharmacology, and mutant analysis identified a voltage-gated CaV1 calcium channel and a Shaker-type potassium channel that underlie action potential dynamics in AWA. Simultaneous patch-clamp recording and calcium imaging in AWA revealed spike-associated calcium signals that were also observed after odor stimulation of intact animals, suggesting that natural odor stimuli induce AWA action potentials. The stimulus regimes that elicited action potentials match AWA’s proposed specialized function in climbing odor gradients. Our results provide evidence that C. elegans can use digital as well as analog coding schemes, expand the computational repertoire of its nervous system, and inform future modeling of its neural coding and network dynamics.


Introduction
The nervous system uses both digital and analog signals to encode perception, computation, and action (Rieke et al., 1997;Dayan and Abbott, 2005). Spiking neurons, which are prominent in most animal nervous systems, compress continuous inputs into digital, regenerative action potentials that transmit information efficiently over long distances.
Graded neurons can encode more than one bit of information per time interval, but are more sensitive to noise than spiking neurons, and therefore are typically found in settings such as the vertebrate retina in which signals are propagated only over short distances (Koch et al., 2006;Sarpeshkar, 1998). Graded signaling allows parallel computations to occur in different parts of a neuron, and even spiking neurons use this multiplexing property in their dendritic arbors.
Among animals, nematodes have been thought to be exceptional in their lack of neuronal action potentials. Early recordings in the parasitic nematode Ascaris suum demonstrated only graded electrical properties and graded synaptic transmission in motor neurons (Davis and Stretton, 1989b), together with high membrane resistance that allows these neurons to propagate signals over centimeters without action potentials (Davis and Stretton, 1989a). A variety of graded electrical properties have subsequently been described in the free-living nematode Caenorhabditis elegans (Geffeney et al., 2011;Goodman et al., 1998;Lindsay et al., 2011;Liu et al., 2017;Liu et al., 2014;Liu et al., 2009;Mellem et al., 2008;O'Hagan et al., 2005;Ramot et al., 2008). Some neurons are smoothly depolarized or hyperpolarized from a tonic resting potential (Liu et al., 2014;Mellem et al., 2008), while others are bistable, with nonlinear transitions between the resting potential and a depolarized potential around -20 mV (Goodman et al., 1998). Striking nonlinearity is observed in the regenerative plateau potentials of RMD motor neurons, which resemble action potentials in their all-or-none properties, but do not spontaneously repolarize (Mellem et al., 2008).
The apparent absence of canonical action potentials in nematode neurons aligns with the absence of genes encoding voltage-gated sodium channels in the C. elegans genome (Bargmann, 1998). However, voltage-gated calcium channels can generate alternative modes of spiking: for example, dendritic calcium spikes play important integrative roles in vertebrate pyramidal neurons (Golding et al., 1999;Larkum et al., 1999). Calciumdependent action potentials at 3-10 Hz have been recorded from C. elegans pharyngeal muscles (Raizen and Avery, 1994;Shtonda and Avery, 2005) and body-wall muscles (Gao and Zhen, 2011;Liu et al., 2011). Activity patterns suggestive of neuronal calcium spikes have been observed in extracellular recordings in the Ascaris ventral nerve cord (Davis and Stretton, 1992), and in all-or-none small-amplitude spikes in a C. elegans interneuron (Faumont et al., 2012), suggesting that further investigation of such events could be fruitful.
There are only 302 neurons in the adult C. elegans hermaphrodite, but their functions, anatomy, molecular properties, and synaptic partners allow them to be divided into at least 120 classes (White et al., 1986). The preferential use of analog over digital signaling in C. elegans neurons increases the theoretical coding capacity of its tiny neuronal repertoire. At the same time, some neurons among these diverse types might prefer digital regimes to engage the coding properties ascribed to spike rates or spike timing (Gerstner and Kistler, 2002). We show here that AWA olfactory neurons, which are specialized for detecting gradients of attractive odors, reliably and reproducibly generate all-or-none action potentials under physiologically realistic conditions, and explore the mechanisms and implications of this property.

AWA neurons fire all-or-none action potentials
To explore the biophysical diversity of the C. elegans nervous system, we conducted an electrophysiological survey of identified C. elegans head neurons. At least four distinct types of current-voltage (I-V) relationships were observed (Fig 1). A motorneuron/interneuron, RIM, exhibited near-zero inward currents under hyperpolarizing voltageclamp steps and rapid inactivating outward currents under depolarizing steps ( Fig 1B). The lack of large sustained currents allowed RIM to be depolarized or hyperpolarized smoothly under current-clamp ( Fig 1A). We defined neurons with this type of I-V relationship as "transient outward rectifiers". The interneuron AIY also lacked large inward currents under hyperpolarizing steps, but had non-inactivating outward currents under depolarizing steps ( Fig 1B), as previously reported (Faumont et al., 2006). These outward currents made AIY's membrane potential more sensitive to hyperpolarizing than depolarizing inputs with a transition point around -30 mV ( Fig 1C). Neurons with this type of I-V relationship were defined as "outward rectifiers". The third type of neuron, "bistable", was inwardly and outwardly rectifying, and included AFD thermosensory neurons ( Fig 1B). In agreement with a previous study (Ramot et al., 2008), large sustained currents to hyperpolarizing and depolarizing steps in AFD essentially restricted its membrane potential to two voltages around -80 mV and -20 mV over a range of current injections ( Fig 1A). Finally, like AFD, the AWA olfactory neuron had large sustained outwardly-and inwardly-rectifying currents in response to depolarizing and hyperpolarizing steps (Fig 1B C). In addition, and to our surprise, AWA membrane potential exhibited oscillations reminiscent of classic Hodgkin-Huxley action potentials under stimulations of certain amplitudes and durations in current clamp ( Fig 1A). We define AWA as a "bistable/spiking" neuron.
AWA spikes could occur either as a single spike or in a transient burst of spikes at up to 10.5 Hz (mean frequency: 4.2 ± 0.2 Hz, n = 89; error denotes SEM in all cases) (Fig 2A, I, Fig S1A, C-E). All AWA spikes had a stereotypical shape with a fast upstroke followed by a fast downstroke and afterhyperpolarization (AHP). Spikes were all-or-none with an amplitude that was well-fit by a normal distribution (Fig 2B-D). Single spikes had a threshold of -34.0 ± 0.6 mV, an amplitude of 25.8 ± 0.8 mV, a half-maximum width of 18.0 ± 0.8 ms, and an AHP of 8.4 ± 0.9 mV ( Fig 2C). The presence of adjacent spikes during bursts altered the membrane potential before the spike and the magnitude of the AHP (Fig 2B, Table S3).
The stereotypical shape of single or bursting spikes was invariant with respect to the amplitude, duration, and waveform of the input stimulus. We conclude that AWA fires all-ornone action potentials.
In addition to these features common to all action potentials, action potentials in AWA had several characteristic features. First, they were associated with membrane potential bistability. Due to large depolarizing and hyperpolarizing currents after voltage steps, the AWA membrane potential had two stable states: a resting state at around -75 mV and a more depolarized plateau state at around -40 mV, near the firing threshold ( Fig 2E). A small positive current caused a membrane potential jump from the resting state to the plateau state, but larger current injections resulted in little further depolarization unless spikes occurred. Second, action potentials were elicited only by stimuli of amplitudes between 2 pA and 12 pA, with the optimal 5 or 6 pA stimulus resulting in a ~70% spiking rate; no spiking was observed at higher current injections despite depolarization to the plateau state (Fig 2A, F). Third, spikes were induced only after a sustained current injection, with a peak time to first spike of one second (Fig 2G, Fig S1B-D). The latency to first spike decreased with increasing stimulus strength within the spike-generating range ( Fig 2H).
Fourth, bursts of spikes typically terminated after 1 -8 spikes, with a total burst duration of less than 2 seconds, so that most spikes occurred between 1 -4 seconds after stimulation ( Fig 2G, I). Even a 30 second stimulus of appropriate amplitude only induced spikes within the first few seconds (Fig S1A). The exact timing and number of spikes induced by a given stimulus varied; for example, a square stimulus of the same amplitude and duration could induce a single spike or a burst after a variable delay (Fig S1E). There was a weak increase in spike count with stimulus strength (Fig 2J). These collective properties were reproducible across animals, and defined a narrow but reliable spiking regime (see Discussion).

The CaV1-type calcium channel EGL-19 generates the action potential upstroke
We used genetic mutations, ion substitution, and pharmacological experiments to define the requirements for AWA spiking. AWA spiking was normal in unc-13 mutants, which lack most fast synaptic transmission, suggesting that spiking results from intrinsic AWA biophysical properties (Fig 3A). Ionic substitution of extracellular Na + with N-Methyl-Dglucamine (NMDG) during recording altered resting membrane potential but spared AWA action potentials (Fig 3B). By contrast, reducing extracellular Ca 2+ to 0-1 mM eliminated AWA spikes (Fig 3C, Table S2). Conversely, increasing extracellular Ca 2+ to 5 mM or 8 mM generated action potential spikes with larger amplitudes (Fig 3D, Fig S2A, Table S3). These results strongly suggest that action potentials in AWA are calcium-mediated.
To identify channels responsible for the action potential in AWA, we recorded from mutant strains lacking each of the five predicted alpha subunits in the voltage-gated calcium channel family. AWA spikes could not be detected in reduction-of-function mutants in egl-19, which encodes a CaV1 L-type voltage-gated calcium channel ( Fig 3E). In agreement with this result, acute addition of the selective L-type channel blocker Nemadipine-A blocked spiking in 6 out of 7 AWA neurons ( Fig 3F). AWA spikes were normal in mutants for unc-2 (CaV2 P/Q-type high voltage-gated calcium channel), cca-1 (CaV3 T-type low voltage-gated calcium channel) (Frokjaer-Jensen et al., 2006) and nca-1; nca-2 (NALCN-related voltageindependent, nonselective cation channels) (Jospin et al., 2007) (Fig 3G, Fig S2B, Table   S3). The TRPV sensory channel OSM-9, which is expressed in AWA, has also been suggested to be voltage-activated (Colbert et al., 1997;Glauser et al., 2011), but action potentials were spared in osm-9 mutants ( Fig 3H) albeit with a shifted threshold suggesting a role for osm-9 in AWA excitability ( Fig 3G, Table S3). Together, these results point to a uniquely important role for EGL-19, a CaV1 type voltage-gated calcium channel, in AWA action potential generation.

Shaker-type potassium channels drive the action potential downstroke
Termination of the action potential in the Hodgkin-Huxley model is a result of voltagedependent potassium channels activated by depolarization. Eliminating potassium currents by substituting intracellular K + with Cs + and adding the potassium channel blockers tetraethylammonium (TEA) and 4-Aminopyridine (4-AP) to the extracellular solution resulted in a more linear AWA membrane potential without spiking, suggesting that potassium channels dominate AWA voltage dynamics inclusive of action potentials (Fig 4A).
In a more refined experiment, addition of the Kv1 subfamily-selective blocker 4-AP to the physiological recording solution resulted in action potentials with a larger peak amplitude, broader spike width and lower spike count (Fig 4B, H, Table S3). This observation implicates 4-AP-sensitive potassium channels in rapid membrane potential repolarization. We recorded AWA in mutants representing 11 of the 22 predicted 6TM voltage-gated potassium channel (VGKC) genes in C. elegans in single, double or triple mutant combinations (Fig 4C-H and Fig S3A-B), including at least one gene from each VGKC gene subfamily. The Shaker/Kv1 subfamily mutant shk-1 had a strong phenotype resembling that of 4-AP blockade (Fig 4C, H). In shk-1 mutants, spiking probability was increased across a range of current inputs (Fig 4E), spike amplitude and width were increased (Fig 4D,F,H), and the maximum bursting frequency was reduced to 1.8 Hz (Mean frequency: 1.4 ± 0.1 Hz, n = 9), while spike time distribution relative to stimulus remained unchanged (Fig 4G) (compare Figs 4D/2B, 4E/2F, 4F/2D and 4G/2G, respectively). These results implicate SHK-1 in action potential repolarization in AWA. No significant effect on repolarization was observed in other tested potassium channel mutants and double mutants ( Fig 4H and Fig S3B, Table S3).
Calcium may also contribute to the repolarization of action potentials in AWA. When extracellular Ca 2+ was substituted with Ba 2+ , which can pass through but does not inactivate the CaV1 calcium channel, AWA action potentials remained at the peak amplitude for the entire duration of the current injection instead of terminating spontaneously ( Fig S3C).
These results suggest that the activation of SHK-1 potassium channel terminates the action potential together with calcium-dependent processes such as calcium channel inactivation.

Modeling AWA action potentials based on known and predicted channels
To begin to model the channels underlying action potential dynamics in AWA, we used whole-cell voltage-clamp recordings to determine I-V relationships of its calcium and potassium currents. Eliminating most potassium currents by Cs + substitution in combination with TEA and 4-AP uncovered a small depolarizing current and leak currents (Fig 5A, B).
The small depolarizing current was eliminated by adding Nemadipine-A to the extracellular solution, suggesting that it arises from EGL-19 calcium channels ( Fig S4A). Since EGL-19 is rapidly, albeit partially, inactivating (Jospin et al., 2002), we subtracted steady-state current from the peak current for each voltage step to estimate presumptive EGL-19 calcium currents (Fig 5C, E). The resulting I-V relationship ( Fig 5D) suggested that EGL-19 was activated near a threshold around -40 mV and peaked near -10 mV, consistent with calcium currents in previous ASER recordings (Goodman et al., 1998). The activation threshold of the inferred calcium currents matches that of AWA action potentials.
The large potassium currents recorded in physiological solutions (Fig 1B, 5H) became much smaller after extracellular Ca 2+ was removed (Fig 5F), suggesting that a subset of AWA potassium currents is calcium dependent. SHK-1 (Kv1) and  currents are typically calcium-independent, and therefore should be preserved at 0 mM [Ca 2+ ] o . We estimated the properties of potassium channels by comparing AWA in wild type to channel mutants, recognizing that this is an approximation that overlooks homeostatic effects. Subtracting the residual current in shk-1 mutants from the wild-type whole-cell current at 0 mM [Ca 2+ ] o yielded a non-inactivating current inferred to be the SHK-1 current ( Fig 5F), with properties consistent with previous studies (Fawcett et al., 2006;Liu et al., 2011). Subtracting the whole-cell current in shk-1; shl-1 from that of shk-1 at 0 mM [Ca 2+ ] o yielded a transient fast activating current, inferred to be SHL-1 ( Fig 5G) (Fawcett et al., 2006;Santi et al., 2003).
Turning to potential calcium-dependent channels, SLO-2 is a large conductance potassium channel (Yuan et al., 2000) that is activated by Cland Ca 2+ entry (Liu et al., 2014). slo-2 mutants had dramatically smaller potassium currents than wild-type at 2 mM [Ca 2+ ] o (Fig 5H), suggesting that SLO-2 is a dominant calcium-dependent potassium channel in AWA. Subtracting the current in slo-2 mutants from wild-type current yielded a large slowactivating non-inactivating current inferred to be SLO-2 (Fig 5H), consistent with previous reports (Liu et al., 2011;Santi et al., 2003). SLO-1 is another large conductance calciumactivated potassium channel that plays an important regulatory role in synaptic transmission (Wang et al., 2001). slo-1 mutants also had smaller potassium currents than wild-type at 2 mM [Ca 2+ ] o ( Fig 5I). The SLO-1 currents inferred by subtracting the current in slo-1 mutants from wild-type current were similar to SLO-2 currents ( Fig 5I).
The I-V relationships of the four inferred potassium currents ( Fig 5K) suggest that the activation voltage of SHK-1 falls narrowly above that of EGL-19, supporting the model that SHK-1 repolarizes the action potential. SHL-1 would be activated at the same voltage, but this transient current appears not to substantially influence spiking. SLO-2 and SLO-1 generate larger currents, but are activated only above 0 mV, which exceeds the effective spiking range.
After SHK-1, SHL-1, and SLO-2 currents were all subtracted from the wild-type whole cell currents, a residual fast-activating slow-inactivating potassium current remained ( Fig 5J, "Kr"). The inferred Kr channel(s) were not affected by mutants for the eleven tested potassium channels, so the molecular identity of Kr is unknown. However, its properties are a central element of the AWA spiking model described below, as Kr accounts for the slow rise in membrane potential that precedes and sets the timing of the first spike ( Fig 6A).
To ask whether these channels are sufficient to generate AWA action potentials, we developed a Hodgkin-Huxley type model of the AWA membrane potential (details in Experimental Procedures). The initial model incorporated the inferred properties of EGL-19, SHK-1, and SLO-1/SLO-2 channels, an additional leak current (inferred from the steadystate current in Fig 1C), and an inwardly-rectifying potassium channel (Hibino et al., 2010) that set the resting potential at -75 mV. This model gave rise to tonic spiking. Following a calculation of the bifurcation diagram that defined the spiking regime, we added the inferred slowly-inactivating Kr potassium channel that determined the delay to spiking, and a second slowly-activating Kr a potassium channel to terminate spiking ( According to the model and the I-V relationships in Fig 5K, the EGL-19 calcium conductance competes with several potassium conductances to dictate the membrane potential dynamics that permit spiking. We predicted that either the removal of the Kr currents or a left shift of the activation voltage of EGL-19 would eliminate the delay to the first spike. Indeed, egl-19(ad695), a gain of function mutant in which the EGL-19 I-V curve is shifted by 6 mV toward negative potentials (Laine et al., 2014), eliminated the delay to the first spike in almost all AWA recordings (Fig 6E, F). This effect supports the identification of EGL-19 as a molecular mediator of the AWA action potential upstroke.

Natural odor stimuli may elicit AWA action potentials
AWA detects attractive volatile odors (Bargmann et al., 1993), which elicit a rise in calcium indicative of membrane depolarization (Larsch et al., 2015;Larsch et al., 2013;Shinkai et al., 2011). Exhaustive attempts to deliver odors to the dissected electrophysiological preparation were unsuccessful, so we took an indirect approach to connect action potential spikes and odor stimulation using calcium dynamics as an intermediate. In the dissected preparation, we conducted simultaneous voltage-clamp recording and calcium imaging of AWA using the genetically-encoded calcium indicator GCaMP6f. Depolarizing AWA to the spike threshold (-40 mV) resulted in smoothly increasing GCaMP6f fluorescence after a delay of approximately one second ( Fig 7A); repolarizing AWA toward the resting potential resulted in fluorescence decreases without an appreciable delay. In traces that included action potentials, individual spikes were associated with an immediate increase in the slope of GCaMP6f fluorescence (Fig 7B).
These results indicate that action potentials induce a sharper increase in AWA calcium than depolarization that does not drive spikes.
shk-1 mutants have prolonged action potentials, presumably associated with prolonged EGL-19 channel opening. In shk-1 mutants, the transient increase in GCaMP6f slope was enhanced both for multiple spikes ( Fig 7C) and for single spikes ( Fig 7D). This signal was further enhanced when measuring calcium in the AWA axon, where calcium clearance is accelerated compared to the soma ( Fig 7E).
Based on the GCaMP6f signals induced by smooth depolarization (Fig 7A) versus spiking ( Fig 7B-E), we sought evidence that natural odor stimuli could induce AWA action potentials in intact animals. The bacterial metabolite diacetyl is a potent stimulator of AWA calcium transients and AWA-driven chemotaxis behavior (Bargmann et al., 1993). Applying derivative and amplitude thresholds and deconvolution to diacetyl-induced GCaMP6f signals supported the presence of action potentials in both wild-type ( Fig 7F) and shk-1 (Fig 7G) animals. In agreement with the predictions from electrophysiology, the inferred action potentials were consistently smaller and more frequent in wild-type than in shk-1 animals.
These results suggest that diacetyl odors can elicit AWA action potentials in intact animals.

AWA action potentials may encode specific stimulus features
Stimuli in natural environments can fluctuate on different temporal and spatial scales.
To identify conditions that best elicit AWA action potentials, we conducted electrophysiological recordings while modulating current in different patterns.
Among a variety of ramps and modulated stimuli, we found that sine wave stimuli from -10 to +10 pA at 0.1 Hz generated AWA action potential bursts reliably across trials ( Fig 8A). By contrast, 0.5, 1, or 2 Hz sine wave stimuli -chosen to match the timescale of C. elegans sinusoidal movement -were ineffective at inducing action potentials ( Fig 8A and   Fig S5A). To ask whether the rate of stimulus change is a key mediator of AWA spiking, we challenged AWA with current injection ramps at slopes ranging from 0.4 to 3 pA/s ( Fig 8B).
In both wild-type and shk-1 animals, spikes were readily induced by these slow ramps ( Fig   8B and Fig S5B), but not by a fast ramp at 25 pA/s (Fig S5C). At slow ramps, the number of spikes had a modest positive correlation with the slope of the stimulation, but spike amplitude was unchanged ( Fig 8C). Together, these results suggest that slowly rising stimuli result in reliable AWA spiking.
Calcium imaging studies have suggested that AWA preferentially detects spaced upsteps in odor concentrations, rather than absolute odor thresholds (Larsch et al., 2015).
To ask whether this property is reflected in action potentials, we elicited a burst of action potentials with a 4 or 5 pA current, and then delivered additional 1 or 2 pA-increments of current at 5 second intervals ( Fig 8D). Once spiking had been induced, subsequent upsteps could also evoke spikes ( Fig 8D). In contrast with the first burst of spikes, these upstep spikes appeared without a delay ( Fig 8D, E, Fig S5D). Thus AWA can faithfully report small stimulus upsteps by firing immediate spike bursts, in a manner dependent on the stimuli history of the cell.

Discussion
Unlike previously-characterized C. elegans neurons, the AWA neuron fires all-or-none calcium-based action potentials. These spikes are reliably elicited by specific current stimuli, and based on indirect calcium measurements, they appear to be elicited by natural odor stimuli as well. The action potentials are mediated by a CaV1 voltage-gated calcium channel, EGL-19, and a Kv1 voltage-gated potassium channel, SHK-1, and their properties are shifted in instructive ways by gain-and loss-of function mutations in these channels.
A delay before the first AWA spike appears to be caused by a slowly-inactivating potassium current. Testing a variety of mutants failed to identify the molecular basis of this current, which may be analogous to "A currents" that cause a first spike delay in other vertebrate and invertebrate neurons (Chu et al., 2003;Dekin and Getting, 1987;Kawaguchi, 1995;Zhao and Wu, 1997). Termination of the burst can be modeled with a slowly activating, high voltage-activated potassium channel, along with inactivation of the EGL-19 channel.
The membrane potential bistability and first-spike delay in AWA provide an elegant solution to the "small-cell limit" problem that has puzzled theorists: for small cells with high impedance, the stochastic opening of a single channel can cause voltage fluctuations that trigger an action potential, which would make firing so irregular that coding schemes based on either firing rate or spike timing are essentially unworkable (Faisal et al., 2005;Lockery and Goodman, 2009;Strassberg and Defelice, 1993). Our data indicates that membrane potential must be depolarized to the plateau state for at least 300 ms for AWA to fire action potentials. This delay far exceeds the open time of most single channels, effectively preventing transient single channel noise from triggering spikes.

Computation and neuronal diversity
The electrophysiological properties of most C. elegans neurons are unknown. Our limited survey enumerated three types of non-spiking neurons and a fourth unexpected spiking neuron, suggesting that additional biophysical diversity awaits discovery in the C. The C. elegans genome encodes 74 predicted potassium channels, a remarkable repertoire for just 302 neurons. Reporter gene data and single-cell RNA sequencing data suggest a considerable diversity in their expression patterns (Cao et al., 2017;Salkoff et al., 2005). At the extreme, each neuronal cell type could express a unique channel composition with unique sensitivity and computing power to suit its function.
EGL-19 and SHK-1 are broadly expressed in C. elegans neurons, so it may be that neurons other than AWA can spike in stimulation regimes that remain to be identified.
Indeed, the spikelets that were reported in an sra-11-expressing C. elegans interneuron resemble those described here in their amplitude and duration (Faumont et al., 2012), and unidentified neurons in the ventral nerve cord of Ascaris nematodes may also spike (Davis and Stretton, 1992).

AWA spiking as a filter of odor stimuli
What information about the odor stimulus is translated into spikes? When C. elegans crawls across a bacterial lawn in a sinusoidal waveform, its undulatory head swings create a natural temporal oscillation in odor concentrations at its nose tip (Kato et al., 2014;Kocabas et al., 2012). We considered that this oscillation might induce phase-locked spiking in AWA, but found that the 0.5 -2 Hz oscillation characteristic of the head swings did not trigger action potentials. Instead, the delay to the first spike may function as a low-pass filter to high frequency fluctuations, including those generated by the worm's own head swings. Slow sustained changes in odor concentration, and the increases caused by the animal's directed locomotion, appear more likely to induce spiking in AWA.
Neuronal firing patterns are typically modeled as either rate codes or temporal codes (Gerstner and Kistler, 2002;Sarpeshkar, 1998). The modest modulation of the spike frequency by stimulus strength (Fig 2J) and our bifurcation model indicate that AWA spiking is most consistent with class 2 excitability based on the Hodgkin classification of isolated crustacean axons (Hodgkin, 1948). Action potentials of this type fire in a narrow frequency band and are relatively insensitive to changes in the stimulus strength, incompatible with a rate-coding scheme (Izhikevich, 2007). Rate coding would also be degraded by the stochastic and self-terminating nature of action potential bursting. Instead, AWA spiking appears most consistent with a filtering function that requires a stimulus of appropriate intensity and duration. The transition between the resting state and plateau state sets the required stimulus intensity, and the first-spike delay serves as an internal time reference signal for tracking stimulus duration. Temporal coding by first-spike delay is also observed in mitral/tufted cells in the mouse olfactory bulb, albeit on a roughly ten-fold faster time scale (Margrie and Schaefer, 2003). After AWA enters the plateau state, small depolarizing inputs spaced a few seconds apart can trigger spikes without a delay. Taking both the bistability and delayed firing features into consideration, we suggest the following: when an animal encounters a suprathreshold attractive odor stimulus for the first time, AWA fires action potentials when the odor stimulus is maintained beyond the first-spike latency, allowing the animal to ignore noisy or transient stimuli. Maintaining AWA membrane potential in the plateau state induces excitability changes that terminate firing, but allow increasing odor concentrations to trigger spikes without delay, enabling odor gradient climbing behavior.
A simulation of C. elegans chemotaxis using an artificial neural circuit for contour tracking found that a hypothetical neural network with a pair of artificial spiking neurons as the primary gradient detector had higher chances of identifying the set-point, and better tracking efficiency, than an equivalent non-spiking network with graded sensory neurons (Santurkar and Rajendran, 2014). Whether action potentials in AWA increase chemotaxis efficiency in real animals remains to be tested by identifying mutations or conditions that selectively disrupt action potentials in AWA. More complicated possibilities can also be explored. For example, in mitral/tufted cells of the mouse olfactory bulb, first-spike latency relative to the start of a sniffing action can encode odor identity (Margrie and Schaefer, 2003). Similarly, it may be informative to ask whether different odors induce AWA action potentials with different spiking thresholds or temporal features.
The identification of spiking neurons marks a shift in our conception of information processing in C. elegans. Understanding the transition from single-neuron to population dynamics is the next step in assessing the significance of AWA spiking. Global brain dynamics, in which groups of neurons exhibit coordinated activities, are associated with behavioral states in C. elegans (Kato et al., 2015). Future experiments should reveal the roles that spiking neurons play in dynamic network activity and its global state transitions.

Nematode growth
All strains were maintained at room temperature (22-23°C) on nematode growth medium (NGM) plates, seeded with E. coli OP50 bacteria as a food source (Brenner, 1974). Wildtype animals were the Bristol strain N2. A complete strain list is provided in Table S1.

Electrophysiology
Electrophysiological recording was performed largely as previously described (Goodman et al., 1998;Liu et al., 2009). Briefly, an adult animal was immobilized on a Sylgard-coated Heka,) using PatchMaster software (Heka). Two-stage capacitive compensation was optimized at rest, and series resistance was compensated to 50%. Analog data were filtered at 2 kHz and digitized at 10 kHz or 50 kHz. As the quality control, only those patch-clamps with seal resistance above 1 GOhm and uncompensated series resistance below 100 MOhm were accepted for further analysis (seal resistance ranged from 1 to 9 GOhm and series resistance ranged from 20 to 60 MOhm for most accepted recordings). To ensure reliable spiking induction, a short -10 pA hyperpolarizing pre-pulse was added to each current injection step in the stimulation protocol in many experiments (e.g. Fig S1C).

Recording solutions
The

Simultaneous electrophysiology and calcium imaging
The electrophysiology recording setup was as described above. GCaMP fluorescence was captured with a CoolSNAP HQ2 Camera (Photometrics) controlled by MetaMorph software.
The onset of imaging acquisition and electrophysiology recording was synchronized by a TTL signal sent through Patchmaster. Illumination was a SpectraX Lumencor solid-state light source. Patch-clamping was performed under DIC illumination, and the sample was switched to GFP illumination once a whole-cell recording configuration was formed to start simultaneous recording. Imaging was set at 20 MHz, binning at 2 and 50 fps. Tiff imaging stacks were analyzed using MetaMorph by drawing circles around the areas of interest (cell body or axon segment) and measuring average intensity for each frame. Time sequence of membrane voltage and fluorescence intensity measurements were then aligned by time 0 and plotted (Fig 7A-E).

Spike detection and analysis
Action potential spikes for averaging and measurement were identified using a customized spike-detection algorithm written in Python. For the calculation of the average upstroke, downstroke, spike shape, spike timing distributions, and other statistics, action potentials were identified automatically in the data using a moving window and two threshold criteria for the rising and falling slope of the potential. The thresholds and the width of the window were tuned by hand on representative data, shown in Fig S6 and S7.
A burst was defined as two or more spikes fired within 2 s. Spiking frequency was calculated by taking the reciprocal of the averaged spike intervals for each burst. Since most action potentials in shk-1 are well-separated from one another, no distinctions were made between single spikes and spikes in bursts. All verified spikes were used for analysis in Fig 4D.

Statistics and graphing
Statistics, curve fitting and graphing were conducted using OriginPro (OriginLab). I-V relationships were measured using Fitmaster (HEKA) and exported to OriginPro.
Electrophysiological recording traces shown in all figures were re-sampled at 2.5kHz by averaging adjacent data points for reducing file size.

Odor-evoked calcium imaging and data analysis
Odor-evoked calcium imaging experiments were performed on young adult N2 or shk-1(ok1581) animals. GCaMP6f, chosen for its fast calcium dissociation kinetics (Chen et al., 2013), was codon-optimized and expressed in the AWA neuron under the gpa-6 promoter (pMD3 = gpa-6P::GCaMP6f). Calcium dynamics of the AWA cell body and axon were imaged using single-animal microfluidics recording chambers (Chronis et al., 2007) connected to reservoirs of S Basal buffer and freshly prepared 1.15 µM diacetyl (Sigma D3634) in S Basal. Switching between buffer and diacetyl was achieved using a solenoid valve controlled by Metamorph software, as previously described (Chronis et al., 2007).
Well-fed animals were paralyzed with 1 mM (-)-tetramisole hydrochloride (Sigma L9756) for 10 minutes before being loaded into the chamber. Two 5 second diacetyl pulses, separated by 5 minutes, were recorded per animal for a total of 40 N2 videos and 56 shk-1 videos.
Videos were recorded at 100 fps under continuous 484-492 nm light through a 40X 1.3 NA Zeiss Plan-APOCHROMAT objective on a Zeiss Axiovert 100TV microscope. An Andor iXon+ DU-987 EMCCD camera and Metamorph software were used for image acquisition.
The fluorescence values were extracted from each TIFF stack using ImageJ software. The mean value of 1 s baseline fluorescence before the onset of diacetyl pulse was used as F0.
ΔF was calculated as F-F0 and all imaging graphs were plotted as ΔF/ F0.

Filtering and spike identification
To identify action potentials in AWA GCaMP time courses, we deconvolved the fluorescence data by a decaying exponential kernel with a 1 second time constant and smoothed the result by averaging over a 200 millisecond moving window. Spikes were then identified using the method described above, with thresholds tuned to give correct results on the ground truth data when GCaMP fluorescence and membrane potential were measured simultaneously (see Fig 7). The data was normalized to a scale of zero to one for spike detection, but for plotting the original fluorescence scale is restored. The units represent a change in fluorescence intensity above baseline, and show that the detected spikes in shk-1 are larger than in wild type.

Modeling and simulation of AWA spikes
The dynamics of the membrane potential, , are governed by an equation of the form where C is the membrane capacitance, and the terms on the right represent leak current, calcium current, potassium current, and input current, respectively. The leak current is given by Ohm's law: L = L ( − L ). We began by modeling the SHK-1 potassium channel and the EGL-19 calcium channel. The SHK-1 potassium current is given by where ! is the overall conductance (fit from the voltage clamp data in Fig 5F), ! is the potassium reversal potential (set to the usual value of -84 mV), and is a gating variable whose dynamics are described by the equations where ! is a characteristic time scale fit from the voltage clamp dynamics in Fig 5F,  The EGL-19 calcium channel was modeled in a similar fashion. The steady-state function of the gating variable was represented as a product of two sigmoid functions of the form ! to reflect the opening and subsequent closing of the channel as membrane potential increases. A simulation of these two channels alone with a realistic leak current (estimated from the IV curve in Fig 1C) and all other parameters fit directly from the voltage clamp data in Fig 5 shows spontaneously generated action potential spikes, lending credence to the hypothesis that EGL-19 and SHK-1 are the primary channels responsible for shaping the action potentials in AWA. To fit the high inward current evident in the IV curve at higher membrane potentials (Fig 1C), we added two channels with threshold voltages and slopes similar to those measured for the SLO-1/SLO-2 channels, but the model required a higher conductance than was measured, suggesting that additional potassium channels open at depolarized membrane potentials. The threshold voltages and slopes were modified slightly to give a better fit to the whole cell I-V curve ( Fig 1C). Finally, we added an inwardly-rectifying potassium channel with a conductance tuned to match the resting potential in AWA (about -75 mV). This model predicts tonic spiking in a small range of input currents from about 12 to 16 pA, only slightly larger than the values of current input that elicit bursts of spikes in AWA.
We also modeled self-inactivation of the calcium channels, as observed in the voltage clamp data taken in the presence of K-channel inhibitors (Fig 5B). This was accomplished by allowing the calcium channel to have two states, with the second state having a lower conductance than the first by a factor f. The correct conductances were estimated by fitting a sigmoidal function plus a linear leak to the I-V curves in Fig 5B and taking the difference. The time scale of inactivation was voltage-dependent and fit by matching the relaxation times of the curves in Fig 5A. To model the bursting structure of action potentials in AWA, we added two potassium channels, one with a slowly inactivating current (which we call Kr), and one with a slowly activating current (which we call Kr a ). These channels together represent the slowly modulated Kr currents that gate the initiation and termination of spiking. To determine the properties of these channels, we first calculated the bifurcation diagram of the model without the Kr and Kr a current, and then added an unknown potassium conductance in the form of an additional term of the form K ( − K ). We used numerical continuation in the PyDSTool package (Clewley, 2012) to find the line of Hopf bifurcations in the I-g K plane. The results ( Fig S4B) show that spiking is possible in a bounded tongue-shaped region. We tuned the threshold and conductance of the Kr channel such that, for realistic values of the input current, the slow inactivation of Kr caused g K to drop into the spiking region after about 1 second, initiating a burst. The corresponding parameters for the Kr a channel were tuned so that the slow activation of Kr a caused g K to rise out of the spiking region, terminating the burst after a realistic number of spikes (2-5, see Fig 6B). To match the length of bursting at different input currents, we allowed the activation time of the Kr a channel to depend on voltage, such that activation occurred more quickly at higher potentials. The path of potassium conductance values at different input currents (Fig S4C) was also designed to give reasonable spiking amplitudes across the range of allowed inputs (see Fig S4B). The earlier onset time and slightly higher frequency of bursting arise naturally from these elements. The potassium conductances in Fig S4C are computed from a fully deterministic equation, and they actually fall outside the allowed spiking region. This occurs because the addition of noise blurs out the bifurcation boundary, so that spiking will occur outside of the region where it is allowed deterministically.
We accounted for noise using a hybrid algorithm in which opening of the calcium and Kr channels was stochastic, while other components were simulated with the deterministic equations. The opening or closing of a calcium/Kr channel was treated as a Poisson process with average rate given by the deterministic equation, and reasonable noise effects were obtained for 1000 calcium channels and 500 of each Kr channel per cell. The shk-1 mutant was simulated with 2500 of each Kr channel, due to the increased potassium conductance. A representative example is shown in Fig 6B. The model qualitatively predicted the shk-1 mutant phenotype by setting the SHK-1 conductance to zero and increasing the conductance of the "SLO-like" and Kr channels (Fig 6C). The model also showed reasonable agreement with the measured shapes of action potentials in N2 and shk-1 animals and the timing and length of action potentials bursts (Fig 6C-D).
There are a few notable discrepancies between the model and the data. The agreement between the spike shape in the model and in the N2 data is reasonably good, but the spike amplitude is smaller in the shk-1 version of the model than in the shk-1 data.
The values of the input current at which spiking occurs are somewhat higher in the model than in AWA. It is likely that additional channels in AWA affect its dynamics. More interestingly, the bifurcation structure in AWA appears slightly different than in the model. In AWA, the spike amplitude typically increases over the course of a burst, in the model the opposite is true --the amplitude of spikes decreases as potassium conductance ! increases. The model would therefore fit the amplitude data if a burst were initiated by an increasing potassium current crossing into the spiking region from below. However, this would be inconsistent with the curves shown in Fig 6A. The model reproduces the qualitative features of AWA dynamics. In particular, the model shows delayed transient bursts of action potentials in a narrow range of input currents. We also simulated the model in the presence of linearly increasing and sinusoidally varying input currents (see experimental data in Fig 8) and obtained small bursts of spikes for low-frequency sinusoidal input and delayed bursts in response to current ramps of varying slope (simulations in Fig S4D-E).
The equations describing the calcium and potassium current are below. These together with the equations in the first paragraph of this section constitute the full model.
The parameter values used are in Table S4. In cases where a parameter is changed between the N2 and shk-1 versions of the model, both values are shown.
Calcium current: Potassium current:    Fig 2B), unc-2 (n = 13), cca-1 (n = 18), nca-1; nca-2 (n = 24) and osm-9 (n = 55) AWAs. H. Representative current-clamp traces recorded from osm-9 AWA. AWA spikes in calcium substitution experiments and in osm-9 mutants are significantly different from WT (Table S3).   A. WT membrane potential traces (same trace as Fig 2A) showing the time dependent dynamics when action potentials fired (magenta trace) or did not fire (green trace). The voltage-dependent time course of the depolarization following the initial partial spike was well fitted with an exponential decay function (red dotted fitting curves), indicating a fastactivating and slow-inactivating K channel (Kr). The slow repolarizations (green dotted fitting curves) following the blunt peak were also well fitted with an exponential decay function and were not seen in 0 mM [Ca 2+ ] o (Fig 3C), suggesting that they are likely due to calcium-  and G were identified with the spike detection algorithm for identifying action potential spikes in WT ( Fig S6) and shk-1 (Fig S7) AWAs, respectively.  Table S1. Strain list Strain Genotype Comment Figure  CX3262 kyIs37[odr-10::GFP] AWA:: GFP  Fig 1-6    upper trace is an AWA recording from a shk-1; shl-1 mutant. The first 4 pA step induced a single spike with a ~2 s delay and several subsequent 2 pA steps induced single instantaneous spikes. The middle trace is an AWA recording from a shk-1; slo-2 mutants.

Supplemental materials Four supplementary tables, seven supplementary figures, and legends
The first 4 pA step did not induce action potentials or depolarize AWA's membrane potential sufficiently to reach the plateau state. The second 2 pA step induced a single spike with a ~2 s delay, while the AHP brought the membrane potential back to the resting state. The third 2 pA step induced another spike with a delay and maintained the membrane potential at the plateau state. The last two steps induced spikes without delays. Lower panel: spike time distribution of all spikes recorded in AWA from strains with shk-1 mutations under the 5step current injection protocol. Several single and double mutants strains with shk-1 mutations were pooled together for this analysis; action potentials in AWA behave similarly in those strains (Fig 4H and Fig S3B). Bin size is 50 ms. 1st step: n = 32; 2nd step: n = 39; 3rd step: n = 35; 4th step: n = 8; 5th step: n = 2. Blue dotted lines indicate the onset of each upstep. The unusual firing pattern shown in the middle panel is not included. In all other cases, the first step induced action potential spikes with variable delays, and subsequent upsteps induced spikes from the plateau state without delays.
Supplemental Figure 6. All algorithm-detected WT action potential spikes used for analysis.
All action potential spikes identified by our spike-detection algorithm from WT AWA recordings. Y axis: voltage (V). X axis: time (s). Figure 7. All algorithm-detected shk-1 action potential spikes used for analysis.

Supplemental
All action potential spikes identified by our spike-detection algorithm from shk-1 AWA recordings. Y axis: voltage (V). X axis: time (s).