OSCR

Age-related changes in ‘cortical’ 1/f dynamics are linked to cardiac activity

Code ↔ Paper

11 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 11 matches · 2 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Methods › MEG/EEG processing › MEG/EEG processing - spectral analysis ↔ utils/fooof_utils.py, lines 138–175 · score 0.85 · peak width limits, peak height, peak threshold, FOOOF models, aperiodic mode, max
  2. [2] § Methods › Literature analysis ↔ notebooks/lit_text_analysis.py, lines 99–167 · score 0.77 · search word, word context, invalid, discard, stems, DSS
  3. [3] § Methods › ECG processing › ECG processing - heart rate variability analysis ↔ notebooks/c_1_f_ecg_only.ipynb, lines 537–555 · score 0.75 · 0.04–0.15 Hz, 0.15–0.4 Hz, Heart rate, 0.04 Hz, filtering, intervals
  4. [4] § Methods › MEG/EEG processing › MEG/EEG processing - pre-processing ↔ cluster_jobs/abstract_jobs/preprocess_abstract.py, lines 17–143 · score 0.70 · high pass filtered, MNE, Potato, copy, residual, epochs
  5. [5] § Methods › MEG/EEG processing › MEG/EEG processing - pre-processing ↔ utils/cleaning_utils.py, lines 3–19 · score 0.70 · covariance matrix, Riemannian, pyriemann, MNE, Potato, epochs
  6. [6] § Methods › Statistical inference ↔ utils/pymc_utils.py, lines 47–108 · score 0.62 · dependent variables, correlation coefficient, Bambi, PyMC, posterior, models
  7. [7] § Methods › MEG/EEG processing › MEG/EEG processing - spectral analysis ↔ cluster_jobs/abstract_jobs/preprocess_abstract.py, lines 17–143 · score 0.60 · 0.1–145 Hz, YASA, Welch, max, raw, peak
  8. [8] § Results › Control analyses: age-related steepening of the spectral slope in the MEG ↔ cluster_jobs/cam_can_single_channel_slopes.py, the whole file · a weak match · score 0.57 · power spectral densities, slope fitting, Space, eye, ECG components, channels
  9. [9] § Methods › Working memory analysis › Data analysis ↔ delay_v_baseline_spectra.py, lines 208–213 · score 0.57 · 0.1–245 Hz, Power spectra, Baseline, Delay, 0.1 Hz, aperiodic
  10. [10] § Results › Age-related changes in aperiodic brain activity are most pronounced in cardiac components ↔ cluster_jobs/cam_can_single_channel_slopes.py, the whole file · a weak match · score 0.52 · 0.5–45 Hz, ECG rejected, ECG components, SSS, IRASA, brain
  11. [11] § Methods › MEG/EEG processing › MEG/EEG processing - temporal response functions ↔ notebooks/eeg_meg_1f_preprocessing.py, lines 52–134 · score 0.51 · downsampled, decoding, encoding, cross, scored, zero

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 · 222 lines · 9.6 KB · BSD-3-Clause · 2 matches

  1. from cluster_jobs.abstract_jobs.meta_job import Job
  2. import mne
  3. import numpy as np
  4. import joblib
  5. import yasa
  6. from fooof.utils import interpolate_spectrum
  7. from utils.cleaning_utils import run_potato
  8. from utils.psd_utils import compute_spectra_ndsp, compute_spectra_mne, interpolate_line_freq
  9. from utils.fooof_utils import fooof2aperiodics
  10. import random
  11. random.seed(42069) #make it reproducible - sort of
  12. class AbstractPreprocessingJob(Job):
  13. def run(self,
  14. subject_id,
  15. l_pass = None,
  16. h_pass = 1,
  17. notch = False,
  18. eye_threshold = 0.5,
  19. heart_threshold = 0.5,
  20. powerline = 50, #in hz
  21. n_peaks=0,
  22. fit_knee=False,
  23. duration=2,
  24. irasa=False,
  25. is_3d=False,
  26. freq_range = [0.1, 145],
  27. lower_freq_fooof = 0.1,
  28. upper_freq_fooof = 145,
  29. sss=True,
  30. interpolate=False,
  31. pick_dict = {'meg': 'mag', 'eog':True, 'ecg':True}):
  32. if fit_knee == False or fit_knee == True and upper_freq_fooof >= 65:
  33. self.raw = self._data_loader(subject_id, sss)
  34. self.raw.pick_types(**pick_dict)
  35. #Apply filters
  36. self.raw.filter(l_freq=h_pass, h_freq=l_pass)
  37. if notch:
  38. nyquist = self.raw.info['sfreq'] / 2
  39. print(f'Running notch filter using {powerline} Hz steps. Nyquist is {nyquist}')
  40. self.raw.notch_filter(np.arange(powerline, nyquist, powerline), filter_length='auto', phase='zero')
  41. #Do the ica
  42. print('Running ICA. Data is copied and the copy is high-pass filtered at 1Hz')
  43. raw_no_ica = self.raw.copy()
  44. raw_copy = self.raw.copy().filter(l_freq=1, h_freq=None)
  45. ica = mne.preprocessing.ICA(n_components=50, #selecting 50 components here -> fieldtrip standard in our lab
  46. max_iter='auto')
  47. ica.fit(raw_copy)
  48. ica.exclude = []
  49. # reject components by explained variance
  50. # find which ICs match the EOG pattern using correlation
  51. eog_indices, eog_scores = ica.find_bads_eog(raw_copy, measure='correlation', threshold=eye_threshold)
  52. ecg_indices, ecg_scores = ica.find_bads_ecg(raw_copy, measure='correlation', threshold=heart_threshold)
  53. ecg_idcs = np.shape(ecg_indices)
  54. print(f'The ecg indices are of shape {ecg_idcs}')
  55. explained_variance_ecg = ica.get_explained_variance_ratio(raw_copy, components=ecg_indices)
  56. #%% select heart activity
  57. raw_heart = self.raw.copy()
  58. brain2exclude = np.delete(np.arange(ica.n_components), ecg_indices)
  59. ica.apply(raw_heart, include=ecg_indices, exclude=brain2exclude) #only project back my ecg components
  60. #%% select everything but heart stuff
  61. ica.apply(self.raw, exclude=ecg_indices + eog_indices)
  62. #%% select only eyes
  63. ica.apply(raw_no_ica, exclude=eog_indices)
  64. #%%clean epochs using potato
  65. epochs_brain = mne.make_fixed_length_epochs(self.raw, duration=duration, preload=True) #usually 2
  66. epochs_no_ica = mne.make_fixed_length_epochs(raw_no_ica, duration=duration, preload=True)
  67. epochs_heart = mne.make_fixed_length_epochs(raw_heart, duration=duration, preload=True)
  68. epochs_brain = run_potato(epochs_brain)
  69. epochs_no_ica = run_potato(epochs_no_ica)
  70. epochs_heart = run_potato(epochs_heart)
  71. #% irasa runs on continuous data
  72. if irasa:
  73. fs = self.raw.info['sfreq']
  74. ch_names= self.raw.info['ch_names']
  75. def run_irasa(cur_data, fs, ch_names, duration):
  76. kwargs_welch = {'average': 'mean', #we rejected bad i.e. outlier epochs before so this should be fine (Note: also cross-checked against median -> doesnt change much)
  77. 'window': 'hann',
  78. 'noverlap': 0} #cant use overlap as residual trials might not be overlapping
  79. freqs, psd_aperiodic, psd_osc, fit_params = yasa.irasa(cur_data, band=freq_range, sf=fs, ch_names=ch_names,
  80. win_sec=duration, kwargs_welch=kwargs_welch)
  81. from scipy.signal import welch
  82. f, pxx = welch(cur_data, fs=fs, nperseg=duration*fs, **kwargs_welch)
  83. irasa_data = {
  84. 'aperiodic': psd_aperiodic,
  85. 'periodic':psd_osc,
  86. 'freqs': freqs,
  87. 'raw_spectra': pxx,
  88. 'fit_params': fit_params
  89. }
  90. return irasa_data
  91. data_brain = run_irasa(np.hstack(epochs_brain), fs, ch_names, duration)
  92. data_no_ica = run_irasa(np.hstack(epochs_no_ica), fs, ch_names, duration)
  93. data_heart = run_irasa(np.hstack(epochs_heart), fs, ch_names, duration)
  94. else:
  95. #%% compute spectra and fooof the data
  96. data_no_ica = self._compute_spectra_and_fooof(epochs_no_ica, freq_range, lower_freq_fooof, upper_freq_fooof, run_on_ecg=False,
  97. is_3d=is_3d, n_peaks=n_peaks, fit_knee=fit_knee, duration=duration, interpolate=interpolate)
  98. data_brain = self._compute_spectra_and_fooof(epochs_brain, freq_range, lower_freq_fooof, upper_freq_fooof, run_on_ecg=False,
  99. is_3d=is_3d, n_peaks=n_peaks, fit_knee=fit_knee, duration=duration, interpolate=interpolate)
  100. data_heart = self._compute_spectra_and_fooof(epochs_heart, freq_range, lower_freq_fooof, upper_freq_fooof, run_on_ecg=True,
  101. is_3d=is_3d, n_peaks=n_peaks, fit_knee=fit_knee, duration=duration, interpolate=interpolate)
  102. #%%
  103. data = {'data_no_ica': data_no_ica,
  104. 'data_brain': data_brain,
  105. 'data_heart': data_heart,
  106. 'subject_id': subject_id,
  107. 'ecg_scores': ecg_scores,
  108. 'age': self._get_age(),
  109. 'explained_variance_ecg': explained_variance_ecg,
  110. #'explained_variance': ica._get_infos_for_repr().fit_explained_variance
  111. }
  112. joblib.dump(data, self.full_output_path)
  113. def _compute_spectra_and_fooof(self, epochs, freq_range, lower_freq_fooof, upper_freq_fooof,
  114. run_on_ecg, is_3d, n_peaks, fit_knee, duration, interpolate):
  115. mags = epochs.copy().pick_types(meg='mag')
  116. freqs, psd_mag, _ = compute_spectra_ndsp(mags,
  117. method='welch',
  118. freq_range=freq_range,
  119. time_window=duration)
  120. if interpolate:
  121. def interpolate_powerline(freqs, psd, line_freqs):
  122. for line_freq in line_freqs:
  123. _, psd = interpolate_spectrum(freqs, psd, line_freq)
  124. return psd
  125. psd_mag_interpol = []
  126. line_freqs = [[48, 52], [98, 102]]
  127. print(f'The shape of the data is {psd_mag.shape}')
  128. for psd_epoch in psd_mag:
  129. psd_mag_interpol.append([interpolate_powerline(freqs, cur_psd, line_freqs) for cur_psd in psd_epoch])
  130. psd_mag = np.array(psd_mag_interpol)
  131. print(f'The shape of the interpolated data is {psd_mag.shape}')
  132. if not is_3d:
  133. psd_mag = psd_mag.mean(axis=0)
  134. exponents_mag, offsets_mag, aps_mag, r2, error = fooof2aperiodics(freqs, lower_freq_fooof, upper_freq_fooof, psd_mag, is_3d=is_3d,
  135. fit_knee=fit_knee, n_peaks=n_peaks)
  136. data = {'mag': {'psd': psd_mag,
  137. 'freqs': freqs,
  138. 'offsets': offsets_mag,
  139. 'exponents': exponents_mag,
  140. 'aps_mag': aps_mag,
  141. 'r2': r2,
  142. 'error': error},}
  143. if run_on_ecg:
  144. ecg = epochs.copy().pick_types(ecg=True)
  145. freqs, psd_ecg, _ = compute_spectra_ndsp(ecg,
  146. method='welch',
  147. freq_range=freq_range,
  148. time_window=duration)
  149. if not is_3d:
  150. psd_ecg = psd_ecg.mean(axis=0) #average for smoother spectra
  151. exponents_ecg, offsets_ecg, aps_ecg, r2, error = fooof2aperiodics(freqs, lower_freq_fooof, upper_freq_fooof, psd_ecg,
  152. is_3d=is_3d, fit_knee=False)
  153. data.update({'ecg': {'psd': psd_ecg,
  154. 'freqs': freqs,
  155. 'offsets': offsets_ecg,
  156. 'exponents': exponents_ecg,
  157. 'aps_ecg': aps_ecg,
  158. 'r2': r2,
  159. 'error': error,},})
  160. return data
  161. #safety methods
  162. def _data_loader(self):
  163. raise NotImplementedError
  164. def _get_age(self):
  165. raise NotImplementedError

preprocess_abstract.py at commit 4562c0d, under BSD-3-Clause · at the source

Overview

Authors: Fabian Schmidt1, Sarah K Danböck1, Eugen Trinka1,2,3, Dominic P Klein4, Gianpaolo Demarchi1, Nathan Weisz1,2
  1. Paris-Lodron-University of Salzburg, Department of Psychology, Centre for Cognitive Neuroscience, Salzburg, Austria
  2. Neuroscience Institute, Christian Doppler University Hospital, Paracelsus Medical University, Salzburg, Austria
  3. Department of Neurology, Christian Doppler University Hospital, Paracelsus Medical University, Salzburg, Austria
  4. Division of Cardiology and Emergency Medicine, Department of Medicine V, Clinic Favoriten, Vienna, Austria
Institutions: University of Salzburg (Austria); Paracelsus Medical University (Austria)
Journal: —, volume 13, article RP100605
Dates: published online 2 October 2025
Type: Research article · Language: English
License: none stated
Identifiers: DOI 10.7554/elife.100605 · PMCID PMC12490856 · OpenAlex W4402393923
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: other (modality), MEG (modality), human (organism), developmental (subfield)
Methods: Spectral & time-frequency, Connectivity, Smoothing, state filtering, decompositions, Machine learning, Complexity, Preprocessing, Evoked potentials, Statistics, fMRI & imaging, Physiology & signal measures
Keywords: Human
MeSH: Aging*, Cerebral Cortex*, Heart*, Adolescent, Adult, Aged, Aged, 80 and over, Electrocardiography, Female, Humans, Magnetoencephalography, Male, Middle Aged, Young Adult (* major topic)
Topic: Heart Rate Variability and Autonomic Control (Cardiology and Cardiovascular Medicine, Medicine), according to OpenAlex
Funding: Austrian Science Fund FWF (10.55776/W1233)
Citations: cited by 14 papers (Europe PMC); 100 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (none stated) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

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

schmidtfa/cardiac_1_f

License: BSD-3-Clause
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 4562c0dc318930c46b77732b73d85504b2b471c4, 15 September 2025
Languages: Python (47), Jupyter (6)
Size: 75 files, 53 scripts
Software Heritage: archived
Found in: “Data availability”
Holds: README, license file, environment (environment.yml), 4 notebooks
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (36 files), pandas (35 files), Matplotlib (22 files), ArviZ (19 files), Bambi (19 files), seaborn (19 files), SciPy (18 files), MNE-Python (17 files), PyMC (13 files), Pingouin (8 files), specparam (formerly FOOOF) (5 files), NeuroDSP (4 files), MNE-BIDS (2 files), NetworkX (2 files), statsmodels (2 files), WFDB Python (2 files), autoreject (1 file), pyRiemann (1 file), scikit-learn (1 file), YASA (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
55 files

schmidtfa/ecg_1f_memory

License: BSD-3-Clause
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 585174cd7f36f17555f8b36ffcc7881aeac9e82e, 15 September 2025
Languages: Python (5)
Size: 8 files, 5 scripts
Software Heritage: archived
Found in: “Data availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: MNE-Python (4 files), NumPy (4 files), pandas (4 files), SciPy (4 files), specparam (formerly FOOOF) (4 files), ArviZ (3 files), Bambi (3 files), Matplotlib (3 files), Pingouin (3 files), PyMC (3 files), seaborn (3 files), autoreject (1 file), h5py (1 file), MNE-BIDS (1 file), pyRiemann (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
7 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;
  • 58 scripts, each with its path and the digest of its content;
  • 11 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

Code and data availability statement

The paper has a code and data availability statement. Its license (none stated) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.7554/elife.100605.

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, pages, dates, 6 authors, 1 keyword, 14 MeSH terms, 1 funder, 96 references.

Cite

This paper

Schmidt, F., Danböck, S. K., Trinka, E., Klein, D. P., Demarchi, G., & Weisz, N. (2025). Age-related changes in ‘cortical’ 1/f dynamics are linked to cardiac activity. eLife, 13, RP100605. https://doi.org/10.7554/elife.100605

BibTeX

@article{schmidt2025age,
author = {Schmidt, Fabian and Danböck, Sarah K and Trinka, Eugen and Klein, Dominic P and Demarchi, Gianpaolo and Weisz, Nathan},
title = {{Age-related changes in ‘cortical’ 1/f dynamics are linked to cardiac activity}},
journal = {eLife},
year = {2025},
volume = {13},
pages = {RP100605},
publisher = {eLife Sciences Publications, Ltd},
issn = {2050-084X},
doi = {10.7554/elife.100605},
url = {https://doi.org/10.7554/elife.100605},
pmcid = {PMC12490856}
}

RIS

TY - JOUR
AU - Schmidt, Fabian
AU - Danböck, Sarah K
AU - Trinka, Eugen
AU - Klein, Dominic P
AU - Demarchi, Gianpaolo
AU - Weisz, Nathan
TI - Age-related changes in ‘cortical’ 1/f dynamics are linked to cardiac activity
T2 - eLife
J2 - eLife
PY - 2025
DA - 2025
VL - 13
SP - RP100605
SN - 2050-084X
PB - eLife Sciences Publications, Ltd
DO - 10.7554/elife.100605
UR - https://doi.org/10.7554/elife.100605
LA - en
ER -

CSL-JSON

{
"id": "10.7554/elife.100605",
"type": "article-journal",
"title": "Age-related changes in ‘cortical’ 1/f dynamics are linked to cardiac activity",
"container-title": "eLife",
"author": [
{
"family": "Schmidt",
"given": "Fabian"
},
{
"family": "Danböck",
"given": "Sarah K"
},
{
"family": "Trinka",
"given": "Eugen"
},
{
"family": "Klein",
"given": "Dominic P"
},
{
"family": "Demarchi",
"given": "Gianpaolo"
},
{
"family": "Weisz",
"given": "Nathan"
}
],
"container-title-short": "eLife",
"volume": "13",
"page": "RP100605",
"DOI": "10.7554/elife.100605",
"PMCID": "PMC12490856",
"ISSN": "2050-084X",
"publisher": "eLife Sciences Publications, Ltd",
"URL": "https://doi.org/10.7554/elife.100605",
"language": "en",
"issued": {
"date-parts": [
[
2025
]
]
}
}

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.1162/imag.a.1269 [code]
From early to contemporary normative modeling: Mapping individual differences in neurophysiological signals.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: ArviZ, PyMC, specparam (formerly FOOOF), 10 other tools, MEG, 3 references
[2] doi:10.1111/ejn.70255 [code]
A Systematic Review of Aperiodic Neural Activity in Clinical Investigations
Journal: —
In common: NeuroDSP, specparam (formerly FOOOF), seaborn, 3 other tools, 11 references
[3] doi:10.1093/cercor/bhag113 [code]
Long-term reliability and stability of parameterized resting state EEG: evidence from a five-year follow-up.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: NeuroDSP, MNE-BIDS, specparam (formerly FOOOF), 7 other tools, 6 references
[4] doi:10.1523/eneuro.0041-26.2026 [code]
Ocular Speech Tracking Persists in Blindness, but Its Dynamics and Oculo-Cerebral Connectivity Depend on Visual Status.
Journal: eNeuro
In common: Pingouin, MNE-Python, statsmodels, 6 other tools, MEG, 4 references, author Nathan Weisz
[5] doi:10.1093/nc/niag029 [code]
A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.
Journal: Neuroscience of consciousness
In common: MNE-BIDS, autoreject, Pingouin, 9 other tools, MEG, 1 reference
[6] doi:10.1038/s41531-026-01372-1 [code]
Varying patterns of association between cortical large-scale networks and subthalamic nucleus activity in Parkinson's disease.
Journal: NPJ Parkinson's disease
In common: NeuroDSP, MNE-Python, h5py, 6 other tools, 5 references
[7] doi:10.1038/s41597-026-07350-9 [code]
An open multi-center MEG-EEG dataset for studying conscious visual perception.
Journal: Scientific data
In common: MNE-BIDS, autoreject, Pingouin, 8 other tools, MEG, 1 reference
[8] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: WFDB Python, ArviZ, PyMC, 8 other tools
[9] doi:10.1097/j.pain.0000000000004044 [code]
No effect of rhythmic visual stimulation on experimental pain perception.
Journal: Pain
In common: MNE-BIDS, specparam (formerly FOOOF), Pingouin, 7 other tools, 2 references
[10] doi:10.1038/s41467-026-73567-2 [code]
Reply to: "No evidence of neural feature-specific pre-activation during the prediction of an upcoming stimulus".
Journal: Nature communications
In common: 3 authors

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.