Major depressive disorder (MDD) is a common disorder with high rates of treatment resistance1. Deep brain stimulation (DBS) has shown promise as a treatment for refractory MDD but interindividual response heterogeneity has contributed to inconsistent findings in definitive clinical trials2,3,4. Open-loop approaches deliver fixed, constant stimulation to a single brain structure and have been successful in Parkinson’s disease and epilepsy. In MDD, however, evidence that different neural circuits underlie different subsets of MDD symptoms speaks for personalized circuit targeting5.

There is also need for personalization via temporally controlling stimulation as in closed-loop neuromodulation, where a patient’s own physiological activity is used to selectively trigger stimulation only when a pathological state is detected6. Because the mood-related effects of neuromodulation exhibit state dependence7, this temporal specificity may be critical for success in patients with MDD with frequent state changes. Closed-loop stimulation also mitigates concerns for neural adaptation, preserves battery life and reduces side effects. However, closed-loop therapy requires a symptom-specific biomarker that has not previously been identified in MDD. In this study, we report our experience with a patient, where we identified a biomarker of MDD symptoms during a 10-d period of intracranial corticolimbic circuitry mapping. We then successfully implemented the biomarker in implanted closed-loop therapy. This is a demonstration of chronic closed-loop neuromodulation in a psychiatric disorder.

The patient was a 36-year-old woman with childhood onset severe and treatment-resistant MDD (Montgomery–Åsberg Depression Rating Scale (MADRS) = 36 out of 54) unresponsive to multiple antidepressant combinations and electroconvulsive therapy, who participated in a personalized closed-loop neurostimulation trial7. We first performed stimulus-response mapping of emotion circuitry employing ten stereoelectroencephalography (SEEG) electrodes implanted bilaterally in the orbitofrontal cortex (OFC), amygdala, hippocampus, ventral capsule/ventral striatum (VC/VS) and subgenual cingulate cortex (SGC). We found dimensionally restrictive clinical responses to stimulation across corticolimbic circuitry aligning with different types of depression symptoms7. Neural activity was recorded continuously for 10 d while the patient completed symptom rating scales used to define high and low symptom severity states (Fig. 1a,b).

Fig. 1: Neural biomarker and limbic subnetwork of depression.
figure 1

a, Location of intracranial electrodes and overall approach for biomarker detection. b, Clustering clinical reports on anxiety and depression dimensions resulted in two symptom states. Shading has been added to aid visualization. c, Top neural features (defined by F-score, ANOVA) that discriminated high versus low symptom severity states. Receiver operating characteristic curves reflect the mean ± s.e.m. over n = 1,000 randomly sampled features for the true (blue) and shuffled models (gray). d, Directed network graph of right hemisphere where percentage circumference indicates the strength of connection between any two brain regions. The color indicates the starting location for each set of connections. e, Connectivity strength from the network graph was quantified by calculating the weighted indegree and outdegree. The values represent the sum of incoming/outgoing evoked potential waveform N1 (10–50 ms poststimulation) amplitudes, averaged over n = 20 repeated pulses. f, Example of dose-dependent mean-evoked potentials (left). Summary of evoked potentials across the corticolimbic network due to single pulses in the right VC/VS is shown overlayed on the brain as a heatmap (right). Warmer colors indicate a larger N1 amplitude. g, Location of right-sided iEEG leads with fiber tracts (color-coded by orientation) showing structural connections between the amygdala and clinically responsive VC/VS electrodes. Lead location is indicated by color as in d,e. h, Change in gamma biomarker after a period of continuous stimulation for those trials that led to a reduction in symptom severity (red) and those that did not reduce symptom severity (blue).

Source data

We then identified SEEG spectral activity features in 6 standard frequency bands that discriminated 15-min segments of resting-state activity coinciding with high and low symptom states (n = 35) employing two cross-validated supervised machine learning models at different spatial resolutions. We found that bilateral amygdala gamma power alone was sufficient to detect the high symptom severity state (accuracy: mean = 0.77, s.d. = 0.09; area under the curve (AUC): mean = 0.82, s.d. = 0.11; Fig. 1c and Extended Data Fig. 1a).

We identified right VC/VS as the stimulation site that led to consistent, sustained and dose-dependent improvement of symptoms7. We next examined connectivity to determine whether right hemispheric VC/VS and amygdala nodes constituted a structurally and functionally connected subnetwork. We performed evoked potential mapping to generate a global directed network graph8 (Fig. 1d) and quantified node-relative importance. We found that the amygdala and hippocampus integrated signals from many brain regions (highest weighted indegree) while VC/VS influenced many distant brain regions (highest weighted outdegree; Fig. 1e). Furthermore, the VC/VS-stimulated evoked response was stronger in the amygdala (Fig. 1f) than other network nodes (Extended Data Fig. 1b). Using deterministic tractography we next identified axonal fiber tracts underlying this effective connectivity. Dense right VC/VS-amygdala structural connectivity consisted of the stria terminalis and ansa peduncularis (Fig. 1g and Extended Data Fig. 1c). Finally, VC/VS stimulation at contacts 2+/3 improved clinical symptoms on 11 out of 13 trials. We examined the change in amygdala gamma power with stimulation with a variety of stimulation paradigms and baseline symptom severities where we had clinical and SEEG data (n = 5 trials). We observed a reduction in amygdala gamma power on both trials where symptom severity improved, which was absent on trials when symptom severity did not improve due to alternate stimulation paradigms, minimal baseline symptoms or a primary effect on activation over depression (Fig. 1h).

We next implanted the U.S. Food and Drug Administration (FDA)-approved NeuroPace RNS System9 unilaterally in the right hemisphere (Fig. 2a), with two separate sensing/stimulation four-contact depth leads placed in the amygdala and VC/VS, respectively (Fig. 2b). The NeuroPace RNS System continuously senses neural activity; detection of prespecified patterns of activity are coupled to delivery of electrical stimulation to designated electrodes. Using the NeuroPace RNS System telemetry wand, we wirelessly streamed 10-min trials of continuous amygdala real-time electrocorticography while the patient engaged in naturalistic activities (for example, social media, virtual therapy). We then paired the neural activity with clinical severity ratings (Fig. 2c) and found that the symptom-specific amygdala gamma power replicated findings from the 10-d intracranial mapping. It was highly correlated with both the visual analog scale-depression (VAS-D) (r2 = 0.79, P = 4.6 × 10−5), VAS-anxiety (VAS-A) (r2 = 0.53, P = 7.5 × 10−3) and the 6-item Hamilton Depression Rating Scale (HAMD-6) (r2 = 0.68, P = 6.5 × 10−4; Fig. 2d) and significantly differentiated the high and low symptom severity states (analysis of variance (ANOVA), F = 6.37, P = 0.012).

Fig. 2: Implementation of closed-loop neuromodulation.
figure 2

a, Fully implantable DBS system (illustrated by K. X. Probst). b, Reproducibility of targeting showing robust engagement of the stria terminalis and ansa peduncularis. VC/VS lead, yellow; amygdala lead, pink. c, Distribution of symptom severity scores in relation to clusters identified in the mapping study. d, Positive correlation between gamma power in amygdala contacts 1/2 and 3/4 within the 10-min trials and HAMD-6 score. The linear regression model was evaluated using a two-sided F-test and P values were adjusted for multiple comparisons. The linear model fit is presented as the mean ± s.e.m. over n = 16 symptom ratings. e, Reproducibility of clinical effects. Each point represents a stimulation trial (n = 6, 2, 4, 5 for VAS-D; n = 6, 2, 3, 4 for HAMD) at different bipolar configurations across the right VC/VS and amygdala. f, Left: Effect of burst duration on clinical measures. Stimulation parameters: contact 3+/4, 1 mA, 36 s total stimulation across 15.6 min in 6–36 s intervals. Highlighted condition (6-s burst duration) selected for implementation of closed-loop therapy. Right: Effect of increasing dose (1–2 mA) and changing contacts (3+/4 to 2+/3) on clinical measures. The faded colors indicate that ON/OFF states were detected by the patient (one trial per condition). g, Schematic of closed-loop control. h, Positive correlation between number of gamma detections by the NeuroPace RNS System within 10-min trials as in d and HAMD-6 score. The linear regression model was evaluated using a two-sided F-test and P values were adjusted for multiple comparisons. The linear model fit is presented as the mean ± s.e.m. over n = 18 gamma detections. i, Symptom severity scores in the week pre- versus postclosed-loop stimulation onset (n = 3, 31 for VAS-D, n = 2, 30 for HAMD-6). j, Relationship between daily mood ratings (purple) and number of daily biomarker detections (gray). The dotted lines indicate the DTW-computed distance between VAS-D scores and daily biomarker detection numbers (left). Significance was assessed by comparing the DTW distance to that computed from 10,000 randomly scrambled biomarker time series (right).

Source data

The clinical effect of right VC/VS stimulation also replicated results from the intracranial mapping study. Bipolar stimulation at the VC/VS contacts that engaged the stria terminalis and ansa peduncularis (contacts 2+/3, 3+/4, 100 Hz, 120 µs, 1–2 mA) led to acute dose-dependent symptom improvement across most trials and the effect was strongest and preferred by the patient (pleasurable/energizing) at the predicted location (contacts 3+/4) compared to other VC/VS and amygdala contact pairs (Fig. 2e). Furthermore, 6 s of intermittent stimulation at 1 mA was clinically effective and below the patient’s perceptual threshold (Fig. 2f). Increasing the dose to 2 mA or changing contacts led the patient to perceive stimulation and worsened the clinical response on some trials.

We then implemented closed-loop therapy such that 6 s of stimulation were delivered following the device’s automated biomarker detection (Fig. 2g). We found that the number of detections, defined as gamma power crossing a threshold of 0.8% of full amplitude scale within 10-min recording periods was 87% predictive of symptom severity state and highly correlated with VAS-D (r2 = 0.59, P = 1.2 × 10−4), VAS-A (r2 = 0.52, P = 4.6 × −4) and HAMD-6 (r2 = 0.65, P = 1.98 × 10−5; Fig. 2h). Over the course of 2 months, we found that on average, there were 468 detections distributed across the daytime (s.d. = 206) with minimal nighttime stimulations. We set a stimulation cap of 300 therapies per day (30 min total stimulation) so as not to disturb sleep from evening therapy.

Implementation of closed-loop therapy rapidly improved both symptom severity (measured daily with the HAMD-6/VAS scales) and depression (periodic MADRS). The individual’s MADRS score dropped from a 33 before turning treatment ON to a 14 at the first during-treatment assessment carried out after 12 d of stimulation and dropped below 10 (remission) several months later. Similarly, her HAMD-6 and VAS-D scores dropped precipitously the morning after stimulation started (HAMD-6 = 12.0 to 1.0; VAS-D = 77 to 23) and were lower the week after stimulation was turned ON versus the previous week (HAMD-6 = mean 16 (s.d. = 2.82) to 1.6 (s.d. = 1.60), Welch’s t-test P = 0.08; VAS-D = 77.33 (14.57) to 10.48 (5.74), Welch’s t-test, P = 0.02; Fig. 2i).

To evaluate whether our algorithm triggered stimulus delivery linked to patient symptoms, and not randomly, we used dynamic time warping (DTW) to nonlinearly align daily symptom severity (VAS-D) and biomarker detection count time traces over two months and calculated their relative postalignment distance10. We found that fluctuation in daily symptoms was significantly associated with the fluctuation in number of device-detected biomarker events (P = 2.8 × 10−4; Fig. 2j). This suggests that our biomarker detection algorithm detects changes in symptom severity significantly better than random chance.

In conclusion, we show the successful development of a personalized biomarker of depression-specific symptoms and implementation of closed-loop therapy for MDD. Success was predicated on a clinical mapping stage before chronic device placement, a strategy that has been utilized in epilepsy to map seizure foci in a personalized manner but has not previously been performed in other neuropsychiatric conditions. During this stage, we developed a comprehensive multimodal framework for selection of sensing and stimulation brain targets (Extended Data Fig. 2). Our approach included personalized stimulus-response mapping, pairing of resting-state signals with clinical symptom measures and identification of functionally and structurally connected subnetworks across the corticolimbic network.

Network mapping and biomarker discovery suggested that VC/VS-amygdala represented an important limbic subnetwork in this patient. Amygdala gamma power reflected depression severity and could be modulated by VC/VS stimulation to decrease clinical symptoms. Previous work showed that these brain regions are important nodes within the mood regulatory circuitry11. Bursts of high-frequency amygdala activity correlate with emotion states in humans12 and VC/VS has been a thoroughly studied DBS target for depression13 and may be particularly effective for treating anhedonia given its role in the reward pathway. Thus, successful reduction in amygdala gamma may be a requirement for symptom improvement. We validated the amygdala gamma biomarker using the NeuroPace RNS System and identified a set of detection algorithms that enabled us to successfully translate this marker into closed-loop treatment. While traditional DBS is performed bilaterally, we performed right-sided unilateral therapy based on the clinical mapping study and safety considerations. Reasons for observed hemispheric differences are unknown but could be lateralization of emotion regulation or electrode placement within the VC/VS bilaterally.

Our single-participant study cannot evaluate whether the VC/VS-amygdala subcircuit or amygdala biomarker is present in all individuals. Previous literature suggested that the SGC is another promising site for closed-loop stimulation in some individuals14. Our methodology intentionally accounts for intersubject variability in MDD symptoms. In contrast to previous DBS studies, a randomized controlled trial using this approach would identify a unique biomarker and treatment site for each individual. It is possible that this personalized approach will overcome limitations evident in previous randomized controlled trials where efficacy was not found when stimulating the VC/VS (or SGC) in all participants2,3,4. In the future, group-level analyses may assess whether certain symptom profiles are predictive of a stimulation target and help define symptom state thresholds that enhance biomarker identification.

We conceptualized MDD as a dynamic process where symptoms arise when a dysfunctional activity state emerges in one or more prefrontal/limbic brain networks subserving mood-related functions. In this model, stimulation has an immediate impact on symptom severity. An acute response to VC/VS stimulation was observed in previous studies in intraoperative or programming periods15. Yet, is not always sustained once continuous stimulation is initiated. By delivering intermittent stimulation in a closed-loop manner, we hypothesize that we can repeatedly obtain these acute effects and employ them to treat depression. In line with our model, this patient’s depression acutely improved once closed-loop therapy was initiated and the effect has been maintained with sustained closed-loop therapy through the time of writing this article. Both the rapidity and intensity of this clinical response was highly unusual in treatment-resistant depression, where the 1-year remission rate for ‘treatment as usual’ is approximately 3.5%16 and symptom relief from DBS can take months to emerge2.

There are several limitations to this study. First, is the n-of-1 sample. It is unknown if the results will generalize. Furthermore, while the patient was blinded to stimulation location and parameters, the clinicians were usually but not always blinded. It is possible that this affected therapeutic response. It is also possible that non-affective sensations elicited during stimulation influenced her affective response. We made efforts to minimize this likelihood by keeping the patient blinded and reducing stimulation intensity if such sensations were observed or reported. Due to device capabilities, we were limited to exploring biomarkers in the power domain in a few frequency bands that could be detected in a time window of a few seconds. New device capabilities that sense continuous neural activity and have the capability to integrate information on the timescale of minutes may improve our ability to incorporate more complex biomarkers into closed-loop control17. The degree of network plasticity or drift in the biomarker signal across time is another area for future work. The intent of this study was not to address the efficacy of closed-loop neuromodulation for MDD, which would require a double-blind, randomized controlled, adequately powered study. In this study, we established proof-of-concept for a new powerful treatment approach for neuropsychiatric disorders. The new framework presented in this article could advance biomarker-based neural interfaces and enhance the mechanistic understanding and treatment of a broad range of neuropsychiatric conditions.



In this n-of-1 study, the patient was a 36-year-old woman with childhood onset severe, treatment-resistant MDD (MADRS = 36 out of 54) unresponsive to multiple antidepressant combinations and electroconvulsive therapy.

Surgical procedure

The patient gave written informed consent for participation in a clinical trial of closed-loop neuromodulation for treatment-resistant MDD (PReSiDio: NCT04004169), approved by the institutional review board of the University of California, San Francisco (UCSF) and by the FDA. (Please see the Life Sciences Reporting Summary published along with this case report for additional details.) The patient underwent two implant surgeries. In the first, we surgically implanted ten SEEG electrodes (PMT Corporation) within the OFC, amygdala, hippocampus, VC/VS and SGC as described in Scangos et al.7. Exploratory intracranial stimulation and recording took place over a 10-d period (October 2019). After 10 d, the electrodes were explanted. In the second implant surgery, we implanted the NeuroPace RNS System with 2 four-contact-depth leads (30-cm lead length, 3.5-mm electrode spacing) in the right VC/VS and amygdala, guided by our findings in the 10-d recording and monitoring (mapping) period. Surgical targeting was planned using the Brainlab iPlan Cranial Software (v3.0) using diffusion tensor imaging (DTI)18 or coordinate-based targeting3 in accordance with published work. Computerized tomography was used intraoperatively to confirm electrode placement. No complications of surgery occurred.

Clinical measures

To assess moment-to-moment changes in MDD symptom severity, we used VAS-D19 and VAS-A and the HAMD-6 of the HAMD-17, which is thought to capture the core symptoms of the full scale and has been used to assess the rapid effects of antidepressants20,21,22. Our symptom assessment strategy included an a priori plan to consider the dimensions of depression that can change in the course of a day as represented in the HAMD-6 subscale of the HAMD-17, which includes: (Q1) sadness; (Q2) guilt; (Q3) apathy; (Q4) fatigue; (Q5) anxiety; and (Q6) energy but focusing only on the dimensions that were possible to meaningfully operationalize in the setting of repeated testing with a VAS (depression, anxiety) and were the smallest number needed to reflect the symptom profile of the patient. Study data were collected and managed using the Research Electronic Data Capture (REDCap, v10.6.19) electronic data capture tools hosted at UCSF23,24. REDCap is a secure, Web-based software platform designed to support data capture for research studies, providing (1) an intuitive interface for validated data capture, (2) audit trails for tracking data manipulation and export procedures, (3) automated export procedures for seamless data downloads to common statistical packages and (4) procedures for data integration and interoperability with external sources. The patient performed her in-lab and at-home surveys using this tool on a study iPad. In the clinical mapping stage, she performed 335 VAS-D, VAS-A and HAMD-6 scales over the 10 d. Scores were distributed across the full range of the patient’s natural emotions (VAS-A, mean = 17.5, s.d. = 21.7; VAS-D, mean = 26.3, s.d. = 12.9). These measures were used to define two symptom states (high and low symptom severity). Once the NeuroPace RNS System device was in place, the patient was asked to perform at-home surveys 2–3 times per day.

Signal processing

Intracranial electroencephalogram (iEEG) recordings derived from SEEG electrodes were used to derive measures of activity and connectivity. This is a high-resolution intracranial recording technique25 and is commonly used in the presurgical evaluation of drug-resistant epilepsy. Stimulation through these electrodes (single pulses26 or continuous stimulation27) was used to perform stimulus-response mapping, assess connectivity and assess the effects of perturbation to MDD networks. Data acquisition of iEEG recordings and evoked potential mapping were performed with a 256-channel Nihon Kohden clinical system and secondary data stream at a sampling rate of 10 kHz. Standard SEEG preprocessing techniques were conducted in Python and involved application of a 2–250 Hz bandpass filter, notch filters at line noise frequency and harmonics, downsampling to 512 Hz and common average referencing across all channels. Signal processing was performed using the continuous wavelet transformation (Morlet, 6-cycles)28 at 30-s intervals to obtain power in 6 spectral frequency bands (delta = 1–4 Hz, theta = 5–8 Hz, alpha = 9–12 Hz, beta = 13–30 Hz, low gamma = 31–70 Hz, high gamma = 71–150 Hz). Artifacts in evoked potential analysis were removed with an eighth-order Butterworth filter.

Electrode stimulation

Our approach to clinical mapping is discussed elsewhere7. Briefly, we tested the clinical effect of a set of stimulation parameters used in the evaluation of patients with epilepsy (1 or 100 Hz, 100 µs, 1–6 mA) through a systematic bipolar stimulation survey and then blinded sham-controlled stimulation studies across 10 d. Where indicated, the brain stimulation configuration is represented by contact number and polarity (for example, 2+/3 reflects that contact 2 is anode and contact 3 is cathode). Once the NeuroPace RNS System device was in place, we repeated the bipolar stimulation survey and sham-controlled stimulation using the same clinical scales as outcome measures. The study was single-blinded such that the patient was blinded to stimulation location and parameters. Closed-loop neuromodulation introduces a new stimulation parameter—the burst duration delivered once a depressed state is detected. We tested the effect of burst duration in a systematic manner by delivering increasing durations of stimulation (6, 12, 18, 36 s bursts,100 Hz, 120 µs, 1 mA) while keeping total stimulation time constant over 15- and 30-min time intervals. Our strategy was to identify a set of parameters where intermittent stimulation was clinically effective over a time interval but each burst onset was not detected by the patient to prevent interfering with normal activities and select shorter more frequent bursts over less frequent but longer stimulation periods to increase specificity.

Biomarker discovery

The development of symptom-specific biomarkers in depression have been challenged by the lack of objectively observable clinical symptoms, such as those that exist in movement disorders, and the multidimensional nature of MDD. We addressed this challenge during the mapping trial in several ways. We included a high trial count to address inherent noise in the self-assessment of internal state. We also ensured there was variability across time in the measures by including the presence of mood variability as one of the inclusion criteria of the clinical trial and having the patient perform naturalistic activities in the laboratory setting that induced symptom state variation (for example, recalling life events, watching movies, using social media) during the 10-d period. Then, based on the anxiety and depression dimensions of the VAS scale, we sought to identify states of high and low symptom severity objectively using semisupervised k-means clustering. Specifically, to discriminate noisy ratings from clinically relevant ratings, we used cluster tuning and cluster aggregation to discriminate two symptom severity states based on the VAS ratings that best corresponded to the clinically established HAMD-6 scores.

To identify spectral biomarkers related to symptom severity state, we asked the patient to rest for 15-min and then assessed MDD symptom severity (self-reported HAMD-6, VAS scales) about 5 times each day. These 15-min intervals were required to be at least 1 h from stimulation to minimize any potential influence of stimulation on neural activity. Spectral power was calculated in 30-s intervals and averaged across the 15-min recording period to obtain power in 6 frequency bands. We then modeled differences in spectral power across symptom states to identify the spectral power features that were predictive of high symptom severity using cross-validated machine learning models. In the first model, the feature set was defined by spectral power averaged across all contacts within brain regions (10 regions × 6 bands = 60 features). In a second model, the feature set was defined by spectral power for each electrode contact (41 anatomically verified contacts × 6 bands = 246 features). The modeling pipeline consisted of feature selection based on ANOVA F value and classification using penalized logistic regression trained on 80% of the data and tested on the remaining 20%. We repeated the training/test schema 1,000 times to ensure stability in AUC score and feature importance histograms. Significance was assessed by comparing the output of our logistic classifier to a null model obtained from randomly permuting class labels 1,000 times.

In closed-loop mode, delivery of therapeutic stimulation is expected to normalize the biomarker that triggers the stimulation. To test the effect of VC/VS stimulation on biomarker activity, we examined the change in gamma power in two 30-s intervals before and after a period of continuous stimulation. We included all types of stimulation trials where we had sufficient iEEG activity and VAS scales. All stimulation was at 100 Hz, 100 µs and 1–3 mA, bipolar contacts 2+3. Stimulation was delivered continuously on 4 out of 5 trials. The change was examined in relation to the change in symptom severity due to stimulation.

We validated the biomarker once the NeuroPace RNS System was in place. In the laboratory setting, we streamed continuous neural data (electrocorticography) using the NeuroPace RNS System wand held over the cranially implanted neurostimulator with a flexible metal arm. Once the final RNS detection parameters were identified, we collected 18 trials with 10 min of resting-state neural activity followed by depression measures over the course of 7 d. As in the 10-d mapping period, the patient engaged in a range of naturalistic activities during the recordings. Logistic and linear regression models were then constructed to assess the relationship of amygdala gamma power and symptom severity state or VAS-D and HAMD-6 scores, respectively.

Effective connectivity

Effective connectivity is a functional connectivity measure that describes the directional influence of one brain region on another29. Intracranial EEG and intracortical stimulation offer the rare and unique capability to directly probe effective network connectivity through the delivery of brief stimulation pulses across adjacent contacts in one brain region and examination of the electrical effect of perturbation—the evoked potentials—in distant contacts. Evoked potential mapping was performed on day 1. We delivered bipolar single pulse stimulation (1, 3, 6 mA) at 0.5 Hz for 40 s to adjacent contact pairs across a central contact pair in each brain region. Standard methods were used26 to measure and quantify evoked potentials including calculating the mean across 20 trials, z-scoring voltage against 50 ms of prestimulus baseline, identifying N1 and N2 by their peak deflection magnitude within the 10–50 and 50–500 ms time windows, respectively, constructing connectivity matrices from N1 response amplitude for the full set of evoked potentials and filtering on statistically significant evoked potentials to generate a directed network graph. We determined which electrodes exhibited statistically significant evoked potentials by comparing the distribution of N1 responses due to 20 single pulses to the distribution of prestimulation baseline fluctuations. The baseline score quantified the amount of spontaneous voltage fluctuation in the absence of stimulation and was calculated by finding the peak deflection magnitude during the 50 ms before stimulation, z-scored against the mean voltage in the 50–100 ms window before stimulation. We used a one-sided Wilcoxon signed-rank test with Benjamini–Hochberg false discovery rate correction to determine if the N1 response was statistically larger than the baseline spontaneous fluctuation. Compared to a uniform z-score threshold, this approach allowed us to account for variable noise between electrodes and identify true evoked potentials with greater sensitivity.

In graph theory, a graph represents the electrophysiology network where nodes are considered to be individual electrodes and the directed link or edge between nodes represents the effect of stimulation of the source node on the amplitude of the neural signal at a distal node30. We computed two graph theoretical metrics from the evoked potential connectivity map—indegree and outdegree—to determine the direction and strength of functional connections between nodes and inform the relationship of stimulation and sensing target candidates. A node with high outdegree is a hub of high network influence in that stimulation there highly affects other nodes in the network and could be indicative of a good treatment target31. A node with high indegree suggests a region that is influenced by stimulation in other regions and may play a role in sensing modifiable neural signatures of MDD that normalize with stimulation elsewhere in the network. We calculated indegree by taking the weighted sum of significant connections (N1 amplitudes) pointed toward each node and outdegree by the weighted sum of significant connections projecting away from each node for right and left hemispheres and the total brain network. We identified those hubs that had the highest values and were directionally connected.


DTI can be used to map structural connectivity by identifying putative axonal fiber tracts that might mediate effective connectivity, thereby constraining our model of functional integration across distant brain regions29. Engagement of specific white matter tracts or the intersection of several tracts has been shown to improve outcomes in DBS for depression32,33. While the exact relationship between structural and functional connectivity is unknown, it has been suggested that structural connectivity properties can be implemented as an informative prior in a Bayesian model of effective connectivity34. Diffusion data were acquired using axial DTI high angular resolution diffusion imaging at 3 Tesla with a 32-channel head coil (B value = 2,000 s mm2, 55 directions). Tractography was performed using deterministic fiber assignment by continuous tracking35, implemented within the Brainlab Fibertracking (v3.0) software. Tractography was based on 3-mm diameter spherical regions of interest centered on each contact of a candidate stimulation and sensing pair; DTI parameters were the same for all pairs with minimum fractional anisotropy = 0.1, minimum fiber length = 80 mm and maximum angulation = 20 degrees. The resulting fiber tracts are color-coded by orientation (red, left to right; green, anterior-posterior and blue, superior-inferior). Using these parameters, the number of streamlines was used to compare the strength of connectivity for each candidate stimulation-sensing pair (VC/VS stimulation-amygdala sensing, VC/VS stimulation-OFC sensing, SGC stimulation-amygdala sensing and OFC stimulation-amygdala sensing).

Closed-loop control

The NeuroPace RNS System was first placed in a sensing-only configuration where neural biomarkers could be detected but no stimulation was delivered (0 mA). For the first 2.5 months, we found a detection algorithm that could identify the amygdala gamma biomarker, modifying several parameters including detector number, bandpass threshold, window size and count criterion. Our final detector included the following parameters: pattern A1 (amygdala 3/4): minimum-maximum frequency = 28.8–125 Hz, minimum amplitude = 0.8%, window size = 160 ms, count criterion = 10, bandpass threshold = 3, detection analysis window size = 2,048; pattern A2 (amygdala 1/2): minimum-maximum frequency = 28.8–125 Hz, minimum amplitude = 0.8%, window size = 160 ms, count criterion = 10, bandpass threshold = 10, detection analysis window size = 2,048. This means a ‘detection’ was triggered when gamma power crossed a threshold of 0.8% of full amplitude scale assessed within a 2-s sliding window for amygdala contacts 3/4 or 1/2. While the NeuroPace RNS System does not implement standard frequency decomposition algorithms, the half-wave detector approximates frequency content. In combination with the minimal amplitude settings, the detector tracked gamma activity.

With this detector ON, we examined the number of detections in the 10-min resting-state intervals for the 18 trials utilized for biomarker validation. Logistic and linear regression models were constructed using the number of stimulations as the dependent variable and the symptom state or HAMD-6/VAS-D score as the independent variable. On day 74, the NeuroPace RNS System was turned on in closed-loop mode with stimulation ON (1 mA, 120 µs, 100 Hz). We capped therapy number at 300 per day (30-min total stimulation per day), which was reached at 81.1% of days. On days when the limit was reached, this occurred on average at 19:40 (s.d. = 3.3 h). This limit was selected because stimulation delivered into the evening hours interfered with the patient’s sleep. Therapy limit reset time was at 7:00.

To investigate the relationship between daily symptom severity scores (VAS-D) and the time series of the daily number of biomarker detection counts, we used DTW, a method demonstrated to be effective at relating time series exhibiting naturalistic noise36. After normalizing symptom severity (VAS-D) and biomarker detection count time traces by their means, we computed the DTW warping function and distance10. To prevent the warping function from skipping important symptom severity or biomarker features and cohere with standard practice, we incorporated a Sakoe–Chiba warping window of size three37. We tested the significance of the symptom severity and biomarker relationship by comparing our DTW distance to DTW distances computed between symptom severity time series and scrambled biomarker detection time series, where the biomarker time series was obtained by randomly shuffling the observed values 10,000 times.

Reporting Summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.