A quality measure for repeating multiple-unit spike patterns.
The 1 match
- [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
- import sys
- import os
- import yaml
- from yaml import Loader
- import numpy as np
- import quantities as pq
- from elephant.conversion import BinnedSpikeTrain
- from elephant.spade import concepts_mining
- from utils import concatenate_spiketrains, compute_isi_based_bin_firing_probability, generate_simulated_spiketrains
- # Example command line to run this script:
- # python compute_simulated_signature_histogram.py {session} {epoch} {trialtype} config.yaml
- # Parse command line options
- args = sys.argv
- if len(args) != 5:
- raise ValueError("Following arguments need to be given: session, epoch, trial type, config file")
- session = args[1]
- epoch = args[2]
- trialtype = args[3]
- configfile = args[4]
- spiketrain_file = f"../data/spiketrains/{session}_{epoch}_{trialtype}.npy"
- firing_rate_file = f"../data/firing_rates/{session}_{epoch}_{trialtype}.npy"
- # Load parameters from the config file
- with open(configfile, 'r') as stream:
- config = yaml.load(stream, Loader=Loader)
- param_keys = ['min_firing_rate', 'binsize', 'winlen', 'min_size', 'max_size', 'min_occ', 'max_occ',
- 'n_sim', 'bin_firing_prob_smooth_width', 'min_nov', 'max_nov', 'nov_step']
- params = {key:config[key] for key in param_keys}
- params['min_firing_rate'] = params['min_firing_rate'] * pq.Hz
- params['binsize'] = params['binsize'] * pq.s
- for key in ['max_size', 'max_occ',]:
- if params[key] == 'None':
- raise ValueError(f"`{key}` cannot be set to None")
- # Load data from files
- spiketrains = np.load(spiketrain_file, allow_pickle=True).item()
- firing_rates = np.load(firing_rate_file, allow_pickle=True).item()
- # Discard units with low firing rates
- firing_rate_threshold = params['min_firing_rate'].rescale('Hz').magnitude
- num_discard = 0
- for unit_id, firing_rate in firing_rates.items():
- if firing_rate < firing_rate_threshold:
- del spiketrains[unit_id]
- num_discard += 1
- 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.")
- unit_ids = np.array(list(spiketrains.keys()))
- # Compute spike novelties based on bin occupation ratio
- bin_occupation_ratio = {}
- for unit_id, sts in spiketrains.items():
- unit_bin_counts = []
- num_bins = []
- for st in sts:
- binned_st = BinnedSpikeTrain(st, params['binsize'], tolerance=None).binarize().to_array().flatten()
- num_bins.append(len(binned_st))
- unit_bin_counts.append(np.sum(binned_st))
- bin_occupation_ratio[unit_id] = np.sum(unit_bin_counts) / np.sum(num_bins)
- spike_novelties = {unit_id: -np.log(bin_occupation_ratio[unit_id]) for unit_id in unit_ids}
- # Compute 4D signature histogram from simulated FIM patterns
- num_simulations = params['n_sim']
- winlen = params['winlen']
- min_size = params['min_size']
- max_size = params['max_size']
- min_occ = params['min_occ']
- max_occ = params['max_occ']
- min_nov = params['min_nov']
- max_nov = params['max_nov']
- nov_step = params['nov_step']
- ## Set up bins for histograms
- bins_size = np.arange(1.5, max_size+1, 1)
- bins_occ = np.arange(0.5, max_occ+1, 1)
- bins_dur = np.arange(-0.5, winlen, 1)
- bins_nov = np.arange(min_nov, max_nov + nov_step/2, nov_step)
- bins = (bins_size, bins_occ, bins_dur, bins_nov)
- signature_hist = np.zeros([len(x)-1 for x in bins])
- signature_hist_simple_nov = np.zeros([len(x)-1 for x in bins])
- nov_hist = np.zeros((len(bins_nov)-1, len(bins_nov)-1))
- # Compute time-varying bin firing probability based on ISIs of the original data
- spiketrains_orig = concatenate_spiketrains(spiketrains, 0.) # inter-trial interval is set to 0 for the manuscript
- bin_firing_probs = compute_isi_based_bin_firing_probability(
- spiketrains_orig, params['binsize'], params['bin_firing_prob_smooth_width'], normalize=True)
- print(f"Applying FIM to {num_simulations} simulated data...")
- print(f"(binsize: {params['binsize']}, winlen: {winlen}, min_size: {min_size}, max_size: {max_size}, min_occ: {min_occ}, max_occ: {max_occ},"
- f" min_nov: {min_nov}, max_nov: {max_nov}, n_sim: {num_simulations}, smooth_width: {params['bin_firing_prob_smooth_width']})")
- # Collect signatures from simulated data and compute the 4D signature histogram
- for i_sim in range(num_simulations):
- # Generate simulated spike trains
- spiketrains_sim = generate_simulated_spiketrains(bin_firing_probs, params['binsize'])
- # Compute time-varying bin novelty
- novelty_array = np.copy(bin_firing_probs)
- novelty_array[novelty_array == 0] = np.nan # replace 0 with nan to avoid taking log(0)
- novelty_array = -np.log(novelty_array)
- for size in range(min_size, max_size + 1):
- # Apply FIM
- raw_fim_patterns, _ = concepts_mining(spiketrains_sim, params['binsize'], winlen,
- min_spikes=size, min_occ=min_occ, max_spikes=size, max_occ=max_occ, min_neu=size, report='a')
- # Compute signatures
- sizes = []
- occurrences = []
- durations = []
- novelties = []
- simple_novelties = []
- for i, fim_pattern in enumerate(raw_fim_patterns):
- pattern_bin_idxs, sample_idxs = fim_pattern
- pattern_unit_idxs = np.array([int(x // winlen) for x in pattern_bin_idxs])
- if len(pattern_unit_idxs) != len(np.unique(pattern_unit_idxs)): # skip auto-patterns
- continue
- pattern_unit_ids = unit_ids[pattern_unit_idxs]
- lags = np.array([int(x % winlen) for x in pattern_bin_idxs])
- sizes.append(len(pattern_unit_ids))
- occurrences.append(len(sample_idxs))
- durations.append(np.max(lags))
- simple_novelties.append(np.sum([spike_novelties[x] for x in pattern_unit_ids]))
- nov_sum = 0
- for sample_idx in sample_idxs:
- for unit_idx, lag in zip(pattern_unit_idxs, lags):
- nov_sum += novelty_array[unit_idx, sample_idx + lag]
- novelties.append(nov_sum / len(sample_idxs))
- # Accumulate signatures in multiple histograms
- signatures = np.column_stack((sizes, occurrences, durations, novelties))
- signature_hist += np.histogramdd(signatures, bins=bins)[0]
- signatures = np.column_stack((sizes, occurrences, durations, simple_novelties))
- signature_hist_simple_nov += np.histogramdd(signatures, bins=bins)[0]
- signatures = np.column_stack((novelties, simple_novelties))
- nov_hist += np.histogramdd(signatures, bins=(bins_nov, bins_nov))[0]
- if (i_sim + 1) % int(num_simulations//10) == 0:
- print(f"\t{i_sim+1} simulations done...")
- print("\t...finished.")
- # Save result
- result = {
- "num_surrogates": num_simulations,
- "sim_method": "isi_based_bin_firing_prob",
- "bin_firing_prob_smooth_width": params['bin_firing_prob_smooth_width'],
- "bins_size": bins_size,
- "bins_occ": bins_occ,
- "bins_dur": bins_dur,
- "bins_nov": bins_nov,
- "signature_hist": signature_hist,
- "signature_hist_simple_nov": signature_hist_simple_nov,
- "nov_hist": nov_hist
- }
- result_dir = '../results/signature_histograms'
- if not os.path.exists(result_dir):
- os.makedirs(result_dir)
- np.save(f"{result_dir}/{session}_{epoch}_{trialtype}.npy", result)
compute_simulated_signature_histogram.py, under CC-BY-4.0 · at the source
Overview
- Institute for Advanced Simulation (IAS-6), Forschungszentrum Jülich,Jülich, Germany
- Institute of Neural Information Processing, University of Ulm,Ulm, Germany
- Cognitive Neuroscience Department, Scuola Internazionale Superiore di Studi Avanzati (SISSA),Trieste, Italy
- JARA-Institute Brain Structure-Function Relationships (INM-10), Forschungszentrum Jülich,Wilhelm-Johnen-Str., Jülich, 52428 Germany
- Theoretical Systems neurobiology, RWTH Aachen University,Aachen, Germany
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
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
5 files
- codes/
compute_quality.py , Python, 190 lines - codes/
compute_simulated_signat , Python, 174 lines, 1 matchure_histogram.py - codes/
plot_signatures_on_quali , Python, 85 linesty_spectrum.py - codes/
utils.py , Python, 107 lines - README.md, Text, 12 lines
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://
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://
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/
url = {https://
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/
VL - 120
IS - 5-6
SP - 25
SN - 0340-1200
PB - Springer Science+Business Media
DO - 10.1007/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1007/
"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":
"volume": "120",
"issue": "5-6",
"page": "25",
"DOI": "10.1007/
"PMID": "42566086",
"PMCID": "PMC13451522",
"ISSN": "0340-1200",
"publisher": "Springer Science+Business Media",
"URL": "https://
"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 NeuroscienceIn 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 biologyIn 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 biologyIn 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: iScienceIn 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 biologyIn common: Elephant, Neo, Matplotlib, 1 other tool, computational
- [6] doi:10.1080/26941899.2026.2619222
- Neurodatascience: Past, Present, and Future.Journal: Data science in scienceIn 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 AnalysisJournal: 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-correctionJournal: bioRxiv : the preprint server for biologyIn 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 biologyIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 4 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:4e3a6d7029bae8cb…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
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.
