*2.4. MER Acquisition*

Up to 5 microelectrodes were used to record neuronal activity along the planned trajectory in order to identify the target. Data were recorded from 10 mm above to 5 to 7 mm below the target in steps of 0.5–1 mm for approximately 30 s at each recording location (mean 35.94 s, SD 15.93). Data from a typical electrode track is shown in Figure 1A.

The target for all patients was the STN. The electrodes classically passed through the thalamus, zona incerta, STN and sometimes reached into the dorsal border of the substantia nigra reticulata. The electrode signal was sampled at 20 or 25 kHz, bandpass filtered online, (V3.15; Inomed Medizintechnik GmbH, Emmendingen, Germany) and saved for offline analysis. The first 41 patients were recorded with a high-pass filter 160 Hz, thereafter the high-pass filter was at 0 Hz, low-pass filter was at 5000 Hz.

**Figure 1.** Overview of the sorting process. (**A**) Example recording trajectory of one electrode with 5 s of data shown at each site. Grey shading indicates sites identified as within the subthalamic nucleus (STN). (**B**) Expanded view of data from one recording site (region highlighted by a dashed box in A) with the spike detection threshold set by A.M.A.S. (blue) and M.J.B. (purple); (**C**) clusters of the spike waveforms identified from the example recording by A.M.A.S. and M.J.B.; (**D**) spike waveform (mean: thick lines, thin lines: standard deviation) of the spike sorted from the example recording by A.M.A.S. and M.J.B.; (**E**) Autocorrelation of the spike times from the example recording by A.M.A.S. and M.J.B.; (**F**) The proportion of sites with identified single units (SU)s (discovery rate) was quite similar, indicating that all sorters applied comparable criteria. (**G**) Nevertheless, the mean firing rate of STN neurons differed somewhat between sorters.

### *2.5. Data Processing and Analysis*

Custom-written MATLAB scripts (V2017B; MathWorks) were used to conduct the data-analysis. For each recording, the raw data were high-pass filtered at 300 Hz prior to visual and auditory inspection. To identify single unit (SU) activity, periods of interest were manually selected to exclude periods of high noise or unstable SU activity. Spike times were identified by signal crossings of a manually set threshold (Figure 1B). Spikes representing SUs were selected using principal component analysis and K means clustering (Figure 1C). Manual selection was used for sorting SU clusters. SU clusters were confirmed as SUs by inspecting their autocorrelation, with a minimum gap of 2 ms between spikes representing the refractory period. For added robustness, this analysis was independently performed by 4 authors (A.M.A.S., M.J.B., R.B. and M.J.R.) (Figure 1C–G). For the main analysis data sorted by A.M.A.S. was used, who inspected all recording sites in our sample. Firing rate (spikes per second) of the SUs were calculated by dividing the number of spikes by the recording time. The coefficient of variation (CV) was defined by dividing the standard deviation of the inter-spike interval by the mean.

To identify multi-unit activity (MUA) we calculated the power-spectral density of the signal within the bandwidth of 100 and 500 Hz. Periods of high noise were automatically identified and rejected by calculating the root-mean squared (RMS) of the high-pass filtered data in segments of 50 ms. Periods in which the RMS exceeded the median RMS + 3 standard deviations were excluded from further analysis [17]. Following this procedure, the surviving raw (unfiltered) data were cut into

non-overlapping snips of 250 ms and the power-spectral density was calculated using a multitaper method with discrete prolate spheroidal sequences using the Fieldtrip MATLAB toolbox [18]. To account for non-biological di fferences between recording tracts (electrode and tissue impedance etc.) power at each frequency was expressed as a ratio with respect to power at the first 5 recording sites. Finally, MUA total power, hereafter referred to simply as MUA, was calculated as the sum of all baseline corrected power above 300 Hz.
