Robust circular cluster-based statistics for respiration-brain coupling.
The 13 matches · 5 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
- [1] § Results ↔ matlab/Tutorial_DataPrep.m, lines 1–53 · score 0.78 · amplitude adjusted Fourier, surrogate respiration phase, phase locked, hit rate, matrices, Phase binning
- [2] § Results › Nexus 1: Accurate extraction of respiratory phase ↔ matlab/respLABmethods/four_point_interp.m, the whole file · a weak match · score 0.71 · inflection points, linearly interpolates, phase angles, phase vector, strongest, troughs
- [3] § Results › Nexus 2: Adequate surrogate distributions using IAAFT ↔ matlab/_figures/plots_fig3.m, lines 95–138 · score 0.65 · segment shuffling, circular shifting, random shuffling, surrogate distributions, IAAFT, empirical
- [4] § Results › Nexus 3: A novel approach for circular cluster-based permutation testing ↔ matlab/respLABmethods/CircPerm.m, the whole file · a weak match · score 0.63 · empirical cumulative distribution, cluster definition, matrix, bounds, scored, permutation
- [5] § Results › Nexus 2: Adequate surrogate distributions using IAAFT ↔ matlab/_figures/plots_fig3.m, lines 95–138 · score 0.62 · segment shuffling, Circular shifting, random shuffling, spectra, MI, IAAFT
- [6] § Results › Nexus 2: Adequate surrogate distributions using IAAFT ↔ generate_surrogate_iaaft.py, the whole file · a weak match · score 0.60 · NSE Laboratory, generate_surrogate_iaaft, Trento, Physics
- [7] § Results › Nexus 2: Adequate surrogate distributions using IAAFT ↔ generate_surrogate_iaaft.m, the whole file · a weak match · score 0.60 · NSE Laboratory, GENERATE_SURROGATE_IAAFT, Trento, Physics
- [8] § Results › Nexus 2: Adequate surrogate distributions using IAAFT ↔ matlab/_figures/plots_fig3_rainclouds.R, lines 48–100 · score 0.57 · segment shuffling, circular shifting, random shuffling, PLV, IAAFT, Figure 3
- [9] § Results › Nexus 2: Adequate surrogate distributions using IAAFT ↔ matlab/_figures/plots_fig3_rainclouds.R, lines 48–100 · score 0.57 · segment shuffling, Circular shifting, random shuffling, IAAFT, Figure 3
- [10] § Results ↔ matlab/_figures/plots_fig2.m, lines 1–28 · score 0.53 · quasi continuous, outcome variables, hit rate, coupling, tutorial, binned
- [11] § Results › Nexus 1: Accurate extraction of respiratory phase ↔ matlab/Tutorial_DataPrep.m, lines 1–53 · score 0.53 · raw respiratory trace, phase extraction, centre, thresholds, amplitudes
- [12] § Results › Nexus 1: Accurate extraction of respiratory phase ↔ matlab/Tutorial_DataPrep.m, lines 110–145 · score 0.51 · bin centre, outcome variable, hit rate, respiratory phases, phase binning
- [13] § Results ↔ generate_surrogate_iaaft.m, the whole file · a weak match · score 0.50 · amplitude adjusted Fourier, iterated, transform, iteration, IAAFT, angles
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
MATLAB · 145 lines · 8 KB · no license · 3 matches
- %% Data preparation script: respiratory phase extraction, surrogate generation & hitrate binning
- %
- % This script extracts respiratory phase from raw respiration data using
- % two-point interpolation, generates surrogate phases via the Iterative
- % Amplitude-Adjusted Fourier Transform (IAAFT), and bins behavioral data
- % (e.g., hit rates) into empirical and surrogate respiratory phase bins.
- % A detailed description of the preparation pipeline can be found in
- % [ref].
- %
- % Input:
- % - raw respiration time series vector
- % - events structure with stimulus onset and outcome field for each subject
- % .onset: contains timestamp of stimulus presentation for each trial (in samples from start of recording)
- % .outcome: contains outcome value for each trial (here: hit vs miss)
- %
- % Output (here: hit rate):
- % binhr.mat = mean empirical outcome for each respiratory phase bin, for each subject
- % (subjects x phase bins matrix)
- % sbinhr.mat = mean surrogate outcome for each respiratory phase bin and surrogate, for each subject
- % (subjects x phase bins x surrogate iterations matrix)
- %
- % Required Helper Functions:
- % - two_point_interp: extracts phase of a signal by two-point interpolation
- % - generate_surrogate_iaaft: creates a phase-scrambled surrogate time series
- % of a signal
- % - PLV: computes phase-locking value of two phase time series
- %
- %
- % Copyright (C) 2025, Daniel Kluger & Teresa Berther, University of Münster, Germany
- clearvars
- clc
- close all
- addpath(genpath('~/respmethods/matlab/'));
- datapath = '~/respmethods/_exampledata/'; % contains raw respiration traces and events table
- % subject ids
- ids = {'001' '002' '003' '004' '005' '006' '007' '009' '010' '011' '012' '013' '014' '015' '016' '019' '020' '022' '023'};
- % config
- orgfs = 600; % original sampling frequency of raw data
- fs = 100; % final sampling frequency after downsampling
- niter = 5000; % number of surrogate iterations
- plvcrit = 0.1; % threshold for IAAFT surrogate generation, max PLV of surrogate with data
- nbin = 60; % number of phase bins
- phw = (2*pi/10)/2; % width of each phase bin, divided in half
- pb = linspace(-pi,pi,nbin+1); % vector containing centre of each phase bin (= phase bin vector)
- pb(end) = [];
- load(fullfile(datapath, 'events.mat')); % load stimulus onsets ("onsets") and outcome (here: "corr" for hit vs miss trials)
- %% Compute true and surrogate respiration phase values at stimulus onset
- for isub = 1:numel(ids)
- disp(['Computing phase and surrogates for subject #' num2str(isub) '/' num2str(length(ids))]);
- pattern = sprintf('*_%s.mat', ids{isub});
- respfiles = dir(fullfile(datapath, pattern));
- load([datapath respfiles.name]);
- x = downsample(zscore(data(1,:)), orgfs/fs); % downsample & zscore raw respiration signal
- x = movmean(x, 0.4*fs); % some smoothing
- % extract phase vector of empirical data using two-point interpolation
- [pv, first, last] = two_point_interp(x); % first/last indices saved for NaN exclusion later
- %%% generate surrogate phase vectors using IAAFT
- allsresp = nan(niter,length(x));
- k = 1;
- while k <= niter
- disp(['Computing surrogate resp trace #' num2str(k) '/' num2str(niter)]);
- sresp = generate_surrogate_iaaft(x,'verbose',false); % single mock solution for respiration time series
- [spv, ftmp, ltmp] = two_point_interp(sresp); % extract surrogate phase via two-point interpolation
- spvtmp = spv(max(first, ftmp):min(last, ltmp)); % temporarily get rid of NaNs in phase vectors as PLV function cannot handle NaNs
- pvtmp = pv(max(first, ftmp):min(last, ltmp));
- plv = PLV(pvtmp', spvtmp); % compute phase-locking value
- if plv < plvcrit % only keep solution if plv is smaller than current constraint
- allsresp(k,:) = spv; % save full surrogate phase vector
- k = k+1;
- else
- continue % otherwise start over
- end
- end
- save(fullfile(datapath, ['surrogates_iaaft_' num2str(isub) '.mat']),'allsresp', '-v7.3');
- % get stimulus onsets in the respiration time frame
- % (= time from recording start in ms)
- disp(['Computing empirical and surrogate onsets for subject #' num2str(isub) '/' num2str(length(ids))]);
- onsets = events{isub}.onsets; % the onsets field contains the sample time stamps for the stimuli presentation
- onsets = round(onsets/(orgfs/fs)); % downsample the sample time stamps to match new fs
- empphase = pv(onsets); % empirical phase at onset of stimulus for each trial
- surrphases = [];
- for k = 1:niter
- surrphases(:,k) = allsresp(k, onsets); % surrogate phase at onset of stimulus for each trial
- end
- % save
- save(fullfile(datapath, ['empiricalphase_' num2str(isub) '.mat']),'empphase');
- save(fullfile(datapath, ['surrogatephases_' num2str(isub) '.mat']),'surrphases');
- end
- %% Compute outcome (hit rates) ~ respiration phase
- % example outcome here is hit rate, but can be any outcome variable
- binhr = nan(numel(ids), nbin);
- sbinhr = nan(numel(ids), nbin, niter);
- for isub = 1:numel(ids)
- disp(['Computing empirical and surrogate binned hit rates for subject #' num2str(isub) '/' num2str(length(ids))]);
- % empirical binHR
- load(fullfile(datapath, ['empiricalphase_' num2str(isub) '.mat']),'empphase');
- for ibin = 1:nbin
- phsel = find((empphase>pb(ibin)-phw) & (empphase<pb(ibin)+phw) | ... % find all trials whose phase falls within the current phase bin
- (empphase-2*pi>pb(ibin)-phw) & (empphase-2*pi<pb(ibin)+phw)| ...
- (empphase+2*pi>pb(ibin)-phw) & (empphase+2*pi<pb(ibin)+phw));
- binhr(isub,ibin) = sum(events{isub}.outcome(phsel))/numel(phsel); % based on the outcome for these trials, compute hit rate for this phase bin
- end
- % surrogate binHR
- load(fullfile(datapath, ['surrogatephases_' num2str(isub) '.mat']),'surrphases');
- for k = 1:niter
- sphase = surrphases(:, k);
- for ibin = 1:nbin
- phsel = find((sphase>pb(ibin)-phw) & (sphase<pb(ibin)+phw) | ... % again find trials for each phase bin...
- (sphase-2*pi>pb(ibin)-phw) & (sphase-2*pi<pb(ibin)+phw)| ...
- (sphase+2*pi>pb(ibin)-phw) & (sphase+2*pi<pb(ibin)+phw));
- sbinhr(isub,ibin,k) = sum(events{isub}.outcome(phsel))/numel(phsel); % ...and compute bin HR based on the outcome
- end
- end
- end
- % save mean hit rates ~ respiration phase bins for empirical & surrogate data
- % this is the data we run the circular clustering on
- save(fullfile(datapath, 'binhr.mat'), 'binhr'); % subjects x nbins array of empirical phase-binned outcome values
- save(fullfile(datapath, 'surrbinhr.mat'), 'sbinhr'); % subjects x nbins x niter array of surrogate phase-binned values
- save(fullfile(datapath, 'phasebinvect.mat'), 'pb'); % also save the vector with the phase bin centres
Tutorial_DataPrep.m at commit f2bd9a0, no license · at the source
Overview
- Institute for Biomagnetism and Biosignal Analysis, University of Münster, Münster, Germany
- Otto Creutzfeldt Center for Cognitive and Behavioral Neuroscience, University of Münster, Münster, Germany
- Department of Linguistics, Cognitive Science and Semiotics, Aarhus University, Aarhus, Denmark
- Center of Functionally Integrative Neuroscience, Aarhus University, Aarhus, Denmark
Abstract
The rapidly developing research field of brain-body neuroscience faces methodological challenges, as analysts continue to develop new analysis strategies in the absence of established best practices. This quest for valid methods is further complicated by the (naturally) circular data involved in the study of phase-locked effects, e.g., in respiration-brain coupling. Various available approaches for phase extraction, constructing adequate surrogate data for statistical comparison, and accounting for the circularity of respiratory data lead to poor cross-study generalisability of results. Interpretation of effects is particularly affected by the problem of multiple comparisons in phase-related inferential statistics. In this tutorial, we propose a robust pipeline for respiration phase-related analyses based on a novel circular extension of cluster-based permutation testing. We highlight and offer guidance on critical parameters in the analysis, systematically compare various approaches being used in the field today, and provide open-access software code for flexible use and future development of our proposed pipeline.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 13 matches between paragraphs and lines of code.
LeonardoRicci/iaaft
4ac80e8f069c5981ca182896f99382890e326859, 20 May 2022Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
4 files
- generate_surrogate_iaaft
.m , MATLAB, 126 lines, 2 matches - generate_surrogate_iaaft
.py , Python, 132 lines, 1 match - LICENSE.txt, License, 675 lines
- README.md, Text, 25 lines
teresaberther/respmethods
f2bd9a0dda9a0952ed2df2f7d34a6d196d4cd060, 27 July 2026Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
38 files
- matlab/
Tutorial_DataClust.m , MATLAB, 295 lines - matlab/
Tutorial_DataPrep.m , MATLAB, 145 lines, 3 matches - matlab/
Tutorial_MI.m , MATLAB, 166 lines - matlab/
_figures/ , MATLAB, 118 lines, 1 matchplots_fig2.m - matlab/
_figures/ , MATLAB, 139 lines, 2 matchesplots_fig3.m - matlab/
_figures/ , R, 100 lines, 2 matchesplots_fig3_rainclouds.R - matlab/
_figures/ , MATLAB, 77 linessupp_surrgenmethods.m - matlab/
respLABmethods/ , MATLAB, 157 linesCircClust.m - matlab/
respLABmethods/ , MATLAB, 139 lines, 1 matchCircPerm.m - matlab/
respLABmethods/ , MATLAB, 16 linesPLV.m - matlab/
respLABmethods/ , MATLAB, 64 lines, 1 matchfour_point_interp.m - matlab/
respLABmethods/ , MATLAB, 127 linesgenerate_surrogate_iaaft .m - matlab/
respLABmethods/ , MATLAB, 94 linesprotophase_interp.m - matlab/
respLABmethods/ , MATLAB, 114 linestrapez_interp.m - matlab/
respLABmethods/ , MATLAB, 46 linestwo_point_interp.m - python/
Tutorial_PlotSimulation. , Jupyter, 288 linesipynb - python/
Tutorial_Preprocessing.i , Jupyter, 131 linespynb - python/
Tutorial_RunSimulation.i , Jupyter, 60 linespynb - python/
advanced_tutorials/ , Python, 137 linesTutorial_DataPrepMultipr ocessing.py - python/
advanced_tutorials/ , Python, 137 linesTutorial_HPCSimulation/ exec-job.py - python/
advanced_tutorials/ , Python, 83 linesTutorial_HPCSimulation/ hq-rerun.py - python/
advanced_tutorials/ , Python, 153 linesTutorial_HPCSimulation/ hq-sim.py - python/
advanced_tutorials/ , Python, 318 linesTutorial_HPCSimulation/ plot-results.py - python/
advanced_tutorials/ , Shell, 5 linesTutorial_HPCSimulation/ server.sh - python/
advanced_tutorials/ , Python, 116 linesTutorial_HPCSimulation/ sim-debug.py - python/
advanced_tutorials/ , Python, 18 linesTutorial_HPCSimulation/ test-deps.py - python/
advanced_tutorials/ , Shell, 26 linesTutorial_HPCSimulation/ workers.sh - python/
legacy/ , C, 121 linesclib/ phase-extraction.c - python/
legacy/ , C, 155 linesclib/ util_resp.c - python/
legacy/ , Python, 14 linessetup.py - python/
src/ , Python, 78 linesrespymethods/ GenerateSurrogates.py - python/
src/ , Python, 102 linesrespymethods/ Helpers.py - python/
src/ , Python, 74 linesrespymethods/ PhaseExtraction.py - python/
src/ , Python, 297 linesrespymethods/ RespStats.py - python/
src/ , Python, 329 linesrespymethods/ Simulation.py - python/
src/ , Python, 1 linerespymethods/ __init__.py - python/
tests/ , Python, 112 linesunit_test.py - README.md, Text, 66 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:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 39 scripts, each with its path and the digest of its content;
- 13 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
Datasets cited
Data Availability
Example datasets for all analysis tutorials can be found in the accompanying GitHub repository (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 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 8 MeSH terms, 6 funders, 44 references.
Cite
This paper
Berther, T., Balestrieri, E., Saltafossi, M., Paulsen, L. B., Andersen, L. M., & Kluger, D. S. (2026). Robust circular cluster-based statistics for respiration-brain coupling. PLoS computational biology, 22(9), e1014672. https://
BibTeX
@article{berther2026robu
author = {Berther, Teresa and Balestrieri, Elio and Saltafossi, Martina and Paulsen, Laura Bock and Andersen, Lau M and Kluger, Daniel S},
title = {{Robust circular cluster-based statistics for respiration-brain coupling}},
journal = {PLoS computational biology},
year = {2026},
month = sep,
volume = {22},
number = {9},
pages = {e1014672},
publisher = {PLOS},
issn = {1553-734X},
doi = {10.1371/
url = {https://
pmid = {42691071},
pmcid = {PMC13541119}
}
RIS
TY - JOUR
AU - Berther, Teresa
AU - Balestrieri, Elio
AU - Saltafossi, Martina
AU - Paulsen, Laura Bock
AU - Andersen, Lau M
AU - Kluger, Daniel S
TI - Robust circular cluster-based statistics for respiration-brain coupling
T2 - PLoS computational biology
J2 - PLoS Comput Biol
PY - 2026
DA - 2026/
VL - 22
IS - 9
SP - e1014672
SN - 1553-734X
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "Robust circular cluster-based statistics for respiration-brain coupling",
"container-title": "PLoS computational biology",
"author": [
{
"family": "Berther",
"given": "Teresa"
},
{
"family": "Balestrieri",
"given": "Elio"
},
{
"family": "Saltafossi",
"given": "Martina"
},
{
"family": "Paulsen",
"given": "Laura Bock"
},
{
"family": "Andersen",
"given": "Lau M"
},
{
"family": "Kluger",
"given": "Daniel S"
}
],
"container-title-short":
"volume": "22",
"issue": "9",
"page": "e1014672",
"DOI": "10.1371/
"PMID": "42691071",
"PMCID": "PMC13541119",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
3
]
]
}
}
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-71604-8 [code]
- Respiration as a dynamic modulator of sensory sampling.Journal: Nature communicationsIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 12 references, author Daniel S Kluger
- [2] doi:10.1371/journal.pbio.3003982 [code]
- No evidence for modulation of the readiness potential by respiratory phase during natural breathing.Journal: PLoS biologyIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 6 references
- [3] doi:10.7554/elife.107088 [code]
- Development of auditory and spontaneous movement responses to music over the first postnatal year.Journal: eLifeIn common: Wavelet Toolbox, Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 7 other tools, 1 reference
- [4] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: Numba, Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 7 other tools
- [5] doi:10.1038/s41467-026-71458-0 [code]
- Early differential impact of MeCP2 mutations on functional networks in Rett syndrome patient-derived human cortical organoids.Journal: Nature communicationsIn common: Wavelet Toolbox, Numba, Signal Processing Toolbox, 5 other tools
- [6] doi:10.7554/elife.107081 [code]
- Cortical motor activity modulates respiration and reduces apnoea in neonates.Journal: eLifeIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 5 references
- [7] doi:10.1111/psyp.70297 [code]
- Heartbeat-Evoked Responses in M/
EEG: A Systematic Review of Methods With Suggestions for Analysis and Reporting. Journal: PsychophysiologyIn common: ggplot2, tidyverse, pandas, 1 other tool, methods / tools, 4 references - [8] doi:10.1162/imag.a.105 [code]
- Right posterior theta reflects human parahippocampal phase resetting by salient cues during goal-directed navigationJournal: n/aIn common: Wavelet Toolbox, Statistics and Machine Learning Toolbox, ggplot2, 6 other tools
- [9] doi:10.1523/eneuro.0344-25.2026 [code]
- Long-Term Variability in Visual Processing versus Perceptual Stability.Journal: eNeuroIn common: seaborn, pandas, SciPy, 2 other tools, author Laura Bock Paulsen
- [10] doi:10.1162/imag.a.1229 [code]
- 40 Hz audiovisual stimulation improves sustained attention and related brain oscillations.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Wavelet Toolbox, Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 5 other tools
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: 2 repositories of the authors' code, each at its verified commit and with its license, 39 scripts, and 13 matches 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:962130f65f3b7a79…
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
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
