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 trials, we computed mPFC-hippocampal theta coherence in real time during the delay and trials were initiated contingent upon theta coherence magnitude. B) Frequency by coherence distribution calculated on data collected in real time. 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. 2 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) Rat-averaged 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. N = 8 rats (4 male, 4 female).

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) = 5.3, ci = 0.14 to 0.37, padj(x2) = 0.002). Hippocampal theta power was stronger on high coherence compared to low coherence trials (t(7) = 2.47, ci = 0.006 to 0.28, padj(x2) = 0.08, pnot-adj = 0.0427). C) The frequency of prefrontal theta oscillations was significantly higher during high coherence states relative to low coherence states (PFC: t(7) = 3.08, padj(x2) = 0.036, ci = 0.16 to 1.3; hippocampus: t(7) = 1.8, ci = -.17 to 1.3, p = 0.11). Note that 6/8 rats showed higher theta frequency in the hippocampus on high theta coherence states relative to low theta coherence states. 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.53, ci = [0.12 to 0.64], padj(x3) = 0.029) and was significantly stronger than granger prediction in the prefrontal-to-hippocampal direction (t(7) = 3.33, ci = 0.097 to 0.57, padj(x3) = 0.038). No significant effect was observed in the prefrontal-hippocampal direction (t(7) = 0.909, p = 0.39). 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 significantly 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 for raw and corrected p-values). 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. Magenta lines denote p<0.05 after Benjamini Hochberg corrections.

Trials initiated by strong mPFC-hippocampal theta coherence enhance task performance on a two-choice conditional discrimination 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.002). 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. N = 16 sessions over 3 rats.

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 as a function of strong (blue) or weak (red) mPFC-hippocampal theta coherence states. *p<0.05. Data are represented as the mean ± s.e.m.

Optogenetic activation of the ventral midline thalamus increased prefrontal and hippocampal theta power while dynamically adjusting the mPFC-hippocampal theta coherence distribution

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) Top panel, histological confirmation of 64ch silicon probe recordings in the dorsal medial prefrontal cortex. Bottom panel, Optogenetic activation of the VMT at 7Hz produced prefrontal theta rhythms (N = 83 blue, 88 red laser events; rat #1). C) Ratio of log-transformed mPFC theta (6-9Hz) power between blue and red laser events across silicon probe shanks and channels. Values > 1 indicate that theta during blue laser epochs was stronger than during red laser epochs. “NaN” represents an excluded channel. See Extended Fig. 8 for companion figure. Columns represent recording channels per shank, while rows represent shank number from the corresponding medial-lateral placement in the mPFC (B). D) Data from rat #2 (N = 108 blue, 104 red laser events) and rat #3 (N = 113 blue, 101 red laser events). 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 the stimulation event. Arrows point to observed negative deflects in the LFP signals surrounding VMT stimulation onset. E) Power and coherence analyses performed on data during VMT stimulation (0-1.5s from laser onset) as a function of frequency (x-axis), brain region (row), and rat (left/right panels). Both mPFC and hippocampal theta power were increased during VMT stimulation. Coherence between mPFC and hippocampal theta rhythms were reduced or enhanced in a frequency-dependent manner during VMT stimulation. Magenta lines denote p<0.05 following Benjamini-Hochberg p-value corrections for two-sample t-tests between the 6-11Hz range. 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).

Brain machine interface parameterization.

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) Visual representation of the analyses shown in (E and F). 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. E) Averaged coherence magnitude (4-12Hz) as a function of data size. Notice that at 250ms, coherence magnitude was highly underestimated. F) 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. 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) Left panel, 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). Middle panel, same data from left panel, but represented as a scatter plot for correlation analysis. Right panel, k-means clustering was used to algorithmically define short and long delay durations. Short delays were defined as the minimum possible delay length (5s) to the minimum centroid (10.34s). Long delays were defined as the maximum centroid (23.58s) to the maximum possible delay length (30s). There was a greater proportion of correct choices following short delays relative to long delays (t(7) = 3.7, p = 0.007, ci = [3.15, 14.1]). These analyses validate the delayed alternation task as 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.

Analysis of random delay trial onset with coincident strong mPFC-hippocampal theta coherence.

A) Delay duration on brain machine interfacing trials was significantly shorter when compared to the delay duration on random delay trials with coincident strong mPFC-hippocampal theta coherence (t(7) = -3.8, ci = -6.4 to -1.6, p = 0.006; paired t-test). B) There was not a significant difference between random trials that co-occurred with strong mPFC-hippocampal theta coherence when compared to a distribution of trials with the same delay durations (t(7) = 2.4, ci = [-0.0048 to 0.184], p = 0.0598). C) Estimation of “delay matched” trials in (B) was obtained by finding trials with identical delay durations. Unlike the brain machine interfacing experiment, these delays were distributed across the session and contribute unequally to the dataset (i.e. a high theta coherence trial in the brain machine interfacing experiment had exactly one yoked control trial in a 10-trial block). There was no difference in the delay length for random high coherence trials and random trials with identical delay durations (t(7) = 0.25, ci = -1.7 to 2.1, p = 0.81). D) Top panel: Distribution of percent change on the delayed alternation task on random delay trials across rats. Positive values indicate that rats performed better on a random delay trial if it was temporally coincident with strong mPFC-hippocampal theta coherence. Bottom panel: Difference in delay duration as a function of rat number. Data are represented as the mean ± sem. Statistical test performed was the paired t-test and corresponding p-values are shown above the figure.

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. 6) 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.

Prefrontal power spectra across recording shanks and channels during ventral midline thalamus stimulation. Companion figure to Fig. 6C.

Log-transformed power as a function of frequency. Blue lines represents power spectral density estimates from mPFC signals recorded during ventral midline thalamus stimulation. Red lines represent power spectral density estimates from mPFC signals recorded during control (red laser) stimulation. Figure columns represent recording channels per shank, while rows represent shank number from the corresponding medial-lateral placement in the mPFC (see Fig. 6A-C).

Sessions recorded with VMT stimulation.

A) Stimulation of the VMT occurred when hippocampal theta power was greater than hippocampal delta power, when theta coherence was neither above a high coherence threshold nor below a low coherence threshold, and using a phase-lag of -1 phase/pi based on visualization of the phase-lag spectrum (N = 57 red, 57 blue laser stimulation events; 1mW power). B) Like in (A), laser onset was timed according to a theta delta ratio and theta coherence magnitude, but this occurred as the animal explored a maze (N = 91 blue, 78 red laser stimulation events; 1mW power). C) Laser onset was timed to epochs when theta power in the hippocampus was less than delta power in the hippocampus (N = 114 red, 131 blue laser stimulation events; 1mW power). D) The VMT was stimulated at 6Hz when hippocampal theta power was less than delta power (N = 104 red, 93 blue laser events). E) Same data as shown in Fig. 6. VMT stimulation was timed around hippocampal theta power exceeding hippocampal delta power, and mPFC-hippocampal theta coherence magnitude falling in between high and low coherence thresholds (113 blue, 101 red laser events; 4.5mW power). F) Rat #2 received 7Hz stimulation randomly (N = 57 red, 57 blue laser stimulation events; 17mW power). G) As shown in Fig. 6, rat #2 also received a session with 8Hz VMT stimulation timed to epochs when 8Hz theta power was the strongest frequency across 1-50Hz (104 red, 108 blue laser stimulation events). Data are represented as the mean ± s.e.m. Benjamini Hochberg corrected p-values are represented in magenta, tested over 6-11Hz with two-sample t-tests. H) The VMT of rat #3 was stimulated across various frequency ranges to understand the effect of VMT theta on the enhancement of prefrontal oscillation power. Each sub-panel represents a power spectrum calculated over the averaged LFP from 1/8 shanks on a 64ch silicon probe. Blue colors indicate blue laser stimulation, red indicates red laser stimulation, black indicates data after stimulation end. VMT stimulation increased mean power when stimulated at 7Hz (N = 83 blue, 88 red laser events), 15Hz (N = 44 blue, 42 red laser events), and 30Hz (N = 34 blue, 52 red laser events), but altered the shape of the power spectrum at 4Hz (N = 39 blue, 47 red laser events). Red laser stimulation increased mean 15Hz and 30Hz power on Shank #5 (S5). Data are represented as the mean.

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).