95
views
0
recommends
+1 Recommend
1 collections
    0
    shares
      • Record: found
      • Abstract: found
      • Article: found
      Is Open Access

      Bonsai: an event-based framework for processing and controlling data streams

      research-article

      Read this article at

      ScienceOpenPublisherPMC
      Bookmark
          There is no author summary for this article yet. Authors can add summaries to their articles on ScienceOpen to make them more accessible to a non-specialist audience.

          Abstract

          The design of modern scientific experiments requires the control and monitoring of many different data streams. However, the serial execution of programming instructions in a computer makes it a challenge to develop software that can deal with the asynchronous, parallel nature of scientific data. Here we present Bonsai, a modular, high-performance, open-source visual programming framework for the acquisition and online processing of data streams. We describe Bonsai's core principles and architecture and demonstrate how it allows for the rapid and flexible prototyping of integrated experimental designs in neuroscience. We specifically highlight some applications that require the combination of many different hardware and software components, including video tracking of behavior, electrophysiology and closed-loop control of stimulation.

          Related collections

          Most cited references23

          • Record: found
          • Abstract: not found
          • Article: not found

          Automatic generation and detection of highly reliable fiducial markers under occlusion

            Bookmark
            • Record: found
            • Abstract: found
            • Article: found
            Is Open Access

            Automated monitoring and quantitative analysis of feeding behaviour in Drosophila

            Feeding is an essential component of an animal’s behavioural repertoire and forms a mechanistic link between physiology and behaviour1. Fruit flies (Drosophila melanogaster) have emerged as a powerful model to study the neuronal and molecular mechanisms underlying feeding behaviour2 3 4 5 6 7 8, but it remains challenging to quantify feeding in these tiny insects, due to the minute quantities of food they ingest. Most current methods rely either on manual scoring of proboscis extensions9, post hoc quantification of the ingested food using colourants10 or radioactive substances11 or measurement of the volumetric change of food ingested from a capillary5. Although widely employed, these methods have several limitations. For example, they do not provide the sensitivity to monitor food intake by individual animals over time, they force the animals to feed from specialized devices in restricted positions, or they require the addition of dyes or radioactive labels. These drawbacks limit the feasibility of high throughput, unbiased studies of feeding as well as the identification of important behavioural parameters controlling food selection and intake. In rodents12 13, humans14 and insects15, the microstructure of ‘meals’ has been very valuable in providing insights into how hunger and satiation regulate homeostasis. Advancing our understanding of homeostasis in flies would benefit from a method that provides sufficient sensitivity and temporal resolution to quantify each ingestion event. In recent years, several automated and quantitative approaches have emerged to monitor and analyse behaviour based on machine vision16 17. Because of the limitations of digital cameras, it is difficult to resolve the fine details of an animal’s physical interactions with small objects, such as morsels of food, especially if the system is optimized to track the animal over many body lengths. An alternative strategy for detecting fine-scale interactions between an animal and other objects is to measure changes in capacitance or resistance. Such methods have been used previously to quantify feeding behaviour in immobilized aphids18 19 and larger insects20, but advances in digital electronics now permit this approach to be modified in a way that is compatible with greater temporal resolution, higher throughput and freely behaving animals, thereby leveraging the advantages of a genetic model organisms. We have developed an automated, high-resolution behavioural monitoring system called flyPAD (fly Proboscis and Activity Detector), that uses capacitive-based measurements to detect the physical interaction of individual Drosophila with food. To validate the accuracy of the flyPAD system, we adapted bioluminescent techniques to measure the intake of very small amounts of food as well as the dynamics of food absorption in single flies. We show that feeding from a non-liquid food induces a pattern of highly stereotyped rhythmic proboscis extensions and retractions that is suggestive of an underlying central pattern generator (CPG) controlling the feeding motor programme. The analysis of ingestion dynamics and the microstructure of meals allowed us to dissect the behavioural elements mediating the homeostatic response of the fly to starvation and satiation. These results uncover several similarities with rodents and humans, highlighting a potential conservation of strategies that regulate food intake across phyla. Results Hardware overview To overcome the challenge of reliably detecting and measuring physical interactions of Drosophila with substrates such as food, we developed a method based on capacitive proximity sensors. Such sensors are based on the principle of measuring the capacitance across two electrodes. We designed a sensor so that an animal standing on one electrode (electrode 1) would be in close proximity to food placed on the other electrode (electrode 2; Fig. 1a). Whenever a fly touches the food with its proboscis or leg, it alters the dielectric constant between the two electrodes creating a change in capacitance that is large enough to be detected. We designed our system using the AD7150 (Analog Devices) ultra-low power capacitance-to-digital converter. This device allows two-channel recording at 100 Hz with a sensitivity of 1 fF. To make the measurement system compact, reproducible and scalable, we designed a printed circuit board (PCB) containing the capacitance-to-digital converter and a connector that carries the digitized capacitance signal via an I2C interface (Fig. 1b). Both the arena enclosing the fly as well as a lid were fabricated from acrylic sheets using a laser cutter and fixed on the PCB. The result is a modular arena equipped with two touch sensors, permitting experiments using a single fly with two different food sources. To allow for high-throughput recordings, we implemented an I2C multiplexing board on a Field Programmable Gate Array (FPGA). The resulting system can simultaneously acquire the data from 32 independent behavioural arenas and stream the data to a computer via USB interface (Fig. 1c). Multiple systems can be connected to a single computer, further increasing the throughput of the system. To ground truth, the electrical signals from our device, we simultaneously monitored the behaviour of flies in the arena using a digital video camera in a series of preliminary experiments (for an example, see Supplementary Video 1). The contact of the fly with the food elicited an immediate increase in the capacitance signal, several orders of magnitude above the background noise of the sensor (Fig. 1d). The signal displayed multiple features such as rhythmic changes that appeared to be related to the interaction of the fly with the food. Automatic annotation of feeding behaviour Direct comparisons with videos suggested that whenever a fly came into contact with the food we could detect rapid changes in the amplitude of the signal for as long as the fly was active (Figs 1d and 2a, top graph). To extract these periods of activity, we calculated the root mean square (RMS) of the signal in consecutive 500 ms windows (Fig. 2a, middle graph). By simply thresholding this signal, it was possible to reliably extract the bouts of activity, during which the fly was interacting with the food (Fig. 2a, grey shading in bottom graph). Furthermore, on closer inspection of the videos, we noticed that flies rhythmically extended and retracted their proboscis on the food. This behaviour was reflected in a highly rhythmic, square wave-like pattern in the capacitance signal (Figs 1d and 2b and Supplementary Video 1). On the basis of the hypothesis that this motor pattern might correspond to rhythmic feeding, we designed an algorithm to extract putative ‘sips’ based on the shape of the signal (Fig. 2b, for further details see Methods). The algorithm identifies the exact moments when a sip begins (contact of the proboscis with the food) and ends (detachment of the proboscis from the food), as well as inter-sip intervals (ISIs; Fig. 2b, lower graph). To validate the accuracy of our feeding detection algorithm, we captured and manually annotated high-resolution videos from flies interacting with the food on the capacitance sensor. The number of proboscis contacts detected by manual annotation was significantly correlated with the number of sips detected by our algorithm (Fig. 2c). A comparison of the ethograms generated by manual annotation with the results of our automated method further confirmed the accuracy of our approach. The algorithm detected 92.5% of the sips tabulated via manual scoring, while missing 7.5% and generating 7.5% false sips (Fig. 2d). These data demonstrate that our method for detecting sips is sufficiently accurate to be used for automatic monitoring of feeding behaviour. Sips mediate food ingestion Although our method can reliably detect individual proboscis interactions with food (sips), it may not accurately report the actual volume that flies consume, because some proboscis extension events might represent non-ingestive sampling of the food. To test whether the automatically detected sips were correlated with actual ingestion, we developed a method for monitoring food intake in individual flies while they fed on the flyPAD. Because existing methods do not have the sensitivity required to measure food intake in real time in individual flies4, we exploited the capacity of the firefly enzyme luciferase to emit photons (bioluminescence) on its reconstitution with its cofactor D-luciferin21. It has been previously demonstrated that D-luciferin can be fed to flies and is subsequently absorbed by the nervous system22. Thus, photon counts generated by neuronally expressed luciferase should be temporally correlated with the intake of food mixed with D-luciferin (Fig. 3a). To be able to detect photons in intact flies, we used the strong pan-neuronal Gal4 line nSyb-Gal4 to drive high levels of luciferase expression in the nervous system. On each bout of sips, we observed an increase in photon counts suggestive of food intake (Fig. 3b,c). Furthermore, we observed that the photon count starts increasing as quickly as 10–20 s after the first sip (Fig. 3c). This short delay might underlie the brief latencies previously reported for the action of metabolically active sugars in flies in appetitive conditioning23 as well as classic flight studies24. This method, therefore, offers new opportunities for measuring the dynamics of nutrient absorption and nutrient availability in various tissues or cell types in the fly. Despite the advantages provided by this luciferase method, we found it difficult to quantify the exact volume of food consumed by the fly during each sip. Hence, we developed an additional assay to measure small volumes of food ingested by single flies feeding on the flyPAD. In this protocol, single flies are allowed to feed in the flyPAD from food containing D-luciferin. After the flyPAD measurement, flies are homogenized and, on addition of recombinant luciferase, the amount of light emitted is measured using a luminometer (Fig. 3d). The advantages of this method are that it does not require the use of luciferase-expressing transgenic animals and that the high signal-to-noise ratio of the bioluminescent signal permits the detection of very small quantities of ingested food. Comparing three different features of the capacitive signal extracted using the flyPAD (number of activity bouts, total duration of activity bouts, and number of sips) with the measured food intake allowed us to define the extent to which they correlate (Fig. 3e). All three behavioural metrics were correlated with ingestion; however, the degree of correlation varied. Whereas the number of activity bouts, which represent how often an animal approaches the food (Fig. 2a), has a significant but weak correlation with the ingested volume (Fig. 3e, left graph), the total duration of all activity bouts (Fig. 3e, middle graph) correlates much more strongly with food intake, as does the number of sips (Fig. 3e, right graph). The sensitivity of this method allowed us to estimate the median volume of food that flies consume per sip to be 1.05 nl (0.72 to 1.35, 95% confidence interval). These results validate the use of the flyPAD to extract the dynamics of feeding and food intake in single flies. To demonstrate the potential applications of the flyPAD device, we next provide several examples of its use to analyse food choice, feeding motor programs and nutritional homeostasis. flyPAD allows the study of the dynamics of food choice The ability of flies to choose among foods of different qualities underlies nutrient balancing2 and is an important experimental paradigm for uncovering the molecular and neuronal basis of gustation in Drosophila 10 25 26 27. When given the choice between 1 and 5 mM sucrose in the flyPAD arena, flies strongly preferred to feed from the 5 mM sucrose source (Fig. 4a), as had been observed previously using the colour assay25. The ability to calculate the preference index for individual flies (Fig. 4a, right side) permits the use of clonal genetic manipulations to study food choice28. Another parameter that strongly affects the throughput of behavioural assays is the length of each trial. Standard food choice assays are normally performed over 2 h (ref. 2). The cumulative plot of the preference index shows that after 10 min, the preference index plateaus at the level observed at the end of a 50 min assay (Fig. 4b). This suggests that using flyPAD makes it possible to drastically shorten the trial length required to make meaningful measurement of food preference. In addition, the dynamic readout of feeding provided by flyPAD permits investigation of the behavioural mechanisms underlying feeding decisions. In the case of the high- versus low-sucrose paradigm, flies continued visiting the food with the lower sucrose concentration, as visualized by a steady increase in the sip count (Fig. 4c). This indicates that flies did not focus exclusively on one resource, but rather continued to sample from both. The flyPAD is therefore well suited to study food choice, opening new possibilities for studying feeding decisions at a mechanistic level in Drosophila. Feeding is mediated by a stable, rhythmic motor programme In humans and rodents, motor programmes underlying food ingestion such as licking, mastication and swallowing are highly rhythmic and are controlled by CPGs located in the brainstem29 30 31. The high temporal resolution of our system allowed us to closely analyse the structure of feeding motor patterns in flies. Similar to rodents and humans, feeding flies exhibited a highly rhythmic motor pattern, with most sips having a length of 0.13 s and an ISI of 0.08 s when eating yeast (Fig. 5a,b). We then tested whether either the pattern or durations of sips were modulated by the content of the food or by the internal metabolic state of the animal. We starved flies for different periods of time (0, 4 and 8 h) and then tested them on the flyPAD with a 10% sucrose gel. The durations of sips were slightly, but significantly, longer on sucrose when compared with yeast (0.16 versus 0.13 s, P=0.019, Wilcoxon Rank-Sum test) (Fig. 5a,c). Furthermore, the sip durations on sucrose were more variable than on yeast as evidenced by the broader distribution of the histogram. ISIs, however, were not significantly altered by the content of the food (0.07 versus 0.08 s, P=0.18, Wilcoxon Rank-Sum test) (Fig. 5b,d). Animals homeostatically compensate for a lack of energy by increasing their food intake following starvation. However, flies might alter their feeding motor programme in two basic ways to increase food consumption: they could increase the duration of sips (corresponding to an increase in food intake per sip) or shorten the ISIs (corresponding to an increase in the feeding rate or vigour of eating). Similar to licks in rodents32, we found that flies maintain both the duration of sips (Fig. 5c) and the ISIs (Fig. 5d) constant on deprivation (P=0.078 for sip duration and P=0.35 for ISI, Kruskal–Wallis one way analysis of variance). Therefore, the feeding motor programme of Drosophila consists of a highly rhythmic proboscis extension and retraction cycle suggestive of an underlying CPG. This pattern is not altered substantially by changes in the internal hunger state of the animal, but does partially adapt to the nature of the food. The microstructure of feeding reveals homeostatic strategies If the motor programme underlying feeding is not modified following starvation, how does a hungry fly modify feeding to achieve homeostasis? In rodents, meals are organized in ‘bursts’ of licking13, and an increase in feeding following starvation is achieved mainly by reducing the interval between bursts33 34. To dissect the behavioural strategies leading to increases in food intake following starvation in Drosophila, we analysed changes in the microstructure of meals. On the basis of criteria established for rat licking behaviour13, we defined a feeding burst as three or more consecutive sips separated by inter-burst intervals (IBIs) smaller than double the median ISI (Fig. 6a). In fully fed flies, sips were organized into bursts consisting of an average of 5.8 sips (Fig. 6b). Whereas the length of the feeding bursts was not significantly altered after 4 h of starvation, 8 h of starvation led to a significant increase in the number of sips per feeding burst (average of 8.3 sips). In contrast to feeding bursts, just 4 h of starvation led to a significant shortening of the IBI from 78 to 29 s (Fig. 6c). Additional starvation (8 h) did not cause a further decrease in IBI. The dissociable effects of starvation time on the duration of feeding bursts and IBI suggest that flies use distinct strategies to adapt to short and medium lengths of starvation. After a short period of starvation, the fly is active on the food for longer periods (Fig. 6d) and shortens the intervals between feeding bursts (Fig. 6c). On longer starvation times, the fly also increases the length of the feeding bursts (Fig. 6b,k). Whereas hunger increases food intake to compensate for the lack of nutrients, satiation regulates the length of a meal by inducing its termination. The effect of satiation is reflected in the reduction of the slope in the cumulative number of sips (Fig. 6e). To quantify how the three microstructure parameters change as the animal becomes satiated, we calculated how each changed during a meal (Fig. 6f–h). We performed these calculations for the flies starved for 8 h, because the satiation effect is the strongest (Fig. 6e). As expected, over the duration of the meal all parameters reverted to values approximating the situation in fully fed flies. The number of sips per burst only significantly changed at the end of the meal, from 8.5 sips per burst at the beginning to 5.2 sips per burst at the end of the experiment (Fig. 6f). A significant change in the length of the IBI and the duration of activity bouts is already detected within about 10 min after the start of a trial (Fig. 6g,h). The modulation of these feeding parameters during the meal ultimately leads to its termination (Fig. 6e). The initial rate of feeding can be used as a bona fide measurement of the motivation to feed. The deceleration of food intake, on the other hand, can be used as readout for the strength of the satiation signal leading to the termination of a meal14 35. Satiation is difficult to measure in Drosophila, so we used an approach employed in human feeding research and fitted a quadratic equation35 to the cumulative feeding curves of every individual fly and extracted the linear and the quadratic coefficients from the fitted curves (Supplementary Fig. 1). As expected, the linear coefficients (which in vertebrates is a proxy for the motivation to feed) increases following starvation (Fig. 6i)14. Likewise, the quadratic coefficient (which is thought to represent the strength of the satiation signal) decreases significantly following starvation (Fig. 6j)14. These results indicate that in flies, as in humans, the linear and the quadratic coefficients are good readouts for the drive-to-eat and the satiation signals. Discussion We use a new device based on capacitive sensing to study the interaction of Drosophila melanogaster with food. This has allowed us to study feeding behaviour at a temporal resolution of 100 samples per second and with
              Bookmark
              • Record: found
              • Abstract: found
              • Article: found
              Is Open Access

              Balanced activity in basal ganglia projection pathways is critical for contraversive movements

              The control of contraversive movement by each brain hemisphere has been extensively studied in neurological patients1 2. Single hemisphere lesions of the dorsal striatum abolish contraversive movements and bias towards ipsiversive movements3 4 5, while unilateral stimulation of the dorsal striatum induces contraversive movements6 7. The striatum projects to downstream nuclei through two main circuits, the so-called direct and indirect pathways, which arise from striatonigral and striatopallidal medium spiny projection neurons8. Several models have been proposed postulating how these different basal ganglia pathways could control movement. Some models postulate that these pathways have opposing effects on the output of the basal ganglia9 10 11 and movement12 13 14, while others say that co-activation of both pathways is necessary for movement15 16 17 18. Recent studies revealed concurrent unilateral activation of both striatonigral and striatopallidal neurons when animals perform contraversive movements in an operant task16. However, other studies have shown that lesion14 18 19 or stimulation of each cell type can have opposite effects on contraversive movements12 13. Here we used a fibre-optic-based method and the genetically encoded calcium indicator GCaMP6s to measure the activity of striatonigral and striatopallidal neurons during spontaneous contraversive and ipsiversive movements. Furthermore, we used optogenetics to selectively inhibit (or activate) either or both striatal projection pathways unilaterally, and assess their role in contraversive and ipsiversive movements. We observed that both striatonigral and striatopallidal neurons showed an increase in activity during spontaneous contraversive movements, and that inhibiting either or both striatal pathways unilaterally impaired contraversive movements and biased the animals to perform ipsilateral turns. Furthermore, we observed that simultaneous activation of both striatal projection pathways produced contraversive movements. Finally, we also show that activation or inhibition manipulations that caused a strong imbalance of activity between the striatal projection pathways can result in opposing movements being driven by each pathway. Results Striatal activity during spontaneous contraversive movements To monitor the activity of the striatonigral and striatopallidal neurons during spontaneous contraversive movements we expressed GCaMP6s specifically in each cell type. We used this by injecting viruses that express GCaMP6s in a Cre-dependent manner (Flex, AAV2/1, see Methods) into the dorsal striatum of mice expressing Cre in either striatonigral (D1 Cre mice—EY217) or striatopallidal neurons (A2A Cre mice—KG139)16 20. To monitor bulk fluorescence of GCaMP during activity of a specific cell population we implanted fibre optics into the dorsal part of the striatum, and coupled these fibres with a detection system using a photomultiplier (PMT) (see methods and Fig. 1a). After 3–4 weeks (for GCaMP6s to express), we placed animals into a novel arena (a novel cage similar to the home cage) and monitored their behaviour using video and changes in GCaMP6s fluorescence using the system described above (Fig. 1a). We used a custom-made software platform (see Methods) to perform online tracking of the body of the animals, and offline analysis to identify spontaneous ipsi or contraversive movements (Fig. 1c,f). We observed that both striatonigral and striatopallidal neurons showed an increase in activity during spontaneous contraversive movements (481 trials for contralateral turns from 4 D1-Cre hemispheres infected with GCaMP6s, P 0.05 against baseline and also left versus right stimulation; n=6, D2/A2A ArchT versus D2/A2A eYFP, Kruskal–Wallis, P 0.05). Furthermore, simultaneous inhibition of both striatonigral and striatopallidal neurons unilaterally resulted in ipsiversive turning (both group and interaction effects when compared with RGS9L-eYFP controls, F time =42.48; F group=17.7 F interaction time × group=16.22; P 0.05, Fig. 1j,k: RGS9L-ArchT GFP versus RGS9L-eYFP, Kruskal–Wallis, P 0.05; Fig. 4a,b). Similarly, inhibition of striatopallidal neurons decreased contralateral turns (D2 Cre ArchT-contra off light: −5±5 cumulative degrees to the contralateral side, n=81 trials, versus D2 Cre ArchT-contra on light: 18±5 cumulative degrees to the ipsilateral side, n=89 trials, Kruskal–Wallis, P 0.05, Fig. 4c,d). These data show that inhibition of either striatonigral and striatopallidal neurons impedes contralateral turns (when neurons from both pathways are activated) but did not further bias ipsilateral turns (when neurons from both pathways are not activated and even decrease activity), indicating that activity of each projection pathway is necessary for contralateral turning, but inhibition of an individual pathway is not sufficient to bias further ipsilateral turns. We next examined the effect of inhibiting both striatonigral and striatopallidal neurons simultaneously. Inhibition of both projection pathways impeded contralateral rotations and further biased ipsilateral rotations (RGS9L Cre ArchT-ipsi off light: −4±5 cumulative degrees to the ipsilateral side, n=86 trials, versus RGS9L Cre ArchT-ipsi on light: 43±5 cumulative degrees to the ipsilateral side, n=100 trials, Kruskal–Wallis, P>0.05. RGS9L Cre ArchT-contra off light: 4±4 cumulative degrees to the ipsilateral side, n=105 trials, versus RGS9L Cre ArchT-contra on light: 39±5 cumulative degrees to the ipsilateral side, n=92 trials, Kruskal–Wallis, P>0.05, Fig. 4e,f). These data show that activity in either striatonigral or striatopallidal neurons is necessary for contralateral turns, but inhibition of an individual cell type is not sufficient to further bias ipsilateral turns; only when both striatonigral and striatopallidal neurons are simultaneously inhibited unilaterally can ipsilateral turns be further biased (consistent with Fig. 1 and with ref. 16). Striatal activity biases head movements The results presented so far suggest that although we only manipulate a few thousand neurons in sensorimotor striatum, this affects whole body movements. However, as our optogenetic manipulations were targeting areas in the striatum receiving input from head areas of motor cortex25 we decided to investigate whether our manipulations affected contraversive movements of the head in relation to the body axis. To assess contraversive and ipsiversive movements of the head in relation to the longitudinal body axis during stimulation we analysed angle of the head and of the body independently (and subtracted whole body turning, see Methods and Fig. 5a). These analyses revealed that inhibition of both striatonigral and striatopallidal neurons produced ipsiversive head movements (comparing 1 s before light onset versus a 1-s sliding window after inhibition; Kruskal–Wallis, P 3:1) were used for further analyses. At the end of recording, cells were resorted using an offline sorting algorithm (Offline Sorter, Plexon Inc.) to isolate single units and together with the timestamps of the light stimulation provided by a pulse generator (Master 8, AMPI) were exported to MATLAB to perform analyses (see Supplementary Fig. 2). To determine the volume of ArchT-positive neurons that can be effectively photostimulated to induce inhibition of spikes in neurons, we estimated the brain volume in which the light intensity achieved is greater than ~9.2 mW × mm−2 (threshold determined as the minimum intensity to modulate the spiking of striatal cells recorded in the slice). From experimental data measuring the light through striatal tissue we estimated that after passing through 100 μm of striatal tissue, total transmitted light power was reduced by 50%, and by 90% at 1 mm (Supplementary Fig. 1c,f). The data was fit by a Kubelka–Munk model for diffuse scattering media35, with best-fit values for the scattering coefficient of 12.0 and 9.0 mm−1 for 473 nm and 561 light in the striatal mouse tissue. In addition to loss of light from scattering and absorption, light intensity also decreases as a result of the conical spreading of light after it exits the optical fibre. The light exiting the multimode fibre is not collimated and spreads with a conical angle of 41° determined by the numerical aperture of 0.48 used in the case of ArchT and 18° as determined by the numerical aperture of 0.22 used for ChR2. This effect will reduce the light intensity, which is expected to be the relevant quantitative parameter determining efficacy of ArchT or ChR2 stimulation. We therefore calculated the effective intensity, taking into account the combined effects of scattering, absorption and conical spread (Supplementary Fig. 1d,g). These calculations allowed us to estimate the expected volume of tissue to modulate the ArchT- or the ChR2-expressing cells by the light illumination in vivo. If effective inhibition of spikes is achieved at 9.2 mW × mm−2, in principle we were able to inhibit the spikes in 30% of the neurons (average rate of infection) at least up to 0.5 mm from the fibre tip (Supplementary Fig. 1d). This distance value, together with the measured conical cross-section of 1.0 and 1.1 mm diameter at 0.5 mm from the fibre tip, results in a total volume experiencing 9.2 mW × mm−2 light intensity of ~0.172–0.217 mm3 (using 200 and 300 fibre core). Considering this volume and taking into account that ~30% of the neurons expressed ArchT lead us to estimate that we were inhibiting between 4,601–5,813 and 7,668–9,689 ArchT-expressing cells. On the other hand, if effective activation of spikes is achieved at 1.6 mW × mm−2 (threshold determined as the minimum intensity to induce spikes of striatal cells recorded in vitro), in principle we were able to induce spikes in 30% of the neurons at least up to 0.4 (for 1 mW) and 0.8 mm (for 3 mW) from the fibre tip (Supplementary Fig. 1g). This distance value, together with the measured conical cross-section of 0.45 and 0.71 mm diameter at 0.4 and 0.8 mm from the fibre tip, results in a total volume experiencing 1.6 mW × mm−2 light intensity of ~0.0348 and ~0.179 mm3. Considering this volume and taking into account that 30% of the neurons expressed ChR2 lead us to estimate that we were activating between 930 and 4,798 ChR2-expressing cells depending on the power used. To estimate the response latency to light illumination we estimated the onset of significant firing rate decrease in the case of ArchT and increase for ChR2 after light onset, based on the neuron’s baseline firing rate peri-histogram aligned to the onset of light illumination using bins of 5 ms sliding 1 ms for ChR2 and 10 ms bins sliding 1 ms. These data analyses were conducted in Matlab with custom-written programmes (MathWorks). To estimate positive- or negative-modulated units in the postsynaptic target nuclei of either D1-ArchT or A2A-ArchT striatal manipulations (Supplementary Fig. 4), we were based on 1 s baseline firing rate peri-histogram aligned to the onset of light illumination using bins of 10 ms sliding 1 bin, and only if 30 bins in the first 2 s after the onset of light were different to the baseline (P<0.05) a unit was considered as positively or negatively modulated. Anatomical verification Three to four weeks post infection, animals were killed after completion of the behavioural tests. First, animals were anaesthetized with isofluorane, followed by intraperitoneal injection of ketamine/xylaxine (~5 mg kg−1 xylazine; 100 mg kg−1 ketamine). Animals were then perfused with saline and 4% paraformaldehyde, and brains extracted for histological analysis. Brains were kept in the same solution overnight and then transferred to saline solution. Brains were sectioned sagittally or coronally in 50 μm slices (using a Leica vibratome (VT1000S) and kept in PBS 1% solution before mounting or immunostaining treatment). After mounting and sealing of sections, one every five slices were selected to image the dorsal striatum using a confocal microscope equipped with Diodo 405 nm, Argon multi line 458-488-514 nm and a DPSS 561 nm lasers (LSM710, Zeiss; see Supplementary Fig. 1). Magnification ( × 40) Z stacks (50 × 50 × 50 μm; 2 μm interslice) were acquired from the upper right quadrant using a randomly positioned grid (square grid 200 μm) covering the dorsal striatum (ZEN lite software, Zeiss). These Z-stacks were imported into the stereo investigator software (MBF Bioscience) and quantification of the NeuN-positive, eYFP-positive or GFP-positive cells was done. Following this method, a total of 806/2,661 were positive for NeuN-eYFP or NeuN/GFP in ChR2 and ArchT animals (n=4 hemispheres; 1 RGS9L-ChR2—1 RGS9L-ArchT: 97/310, 1 D1-ChR2: 236/897, 1 D2-ChR2: 473/1454 and 1 A2A-ChR2: 50/157). To evaluate whether the RGS9L-Cre line targets the two striatal pathways we injected virus expressing protein reporters into the striatum of RGS9L-Cre animals that were generated from cross breading RGS9L-Cre animals with either D1 td-tomato or D2-eGFP. This allowed us to identify from the RGS9L-Cre-infected cell (by a DIO AAV1 virus, see above) how many of them correspond to D1-td-tomato or D2-eGFP. From three sections from three different slices in one RGS9L Cre D1 td-tomato mice we estimated that out of 347 infected cells 181 were D1 td-tomato positive (52%). On the other hand, when infecting the striatum to express td-tomato in an RGS9L-Cre D2-eGFP animal (counting the infected cells from four sections from four different slices), we estimated that 174 out of 354 infected RGS9L-Cre cells were D2-eGFP positive (49%). Software to evaluate rotations Videos from the animals in an open field were acquired using a charge-coupled device camera (DFK 31BF03) using the ICcapture software (Imaging Source) or a custom-developed software in Labview (National Instruments, Portugal) at a rate of 15 frames per second signalling in the videos of the light stimulation periods. To calculate the rostrocaudal axis, the coordinates of the head centre and the tail were determined using a custom-made software developed in Python ( https://github.com/joseaccruz/SimpleMouseTracker). We used Matlab (MathWorks) post-hoc analyses of these coordinates to estimate rotations aligned to a one second before the light onset (Fig. 3, Supplementary Figs 2 and 3). Similarly, we used Matlab to detect the direction of the animal three frames before the light onset (the minimum number of frames to define a change in trajectory is two frames (sampling at 15 fps)—therefore, we used the minimum of three frames moving in a given trajectory to define where the body or the head was turning), to ensure that this was indeed a turning trajectory. Ipsilateral turning was plotted as positive and contralateral turning as negative (Figs 4 and 5, and Supplementary Figs 2 and 3). In these same figures for the ‘light-off’ condition we took trials using the same criteria 6 s before light onset. To further track the head rotations related to the body we vertically aligned the mouse in each frame by calculating the vertical axis of the whole animal and subtracting it for each frame (this is what we refer in the main text as subtracting the whole body axis). Once the image was vertically aligned we segmented the image, using the upper three segments to categorize the head angle and the remaining seven to determine the body angle (as depicted in Fig. 5). Statistics Results were represented as mean±s.e.m. and statistical significance was accepted for P<0.05. The repetition of experiments was determined above the minimum n depending on the statistical test. A non-parametric Mann–Whitney test was used for comparisons of GCaMP6s activation during baseline and turning behaviour. Paired non-parametric Wilcoxon test were performed to compare within-subject effects of the light stimulation, unless otherwise specifically stated in text. Non-parametric Kruskal–Wallis tests were used for between-subject comparisons. For statistical analyses, Matlab and Systat11 (Chicago, IL) were used. Author contributions F.T. and R.M.C. designed the experiments and wrote the manuscript. F.T. performed the optogenetics experiments. S.M., G.P.D. and Z.F.M. developed the GCaMP acquisition system. S.M. performed and analysed the GCaMP experiments. Additional information How to cite this article: Tecuapetla, F. et al. Balanced activity in basal ganglia projection pathways is critical for contraversive movements. Nat. Commun. 5:4315 doi: 10.1038/ncomms5315 (2014). Supplementary Material Supplementary Information Supplementary Figures 1-4
                Bookmark

                Author and article information

                Contributors
                Journal
                Front Neuroinform
                Front Neuroinform
                Front. Neuroinform.
                Frontiers in Neuroinformatics
                Frontiers Media S.A.
                1662-5196
                08 April 2015
                2015
                : 9
                : 7
                Affiliations
                [1] 1Champalimaud Neuroscience Programme, Champalimaud Centre for the Unknown Lisbon, Portugal
                [2] 2Departamento de Ciência dos Materiais, CENIMAT/I3N and CEMOP/Uninova Lisbon, Portugal
                [3] 3Department of Cell and Developmental Biology, University College London London, UK
                Author notes

                Edited by: Andrew P. Davison, Centre National de la Recherche Scientifique, France

                Reviewed by: Jonathan W. Peirce, University of Nottingham, UK; Joshua H. Siegle, Massachusetts Institute of Technology, USA

                *Correspondence: Gonçalo Lopes, Champalimaud Neuroscience Programme, Champalimaud Centre for the Unknown, Av. de Brasilia s/n, Doca de Pedrouços, 1400-038 Lisbon, Portugal goncalo.lopes@ 123456neuro.fchampalimaud.org
                Article
                10.3389/fninf.2015.00007
                4389726
                25904861
                425cae0a-ffed-4940-adca-40f1308d458f
                Copyright © 2015 Lopes, Bonacchi, Frazão, Neto, Atallah, Soares, Moreira, Matias, Itskov, Correia, Medina, Calcaterra, Dreosti, Paton and Kampff.

                This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

                History
                : 01 December 2014
                : 19 March 2015
                Page count
                Figures: 5, Tables: 1, Equations: 0, References: 20, Pages: 14, Words: 10373
                Categories
                Neuroscience
                Technology Report

                Neurosciences
                rapid prototyping,data acquisition system,data stream processing,parallel processing,open-source,video tracking,electrophysiology,behavior control

                Comments

                Comment on this article