A brain machine interface that harnesses endogenous mPFC-hippocampal theta coherence on a working memory task.

A) Schematic of brain machine interfacing as rats performed a delayed alternation task on an automated T-maze. The delayed alternation task requires rats to alternate between left and right reward zones. Blue arrows and stars denote correct (rewarded) trajectories while red arrows and stars represent incorrect (unrewarded) trajectories. The rat was confined to the delay zone with three barriers. On a subset of delays, we computed mPFC-hippocampal theta coherence in real-time and trials were initiated contingent upon theta coherence magnitude. B) Frequency by coherence distribution calculated on data collected in real-time (N = 8 rats; 4 female, 4 male). For brain machine interfacing experiments, “theta coherence” was defined as the averaged coherence values between 6-11Hz. Data are represented as the mean +/− s.e.m. C) Thresholds for high and low magnitude coherence were estimated based on distributions of theta coherence values that were unique to individual rats (see Extended Fig. 3J and methods). N = 8 rats (4 female, 4 male).

High mPFC-hippocampal theta coherence can be used to enhance performance of a working memory dependent task

A) Left panel: Histology from a representative rat showing electrode tracks in the dorsal hippocampus (top) and mPFC (bottom). Right panel: Distribution of trial-types within a session. Within 10-trial blocks, 20% of trials were initiated based on high or low mPFC-hippocampal theta coherence, 20% of trials were yoked to the high/low coherence trials, and 60% were triggered following a random delay (5-30s). Yoked trials were identical in delay duration as high/low coherence trials, but triggered independent of coherence magnitude to control for the negative correlation between delay length and task performance (Extended Fig. 4A). B) Example LFP traces recorded during high and low coherence trials from three representative rats. The mPFC and hippocampal signals were used to compute theta coherence in real-time. C) Coherograms representing time around trial initiation (x-axis), coherence frequency (y-axis) and coherence magnitude, with warmer colors indicating higher coherence values. White arrows denote strong (top panel) and weak (bottom panel) theta coherence, as expected on trials triggered during high and low coherence states. Notice that on yoked trials, coherence was rather consistent before and after trial initiation, as expected for trials triggered independent of coherence magnitude. D) Relative to yoked trials, presenting choices to rats when mPFC-hippocampal theta coherence was high led to improved task performance (t(7) = 2.85, pp.c. = 0.0248). Trials contingent upon low magnitude theta coherence did not impact task performance compared to delay matched controls (t(7) = −0.26, pp.c. = 0.80; paired t-test). Follow-up statistical testing revealed that choice accuracy on high coherence trials was significantly greater than choice accuracy on random delays, consistent with our planned comparisons between high and yoked trials (t(7) = 6.12; p(x4) = 0.002). See Extended Table 1 for statistics. * p<0.05, **p<0.01. Stars (**) above bar graph denotes significance as measured from comparisons relative to random delay choice outcomes (black) and relative to 70% criterion (gray). Subscript “P.C.” indicates planned comparisons. Subscript “(x4)” indicates unplanned comparisons with Bonferroni corrected p-values for the number of unplanned tests performed.

High mPFC-hippocampal theta coherence trials are gated by prefrontal theta rhythms and lead to heightened pre-choice synchrony

A) Prefrontal and hippocampal power spectra during the high and low coherence epochs used for brain machine interfacing (Fig. 1 and 2). B) Prefrontal theta power (6-9Hz) was significantly greater during high coherence epochs relative to low coherence epochs (t(7) = 3.66, ci = 0.067 to 0.312, padj(x2) = 0.016). Hippocampal theta power was stronger on high coherence compared to low coherence trials (t(7) = 2.36, ci = −0.0003 to 0.254, p = 0.05). C) The frequency of prefrontal and hippocampal theta oscillations was significantly higher during high coherence states relative to low coherence states (PFC: t(7) = 5.35, padj(x2) = 0.002, ci = 0.55 to 1.42; hippocampus: t(7) = 3.34, padj(x2) = 0.025, ci = 0.17 to 0.98). Theta frequency was measured by identifying the frequency corresponding to maximum theta power. D) Hippocampal-to-prefrontal theta directionality was significantly stronger during high theta coherence states relative to low theta coherence states (t(7) = 3.9, ci = [0.11 to 0.46], padj(x3) = 0.018). No significant effect was observed in the prefrontal-hippocampal direction (t(7) = 1.8, p = 0.11), nor when we compared HPC->PFC vs PFC->HPC (t(7) = 2.6, padj(x3) = 0.1). For panels B-D, data are represented as the mean +/− s.e.m. across 8 rats. *p<0.05, **p<0.01, paired t-tests with Bonferroni p-value corrections when p<0.05. Difference scores were tested against a null of 0. E) LFP signals (jittered for visualization) were extracted from 2s before choice point entry (as defined by infrared beam breaks) and 0.5s afterwards. Bar graphs show that the average time to choice-entry for high coherence and low coherence trials was between 1.6-2.1s and did not differ between trial-types (t(7) = 2.0, p 0.08). F) Averaged coherograms (N = 8 rats) showing coherence as a function of frequency and time surrounding choice point entry. G) Difference of the coherograms shown in F. White arrows point to initial 6-9Hz synchronization at −2s which approximates trial onset (see bar graph in E), and a second time point of heightened theta synchrony before choice entry. H) Normalized difference scores representing theta coherence as a function of time. Theta coherence at choice-entry was significantly stronger on trials triggered by high coherence relative to trials triggered during low coherence (see Extended Table 2). Magenta lines denote p<0.05 after Benjaminin Hochberg corrections.

mPFC-hippocampal theta coherence was harnessed to enhance the performance of a cue-guided decision making task

A) Schematic of the conditional discrimination task. Wooden or mesh floor inserts were used to guide choice behavior. Rats were randomly assigned to insert-reward contingencies. Like the brain machine interfacing experiment on the delayed alternation task, trials were initiated when rats were sequestered in the delay zone. B) Example histology from a representative rat showing electrode placements in the hippocampus and mPFC. C) Trials initiated during high mPFC-hippocampal theta coherence states led to better task performance when compared to yoked control trials (t(15) = 2.23, ci = 0.29 to 12.87, p(p.c.) = 0.04) or when compared to trials triggered following a random delay (t(15) = 3.8, ci = 4.7 to 16.6, p(x2) = 0.003). There was no difference in choice outcome following yoked and random delay trials (t(15) = 1.0, ci = −4.5 to 12.7, p(x2) = 0.33). *p<0.05. **p<0.01. Subscript on p-values show if comparisons were planned (‘p.c.’) or corrected for multiple comparisons (‘x2’). Data are represented as the mean ± s.e.m.

Prefrontal-hippocampal theta synchronization modulates prefrontal-thalamic interactions

A) LFPs were recorded from the mPFC, VMT and hippocampal of 3 rats (N = 22 sessions). Right panel shows triple site recordings taken from a representative rat. Green box shows example tetrode tracks from the mPFC. B) High and low mPFC-hippocampal theta coherence epochs were identified, and LFP from the VMT was extracted. The data shown are collapsed across high or low coherence epochs. C) Frequency by coherence plots from the mPFC (top panel), VMT (middle panel), and hippocampus (bottom panel). Compare these data to Fig. 3. D) Normalized difference scores comparing theta (6-9Hz) power between high and low coherence epochs. There was a main effect of brain region on the coherence difference score (F(2,65) = 20.8; p < 0.001; one-way ANOVA) with each brain area showing higher theta power during high coherence states relative to low coherence states (PFC: p < 0.001; VMT; p < 0.001; HPC: p < 0.001; see Extended Table 3). E) Theta coherence for mPFC-VMT and VMT-HPC was estimated during high and low mPFC-hippocampal theta coherence states. F) mPFC-VMT and VMT-HPC theta coherence was stronger during high when compared to low mPFC-hippocampal theta coherence states. mPFC-VMT theta coherence changed more drastically with mPFC-hippocampal theta coherence magnitude (mPFC-VMT: p < 0.001; VMT-HPC: p < 0.001; mPFC-VMT vs VMT-HPC: p < 0.001; see Extended Table 4). G) Multivariate granger prediction analysis. Left panel shows VMT-HPC theta directionality. Middle panel shows mPFC-VMT theta directionality. Right panel shows mPFC-hippocampal theta directionality. Granger prediction in the mPFC- to-VMT direction was more sensitive to mPFC-hippocampal theta coherence magnitude when compared to granger prediction in the VMT-to-mPFC direction (statistics in Extended Table 5). H) Top panel shows hippocampal LFP (1-sec) and example spikes from an mPFC neuron with significant spike-theta entrainment. Middle panel shows polar plots of the unit in the top panel. Histogram represents the distribution of spike-phase values with the mean result length vector shown as a white bar in the center. Bottom panel shows spike-field coherence for the same neuron. I) Difference score (high-low/high+low) of bootstrapped MRL and Rayleighs Z-statistic for each neuron as a function of hippocampal or VMT theta. No significant differences were found between high and low mPFC-hippocampal theta coherence states. J) Spike-field coherence, represented as a difference score. No effects survived p-value correction. Arrow points to a numerical increase to spike-field coherence at hippocampal 4-6Hz. K) Percentage of significantly modulated mPFC units to VMT theta and hippocampal theta. *p<0.05. **p<0.01. Data are represented as the mean ± s.e.m.

Optogenetic activation of the ventral midline thalamus produces prefrontal theta and dynamically modulates prefrontal-hippocampal theta coherence

A) Top panel, Schematic demonstrating recordings from the mPFC and hippocampus with optogenetic activation of the VMT. Middle panel, example histological confirmation of fiber implant and viral expression targeting the VMT. Bottom panel. Viral expression at similar viral injection coordinates. Notice that all rats showed overlap in viral expression in the nucleus reuniens (brain section overlay from Paxinos and Watson, 2006). B) Optogenetic activation of the VMT at 7Hz produced prefrontal theta rhythms (N = 83 blue, 88 red laser events). C) Power spectrum from blue and red laser stimulation events averaged over recording channels. Columns represent recording channels per shank, while rows represent shank number and the corresponding medial-lateral placement in the mPFC (B). D and E) Data from rat 21-42 (N = 108 blue, 104 red laser events). D) Top panel shows raw LFP traces, middle panel shows theta filtered traces (6-9Hz), while the bottom panel shows theta coherence as a function of time. Yellow box shows stimulation the event. E) VMT activation increased mPFC and hippocampal theta, while reducing other frequencies of the mPFC and hippocampal LFP. VMT activation decreased mPFC-hippocampal theta coherence (bottom panel). F and G) Data from 21-43 (N = 113 blue, 101 red laser events), like those results from 21-42. Notice that VMT stimulation robustly increased mPFC theta power, while reducing mPFC-hippocampal theta coherence. H-K) Data from 21-42 (N = 63 blue, 104 red laser events) and 21-43 (N = 113 blue, 101 red laser events) after excluding the first 0.5s, where visual observations revealed a brief decoupling of mPFC and hippocampal theta oscillations. Both rats showed increased mPFC-hippocampal theta coherence. Lines denote p<0.05 following Benjamini-Hochberg p-value corrections for two-sample t-tests. Data are represented as the mean ± s.e.m.

Two independent loops support brain machine interfacing.

Schematic demonstration of how neural data could be processed in between control of the automatic T-maze. In terms of maze control, serial ports were formed between hardware built from MazeEngineers and an Arduino Uno board. Custom written functions were used to control solenoid valves, which pushed or released air, mediated by a silent air compressor. The solenoid valves and air compressor were placed in a large wooden box, with foam insulation walls, in order to reduce noise. The MazeEngineers hardware was also programmed to control the release of chocolate pellets for reward delivery. Using Arduino-powered infrared beam breaks (yellow lines denote connections), MATLAB could detect the exact location of the rat in order to carry out the programmed sequence of the task. For example, as rats approached a reward zone, an infrared beam break triggered the closing of a door (blue lines on maze) and the release of a reward (if a choice was correct).

A) Cartoon schematic showing that signals were collected from the mPFC and hippocampus, then sent to a computer for processing in real-time. B) Two LFP signals were collected in real-time at various intervals, with an interval being defined as the time-lag in between attempted streaming from the acquisition system recording the neural data and the computer processing the data. Each data point represents an average from 50 attempted streaming events. Notice the negative relationship between the probability of streaming failure and the amount of data streamed. If our program waited 250ms in between streaming attempts, we found a 0 probability of acquisition failure. In practice, even at this interval, there were still rare acquisition failures that could be accounted for via programming. C) Two identical signals were programmed as two different recording channels in the DigitalLynx SX data acquisition system to test if serial streaming of two signals induced time-lags (e.g. one signal being temporally shifted in time relative to the other signal). We found that all serial streaming events were identical, indicating a zero time lag in between extracting two signals in real-time. D) Averaged coherence magnitude (4-12Hz) as a function of data size. Notice that at 250ms, coherence magnitude was highly underestimated. E) Coherence frequency (the frequency corresponding to the strongest coherence values) was modulated by the amount of data analyzed. Notice the coherence frequency to taper at 8Hz when analyzing at least 1.25s worth of data. F) Visual representation of the analyses shown in (D and E). Notice that the shape of the coherence distributions vary as a function of the amount of data analyzed, but are generally consistent when analyzing at least 1.25s worth of data. G) A coherence “epoch” was defined as a 1.25s window, with each epoch varying by 250ms in time. The red colored signal was acquired first, the blue colored signal was acquired after 250ms, and the two signals were overlaid for visualization purposes. H) Stem plot showing theta coherence epochs as a function of time. Notice the rather smooth transitions between stronger and weaker theta coherence values, consistent with a moving window approach sharing a large proportion of data (G). I) Real-time artifact rejection procedures contained strong delta coherence across all rats (red curves). When these artifact rejection procedures were combined with rejection of signals if delta coherence was stronger than theta coherence, highly consistent coherence distributions emerged (black curves). J) By performing these methods in real-time and gathering hundreds-to-thousands of theta coherence values (6-11Hz), coherence distributions were generated via offline data analysis. “High” and “low” magnitude theta coherence thresholds were then defined as +1std and −1std from the mean theta coherence value, respectively.

Detailed representation of brain machine interfacing.

Data were acquired in real-time, then processed in MATLAB. Data processing consisted of fitting and removing a third degree polynomial to detrend the signals (1.25s worth of data), then signals were tested for artifacts. These artifacts were defined as large voltage fluctuations exceeding 4std of a mean and standard deviation generated from 10 minute baseline recordings (as rats occupied a flower pot with motion being more restricted than when on the maze). In real-time, if voltage fluctuations exceeded 4std and these events saturated >1% of the signal, then the brain machine interfacing restarted. If no artifacts were detected, coherence was calculated in 0.5Hz steps from 1-20Hz using mscohere and only if delta coherence (1-4Hz) exceeded theta coherence (6-11Hz), then brain machine interfacing restarted. If on a high coherence trial, theta coherence exceeded delta coherence, and theta coherence was higher than the predetermined threshold, a door was opened, releasing the rat from being sequestered in the delay zone that separated trials. Upon release, rats could make a choice. Similarly, on low coherence trials, if the criterion described above was met and theta coherence was lower than the predetermined threshold, then the trial was initiated. If coherence was not met, the brain machine interface restarted.

Follow-up behavioral analyses from the delayed alternation brain machine interfacing experiment.

A) During task training, time-spent in the delay zone was binned and the average proportion correct (# correct trials/ # trials) was calculated. There was a significant effect of delay duration on future choice outcomes (F(5,35) = 3.38; Repeated Measures ANOVA; N = 8 rats, 4 male, 4 female). This analysis validates the delayed alternation task being a working memory dependent task. B) Time to choice was calculated as the amount of time spent from trial initiation to choice exit (infrared beam break that triggers the reward release). There was no statistical difference between high and yoked trials, although there was a trending difference between low and yoked trials (t(7) = −2.23, ci = [-1.4 0.04]). C) Behavioral complexity (or head-movement complexity) was measured via the integrative change in absolute angular velocity (IdPhi; Redish, 2016), a common metric to extract vicarious trial and error. Low coherence trials showed significantly lower IdPhi relative to yoked trials (t(7) = −2.5, ci = [-68.36 −1.9]). D) Distance (in pixels) was calculated in the last 1.25s before trial initiation, as these times were used to trigger trials according to theta coherence magnitude. There were no differences in distance traveled between coherence and yoked trials. E) The amount of time spent in the delay zone is a proxy of the amount of time it took to reach theta coherence thresholds. There was no significant difference in delay zone time-spent between high and low coherence trials. Planned comparisons between coherence and yoked trials were performed via paired t-tests. *p<0.05. P-values were shown in figure and the statistics were reported in the figure caption of p<0.05.

mPFC-hippocampal theta coherence across a fixed delay.

A) Task schematic showing that in between delayed alternation choices, rats waited for a fixed and predictable, 30s delay duration. B) Two trials showing mPFC-hippocampal theta coherence as a function of time in the delay. Dashed blue line represents high coherence threshold, while the dashed red line denotes low coherence threshold. C) Sample autocorrelation function of mPFC-hippocampal theta coherence (black line). Data are represented as the mean ± s.e.m. Red line denotes the session average calculated from shuffling the distribution of theta coherence values over the delay. Right y-axis shows Bonferroni corrected p-value of a one-sample t-test against the shuffled autocorrelation mean. Arrows point to significant correlations to lags not sharing data (coherence epochs were 1.25s with 250ms overlap). D) High mPFC-hippocampal theta coherence events did not increase in frequency towards trial onset (30s) relative to shuffled theta coherence distributions (red solid line). There was a significant reduction in mPFC-hippocampal theta coherence between 10 and 15s, as denoted by a magenta bar in the figure (t(21) = 2.9, p = 0.046, Bonferroni Corrected for 4 comparisons; one-sample t-test against the shuffled session average).

Details regarding mPFC-VMT-HPC recordings.

Data from (A and B) were used for analyses of LFP-LFP synchrony in Figs 5 and Extended Fig. 5. A) Data from six rats were analyzed, three from Hallock et al., 2016 with simultaneous mPFC and hippocampal recordings and three from Stout and Griffin, 2020. B) High and low coherence thresholds were determined for each rat. Notice that thresholds were rather consistent across rats.

Statistics from the delayed alternation brain machine interfacing experiment from Fig. 2.

Statistics from Fig. 3H showing change in mPFC-hippocampal theta coherence difference scores (high coherence – low coherence trials) as rats navigated towards and away from the choice-point infrared beam.

Statistics from Fig. 5 power analysis

Statistics from Fig. 5 coherence analysis

Multivariate granger prediction results (Fig. 5).