OSCR

Robust circular cluster-based statistics for respiration-brain coupling.

Code ↔ Paper

13 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 13 matches · 5 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [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. [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. [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. [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. [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. [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. [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. [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. [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. [10] § Results ↔ matlab/_figures/plots_fig2.m, lines 1–28 · score 0.53 · quasi continuous, outcome variables, hit rate, coupling, tutorial, binned
  11. [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. [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. [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

  1. %% Data preparation script: respiratory phase extraction, surrogate generation & hitrate binning
  2. %
  3. % This script extracts respiratory phase from raw respiration data using
  4. % two-point interpolation, generates surrogate phases via the Iterative
  5. % Amplitude-Adjusted Fourier Transform (IAAFT), and bins behavioral data
  6. % (e.g., hit rates) into empirical and surrogate respiratory phase bins.
  7. % A detailed description of the preparation pipeline can be found in
  8. % [ref].
  9. %
  10. % Input:
  11. % - raw respiration time series vector
  12. % - events structure with stimulus onset and outcome field for each subject
  13. % .onset: contains timestamp of stimulus presentation for each trial (in samples from start of recording)
  14. % .outcome: contains outcome value for each trial (here: hit vs miss)
  15. %
  16. % Output (here: hit rate):
  17. % binhr.mat = mean empirical outcome for each respiratory phase bin, for each subject
  18. % (subjects x phase bins matrix)
  19. % sbinhr.mat = mean surrogate outcome for each respiratory phase bin and surrogate, for each subject
  20. % (subjects x phase bins x surrogate iterations matrix)
  21. %
  22. % Required Helper Functions:
  23. % - two_point_interp: extracts phase of a signal by two-point interpolation
  24. % - generate_surrogate_iaaft: creates a phase-scrambled surrogate time series
  25. % of a signal
  26. % - PLV: computes phase-locking value of two phase time series
  27. %
  28. %
  29. % Copyright (C) 2025, Daniel Kluger & Teresa Berther, University of Münster, Germany
  30. clearvars
  31. clc
  32. close all
  33. addpath(genpath('~/respmethods/matlab/'));
  34. datapath = '~/respmethods/_exampledata/'; % contains raw respiration traces and events table
  35. % subject ids
  36. ids = {'001' '002' '003' '004' '005' '006' '007' '009' '010' '011' '012' '013' '014' '015' '016' '019' '020' '022' '023'};
  37. % config
  38. orgfs = 600; % original sampling frequency of raw data
  39. fs = 100; % final sampling frequency after downsampling
  40. niter = 5000; % number of surrogate iterations
  41. plvcrit = 0.1; % threshold for IAAFT surrogate generation, max PLV of surrogate with data
  42. nbin = 60; % number of phase bins
  43. phw = (2*pi/10)/2; % width of each phase bin, divided in half
  44. pb = linspace(-pi,pi,nbin+1); % vector containing centre of each phase bin (= phase bin vector)
  45. pb(end) = [];
  46. load(fullfile(datapath, 'events.mat')); % load stimulus onsets ("onsets") and outcome (here: "corr" for hit vs miss trials)
  47. %% Compute true and surrogate respiration phase values at stimulus onset
  48. for isub = 1:numel(ids)
  49. disp(['Computing phase and surrogates for subject #' num2str(isub) '/' num2str(length(ids))]);
  50. pattern = sprintf('*_%s.mat', ids{isub});
  51. respfiles = dir(fullfile(datapath, pattern));
  52. load([datapath respfiles.name]);
  53. x = downsample(zscore(data(1,:)), orgfs/fs); % downsample & zscore raw respiration signal
  54. x = movmean(x, 0.4*fs); % some smoothing
  55. % extract phase vector of empirical data using two-point interpolation
  56. [pv, first, last] = two_point_interp(x); % first/last indices saved for NaN exclusion later
  57. %%% generate surrogate phase vectors using IAAFT
  58. allsresp = nan(niter,length(x));
  59. k = 1;
  60. while k <= niter
  61. disp(['Computing surrogate resp trace #' num2str(k) '/' num2str(niter)]);
  62. sresp = generate_surrogate_iaaft(x,'verbose',false); % single mock solution for respiration time series
  63. [spv, ftmp, ltmp] = two_point_interp(sresp); % extract surrogate phase via two-point interpolation
  64. spvtmp = spv(max(first, ftmp):min(last, ltmp)); % temporarily get rid of NaNs in phase vectors as PLV function cannot handle NaNs
  65. pvtmp = pv(max(first, ftmp):min(last, ltmp));
  66. plv = PLV(pvtmp', spvtmp); % compute phase-locking value
  67. if plv < plvcrit % only keep solution if plv is smaller than current constraint
  68. allsresp(k,:) = spv; % save full surrogate phase vector
  69. k = k+1;
  70. else
  71. continue % otherwise start over
  72. end
  73. end
  74. save(fullfile(datapath, ['surrogates_iaaft_' num2str(isub) '.mat']),'allsresp', '-v7.3');
  75. % get stimulus onsets in the respiration time frame
  76. % (= time from recording start in ms)
  77. disp(['Computing empirical and surrogate onsets for subject #' num2str(isub) '/' num2str(length(ids))]);
  78. onsets = events{isub}.onsets; % the onsets field contains the sample time stamps for the stimuli presentation
  79. onsets = round(onsets/(orgfs/fs)); % downsample the sample time stamps to match new fs
  80. empphase = pv(onsets); % empirical phase at onset of stimulus for each trial
  81. surrphases = [];
  82. for k = 1:niter
  83. surrphases(:,k) = allsresp(k, onsets); % surrogate phase at onset of stimulus for each trial
  84. end
  85. % save
  86. save(fullfile(datapath, ['empiricalphase_' num2str(isub) '.mat']),'empphase');
  87. save(fullfile(datapath, ['surrogatephases_' num2str(isub) '.mat']),'surrphases');
  88. end
  89. %% Compute outcome (hit rates) ~ respiration phase
  90. % example outcome here is hit rate, but can be any outcome variable
  91. binhr = nan(numel(ids), nbin);
  92. sbinhr = nan(numel(ids), nbin, niter);
  93. for isub = 1:numel(ids)
  94. disp(['Computing empirical and surrogate binned hit rates for subject #' num2str(isub) '/' num2str(length(ids))]);
  95. % empirical binHR
  96. load(fullfile(datapath, ['empiricalphase_' num2str(isub) '.mat']),'empphase');
  97. for ibin = 1:nbin
  98. phsel = find((empphase>pb(ibin)-phw) & (empphase<pb(ibin)+phw) | ... % find all trials whose phase falls within the current phase bin
  99. (empphase-2*pi>pb(ibin)-phw) & (empphase-2*pi<pb(ibin)+phw)| ...
  100. (empphase+2*pi>pb(ibin)-phw) & (empphase+2*pi<pb(ibin)+phw));
  101. binhr(isub,ibin) = sum(events{isub}.outcome(phsel))/numel(phsel); % based on the outcome for these trials, compute hit rate for this phase bin
  102. end
  103. % surrogate binHR
  104. load(fullfile(datapath, ['surrogatephases_' num2str(isub) '.mat']),'surrphases');
  105. for k = 1:niter
  106. sphase = surrphases(:, k);
  107. for ibin = 1:nbin
  108. phsel = find((sphase>pb(ibin)-phw) & (sphase<pb(ibin)+phw) | ... % again find trials for each phase bin...
  109. (sphase-2*pi>pb(ibin)-phw) & (sphase-2*pi<pb(ibin)+phw)| ...
  110. (sphase+2*pi>pb(ibin)-phw) & (sphase+2*pi<pb(ibin)+phw));
  111. sbinhr(isub,ibin,k) = sum(events{isub}.outcome(phsel))/numel(phsel); % ...and compute bin HR based on the outcome
  112. end
  113. end
  114. end
  115. % save mean hit rates ~ respiration phase bins for empirical & surrogate data
  116. % this is the data we run the circular clustering on
  117. save(fullfile(datapath, 'binhr.mat'), 'binhr'); % subjects x nbins array of empirical phase-binned outcome values
  118. save(fullfile(datapath, 'surrbinhr.mat'), 'sbinhr'); % subjects x nbins x niter array of surrogate phase-binned values
  119. 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

Authors: Teresa Berther1,2, Elio Balestrieri1,2, Martina Saltafossi1,2, Laura Bock Paulsen3, Lau M Andersen3,4, Daniel S Kluger1,2
  1. Institute for Biomagnetism and Biosignal Analysis, University of Münster, Münster, Germany
  2. Otto Creutzfeldt Center for Cognitive and Behavioral Neuroscience, University of Münster, Münster, Germany
  3. Department of Linguistics, Cognitive Science and Semiotics, Aarhus University, Aarhus, Denmark
  4. Center of Functionally Integrative Neuroscience, Aarhus University, Aarhus, Denmark
Institutions: University of Münster (Germany); Aarhus University (Denmark)
Journal: PLoS computational biology, volume 22, issue 9, article e1014672
Dates: received 14 January 2026; accepted 5 August 2026; published online 3 September 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pcbi.1014672 · PMID 42691071 · PMCID PMC13541119 · OpenAlex W4416696403
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), methods / tools (subfield)
Methods: Statistics, Spectral & time-frequency, Connectivity, Preprocessing, Complexity, Physiology & signal measures
MeSH: Brain*, Respiration*, Algorithms, Cluster Analysis, Clustering Algorithms, Computational Biology, Humans, Software (* major topic)
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Innovative Medical Research (IMF) programme of the University of Münster; IZKF (Klu3/002/26); European Union; European Research Council (101162169); IMF (KL 1 2 22 01); Interdisciplinary Centre for Clinical Research Münster
Citations: not cited yet (Europe PMC); 44 references in the paper

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

License: GPL-3.0
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 4ac80e8f069c5981ca182896f99382890e326859, 20 May 2022
Languages: MATLAB (1), Python (1)
Size: 4 files, 2 scripts
Software Heritage: not checked
Found in: the text, “Nexus 2: Adequate surrogate distributions using ”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
4 files

teresaberther/respmethods

License: none: the authors keep all their rights
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: f2bd9a0dda9a0952ed2df2f7d34a6d196d4cd060, 27 July 2026
Languages: Python (15), MATLAB (14), Jupyter (3), Shell (2), C (2), R (1)
Size: 78 files, 37 scripts
Software Heritage: not checked
Found in: “Data Availability”
Holds: README, environment (python/pyproject.toml, python/uv.lock, python/legacy/setup.py), tests, continuous integration, 3 notebooks
Not found: license file, CITATION.cff, documentation
Tools: NumPy (15 files), SciPy (9 files), pandas (8 files), Matplotlib (6 files), Signal Processing Toolbox (5 files), seaborn (4 files), Numba (3 files), Statistics and Machine Learning Toolbox (2 files), ggplot2 (1 file), Wavelet Toolbox (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
38 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:

  • 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://github.com/teresaberther/respmethods/tree/main/_exampledata). The full dataset underlying the simulation results presented in this paper is available in an associated OSF project (https://osf.io/yzewv/overview).

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://doi.org/10.1371/journal.pcbi.1014672

BibTeX

@article{berther2026robust,
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/journal.pcbi.1014672},
url = {https://doi.org/10.1371/journal.pcbi.1014672},
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/09/03
VL - 22
IS - 9
SP - e1014672
SN - 1553-734X
PB - PLOS
DO - 10.1371/journal.pcbi.1014672
UR - https://doi.org/10.1371/journal.pcbi.1014672
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pcbi.1014672",
"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": "PLoS Comput Biol",
"volume": "22",
"issue": "9",
"page": "e1014672",
"DOI": "10.1371/journal.pcbi.1014672",
"PMID": "42691071",
"PMCID": "PMC13541119",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pcbi.1014672",
"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 communications
In 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 biology
In 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: eLife
In 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 biology
In 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 communications
In 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: eLife
In 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: Psychophysiology
In 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 navigation
Journal: n/a
In 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: eNeuro
In 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.

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.