Abstract
Time estimation is an essential prerequisite underlying various cognitive functions. Previous studies identified “sequential firing” and “activity ramps” as the primary neuron activity patterns in the medial frontal cortex (mPFC) that could convey information regarding time. However, the relationship between these patterns and the timing behavior has not been fully understood. In this study, we utilized in vivo calcium imaging of mPFC in rats performing a timing task. We observed cells that showed selective activation at trial start, end, or during the timing interval. By aligning long-term time-lapse datasets, we discovered that sequential patterns of time coding were stable over weeks, while cells coding for trial start or end showed constant dynamism. Furthermore, with a novel behavior design that allowed the animal to determine individual trial interval, we were able to demonstrate that real-time adjustment in the sequence procession speed closely tracked the trial-to-trial interval variations. And errors in the rats’ timing behavior can be primarily attributed to the premature ending of the time sequence. Together, our data suggest that sequential activity maybe a stable neural substrate thatrepresentstime under physiological conditions.Furthermore, our results imply the existence of a unique cell type in the mPFC that participates in the time-related sequences. Future characterization of this cell type could provide important insights in the neural mechanism of timing and related cognitive functions.
Introduction
Time estimation is an essential function in the brain1–3, since many crucial cognitive functions implicitly require a record of time, such as motor control4,5 or memory6,7. The neural substrate for time estimation in the brain has been studied for decades, and several modes of time coding emerged from these studies: 1) Time can be represented by the gradual change of activity levels in certain cells (ramping)8–10; 2) Individual cells show selective activation at a specific time point (sequential)11–15; and 3) Population coding that showed complex patterns but stable dynamics in latent space16–18. Interestingly, by training the animal to learn different lengths of waiting periods, several groups found that these “time codes” exhibit scaling properties so that the number of cells for coding different lengths of time remains constant, while the activity can be compressed or stretched according to the duration of target time11,19–21. While these findings provide strong evidence for a neural mechanism of time coding in the brain, true causal evidence at single-cell resolution remains beyond reach due to technical limitations. Although inhibiting certain brain regions (such as medial prefrontal cortex, mPFC,22) led to disruption in the performance of the timing task, it is difficult to attribute the effect specifically to the ramping or sequential activity patterns seen in those regions as other processes may be involved.
Lacking direct experimental evidence, one potential way of testing the causal involvement of “time codes” in time estimation function is to examine their correlation at a finer resolution. However, a limitation in the experimental protocols of previous studies is that the animal learns a fixed time target, so that the scaling phenomenon is observed at the group level. Thus, there is a lack of evidence regarding whether the scaling happens rapidly at single-trial level to support time estimation.
In this study, we utilized a novel timing task in rat that allowed the animal to control the waiting period on its own will, so that we can observe the correlation of “time code” scaling with behavioral waiting responses at individual trial resolution. We found robust sequential activities in the mPFC when the rats performed the task. To the best of our knowledge, we provide the first piece of evidence that the scaling effect is dynamic to account for the variation of waiting periods at individual trial level. And the rats were capable of subjectively adjusting the scaling factor for accurate time estimation. Intriguingly, we found that cells coding for the start or end of the waiting period undergo cross-session shifts, while the sequential time code remains stable over weeks. This surprising stability of the time code suggests an underlying mechanism that is different from apparently similar sequential activities seen in place coding or time coding in hippocampus CA123,24, which showed dynamic shifts across sessions. Altogether, our study provides strong evidence for the online utilization of sequential time code in rats mPFC during a timing task. The unique rapid scaling and cell-identity stability of these sequential time code suggest a designated cell population for coding time in this region.
Results
Calcium imaging in mPFCduring rats perform the timing task
We trained eight rats to perform a modified version of the timing task used in previous studies21. In order to get the water rewards, water-deprived rats must poke their nose in a designated hole and maintain position (Figure 1A). The rat was free to start and end the nose poke at its own will, but only when the duration of the nose poke was above the minimal threshold would the rat receive a water reward. The rat did not receive additional punishment for nose poke duration below the minimal threshold, and can start a new trial when it was ready. Importantly, once the nose poke duration was over the minimum threshold, the amount of water reward was proportional to the total length of thenose poke duration. We trained the rat to perform this task in two phases. After the initial shaping for rats to associate nose poke with water rewards, the rats were trained on a short duration phase in which the minimal threshold was set to be 300 ms. When the rats’ correct performance reached above 70%, they advanced into a long duration phase and the threshold was set to be 1500 ms (Figure 1A).
Rats that underwent the training paradigm described above showed gradual increase in their nose poke durations (Figure 1B). And the median durations in each phase were slightly above the respective threshold in that phase (Figure 1C), indicating that the rats were capable of learning the different minimal threshold. Notably, there was a wide distribution of the nose poking durations in both phases of the task, which allowed us to study the trial-to-trial variation of the timing behavior.
We recorded neuronal activities from 4 different sessions from 5 rats (1 from short phase and 3 from long phase, Figure 1D). To obtain neuronal activity, we injected adeno-associated viruses expressing calcium sensor GCaMP6S in the medial prefrontal cortex (mPFC) of the rat and installed a 1.8 mm diameter GRIN lens after aspiring the cortical tissue on top (Figure 1E). Using a miniaturized microscope, we were able to record calcium activities from pyramidal neurons in the mPFC (Figure 1F), while the rats can freely move and perform the timing task.Our preparation yielded stable imaging data with good signal-to-noise ratio and cell counts (ranging from 50 to 150 cells per session, Supp. Figure 1).
Scaling of the mPFC time sequences at single-trial resolution
We started our analysis by examining the neural activities correlated with different features of the nose-poking behavior. To this end, we aligned calcium traces by nose-poking events for each cell, and calculated the Pearson’s correlation between the averaged activity trace to the binarized event trace (start, during and end). To determine the statistical significance of the correlation, we performed random shuffles of the calcium traces and repeated the calculations above, generating a distribution of correlation coefficients for each cell. If the actual correlation coefficient reached beyond 95% confidence interval of this distribution, we then assigned this cell to the group that codes for the specific feature of the nose-poking event. With this method, we identified neurons that showed selective activation at the beginning, the middle, or the end of the nose poke events (Figure 2A), which we designated as “start cell”, “duration cell” and “end cell”, respectively. A small portion of these coding cells (∼10%) showed significant correlation between two features of the task (“start” and “duration”; “end” and “duration”). In later analysis, we excluded these cells from the duration cell group. Notably, we observed gradual decays of GCaMP signal in start cells and sometimes gradual rise in end cells. However, we cannot definitively separate these “ramping-like” activities from the potential artifact due to slow kinetics of calcium sensor25. These three typesof cellsconstituted more than half of the observed neurons(Figure 2B). By training a support-vector machine classifier using activities from the start cells and end cells, we were able to predict nose-poking events with above 90% accuracy, indicating that their activities were highly specific to the nose-poking events (Figure 2C, D).
We then examined the activity patterns of the duration cells. We found that many duration cells showed activation during a certain proportion of the nose-poking events, and the timing of the activation seemed to be modulated by the total length of the events (Figure 2E, Supp. Figure 1A). When we normalized the actual time to the total length of each nose-poking event and transformed the calcium traces accordingly, we found that many duration cells showed selective activation at a fixed point in the normalized time scale (Figure 2E), consistent with the view that their actual activity was scaled by the total event duration 11,18. The ensemble activities from duration cells tiled across the normalized nose-poking time, showing a sequential activation pattern (Figure 2F). This activity sequence was stable across individual trials within a session, regardless of whether rat reached minimal reward threshold (Figure 2G, Supp. Figure 1B-C). These data suggest that the sequential activities of the duration cells may be representing nose-poking time. To examine other possible interpretations of these data, we first measured the time interval between exiting nose poke to licking the water reward as indicators for the rat’s motivation (Supp. Figure 2). While nose-poking durations were correlated with this reward-seeking time, normalizing the duration cells’ activities according to this motivation factor showed poor sequential patterns (Figure 2F), suggesting that the sequences were not representing the rat’s motivation for water rewards. In addition, we measured the rat’s head movements during the nose poke and found that the duration cells’ activities were not modulated by these movements (Supp. Figure 2).Furthermore, we were able to train a Gaussian process regression model to predict the progress of each trial with high accuracy (Figure 2H-J). While activities from start and end cells can also decode time, this might be due to slow calcium dynamics arising from either ramping activity or GCaMP kinetics as peak-extracted traces showed no decoding power (Figure 2J). On the other hand, peak-extracted activities from duration cells maintained high decoding power, indicating a more reliable sequential activity pattern. Consistently, the trial-length normalized duration cell activity exhibited robust sequentiality as measured by peak entropy 26,27, which was not seen in activities from start or end cells, or when duration cells normalized with motivation factors (Figure 2K). Together, these results indicated that distinct cell groups existed in the mPFC to code for different features of the nose-poking timing task. Duration cells showed selective activation towards specific timepoints in the normalized time scale, and their actual trial-by-trial activity was scaled by total event duration.
mPFC sequential time code remains stable over weeks
Previous studies reported that sequential activity patterns in the hippocampus can represent temporally ordered events28andtimepoints24. Interestingly, these sequences were highly dynamic, and the ordered pattern showed significant session-to-session variations29,30. Therefore, we then examined whether the sequential time code we observed in the mPFC showed similar instability across different sessions. To achieve this, we aligned imaging data from multiple sessions based on matching unique blood vessel patterns in the field of view (Supp. Figure 3). This allowed us to examine the coding properties in the aligned cells. We were able to see cells that maintained their coding features in different sessions (Figure 3A-C). And particularly for duration cells, we found that cells can represent a fixed timepoint in the duration across sessions, or shifted to another timepoint while still being a duration cell (Figure 3C, Supp Fig. 3).
We next formally quantified these dynamics. Below 30% of the start cells or end cells continued to maintain the same type of coding in the next session (Figure 3D). When we used the activities from the aligned start and end cells to classify the nose poking state, we found chance level performance for cross-session decoding despite of high within-session accuracy (Figure 3E). These results indicated that cells code for nose poking start and end are highly dynamic and they did not form stable representation over days. In contrast, around 70% of the duration cells kept their identity in the next session. And within these stable duration cells, more than 70% of them coded for a fixed timepoint in the normalized time scale (Figure 3F). Using activities from aligned duration cells, we were able to make GPR models that show good cross-session decoding of the nose poking time (Figure 3G), suggesting a stable code in the duration cells regarding the sequential activity pattern and time. We found largely the same results from three pairs of sessions: two sessions in the long phase with 2-day interval, two sessions in the long phase with 14-day interval and one short phase session and one long phase session with 16-day interval. Thus, the dynamism and stability we observed were not influenced by elapsed time or task structure, but may be a reflection of intrinsic properties of those cells. Given that previous studies in the hippocampus30and cortex31 all showed unstable sequential pattern across days, to the best of our knowledge our data for the first time demonstrated a stable time code in the brain.
Active scaling of the mPFC sequences represents subjective time estimation
Having found that mPFC showed time-associated stable sequential activities in the duration cells, we next investigated whether this activity could serve as a neural substrate for time estimation in rats performing our task. Previous studies showed that cooling of the mPFC in rats disrupted their performance in tasks that require timing 21,22. However, in that study it was difficult to separate the influence of other cognitive functions affected by cooling the mPFC. Lacking the technology of single-neuron manipulation in freely-moving rats, we argue that further evidence on the necessity of mPFC sequential activities for time estimation could come from the analysis of the trials in that rats made errors. If the sequential time code we observed is causally linked with time estimation function, we should see reflection of behavior errors in the neural activity in some form. We speculated that there might be three types of coding errors in the mPFC: type I, absence of sequential activities that could be due to inattention or disengagement of the rats; type II, disordered sequences that may lead to errors in time estimation; and type III, scaling error with intact sequential code but wrong target time.
We then examined the above error types in detail. We performed a decomposition of the neural activity with principal component analysis in individual trials and found that almost all trials showed similar trajectories, indicating a lack of type I error described above (Figure 4A). Interestingly, we found that trajectories from correct trials appeared to be more expanded than those from the incorrect trials (Figure 4B and C), suggesting a difference in scaling between these two types of trials. We next utilized a partial least square regression model to examine the neural trajectory directions specifically aligned to trial durations (Figure 4D). Again, we observed that correct and incorrect trials in general follow the same direction during nose poke. In addition, we found that duration cells were more important for this trajectory pattern compared to other cells that we observed (Figure 4E). The constructed trajectories could explain ∼52% of the variance in the normalized time, which was primarily contributed by the activities from duration cells (Figure 4F). These results indicated a lack of type I or type II errors. Consistent with this view,when we examined the raw activities from duration cells in individual error trials, we found only a small fraction showed the absence of sequential activities (Supp. Figure 4), indicating that type III errors (error in activity scaling) are the primary source of coding error. Indeed, we can find some duration cells showedtrial type-modulated activities(Supp. Figure 4D), suggesting that precise time estimation from these sequential activities may be affected.
To estimate the scaling errors associated with the type III errors, we calculated a scaling factor of the sequential activities on individual trials. To this end, we first calculated a scaling factor with individual duration cells’ activities by comparing the peak position of each cell’s activity on individual trial to the expected position from the averaged template (Figure 4G). We found that correct trials showed significantly larger scaling factors compared to those from the incorrect trials (Figure 4H and 4K), supporting the view that scaling errors are the major source for behavior errors. Furthermore, we computed a scaling factor following a previously reported method21,byusing population activities from the duration cells. We hypothesized that a singular multiplier could affect all duration cells in individual trials to prolong or compress the activity sequences, and the scaling factor for the trial should be the multiplier that minimizes the difference between the scaled activity and the averaged template (Figure 4I). The scaling factors derived this way again showed larger values in correct trials compared to incorrect ones (Figure 4J and 4L), further corroborating the importance of scaling errors.
Furthermore, we quantified the time estimation errors between the predicted time from duration cell neural activity and actual time using our previously established GPR models (Figure 4M). In general we did not find significant difference in prediction errors between correct and incorrect trials, and we were able to train a common model that showed accurate time estimation for both trial types (Figure 4N), again indicating a lack of type I or type II error. To estimate the scaling errors, we calculated the cumulative errors between the model predicted time and actual trial time. When we plotted these data against actual individual trial durations, we found that interestingly, incorrect trials showed cumulative errors clusteredbelow zero, and correct trials showed errors above zero (Figure 4O), indicating that during the majority of the incorrect trials the rats timed too short from the expected sequences. Surprisingly, the duration time at which the polarity of the cumulative error reversed was 1500 ms, exactly the minimal time threshold required for the rats to receive reward. This result strongly suggests that the rat was capable of perceiving the minimal time threshold and adjusting trial-by-trial scaling factor of the mPFC sequential activities during the task, and that errors in the online scaling accounted for most of the incorrect trials that we observed.
Discussion
The neural basis of time representation is a fundamental question in neuroscience. As timing is closely intertwined with various cognitive functions, such as short-term memory, decision-making, etc., it is perhaps not surprising that neuron activities correlated with time were found throughout the brain. Previous studies established that sequential or ramping activity can be feasible neural code for time representation. Indeed, time-related sequential or ramping patterns of neuron activity have been reported in prefrontal cortex 32,33, motor cortex 34,35, sensory cortex36–38, striatum11,39–41, thalamus42, hippocampus12,43,44, and entorhinal cortex31,45. A fascinating feature of time coding is the capability of scaling, in which the same sequential or ramping patterns were compressed or stretched to represent different durations of time2,46. While these previous findings set forth substantial insights into the neural substrate of time in the brain, two major limitations exist in the field.
One aspect is the lack of direct causal evidence regarding the neuron activity and the perception of time. Resolving this would not be an easy task as the causal evidence between similar sequential patterns of place cell firing and spatial perception was not fully demonstrated either, although the phenomenon was described about 50 years ago. Recent advances in the technology indicated a possibility of single-cell optogenetic control for such experiments47, yet the low throughput and the difficulty for inhibitory control still greatly limit its application. While lacking direct causal evidence, results from our current study provides a finer correlation between sequential firing and timing function. As previous studies generally trained the animal to learn distinct categories of durations21,48, the scaling effect of sequential activity was usually described as a group effect. We discovered that scaling is correlated with durations at individual trial level, and that failure in reaching the minimal timing threshold for reward can be primarily attributed to scaling errors, in which the sequential pattern prematurely reached the end. Furthermore, the probability of high scaling error was disproportionally increased when the duration of the trial is close to the timing threshold for reward, suggesting that the animal provides trial-by-trial adjustment of the scaling factor that reflected its estimation of the timing threshold. The real-time scaling of sequential activity, and the enrichment of scaling errors around the timing threshold strongly suggest that the animal actively uses this mechanism, and thus the sequential activity we observed is likely to be the neural code for time estimation. We have also provided evidence excluding the effect of motivation or motion. Future advances in single-cell manipulations may provide more definitive experimental evidence.
The second limitation in our understanding for the neural basis of time perception is the lack of biophysical mechanism for the emergence of sequential patterns and the scaling effect. In this regard, several theoretical models have been proposed18,26,49, yet testing these models in biological systems is currently not possible. Our data demonstrated a unique stability of the duration cells and their sequential activity patterns for coding time (Supp. Figure 5). Large proportions of duration cells’ coding type and their sequential order remained unchanged over weeks, even when the target time threshold was changed. In contrast, within the same field of view, cells that code for the start or end phase of the nose poke showed dynamic changes, although we could not separate the start and end-coding cells from time-coding cells with ramping patterns and could not assess the long-term stability of time coding by ramping activities. Previous studies of sequential activity did not report such stability over time, and activities related to event trajectories are generally considered unstable29,30. It is possible that this difference reflects different mechanisms underlying sequence emergence in different brain regions. This prolonged stability of duration cells suggests that in the mPFC, participation in the sequential pattern was unlikely a result of input-driven flexible coding, but a reflection of certain intrinsic properties. In other words, our data implied the existence of predetermined factors such as a genetic program for time coding neural population in the mPFC. Similarly, a recent study reported stable time sequences across different modalities in premotor cortex50. A designated neural substrate for timing could be advantageous so that time coding can be a relatively independent module and can be inert to constant plastic changes happened in the brain. Future studies isolating molecular signatures of the time-coding population could provide a powerful tool in dissecting the neural mechanism of time representation in the brain.
Acknowledgements
This study was supported by Jiangxi Natural Science Foundation 20171ACB20002 to BM.L., andNational Natural Science Foundation of China 31960171 to CL.M.. P.Y. was additionally supported by Shanghai Pilot Program for Basic Research – FuDan University 21TQ1400100 (22TQ019), the Lingang Laboratory (grant no. LG-QS-202203-09) and National Natural Science Foundation of China (32371036).
Additional information
Author contributions
CL.M. and BM.L. designed the study. YT.L., WQ.L. and JW.L. performed the experiments. P.Y., SL.Z. and YT.L. performed data analysis. YT.L. drafted the manuscript. YT.L and X.W prepared figures. P.Y., CL.M. and BM.L. revised the manuscript.
Competing interest statement
The authors claim no competing interest.
Materials and Methods
Subjects
Our study used Sprague Dawley rats. Equal number of male and female rats were used in the study. The environment temperature was controlled at 25-degree Celsius with 12/12 light-dark cycle. All the rats were raised in single-housing after surgery with ad libitum access to food and water. During behavior training, water access was restricted according to an experimental procedure, in which the body weight loss was monitored and kept under 20%. Animal procedures were conducted in accordance with the Guiding Principles for the Care and Use of Laboratory Animals. All experiments were approved and monitored by the Ethical Committee of Animal Experiments at the Institute of Life Science, Nanchang University.
Apparatus
Behavioral training and testing were conducted in a 40×20×30 cm plastic chamber. One side of the chamber had a semicircular hole (2.5 cm diameter) which was 13 cm above the floor and an infrared detector was placed to detect the nose poking, this hole was called as the operant hole. Under the operant hole is a reward hole where rats can get a certain volume of water, and water delivery is controlled by a solenoid valve. If the detector had detected a nose poking longer than the minimal time threshold from a rat, the solenoid valve will deliver a certain amount of water. We had written scripts to control those processes and record the timestamp of the nose poking.
Virus injection
The rat was anesthetized with isoflurane and placed into a stereotactic apparatus. Rats were injected with carprofen solution (5 mg/kg) and dexamethasone solution (0.2 mg/kg) to minimize inflammation. We then shaved the head area and disinfected 3 times with alternating iodophors and alcohol. An opening on the skull was made with a dental drill. Then we unilaterally microinjected 500 nl of rAAV-CaMKIIa-GCaMP6S-WPRE-PA virus (1.37e+12 vg/ml, BrainVTA) at 80 nl/min into the prelimbic cortex with the following stereotactic coordinates: 3.7 mm anterior to bregma, 0.5 mm lateral to the midline, and −3.2 mm ventral to the skull surface.After the virus injection, we waited10 minutes to remove the microelectrode from the prelimbic cortex, and thensutured the scalp and disinfected.The rat was placed back in the homecage after waking up from anesthesia.
GRIN lens implantation
Our surgical method is based on the surgical procedure reported in mice51. Two weeks after the virus injection, the GRIN lens was implanted above the previous injection site. For the procedure, after disinfecting the head area, we removed the scalp with scissors and cleaned up the skull with hydrogen peroxide and saline, and then inserted three skull screws on the skull.The skull screws wereplaced in a way that would not block the lens. Then, we used saline to clean up the fragment, and drilled a hole with 1.9 mm diameter on top of the virus injection site. We slowly aspired brain tissue above the prelimbic cortex by connecting a syringe needle with the vacuum pump. The aspiration stopped at 2.5mm below brain surface. We then inserteda GRIN lens(1.8 mm diameter, N.A: 0.54., Edmund) to the target position with the micromanipulators.The placement was checked using a miniscope(Labmaker) and adjusted to maximize the fluorescence signal.
We then removed excess liquid with the vacuum pump, and glued the GRIN lens with skull and skull screw using cyanoacrylate glue.After the glue was fully cured, we then applied black dental cement andcoveredthe top of the lens with Kwik-Sil (WPI) after the dental cement is dry. The ratwas placed back to their homecage and amoxicillin was added to their drinking water for 7 days.
After GRIN lens implantation, we waited 4 to 6 weeks to install baseplate. The rat was anesthetized with isoflurane again, and then we used forceps to remove the Kwik-Sil from the top of the lens, cleaned the lenswith wet lens paper. We then installed aminiscope with a micro-manipulator holder andfoundthebest view with clearvasculature and cells. At this position, we applied glue around the baseplate. After the glue was set, we continued to cover the larger area with dental cement. When the dental cement is dry, we removed the miniscope. Finally, we covered the plastic cap on the top of the baseplate and fixed it with a screw.
The timing task
To motivate the rats to learn the task, their drinking water was limited during the training period, so that rats could only obtain water through task operation. Specifically, the rats need to probe their nose into the operant holeand stay longer than the minimal threshold time. After rats withdrew their nose from the hole, they can get reward from the reward hole.If the rats performed this action and acquired water reward, we called this as a correct trial. Conversely, an incorrect trial is when the rats started a nose pokebut did not reach designated time for reward.
The training was separated into three phases. In the pre-training phase, once rats produced the nose poking action, they could immediately acquire water reward at a small amount (60 μl). Therats moved on to the short phase after they mastered the nose poking action.In this phase, rats would acquire the reward only if they kept the action of nose poking for at least 300 ms.Rats received 50 μl water with 300 ms duration. The rats graduated from this phase when their performance reached above 70% correct. In the long phase, the nose poking duration must reach at least 1500 ms. Rats received 100 μl water with 1500 ms duration. In these two phases, with each additional 500 ms nose poke time in a trial, the reward was increased by 60 μl.
Calcium image recording
We did not anesthetize the rat for installing miniscope. Instead, we hand-held the rat to maintain its position and installed the miniscope and fixed it with screws. We monitored the calcium signal so that if the recording was not stable, the experiment would be interrupted. The calcium imaging of animals was recorded using a UCLA miniscope (V3), and the animal behavior was recorded using a webcam. Data acquisition software recorded the timestamps of the behavior camera and miniscope at the same time in order for subsequent alignment. Video streams were recorded at 20 frames per second. And excitation was set at ∼4.5 mW. In our experiment, we used an MCX adapters to link the coaxial cable to ensure the animals can move freely and avoid the winding of cables.
Extracting calcium activity
All analyses of the calcium imaging data were performed using custom software written in MATLAB. First, the raw imaging data was motion corrected using a previously published the NoRMCorre algorithm52. The corrected movies have been processed by median filter and down-sampled prior to extract the calcium traces. Here, to accurately extract the calcium signals of individual cells, we applied a supervised and robust the EXTRACTalgorithm53,54. Extracted units were checked manually to exclude artifacts.
The identification of cell types
To identify cells that encode different periods of the nose-poking event, we calculated the Pearson’scorrelation coefficients between calcium traces and binarized event traces. In our task, we focused on three types of events, the start of nose pocking was defined as the 5 frames prior tothe detection of the nose-poking event start. The end of nose probing was defined as the 5 frames after the rat began to withdraw from the operant hole. The duration of the nose poke was defined as the interrupted time of the infrared sensor in each trial.In order to calculate the statistics of the correlation coefficients, we generated a null hypothesis for each cell by shufflingthe calcium traces with random delays for one hundred times, and calculated the resulted correlation coefficients. A cell was deemed to respond to certain events when the observed coefficient reached above the 95th percentiles of the corresponding coefficient distribution from the shuffled dataset. Those neurons responding specifically the three events were called respectively the start cells, the end cells and the duration cells.
Calculation of peak entropy
PE (peak entropy) measures the entropy of peak times distribution across the population. Peak times are determined by analyzing the activity of the duration cells during normalized intervals for each trial. For a group of trials, the frequency of peak times is then calculated within M bins, where M represents the number of bins used to estimate the peak time distribution (30 frames for neural dynamics in normalized durations). Here, pj is the proportion of units peaking in time bin j relative to the total number of units. We did not further normalize the peak entropy with cell numbers since the numbers between groups were close to each other.
The alignment of calcium imaging cross sessions
We performed cross-session alignment by manually select unique blood-vessel or neuron patterns as fixed control points, and then calculated the transformation between sessions by linear interpolation. We then applied the transformation to the centroid coordinates of each extracted cell to obtain the aligned cell positions in the target session. By calculating the pair-wise distances between the aligned centroids and that from the extracted cells in that session, we selected the minimal distance for each cell as the most likely candidate matches. And if this distance is below 5 pixels, which is about the radius of a cell, we recorded these two cells as a matched pair. In order to maximize the number of aligned cells, in all cross-session analysis, we used matched paired between two sessions.
Support vector machine model for classification
We trained a linear kernel support vector machine (SVM) model using the activities of the start and end cells to predict the binarized nose poking state for each timepoint. In order to avoid biases caused by the imbalance of the samples, we chose random subsamples of recorded timepoints with equal number of nose-poking and non-nose-poking states. From this subsample, we then selected 80% of the timepoints for model training, and used the remaining 20% to evaluate the performance of the model. For performance measurement, we tabulated the differences between the model’s predicted states from the actual states and calculated percentages of accurate predictions. In order to avoid variations introduced by sampling, we repeated our random sampling process for 100 times for each dataset and recorded the average performance. For generating a null hypothesis, the actual states were randomly shuffled during the training process, and the resulted model was then tested on real testing dataset. For testing cross-session performance, the within-session training and testing procedures were similar as described above, but using only cells that can be matched to the target session as model input. After training, the model was tested on the timepoints of the target session using activities from the activities of the matched neurons, and accuracy calculation was the same as that described above.
Gaussian process regression model
Neuron activities from each nose poking trial were isolated by taking the frames of each nose-poking bouts detected by the sensors and the amplitude of each cell’s activity was normalized into a 0-1 scale within the trial. We then used linear interpolation algorithm (MATLAB “interp1” function) to make each trial into the same number of “normalized” timepoints. In our case we used 30 frames as the normalized trial length. Before model fitting, we selected subsamples of the same number of correct and incorrect trials, and used 80% of the trials for model training and saved 20% for testing. We then fitted a Gaussian process regression (GPR) model with a principal analysis pre-processing with a rational quadratic kernel function to describe the relationship between neuron activities and the progression of trial in normalized timepoints.
Rational Quadratic Kernel:
where σ is the characteristic length scale, α is a positive-valued scale-mixture parameter, r is the Euclidean distance between xi and xj.
We feed the testing set data to the fitted model to calculate the predicted normalized time. The performance was defined as the root mean square error (RMSE) between the actual normalized time and the predicted time across all tested trials. Similar to the SVM model, we repeated this process for 100 times to eliminate the sampling variations and shuffled the normalized time in the training set to generate a null hypothesis. It is notable that in this case, the null model output was generally around 15, which is at the middle of our normalized trial length. While this number gave no prediction power, the RMSE (∼9) was lower than a random number set between 1 and 30 (∼12).
Partial least square regression
The VIP score was computed to authenticate the importance of neuronal ensembles on time estimation. VIP score is a measure used in PLS regression to identify the most important variables that predict a response variable. VIP score values range from 0 to 1, where higher values indicate greater importance of the variable in predicting the response. To calculate VIP score using the Partial Least Squares Regression method, several steps are involved. First, the dataset is divided into a training set and a test set. The training set is used to build the PLS regression model, while the test set is used to evaluate its performance. Next, the PLS regression model is trained using the training set. During this step, the model identifies the most relevant variables that explain the variance in the response variable. The VIP score for each variable is then calculated based on its contribution to explaining the variance in the response variable.
The VIP score is importance in predicting the response variable.
XS is an orthonormal matrix including n time points by m components. Each row of XS corresponds to one time point, and each column corresponds to one component. YL is an n-by-one matrix, where n is the number of response variables and one is the number of PLS components. Each row of YL contains coefficients that define a linear combination of PLS components approximating the original response variables. W is n-by-m components matrix of PLS weights.
Principal components analysis (PCA) for duration cells
Weapplied the PCA function of matlab to determine the score of correct trials.The covariance matrixwas calculated for duration cell activities that included only the normalized time in the correct trials. Next, eigenvalue decomposition of the covariance matrix was performed to obtain eigenvalues and eigenvector matrices. The feature vectors were sorted according to the numerical magnitude of the feature values, and the top three feature vectors were selected as the principal components. Finally, the projection of the dataset on the selected principal components is calculated, that is, the score matrix is calculated.And the scores in incorrect trials were determined as the Principal component coefficientcoeffCT and estimated meansμCT from the data on the correct trials.
Incorrect trials:
To quantify the trajectorieslengths of duration cell activities, we calculated the length of the average trajectory on the correct trials and the average trajectory on the incorrecttrials using the Euclidean distance. Here, then means that there are multiple time points in the average trajectory
Scaling factor
The scaling factork at the cellular level is calculated by dividing the location pi of the peak of activity of a single cell during each actual trial duration by the location pave of the peak of average activity. The average activity here is taken as the number of trials with the highest frequency of nose poking time within a session, and the activity of individual neurons during these trials is averaged.
Cell level:
To determine the optimal scaling factor ki at the ensemble level (where ki yields the minimum difference after scaling at ensemble level), we linearly compressed or stretched the binary activities of each duration cell within the same actual trial ti using various scaling factors ranging from 0.5 to 2. We calculated the standard error (SE) between the binary activities of each duration cell and their corresponding normalized time trial . The scaling factor ki corresponding to the ith trial that resulted in the minimum SE was selected as the best scaling factor. As the following equation: Ensemble level:
Motion analysis
To explore the effect of motion on regulating neural activity during the timing task, we utilized the popular software DeepLabCut55,56 for motion analysis based on transfer learning with deep neural networks. Using DeepLabCut, we successfully obtained information on the rat’s head position. Initially, we created minimal training data from raw behavioral pictures where markers were manually placed on the rat’s head. This labeled training data was then used with deep neural networks (DNNs) to track changes in the rat’s head movement throughout the entire behavioral video. Specifically, movements during nose poking were extracted to analyze the duration of cell activity in relation to head movements.
Statistics analysis
GraphPad Prism version 9.00 was used for statistical analyses. All data are presented as mean ± standard error (SE). Statistical significance was assessed by two-tailed and non-parametricStudent’s t-tests. p < 0.05 was considered statistically significant. *p < 0.05;**p < 0.01; ***p < 0.001; ****p < 0.0001
References
- 1.What makes us tick? Functional and neural mechanisms of interval timingNature Reviews. Neuroscience 6:755–765https://doi.org/10.1038/nrn1764
- 2.The neural bases for timing of durationsNature Reviews Neuroscience 23https://doi.org/10.1038/s41583-022-00623-3
- 3.Temporal discrimination and the indifference interval. Implications for a model of the 《internal clock》Psychological monographs 77:1–31https://doi.org/10.1037/h0093864
- 4.Anticipated moments: Temporal structure in attentionNature Reviews Neuroscience 19https://doi.org/10.1038/nrn.2017.141
- 5.Early behavioural facilitation by temporal expectations in complex visual-motor sequencesJournal of Physiology-Paris 110:487–496https://doi.org/10.1016/j.jphysparis.2017.03.003
- 6.Low-dimensional dynamics for working memory and time encodingProceedings of the National Academy of Sciences of the United States of America 117:23021–23032https://doi.org/10.1073/pnas.1915984117
- 7.Timing and Neural Encoding of Somatosensory Parametric Working Memory in Macaque Prefrontal CortexCerebral Cortex 13:1196–1207https://doi.org/10.1093/cercor/bhg100
- 8.A decision model of timingCurrent Opinion in Behavioral Sciences 8:94–101https://doi.org/10.1016/j.cobeha.2016.02.002
- 9.Neural correlates of interval timing in rodent prefrontal cortexThe Journal of Neuroscience: The Official Journal of the Society for Neuroscience 33:13834–13847https://doi.org/10.1523/JNEUROSCI.1443-13.2013
- 10.Neural basis for categorical boundaries in the primate pre-SMA during relative categorization of time intervalsNature Communications 9https://doi.org/10.1038/s41467-018-03482-8
- 11.A Scalable Population Code for Time in the StriatumCurrent Biology 25:1113–1122https://doi.org/10.1016/j.cub.2015.02.036
- 12.Internally Generated Cell Assembly Sequences in the Rat HippocampusScience 321:1322–1327
- 13.Striatal dynamics explain duration judgmentseLife 4https://doi.org/10.7554/eLife.11386
- 14.Timing Mechanisms in the Cerebellum: Testing Predictions of a Large-Scale Computer SimulationJournal of Neuroscience 20:5516–5525https://doi.org/10.1523/JNEUROSCI.20-14-05516.2000
- 15.The Neural Basis of Timing: Distributed Mechanisms for Diverse FunctionsNeuron 98:687–705https://doi.org/10.1016/j.neuron.2018.03.045
- 16.Measuring time with different neural chronometers during a synchronization-continuation taskProceedings of the National Academy of Sciences 108:19784–19789https://doi.org/10.1073/pnas.1112933108
- 17.Reward Timing in the Primary Visual CortexScience 311:1606–1609https://doi.org/10.1126/science.1123513
- 18.Flexible timing by temporal scaling of cortical responsesNature Neuroscience 21https://doi.org/10.1038/s41593-017-0028-6
- 19.Scalable representation of time in the hippocampusScience Advances 7https://doi.org/10.1126/sciadv.abd7013
- 20.Internal models of sensorimotor integration regulate cortical dynamicsNature Neuroscience 22https://doi.org/10.1038/s41593-019-0500-6
- 21.Representation of interval timing by temporally scalable firing patterns in rat prefrontal cortexProceedings of the National Academy of Sciences 111:480–485https://doi.org/10.1073/pnas.1321314111
- 22.Inactivation of medial prefrontal cortex impairs time interval discrimination in ratsFrontiers in Behavioral Neuroscience 3https://doi.org/10.3389/neuro.08.038.2009
- 23.Parallel emergence of stable and dynamic memory engrams in the hippocampusNature 558https://doi.org/10.1038/s41586-018-0191-2
- 24.Differential Emergence and Stability of Sensory and Temporal Representations in Context-Specific Hippocampal SequencesNeuron 108:984–998https://doi.org/10.1016/j.neuron.2020.08.028
- 25.Ultrasensitive fluorescent proteins for imaging neuronal activityNature 499:295–300https://doi.org/10.1038/nature12354
- 26.Neural Sequences as an Optimal Dynamical Regime for the Readout of TimeNeuron 108:651–658https://doi.org/10.1016/j.neuron.2020.08.020
- 27.A diverse range of factors affect the nature of neural representations underlying short-term memoryNature Neuroscience 22https://doi.org/10.1038/s41593-018-0314-y
- 28.Temporally selective contextual encoding in the dentate gyrus of the hippocampusNature Communications 5https://doi.org/10.1038/ncomms4181
- 29.Hippocampal CA2 Activity Patterns Change over Time to a Larger Extent than between Spatial ContextsNeuron 85:190–201https://doi.org/10.1016/j.neuron.2014.12.001
- 30.Neuronal code for extended time in the hippocampusProceedings of the National Academy of Sciences of the United States of America 109:19462–19467https://doi.org/10.1073/pnas.1214107109
- 31.Integrating time from experience in the lateral entorhinal cortexNature 561https://doi.org/10.1038/s41586-018-0459-6
- 32.A precise and adaptive neural mechanism for predictive temporal processing in the frontal cortexNeuron 109:2995–3011https://doi.org/10.1016/j.neuron.2021.08.025
- 33.Distributed coding of duration in rodent prefrontal cortex during time reproductioneLife 10https://doi.org/10.7554/eLife.71612
- 34.Dynamic representation of the temporal and sequential structure of rhythmic movements in the primate medial premotor cortexThe Journal of Neuroscience: The Official Journal of the Society for Neuroscience 34:11972–11983https://doi.org/10.1523/JNEUROSCI.2177-14.2014
- 35.The Computational and Neural Basis of Rhythmic Timing in Medial Premotor CortexThe Journal of Neuroscience: The Official Journal of the Society for Neuroscience 37:4552–4564https://doi.org/10.1523/JNEUROSCI.0367-17.2017
- 36.Selective activation of a putative reinforcement signal conditions cued interval timing in primary visual cortexCurrent Biology: CB 25:1551–1561https://doi.org/10.1016/j.cub.2015.04.028
- 37.A Cholinergic Mechanism for Reward Timing within Primary Visual CortexNeuron 77:723–735https://doi.org/10.1016/j.neuron.2012.12.039
- 38.Visually cued action timing in the primary visual cortexNeuron 86:319–330https://doi.org/10.1016/j.neuron.2015.02.043
- 39.Temporal Learning Among Prefrontal and Striatal EnsemblesCerebral Cortex Communications 1https://doi.org/10.1093/texcom/tgaa058
- 40.Time coding in rat dorsolateral striatumNeuron 109:3663–3673https://doi.org/10.1016/j.neuron.2021.08.020
- 41.Distinct Dynamics of Striatal and Prefrontal Neural Activity During Temporal DiscriminationFrontiers in Integrative Neuroscience 12
- 42.Retrospective and prospective coding for predicted reward in the sensory thalamusNature 412https://doi.org/10.1038/35087595
- 43.Cell Assembly Sequences Arising from Spike Threshold Adaptation Keep Track of Time in the HippocampusJournal of Neuroscience 31:2828–2834https://doi.org/10.1523/JNEUROSCI.3773-10.2011
- 44.Hippocampal “Time Cells” Bridge the Gap in Memory for Discontiguous EventsNeuron 71:737–749https://doi.org/10.1016/j.neuron.2011.07.012
- 45.Stability of medial entorhinal cortex representations over timeHippocampus 29:284–302https://doi.org/10.1002/hipo.23017
- 46.Time for MemoriesJournal of Neuroscience 43:7565–7574https://doi.org/10.1523/JNEUROSCI.1430-23.2023
- 47.Targeted Activation of Hippocampal Place Cells Drives Memory-Guided Spatial BehaviorCell 183:1586–1599https://doi.org/10.1016/j.cell.2020.09.061
- 48.Differential Encoding of Time by Prefrontal and Striatal Network DynamicsThe Journal of Neuroscience: The Official Journal of the Society for Neuroscience 37:854–870https://doi.org/10.1523/JNEUROSCI.1789-16.2016
- 49.A model of temporal scaling correctly predicts that motor timing improves with speedNature Communications 9https://doi.org/10.1038/s41467-018-07161-6
- 50.Amodal population clock in the primate medial premotor system for rhythmic tappingCell Reports 42https://doi.org/10.1016/j.celrep.2023.113234
- 51.Visualization of cortical, subcortical and deep brain neural circuit dynamics during naturalistic mammalian behavior with head-mounted microscopes and chronically implanted lensesNature Protocols 11https://doi.org/10.1038/nprot.2016.021
- 52.NoRMCorre: An online algorithm for piecewise rigid motion correction of calcium imaging dataJournal of Neuroscience Methods 291:83–94https://doi.org/10.1016/j.jneumeth.2017.07.031
- 53.Robust estimation of neural signals in calcium imagingProceedings of the 31st International Conference on Neural Information Processing Systems :2905–2914
- 54.Fast and statistically robust cell extraction from large-scale neural calcium imaging datasetsbioRxiv https://doi.org/10.1101/2021.03.24.436279
- 55.DeepLabCut: Markerless pose estimation of user-defined body parts with deep learningNature Neuroscience 21:1281–1289https://doi.org/10.1038/s41593-018-0209-y
- 56.Using DeepLabCut for 3D markerless pose estimation across species and behaviorsNature Protocols 14:2152–2176https://doi.org/10.1038/s41596-019-0176-0
Article and author information
Author information
Version history
- Sent for peer review:
- Preprint posted:
- Reviewed Preprint version 1:
- Reviewed Preprint version 2:
Copyright
© 2024, Li et al.
This article is distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use and redistribution provided that the original author and source are credited.
Metrics
- views
- 265
- downloads
- 4
- citations
- 0
Views, downloads and citations are aggregated across all versions of this paper published by eLife.