OSCR

ACORN: Adaptive Consensus of Repeated Clusterings Identifies Pyramidal Neurons and Interneurons in the Primate Motor Cortex Based on Extracellular Spike Waveforms.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 3 matches
  1. [1] § Materials and Methods ↔ cleanspike.py, lines 116 to 181 · score 0.67 · pattern matched noise, spike waveforms, cleanspike, stimuli, imputation, sweeps · Report a mismatch
  2. [2] § Materials and Methods › Code accessibility ↔ cleanspike.py, lines 1 to 61 · score 0.59 · pattern matched noise, Precision, imputation, Windows, Python, MATLAB · Report a mismatch
  3. [3] § Materials and Methods ↔ cleanspike.py, lines 1 to 61 · score 0.56 · background noise, spike window, troughs, waveform · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 346 lines · 18 KB · no license · 3 matches

  1. #!/usr/bin/env python
  2. # coding: utf-8
  3. """
  4. cleanspike.py -- Python port of cleanspike.m from the ACORN repository.
  5. "Pattern-matched noise imputation": every sweep is aligned on its trough, and
  6. the parts of the spike window before and after the spike itself are replaced by
  7. stretches of that sweep's own background noise, chosen so that they join the
  8. remaining waveform as smoothly as possible.
  9. cleaned = cleanspike(inputsweeps, stimulusindex, spikestartindex,
  10. spiketroughindex, spikeendindex, samplingfrequency)
  11. * inputsweeps should be a matrix of sweeps-by-samples
  12. * stimulusindex should be, in samples, the time of the main stimulation (set it to NaN if not applicable!, e.g. when no stimulation was delivered)
  13. * spikestartindex should be, in samples, the time when the mean spike is considered to have begun (better to err on the side of including a bit more than needed)
  14. * spiketroughindex should be, in samples, the time when the mean spike shape is at its lowest
  15. * spikeendindex should be in, in samples, the time when the mean spike is considered to have ended (better to err on the side of including a bit more than needed)
  16. * samplingfrequency should be the number of samples per second
  17. * outputsweeps will be a matrix of sweeps-by-samples, with spike waveforms "cleaned" through "pattern-matched noise imputation"
  18. * the optional second return value will be a matrix of sweeps-by-samples, with spike waveforms aligned but NOT "cleaned" through "pattern-matched noise imputation"
  19. The calculation follows the MATLAB file line by line (the MATLAB variable names
  20. are kept so the two can be read side by side). Deliberate differences:
  21. * INDEXING. Sample indices are 0-based by default, as everywhere else in
  22. Python. If your indices come from MATLAB (1-based), pass ``index_base=1``;
  23. the numbers are then interpreted exactly as cleanspike.m interprets them.
  24. * The second MATLAB output (nargout > 1) is requested with
  25. ``return_aligned=True``.
  26. * The input array is never modified, and it is always processed in float64.
  27. (cleanspike.m computes in single precision if given single precision, so
  28. results then agree to about 7 digits only. Integer arrays cannot hold NaN,
  29. which the method relies on; cleanspike.m needs floating-point input, the
  30. port converts.)
  31. * Out-of-range windows raise an error instead of silently wrapping around
  32. (negative indices mean "count from the end" in numpy).
  33. Requires only numpy.
  34. """
  35. from __future__ import annotations
  36. import math
  37. import warnings
  38. import numpy as np
  39. __all__ = ["cleanspike"]
  40. # --- constants, identical to cleanspike.m ------------------------------------
  41. SPIKEWINDOWMS = 2.0 # ms, duration
  42. TROUGHMS = +0.3 # ms, relative to spike window start
  43. ALIGNMENTSEARCHRADIUSMS = 0.1 # ms, max for aligning troughs across sweeps
  44. PRESTIMULUSENDMS = -8 # ms, relative to stimulusindex
  45. MAINSTIMULUSSTARTMS = -1 # ms, relative to stimulusindex
  46. MAINSTIMULUSENDMS = +2 # ms, relative to stimulusindex
  47. # --- small helpers that reproduce MATLAB behaviour ---------------------------
  48. def _matlab_round(x: float) -> int:
  49. """MATLAB round(): ties go away from zero (Python's round() goes to even)."""
  50. a = abs(x)
  51. r = math.floor(a)
  52. if a - r >= 0.5:
  53. r += 1
  54. return int(math.copysign(r, x))
  55. def _as_index(value, name: str) -> int:
  56. """Accept only whole numbers as sample indices (MATLAB would error too)."""
  57. f = float(value)
  58. if not math.isfinite(f) or f != math.floor(f):
  59. raise ValueError(f"{name} must be a whole number of samples, got {value!r}")
  60. return int(f)
  61. def _nanargmin_first(x: np.ndarray) -> tuple[int, bool]:
  62. """0-based position of the smallest non-NaN value (first one if tied).
  63. MATLAB's min() returns index 1 when everything is NaN; so do we (0), and
  64. the second return value says that this happened. (np.argmin would return
  65. the position of the first NaN, np.nanargmin would raise.)
  66. """
  67. valid = ~np.isnan(x)
  68. if not valid.any():
  69. return 0, True
  70. return int(np.nanargmin(x)), False
  71. def _exclude(mask: np.ndarray, first: int, last: int, name: str) -> None:
  72. """mask(first:last) = false with MATLAB 1-based inclusive indices.
  73. An empty range (last < first) does nothing, as in MATLAB. It is NOT passed
  74. on to numpy, where e.g. mask[0:-50] would blank almost the whole array.
  75. """
  76. if last < first:
  77. return
  78. if first < 1:
  79. raise IndexError(f"{name}: range starts before the first sample")
  80. if last > mask.size:
  81. # MATLAB would silently grow the logical array; the net effect there is
  82. # the same as stopping at the last sample.
  83. warnings.warn(f"{name}: range ends after the last sample; clipped", stacklevel=3)
  84. last = mask.size
  85. mask[first - 1:last] = False
  86. def _nan_counts(x: np.ndarray) -> np.ndarray:
  87. """c[j] = number of NaNs in x[0:j]; so x[a:b] has c[b] - c[a] NaNs."""
  88. return np.concatenate(([0], np.cumsum(np.isnan(x))))
  89. # --- the function -------------------------------------------------------------
  90. def cleanspike(inputsweeps, stimulusindex, spikestartindex, spiketroughindex,
  91. spikeendindex, samplingfrequency, *, index_base: int = 0,
  92. return_aligned: bool = False):
  93. """Clean spike waveforms by pattern-matched noise imputation.
  94. Parameters
  95. ----------
  96. inputsweeps : array, sweeps-by-samples
  97. One sweep per row. Not modified.
  98. stimulusindex : number, NaN or None
  99. Sample of the main stimulation. NaN/None if no stimulation was
  100. delivered (nothing stimulus-related is then excluded).
  101. spikestartindex, spikeendindex : int
  102. Samples where the mean spike is considered to begin / to have ended
  103. (better to err on the side of including a bit more than needed).
  104. spiketroughindex : int
  105. Sample where the mean spike shape is at its lowest.
  106. samplingfrequency : number
  107. Samples per second.
  108. index_base : 0 or 1, keyword only
  109. 0 (default): the four indices above are Python-style, first sample = 0.
  110. 1: they are MATLAB-style, first sample = 1, exactly as in cleanspike.m.
  111. return_aligned : bool, keyword only
  112. Also return the aligned but NOT cleaned spike windows (the optional
  113. second output of cleanspike.m).
  114. Returns
  115. -------
  116. outputsweeps : float64 array, sweeps-by-window samples
  117. Cleaned spike waveforms (window = 2 ms starting 0.3 ms before trough).
  118. originalindividualspikeshapes : float64 array, only if return_aligned
  119. """
  120. if index_base not in (0, 1):
  121. raise ValueError("index_base must be 0 (Python) or 1 (MATLAB)")
  122. tomatlab = 1 - index_base # added to a user index to get the MATLAB index
  123. # MATLAB passes arrays by value; numpy passes references. Work on a private
  124. # float64 copy so the caller's data is untouched and NaN can be stored.
  125. inputsweeps = np.array(inputsweeps, dtype=np.float64, copy=True)
  126. if inputsweeps.ndim == 1:
  127. inputsweeps = inputsweeps[np.newaxis, :] # a single sweep
  128. if inputsweeps.ndim != 2:
  129. raise ValueError("inputsweeps must be a sweeps-by-samples matrix")
  130. sweepn, analysiswindown = inputsweeps.shape
  131. samplingfrequency = float(samplingfrequency)
  132. # From here on all indices are MATLAB indices (1-based, ranges inclusive);
  133. # they are turned into numpy slices only at the point of use.
  134. spikestartindex = _as_index(spikestartindex, "spikestartindex") + tomatlab
  135. spiketroughindex = _as_index(spiketroughindex, "spiketroughindex") + tomatlab
  136. spikeendindex = _as_index(spikeendindex, "spikeendindex") + tomatlab
  137. if stimulusindex is None:
  138. stimulusindex = math.nan
  139. stimulusindex = float(stimulusindex)
  140. if math.isinf(stimulusindex):
  141. raise ValueError("stimulusindex must be a number, NaN or None")
  142. stimulusindex += tomatlab
  143. if not 1 <= spiketroughindex <= analysiswindown:
  144. raise IndexError(f"spiketroughindex is outside the sweep ({analysiswindown} samples)")
  145. alignmentsamples = math.ceil(ALIGNMENTSEARCHRADIUSMS / 1000 * samplingfrequency)
  146. spikewindowstart = math.floor(spiketroughindex - TROUGHMS / 1000 * samplingfrequency)
  147. spikewindowend = math.ceil(spikewindowstart + SPIKEWINDOWMS / 1000 * samplingfrequency)
  148. spikewindown = spikewindowend - spikewindowstart + 1
  149. # in samples, relative to spike window start (1-based position in window)
  150. troughinwindow = 1 + _matlab_round(TROUGHMS / 1000 * samplingfrequency)
  151. if spikewindowstart < 1 or spikewindowend > analysiswindown:
  152. raise IndexError(
  153. f"the spike window (samples {spikewindowstart - tomatlab}..{spikewindowend - tomatlab}) does not "
  154. f"fit inside the sweep ({1 - tomatlab}..{analysiswindown - tomatlab}); cleanspike.m fails here as well")
  155. # --- align the trough of every sweep -------------------------------------
  156. currentlookfrom = max(spiketroughindex - alignmentsamples, 1)
  157. currentlookuntil = min(currentlookfrom + 2 * alignmentsamples, analysiswindown)
  158. for sweepi in range(sweepn):
  159. currentlocalminwhere, _ = _nanargmin_first(inputsweeps[sweepi, currentlookfrom - 1:currentlookuntil])
  160. currentlocalminwhere += 1 # MATLAB position within the search range
  161. displacementneeded = spiketroughindex - (currentlookfrom + currentlocalminwhere - 1)
  162. if displacementneeded > 0:
  163. inputsweeps[sweepi, displacementneeded:] = inputsweeps[sweepi, :-displacementneeded].copy()
  164. inputsweeps[sweepi, :displacementneeded] = np.nan
  165. elif displacementneeded < 0:
  166. inputsweeps[sweepi, :displacementneeded] = inputsweeps[sweepi, -displacementneeded:].copy()
  167. inputsweeps[sweepi, displacementneeded:] = np.nan
  168. # .copy(): a numpy slice is a view, a MATLAB slice is a copy
  169. individualspikeshapes = inputsweeps[:, spikewindowstart - 1:spikewindowend].copy()
  170. originalindividualspikeshapes = individualspikeshapes.copy()
  171. with warnings.catch_warnings():
  172. warnings.simplefilter("ignore", RuntimeWarning) # all-NaN column -> NaN, silently as in MATLAB
  173. originalmeanspikeshape = np.nanmean(individualspikeshapes, axis=0)
  174. potentialnoisesweeps = inputsweeps.copy()
  175. ispotentialnoise = np.ones(analysiswindown, dtype=bool)
  176. # exclude our spike from being considered as a potential source for imputation
  177. _exclude(ispotentialnoise, spikestartindex, spikeendindex, "spikestartindex:spikeendindex")
  178. if not math.isnan(stimulusindex): # if it's NaN, nothing stimulus-related is excluded
  179. # exclude the prestimulus interval
  180. prestimulusendindex = min(math.ceil(stimulusindex + PRESTIMULUSENDMS / 1000 * samplingfrequency),
  181. analysiswindown)
  182. _exclude(ispotentialnoise, 1, prestimulusendindex, "prestimulus interval")
  183. # exclude the main stimulus interval
  184. mainstimulusstartindex = max(math.floor(stimulusindex + MAINSTIMULUSSTARTMS / 1000 * samplingfrequency), 1)
  185. mainstimulusendindex = min(math.ceil(stimulusindex + MAINSTIMULUSENDMS / 1000 * samplingfrequency),
  186. analysiswindown)
  187. _exclude(ispotentialnoise, mainstimulusstartindex, mainstimulusendindex, "main stimulus interval")
  188. # --- exclude "probable spikes", now on a per-sweep basis ------------------
  189. for sweepi in range(sweepn):
  190. currentpotentialnoise = potentialnoisesweeps[sweepi, :].copy()
  191. currentpotentialnoise[~ispotentialnoise] = np.nan # exclude stimulation artifacts from the noise estimate
  192. validn = int(np.count_nonzero(~np.isnan(currentpotentialnoise)))
  193. if validn == 0:
  194. currentspikethreshold = math.nan
  195. else:
  196. # per Quiroga, Nadasdy & Ben-Shaul (2004), after Donoho & Johnstone (1994)
  197. currentspikethreshold1 = 3 * np.nanmedian(np.abs(currentpotentialnoise)) / 0.6745
  198. # MATLAB std() normalises by N-1 (numpy's default is N) and gives 0 for a single value
  199. currentpotentialnoisestd = np.nanstd(currentpotentialnoise, ddof=1) if validn > 1 else 0.0
  200. currentspikethreshold2 = 0 + 3 * currentpotentialnoisestd # grand mean should be 0 (highpass)
  201. # the more conservative of the two thresholds (which will exclude more)
  202. # (np.fmin ignores a NaN operand like MATLAB's min; Python's built-in min() does not)
  203. currentspikethreshold = float(np.fmin(currentspikethreshold1, currentspikethreshold2))
  204. with np.errstate(invalid="ignore"):
  205. exclude = (~ispotentialnoise
  206. | (currentpotentialnoise > currentspikethreshold)
  207. | (currentpotentialnoise < -currentspikethreshold))
  208. potentialnoisesweeps[sweepi, exclude] = np.nan
  209. windowpositions = np.arange(1, spikewindown + 1) # MATLAB positions within the spike window
  210. with np.errstate(invalid="ignore"):
  211. isnegative = originalmeanspikeshape < 0
  212. # [m(1:end-1)-m(2:end) < 0, false]
  213. risesnext = np.append(originalmeanspikeshape[:-1] - originalmeanspikeshape[1:] < 0, False)
  214. # [false, m(2:end)-m(1:end-1) < 0]
  215. fellbefore = np.append(False, originalmeanspikeshape[1:] - originalmeanspikeshape[:-1] < 0)
  216. def _warn_no_noise(sweepi: int, part: str) -> None:
  217. warnings.warn(
  218. f"cleanspike: sweep {sweepi + index_base} has no usable noise stretch for the part {part} "
  219. "the trough; the first samples of the sweep were used instead (as cleanspike.m does), "
  220. "so this sweep may contain NaN", stacklevel=3)
  221. # --- Processing BEFORE the trough ----------------------------------------
  222. # before the trough AND negative AND negative-direction
  223. found = np.flatnonzero((windowpositions <= troughinwindow - 3) & isnegative & risesnext)
  224. if found.size > 0:
  225. dipbackbelowzeroindex = int(found[-1]) + 1 # find(..., 1, 'last')
  226. needtoreplaceuntil = dipbackbelowzeroindex
  227. needtoreplacen = dipbackbelowzeroindex
  228. for swi in range(sweepn):
  229. noise = potentialnoisesweeps[swi, :]
  230. # patterndifferences holds, at each index, the weighted sum of squared distances across a
  231. # 3 datapoint "overlap" immediately AFTER the interval (index = LAST sample of the candidate)
  232. patterndifferences = np.full(analysiswindown, np.nan)
  233. n = analysiswindown
  234. if n > 3:
  235. patterndifferences[:n - 3] = (
  236. (noise[1:n - 2] - individualspikeshapes[swi, needtoreplaceuntil]) ** 2.0 * 1.0
  237. + (noise[2:n - 1] - individualspikeshapes[swi, needtoreplaceuntil + 1]) ** 2.0 * 0.5
  238. + (noise[3:n] - individualspikeshapes[swi, needtoreplaceuntil + 2]) ** 2.0 * 0.25)
  239. # exclude intervals that would stretch outside of the analysis window or include excluded timepoints
  240. nancount = _nan_counts(noise)
  241. lastsample = np.arange(n) # 0-based last sample of the candidate
  242. firstsample = lastsample - needtoreplacen + 1 # 0-based first sample of the candidate
  243. invalid = firstsample < 0
  244. ok = ~invalid
  245. invalid[ok] = (nancount[lastsample[ok] + 1] - nancount[firstsample[ok]]) > 0
  246. patterndifferences[invalid] = np.nan
  247. relativelybestwhere, nonefound = _nanargmin_first(patterndifferences)
  248. takefrom = relativelybestwhere - needtoreplacen + 1
  249. if takefrom < 0:
  250. raise ValueError(
  251. f"cleanspike: sweep {swi + index_base} has no usable noise stretch of {needtoreplacen} "
  252. "samples for the part before the trough (cleanspike.m stops with an indexing error "
  253. "in the same situation)")
  254. if nonefound:
  255. _warn_no_noise(swi, "before")
  256. individualspikeshapes[swi, :needtoreplaceuntil] = noise[takefrom:relativelybestwhere + 1]
  257. # --- Processing AFTER the trough -----------------------------------------
  258. # after the trough AND negative AND negative-direction
  259. found = np.flatnonzero((windowpositions > troughinwindow + 3) & isnegative & fellbefore)
  260. if found.size > 0:
  261. returntozeroindex = int(found[0]) + 1 # find(..., 1, 'first')
  262. needtoreplacefrom = returntozeroindex
  263. needtoreplacen = spikewindown - needtoreplacefrom + 1
  264. for swi in range(sweepn):
  265. noise = potentialnoisesweeps[swi, :]
  266. # ... across a 3 datapoint "overlap" immediately BEFORE the interval
  267. # (index = FIRST sample of the candidate)
  268. patterndifferences = np.full(analysiswindown, np.nan)
  269. n = analysiswindown
  270. if n > 3:
  271. patterndifferences[3:] = (
  272. (noise[2:n - 1] - individualspikeshapes[swi, needtoreplacefrom - 2]) ** 2.0 * 1.0
  273. + (noise[1:n - 2] - individualspikeshapes[swi, needtoreplacefrom - 3]) ** 2.0 * 0.5
  274. + (noise[0:n - 3] - individualspikeshapes[swi, needtoreplacefrom - 4]) ** 2.0 * 0.25)
  275. nancount = _nan_counts(noise)
  276. firstsample = np.arange(n)
  277. pastend = firstsample + needtoreplacen # one past the 0-based last sample
  278. invalid = pastend > n
  279. ok = ~invalid
  280. invalid[ok] = (nancount[pastend[ok]] - nancount[firstsample[ok]]) > 0
  281. patterndifferences[invalid] = np.nan
  282. relativelybestwhere, nonefound = _nanargmin_first(patterndifferences)
  283. if nonefound:
  284. _warn_no_noise(swi, "after")
  285. individualspikeshapes[swi, needtoreplacefrom - 1:] = \
  286. noise[relativelybestwhere:relativelybestwhere + needtoreplacen]
  287. # final baseline compensation (the median may have slightly changed as a result of the imputation)
  288. with warnings.catch_warnings():
  289. warnings.simplefilter("ignore", RuntimeWarning)
  290. meanspikeshape = np.nanmean(individualspikeshapes, axis=0)
  291. # plain median on purpose: as in cleanspike.m, a NaN in the mean shape makes the whole output NaN
  292. finalbaselinecompensation = np.median(meanspikeshape)
  293. outputsweeps = individualspikeshapes - finalbaselinecompensation
  294. if return_aligned:
  295. return outputsweeps, originalindividualspikeshapes
  296. return outputsweeps

cleanspike.py at commit c4a126d, no license · at the source

Overview

Authors: Zoltan Soltesz1, Viviane S. G. M. Tenorio2, Takamichi Tohyama3, Anne M. E. Baker1, Stuart N. Baker1, Alexander Kraskov1
  1. Faculty of Medical Sciences, Newcastle University, Newcastle NE2 4HH, United Kingdom
  2. School of Engineering and Built Environment, Sheffield Hallam University, Sheffield S1 1WB, United Kingdom
  3. Department of Rehabilitation Medicine, School of Medicine, Fujita Health University, Aichi 470-1192, Japan
Institutions: Newcastle University (United Kingdom); Sheffield Hallam University (United Kingdom); Fujita Health University (Japan)
Journal: eNeuro, volume 13, issue 10, pages ENEURO.0394-25.2026
Dates: received 14 October 2025; accepted 22 September 2026; published online 23 October 2026; in print October 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1523/eneuro.0394-25.2026 · PMID 42880967 · PMCID PMC13713218 · OpenAlex W7222104320
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: extracellular electrophysiology (units, LFP) (modality), mouse (organism), non-human primate (organism)
Methods: Statistics, Smoothing, state filtering, decompositions, Connectivity, fMRI & imaging, Single-unit activity, calcium imaging
Keywords: antidromic identification, electrophysiology, ground truth dataset, neuron classification, pyramidal tract neurons, supplementary motor area
MeSH: Action Potentials*, Interneurons*, Motor Cortex*, Pyramidal Cells*, Animals, Cluster Analysis, Clustering Algorithms, Female, Macaca mulatta, Mice (* major topic)
Journal subjects: Research Article: New Research, Sensory and Motor Systems
Topic: Neuroscience and Neural Engineering (Cellular and Molecular Neuroscience, Neuroscience), according to OpenAlex
Funding: UKRI | Biotechnology and Biological Sciences Research Council (AFRC) (BB/Y000625/1, BB/V00896X/1); HHS | National Institutes of Health (NIH) (R01NS119319); EU Grant to the In2PrimateBrains Consortium (956669); DSIT | Advanced Research and Invention Agency (ARIA) (SCNI-PR01-P09)
Citations: not cited yet (Europe PMC); 32 references in the paper

Abstract

Understanding how neural circuits generate behavior requires knowledge of both neural activity patterns and the cell types they originate from. While the scale of neuronal recordings has dramatically increased since the advent of dense multicontact probes, accurate identification of cell types remains elusive. Traditional approaches have used spike width to attempt a classification, with narrow spikes assumed to be inhibitory interneurons. However, fast pyramidal tract neurons (PTNs; known to be excitatory) with thin spikes and interneurons with wide spikes challenge these assumptions. Here we accomplish three related objectives. First, we produce a ground truth dataset of extracellular spike shapes from electrophysiologically identified pyramidal neurons from primary (M1) and supplementary motor areas (SMA) and optogenetically identified interneurons in M1 in female macaque monkeys. Next, we show that spike width correlates with antidromic latency not only in M1 but also in the SMA, suggesting that it is a physiologically meaningful measure across the motor cortex. Finally, we introduce our unsupervised ensemble clustering method, “ACORN,” and characterize its performance on our neocortical macaque dataset, the C4 cerebellar database, and a juxtacellularly recorded mouse dataset, demonstrating strong out-of-the-box performance across species, brain areas, and recording techniques. ACORN can cluster neuronal waveforms without training or tuning and provides data-derived confidence values for its predictions. Our ground truth data can be used as a reference to help identify or verify clusters in novel datasets. Together, our method and database provide a streamlined foundation for electrophysiological cell classification without necessitating changes to recording paradigms.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

zolts/ACORN

License: none: the authors keep all their rights
State: the link answers, verified on 30 October 2026
Evidence: files inventoried
Commit: c4a126d5c967697cf349811676780b34acfecab0, 14 October 2026
Languages: Python (4), MATLAB (2)
Size: 12 files, 6 scripts
Software Heritage: not archived
Found in: “Code accessibility”
Holds: README, environment (requirements.txt)
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (4 files), pandas (3 files), h5py (2 files), scikit-learn (2 files), SciPy (2 files), UMAP (2 files)
Availability: 1 check, the latest on 30 October 2026: the link answers
  • 30 October 2026: the link answers
7 files
At the source: github.com/zolts/ACORN

Code accessibility

The ACORN code, as well as an implementation of the “pattern-matched noise imputation” used in this paper, is freely available (https://github.com/zolts/ACORN). The code is not OS-specific. Here, it was run on a Dell Precision 7,920 PC with a Microsoft Windows 10 Enterprise operating system, using Python 3.8 (Python Software Foundation) and MATLAB R2025b (MathWorks).

Reproduced under the paper's license (CC BY), from the paper cited above.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 6 scripts, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 30 October 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 6 keywords, 10 MeSH terms, 4 funders, 27 references.

Cite

This paper

Soltesz, Z., Tenorio, V. S. G. M., Tohyama, T., Baker, A. M. E., Baker, S. N., & Kraskov, A. (2026). ACORN: Adaptive Consensus of Repeated Clusterings Identifies Pyramidal Neurons and Interneurons in the Primate Motor Cortex Based on Extracellular Spike Waveforms. eNeuro, 13(10), ENEURO.0394-25.2026. https://doi.org/10.1523/eneuro.0394-25.2026

BibTeX

@article{soltesz2026acorn,
author = {Soltesz, Zoltan and Tenorio, Viviane S. G. M. and Tohyama, Takamichi and Baker, Anne M. E. and Baker, Stuart N. and Kraskov, Alexander},
title = {{ACORN: Adaptive Consensus of Repeated Clusterings Identifies Pyramidal Neurons and Interneurons in the Primate Motor Cortex Based on Extracellular Spike Waveforms}},
journal = {eNeuro},
year = {2026},
month = oct,
volume = {13},
number = {10},
pages = {ENEURO.0394--25.2026},
publisher = {Society for Neuroscience},
issn = {2373-2822},
doi = {10.1523/eneuro.0394-25.2026},
url = {https://doi.org/10.1523/eneuro.0394-25.2026},
pmid = {42880967},
pmcid = {PMC13713218}
}

RIS

TY - JOUR
AU - Soltesz, Zoltan
AU - Tenorio, Viviane S. G. M.
AU - Tohyama, Takamichi
AU - Baker, Anne M. E.
AU - Baker, Stuart N.
AU - Kraskov, Alexander
TI - ACORN: Adaptive Consensus of Repeated Clusterings Identifies Pyramidal Neurons and Interneurons in the Primate Motor Cortex Based on Extracellular Spike Waveforms
T2 - eNeuro
J2 - eNeuro
PY - 2026
DA - 2026/10/27
VL - 13
IS - 10
SP - ENEURO.0394
EP - 25.2026
SN - 2373-2822
PB - Society for Neuroscience
DO - 10.1523/eneuro.0394-25.2026
UR - https://doi.org/10.1523/eneuro.0394-25.2026
LA - en
ER -

CSL-JSON

{
"id": "10.1523/eneuro.0394-25.2026",
"type": "article-journal",
"title": "ACORN: Adaptive Consensus of Repeated Clusterings Identifies Pyramidal Neurons and Interneurons in the Primate Motor Cortex Based on Extracellular Spike Waveforms",
"container-title": "eNeuro",
"author": [
{
"family": "Soltesz",
"given": "Zoltan"
},
{
"family": "Tenorio",
"given": "Viviane S. G. M."
},
{
"family": "Tohyama",
"given": "Takamichi"
},
{
"family": "Baker",
"given": "Anne M. E."
},
{
"family": "Baker",
"given": "Stuart N."
},
{
"family": "Kraskov",
"given": "Alexander"
}
],
"container-title-short": "eNeuro",
"volume": "13",
"issue": "10",
"page": "ENEURO.0394-25.2026",
"DOI": "10.1523/eneuro.0394-25.2026",
"PMID": "42880967",
"PMCID": "PMC13713218",
"ISSN": "2373-2822",
"publisher": "Society for Neuroscience",
"URL": "https://doi.org/10.1523/eneuro.0394-25.2026",
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
27
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41467-026-71331-0 [code]
A multimodal approach for visualizing and identifying electrophysiological cell types in vivo.
Journal: Nature communications
In common: UMAP, scikit-learn, pandas, 2 other tools, extracellular electrophysiology (units, LFP), mouse, 10 references
[2] doi:10.1073/pnas.2521556123 [code]
Neuropixels reveal laminar microcircuit organization in monkey V1 in vivo.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: UMAP, h5py, scikit-learn, 3 other tools, extracellular electrophysiology (units, LFP), non-human primate, 6 references
[3] doi:10.1038/s41467-026-76939-w [code]
HIPPIE: a generative model for electrophysiological analysis across species, technologies, and modalities.
Journal: Nature communications
In common: UMAP, h5py, scikit-learn, 3 other tools, non-human primate, mouse, 4 references
[4] doi:10.7554/elife.110588 [code]
Opening the black box toward a modular approach to spike sorting.
Journal: eLife
In common: UMAP, h5py, scikit-learn, 3 other tools, extracellular electrophysiology (units, LFP), mouse, 3 references
[5] doi:10.1371/journal.pbio.3003527 [code]
Efficient and reliable spike sorting from neural recordings with UMAP-based unsupervised nonlinear dimensionality reduction.
Journal: PLoS biology
In common: UMAP, h5py, scikit-learn, 3 other tools, extracellular electrophysiology (units, LFP), 3 references
[6] doi:10.1016/j.xpro.2023.102320 [code]
WaveMAP for identifying putative cell types from in vivo electrophysiology.
Journal: STAR protocols
In common: UMAP, h5py, scikit-learn, 3 other tools, extracellular electrophysiology (units, LFP), 3 references
[7] doi:10.1016/j.neuron.2025.08.030 [code]
Ultra-high-density Neuropixels probes improve detection and identification in neuronal recordings.
Journal: Neuron
In common: h5py, scikit-learn, pandas, 2 other tools, extracellular electrophysiology (units, LFP), mouse, 3 references
[8] doi:10.1038/s41467-024-53477-x [code]
The human claustrum tracks slow waves during sleep.
Journal: Nature communications
In common: UMAP, h5py, scikit-learn, 3 other tools, 2 references
[9] doi:10.64898/2026.01.23.701239 [code]
Opening the black box: a modular approach to spike sorting
Journal: bioRxiv (preprint)
In common: UMAP, h5py, scikit-learn, 3 other tools, extracellular electrophysiology (units, LFP), 1 reference
[10] doi:10.1016/j.celrep.2024.114519 [code]
Circuit dynamics of superficial and deep CA1 pyramidal cells and inhibitory cells in freely moving macaques.
Journal: Cell reports
In common: UMAP, scikit-learn, pandas, 2 other tools, non-human primate, 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1523/eneuro.0394-25.2026.svg)](https://openscicode.org/badge/doi/10.1523/eneuro.0394-25.2026)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1523/eneuro.0394-25.2026.svg
   :target: https://openscicode.org/badge/doi/10.1523/eneuro.0394-25.2026
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1523/eneuro.0394-25.2026"><img src="https://openscicode.org/badge/doi/10.1523/eneuro.0394-25.2026.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.