OSCR

A quality measure for repeating multiple-unit spike patterns.

Code ↔ Paper

1 match 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 1 match
  1. [1] § Computing quality › Simulation-based estimation of ubiquity ↔ codes/compute_simulated_signature_histogram.py, lines 102–156 · score 0.60 · signature histogram, simple novelty, accumulated, summed, simulations, mining

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 174 lines · 7.1 KB · CC-BY-4.0 · 1 match

  1. import sys
  2. import os
  3. import yaml
  4. from yaml import Loader
  5. import numpy as np
  6. import quantities as pq
  7. from elephant.conversion import BinnedSpikeTrain
  8. from elephant.spade import concepts_mining
  9. from utils import concatenate_spiketrains, compute_isi_based_bin_firing_probability, generate_simulated_spiketrains
  10. # Example command line to run this script:
  11. # python compute_simulated_signature_histogram.py {session} {epoch} {trialtype} config.yaml
  12. # Parse command line options
  13. args = sys.argv
  14. if len(args) != 5:
  15. raise ValueError("Following arguments need to be given: session, epoch, trial type, config file")
  16. session = args[1]
  17. epoch = args[2]
  18. trialtype = args[3]
  19. configfile = args[4]
  20. spiketrain_file = f"../data/spiketrains/{session}_{epoch}_{trialtype}.npy"
  21. firing_rate_file = f"../data/firing_rates/{session}_{epoch}_{trialtype}.npy"
  22. # Load parameters from the config file
  23. with open(configfile, 'r') as stream:
  24. config = yaml.load(stream, Loader=Loader)
  25. param_keys = ['min_firing_rate', 'binsize', 'winlen', 'min_size', 'max_size', 'min_occ', 'max_occ',
  26. 'n_sim', 'bin_firing_prob_smooth_width', 'min_nov', 'max_nov', 'nov_step']
  27. params = {key:config[key] for key in param_keys}
  28. params['min_firing_rate'] = params['min_firing_rate'] * pq.Hz
  29. params['binsize'] = params['binsize'] * pq.s
  30. for key in ['max_size', 'max_occ',]:
  31. if params[key] == 'None':
  32. raise ValueError(f"`{key}` cannot be set to None")
  33. # Load data from files
  34. spiketrains = np.load(spiketrain_file, allow_pickle=True).item()
  35. firing_rates = np.load(firing_rate_file, allow_pickle=True).item()
  36. # Discard units with low firing rates
  37. firing_rate_threshold = params['min_firing_rate'].rescale('Hz').magnitude
  38. num_discard = 0
  39. for unit_id, firing_rate in firing_rates.items():
  40. if firing_rate < firing_rate_threshold:
  41. del spiketrains[unit_id]
  42. num_discard += 1
  43. print(f"{session}/{epoch}_{trialtype}: {num_discard} units are discarded due to low firing rates (< {params['min_firing_rate'].magnitude} Hz). {len(spiketrains)} units remain.")
  44. unit_ids = np.array(list(spiketrains.keys()))
  45. # Compute spike novelties based on bin occupation ratio
  46. bin_occupation_ratio = {}
  47. for unit_id, sts in spiketrains.items():
  48. unit_bin_counts = []
  49. num_bins = []
  50. for st in sts:
  51. binned_st = BinnedSpikeTrain(st, params['binsize'], tolerance=None).binarize().to_array().flatten()
  52. num_bins.append(len(binned_st))
  53. unit_bin_counts.append(np.sum(binned_st))
  54. bin_occupation_ratio[unit_id] = np.sum(unit_bin_counts) / np.sum(num_bins)
  55. spike_novelties = {unit_id: -np.log(bin_occupation_ratio[unit_id]) for unit_id in unit_ids}
  56. # Compute 4D signature histogram from simulated FIM patterns
  57. num_simulations = params['n_sim']
  58. winlen = params['winlen']
  59. min_size = params['min_size']
  60. max_size = params['max_size']
  61. min_occ = params['min_occ']
  62. max_occ = params['max_occ']
  63. min_nov = params['min_nov']
  64. max_nov = params['max_nov']
  65. nov_step = params['nov_step']
  66. ## Set up bins for histograms
  67. bins_size = np.arange(1.5, max_size+1, 1)
  68. bins_occ = np.arange(0.5, max_occ+1, 1)
  69. bins_dur = np.arange(-0.5, winlen, 1)
  70. bins_nov = np.arange(min_nov, max_nov + nov_step/2, nov_step)
  71. bins = (bins_size, bins_occ, bins_dur, bins_nov)
  72. signature_hist = np.zeros([len(x)-1 for x in bins])
  73. signature_hist_simple_nov = np.zeros([len(x)-1 for x in bins])
  74. nov_hist = np.zeros((len(bins_nov)-1, len(bins_nov)-1))
  75. # Compute time-varying bin firing probability based on ISIs of the original data
  76. spiketrains_orig = concatenate_spiketrains(spiketrains, 0.) # inter-trial interval is set to 0 for the manuscript
  77. bin_firing_probs = compute_isi_based_bin_firing_probability(
  78. spiketrains_orig, params['binsize'], params['bin_firing_prob_smooth_width'], normalize=True)
  79. print(f"Applying FIM to {num_simulations} simulated data...")
  80. print(f"(binsize: {params['binsize']}, winlen: {winlen}, min_size: {min_size}, max_size: {max_size}, min_occ: {min_occ}, max_occ: {max_occ},"
  81. f" min_nov: {min_nov}, max_nov: {max_nov}, n_sim: {num_simulations}, smooth_width: {params['bin_firing_prob_smooth_width']})")
  82. # Collect signatures from simulated data and compute the 4D signature histogram
  83. for i_sim in range(num_simulations):
  84. # Generate simulated spike trains
  85. spiketrains_sim = generate_simulated_spiketrains(bin_firing_probs, params['binsize'])
  86. # Compute time-varying bin novelty
  87. novelty_array = np.copy(bin_firing_probs)
  88. novelty_array[novelty_array == 0] = np.nan # replace 0 with nan to avoid taking log(0)
  89. novelty_array = -np.log(novelty_array)
  90. for size in range(min_size, max_size + 1):
  91. # Apply FIM
  92. raw_fim_patterns, _ = concepts_mining(spiketrains_sim, params['binsize'], winlen,
  93. min_spikes=size, min_occ=min_occ, max_spikes=size, max_occ=max_occ, min_neu=size, report='a')
  94. # Compute signatures
  95. sizes = []
  96. occurrences = []
  97. durations = []
  98. novelties = []
  99. simple_novelties = []
  100. for i, fim_pattern in enumerate(raw_fim_patterns):
  101. pattern_bin_idxs, sample_idxs = fim_pattern
  102. pattern_unit_idxs = np.array([int(x // winlen) for x in pattern_bin_idxs])
  103. if len(pattern_unit_idxs) != len(np.unique(pattern_unit_idxs)): # skip auto-patterns
  104. continue
  105. pattern_unit_ids = unit_ids[pattern_unit_idxs]
  106. lags = np.array([int(x % winlen) for x in pattern_bin_idxs])
  107. sizes.append(len(pattern_unit_ids))
  108. occurrences.append(len(sample_idxs))
  109. durations.append(np.max(lags))
  110. simple_novelties.append(np.sum([spike_novelties[x] for x in pattern_unit_ids]))
  111. nov_sum = 0
  112. for sample_idx in sample_idxs:
  113. for unit_idx, lag in zip(pattern_unit_idxs, lags):
  114. nov_sum += novelty_array[unit_idx, sample_idx + lag]
  115. novelties.append(nov_sum / len(sample_idxs))
  116. # Accumulate signatures in multiple histograms
  117. signatures = np.column_stack((sizes, occurrences, durations, novelties))
  118. signature_hist += np.histogramdd(signatures, bins=bins)[0]
  119. signatures = np.column_stack((sizes, occurrences, durations, simple_novelties))
  120. signature_hist_simple_nov += np.histogramdd(signatures, bins=bins)[0]
  121. signatures = np.column_stack((novelties, simple_novelties))
  122. nov_hist += np.histogramdd(signatures, bins=(bins_nov, bins_nov))[0]
  123. if (i_sim + 1) % int(num_simulations//10) == 0:
  124. print(f"\t{i_sim+1} simulations done...")
  125. print("\t...finished.")
  126. # Save result
  127. result = {
  128. "num_surrogates": num_simulations,
  129. "sim_method": "isi_based_bin_firing_prob",
  130. "bin_firing_prob_smooth_width": params['bin_firing_prob_smooth_width'],
  131. "bins_size": bins_size,
  132. "bins_occ": bins_occ,
  133. "bins_dur": bins_dur,
  134. "bins_nov": bins_nov,
  135. "signature_hist": signature_hist,
  136. "signature_hist_simple_nov": signature_hist_simple_nov,
  137. "nov_hist": nov_hist
  138. }
  139. result_dir = '../results/signature_histograms'
  140. if not os.path.exists(result_dir):
  141. os.makedirs(result_dir)
  142. np.save(f"{result_dir}/{session}_{epoch}_{trialtype}.npy", result)

compute_simulated_signature_histogram.py, under CC-BY-4.0 · at the source

Overview

Authors: Günther Palm1,2, Monica Paoletti1,3, Junji Ito1, Alessandra Stella1, Sonja Grün1,4,5
  1. Institute for Advanced Simulation (IAS-6), Forschungszentrum Jülich,Jülich, Germany
  2. Institute of Neural Information Processing, University of Ulm,Ulm, Germany
  3. Cognitive Neuroscience Department, Scuola Internazionale Superiore di Studi Avanzati (SISSA),Trieste, Italy
  4. JARA-Institute Brain Structure-Function Relationships (INM-10), Forschungszentrum Jülich,Wilhelm-Johnen-Str., Jülich, 52428 Germany
  5. Theoretical Systems neurobiology, RWTH Aachen University,Aachen, Germany
Journal: Biological cybernetics, volume 120, issue 5-6, article 25
Dates: received 31 January 2026; accepted 22 June 2026; published online 7 August 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1007/s00422-026-01048-2 · PMID 42566086 · PMCID PMC13451522 · OpenAlex W7201832390
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: extracellular electrophysiology (units, LFP) (modality), none (in silico) (organism), computational (subfield)
Methods: Statistics, Single-unit activity, calcium imaging, Smoothing, state filtering, decompositions
Keywords: Spatio-temporal spike pattern, Multiple-unit spike trains, Statistical analysis, Significance test
MeSH: Action Potentials*, Models, Neurological*, Neurons*, Algorithms, Animals, Computer Simulation (* major topic)
Topic: Neural dynamics and brain function (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: NRW-network ’iBehave’ (NW21-049); Deutsche Forschungsgemeinschaft (368482240/GRK2416)
Citations: not cited yet (Europe PMC); 89 references in the paper

Abstract

We propose a quality measure for spatio-temporal spike patterns (STPs) in multiple-neuron recordings. In such recordings, repeating STPs or pattern repetitions (PRs) are often found, with many of these generated by chance. To rule those out, statistical tests have been developed to discriminate the unlikely from the more likely PRs. This statistical problem is complicated by the fact that there are several obvious quality criteria for a PR, such as the size (the number of spikes) of the pattern and the number of its occurrences. Here, we propose a canonical way of combining several criteria (which we collect in the so-called signature of the pattern) into a single quality measure, based on the ’unlikeliness’ of the pattern. This measure is defined mathematically, and a formula for its computation is derived for stationary spike trains. It can be used to compare PRs. Since spike trains are not stationary in practice, we discuss, for two experimental data sets, how well the stationary formula correlates with the defined quality measure as determined from simulations. Sometimes the calculated values are far off, but one can still use the stationary formula or also some simpler, related formulas as ’proxies’ for the quality, to compare PRs and also for statistical tests that avoid the multiple testing problem incurred by using several quality criteria. Based on our results, we propose a few test statistics, i.e., random variables on the space of multi-unit spike trains with an appropriate null-hypothesis distribution, to evaluate STPs with less computational and sampling efforts.

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 1 match between paragraphs and lines of code.

Zenodo 18424512

License: CC-BY-4.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data Availibility”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (4 files), Elephant (3 files), Matplotlib (1 file), Neo (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
5 files

The paper's code and data availability statement is in the Data section.

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;
  • 4 scripts, each with its path and the digest of its content;
  • 1 match 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.

Data Availibility

The data and codes that support the findings of this study are available in Zenodo with the identifier: https://doi.org/10.5281/zenodo.18424512.

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

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 3, 28 September 2026

  • Publisher: n/a → Springer Science+Business Media

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 4 keywords, 6 MeSH terms, 2 funders, 84 references.

Cite

This paper

Palm, G., Paoletti, M., Ito, J., Stella, A., & Grün, S. (2026). A quality measure for repeating multiple-unit spike patterns. Biological cybernetics, 120(5-6), 25. https://doi.org/10.1007/s00422-026-01048-2

BibTeX

@article{palm2026quality,
author = {Palm, Günther and Paoletti, Monica and Ito, Junji and Stella, Alessandra and Grün, Sonja},
title = {{A quality measure for repeating multiple-unit spike patterns}},
journal = {Biological cybernetics},
year = {2026},
month = aug,
volume = {120},
number = {5-6},
pages = {25},
publisher = {Springer Science+Business Media},
issn = {0340-1200},
doi = {10.1007/s00422-026-01048-2},
url = {https://doi.org/10.1007/s00422-026-01048-2},
pmid = {42566086},
pmcid = {PMC13451522}
}

RIS

TY - JOUR
AU - Palm, Günther
AU - Paoletti, Monica
AU - Ito, Junji
AU - Stella, Alessandra
AU - Grün, Sonja
TI - A quality measure for repeating multiple-unit spike patterns
T2 - Biological cybernetics
J2 - Biol Cybern
PY - 2026
DA - 2026/08/07
VL - 120
IS - 5-6
SP - 25
SN - 0340-1200
PB - Springer Science+Business Media
DO - 10.1007/s00422-026-01048-2
UR - https://doi.org/10.1007/s00422-026-01048-2
LA - en
ER -

CSL-JSON

{
"id": "10.1007/s00422-026-01048-2",
"type": "article-journal",
"title": "A quality measure for repeating multiple-unit spike patterns",
"container-title": "Biological cybernetics",
"author": [
{
"family": "Palm",
"given": "Günther"
},
{
"family": "Paoletti",
"given": "Monica"
},
{
"family": "Ito",
"given": "Junji"
},
{
"family": "Stella",
"given": "Alessandra"
},
{
"family": "Grün",
"given": "Sonja"
}
],
"container-title-short": "Biol Cybern",
"volume": "120",
"issue": "5-6",
"page": "25",
"DOI": "10.1007/s00422-026-01048-2",
"PMID": "42566086",
"PMCID": "PMC13451522",
"ISSN": "0340-1200",
"publisher": "Springer Science+Business Media",
"URL": "https://doi.org/10.1007/s00422-026-01048-2",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
7
]
]
}
}

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.1523/jneurosci.0295-26.2026 [code]
Detection and Removal of Hyper-synchronous Artifacts in Massively Parallel Spike Recordings.
Journal: The Journal of neuroscience : the official journal of the Society for Neuroscience
In common: extracellular electrophysiology (units, LFP), 7 references, 2 authors
[2] doi:10.1371/journal.pcbi.1014752 [code]
Hierarchical feature binding in a spiking neural network model of the primate ventral visual pathway.
Journal: PLoS computational biology
In common: Elephant, Neo, Matplotlib, 1 other tool, 5 references
[3] doi:10.1371/journal.pcbi.1014730 [code]
A unified model of short- and long-term plasticity: Effects on network connectivity and information capacity.
Journal: PLoS computational biology
In common: Elephant, Neo, Matplotlib, 1 other tool, 1 reference
[4] doi:10.1016/j.isci.2026.115488 [code]
An integrated &lt;i&gt;i&lt;/i&gt; &lt;i&gt;n vitro&lt;/i&gt; platform and biophysical modeling approach for studying synaptic transmission in isolated neuronal pairs.
Journal: iScience
In common: Elephant, Neo, Matplotlib, 1 other tool, 1 reference
[5] doi:10.1371/journal.pcbi.1014283 [code]
Spatial richness of neural magnetic fields.
Journal: PLoS computational biology
In common: Elephant, Neo, Matplotlib, 1 other tool, computational
[6] doi:10.1080/26941899.2026.2619222
Neurodatascience: Past, Present, and Future.
Journal: Data science in science
In common: computational, 4 references
[7] doi: [code]
Limit-Cycle Proliferation Under Parametric Delayed Feedback in a Conductance-Based Neuron: Bifurcation Landscape, Orbit Catalog, and Capacity Analysis
Journal: Entropy (Basel, Switzerland)
In common: Matplotlib, NumPy, none (in silico), 3 references
[8] doi: [code]
Naturalistic behavior and self-generated neural activity predictive of self-correction
Journal: bioRxiv : the preprint server for biology
In common: Elephant, Neo, Matplotlib, 1 other tool
[9] doi:10.1093/bioinformatics/btag328 [code]
eFEL: electrophysiology feature extraction library.
Journal: Bioinformatics (Oxford, England)
In common: Neo, Matplotlib, NumPy, none (in silico), 1 reference
[10] doi:10.1371/journal.pcbi.1014615 [code]
Toward reliable machine learning models for neural circuit inference: A diagnostic study of CNNs on spike trains.
Journal: PLoS computational biology
In common: Matplotlib, NumPy, extracellular electrophysiology (units, LFP), 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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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