OSCR

Emotion regulation success involves systematic gradient-based reconfigurations of large-scale activation patterns in the human brain.

Code ↔ Paper

2 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 2 matches
  1. [1] § Materials and methods › Neurosynth functional decoding ↔ Code/Neurosynth_Decoding/Neurosynth_Functional_Decoding.ipynb, lines 35–50 · score 0.60 · Neurosynth database, functional decoding, NiMARE
  2. [2] § Materials and methods › Gradient analysis › Out-of-sample predictions. ↔ Code/LMM/Cross-sample_Validation.R, lines 1–52 · score 0.60 · cross sample, joint sample, validation, lmer, trained, correlating

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

Jupyter notebook · 211 lines · 6.8 KB · no license · 1 match

  1. # %% [markdown]
  2. # ## ER gradient Neurosynth Meta-Analytic Functional Decoding
  3. # %%
  4. import os
  5. import pickle
  6. import pandas as pd
  7. import numpy as np
  8. from wordcloud import WordCloud
  9. import matplotlib.pyplot as plt
  10. from matplotlib import font_manager as fm
  11. from pprint import pprint
  12. from nimare.extract import download_abstracts, fetch_neurosynth
  13. from nimare.io import convert_neurosynth_to_dataset
  14. from nimare import decode, meta
  15. out_dir = os.path.abspath("")
  16. os.makedirs(out_dir, exist_ok=True)
  17. # %% [markdown]
  18. # ### Downlaod Neurosynth database
  19. # %%
  20. # Fetch Neurosynth with *just* the LDA50 features
  21. files = fetch_neurosynth(
  22. data_dir=out_dir,
  23. version="7",
  24. overwrite=True,
  25. source="abstract",
  26. vocab="LDA50", # LDA 100, 200 , or term
  27. )
  28. neurosynth_db = files[0]
  29. pprint(neurosynth_db)
  30. # %% [markdown]
  31. # ### Convert Neurosynth database to NiMARE dataset file
  32. # %%
  33. # Get the Dataset object
  34. neurosynth_dset = convert_neurosynth_to_dataset(
  35. coordinates_file=neurosynth_db["coordinates"],
  36. metadata_file=neurosynth_db["metadata"],
  37. annotations_files=neurosynth_db["features"],
  38. )
  39. neurosynth_dset.save(os.path.join(out_dir, 'neurosynth',"neurosynth_dataset_LDA50.pkl.gz"))
  40. print(neurosynth_dset)
  41. neurosynth_dset = download_abstracts(neurosynth_dset, "[email hidden]")
  42. neurosynth_dset.save(os.path.join(out_dir, 'neurosynth' ,"neurosynth_dataset_LDA50_with_abstracts.pkl.gz"))
  43. # %% [markdown]
  44. # ### Feature selection
  45. # %%
  46. id_cols = ["id", "study_id", "contrast_id"]
  47. frequency_threshold = 0.001
  48. cols = neurosynth_dset.annotations.columns
  49. cols = [c for c in cols if c not in id_cols]
  50. df = neurosynth_dset.annotations.copy()[cols]
  51. n_studies = df.shape[0]
  52. feature_counts = (df >= frequency_threshold).sum(axis=0)
  53. target_features = feature_counts.between(n_studies * 0.1, n_studies * 0.9)
  54. target_features = target_features[target_features]
  55. target_features = target_features.index.values
  56. print(f"{len(target_features)} features selected.", flush=True)
  57. # %% [markdown]
  58. # ### Decoding continuous map
  59. # %%
  60. corr_decoder = decode.continuous.CorrelationDecoder(
  61. frequency_threshold=0.001,
  62. meta_estimator = meta.cbma.mkda.MKDAChi2(),
  63. features=target_features)
  64. corr_decoder.fit(neurosynth_dset)
  65. # save the correlation decoder
  66. with open(os.path.join(out_dir, 'neurosynth',"corr_decoder.pkl"), "wb") as file:
  67. pickle.dump(corr_decoder, file)
  68. # %%
  69. map = {'er_beta': "../Data/Unthresholded_Tmaps/RS_Covariate_unthresholded_Tmap.nii.gz",
  70. 'grad1' : "../Gradients_Map/volume.all.0.nii.gz",
  71. 'grad2' : "../Gradients_Map/volume.all.1.nii.gz",
  72. 'grad3' : "../Gradients_Map/volume.all.2.nii.gz",
  73. 'grad4' : "../Gradients_Map/volume.all.3.nii.gz",
  74. 'grad5' : "../Gradients_Map/volume.all.4.nii.gz"}
  75. with open(os.path.join(out_dir, 'neurosynth',"corr_decoder.pkl"), "rb") as file:
  76. corr_decoder = pickle.load(file)
  77. corr_df = {}
  78. for i in map.keys():
  79. corr_df[i] = corr_decoder.transform(map[i])
  80. lda50_keys = pd.read_csv(os.path.join(out_dir, 'neurosynth', 'LDA50_keys.csv')).loc[:,['idx','key']]
  81. def match_corr_df(corr_df, lda_keys):
  82. ## Sort the df based on r score
  83. corr_df_sorted = corr_df.reindex(corr_df["r"].abs().sort_values(ascending=False).index)
  84. corr_df_sorted['feature'] = corr_df_sorted.index
  85. corr_df_sorted = corr_df_sorted.reset_index(drop=True)
  86. for index, row in corr_df_sorted.iterrows():
  87. idx = row['feature'].split('_')[4]
  88. corr_df_sorted.loc[index,'idx'] = int(idx)
  89. ## merge the correlation df with the keywords
  90. dff = pd.merge(corr_df_sorted, lda_keys, on='idx')
  91. ## Delete the rows with the method-related keywords
  92. dff = dff.dropna().reset_index(drop=True)
  93. return dff
  94. dff_dict = {}
  95. for i in corr_df.keys():
  96. dff_dict[i] = match_corr_df(corr_df[i], lda50_keys)
  97. dff_dict[i].to_csv(os.path.join(out_dir, f'{i}_decoding_frequency.csv'), index=False)
  98. # %%
  99. key_list = pd.read_csv(os.path.join(out_dir, 'neurosynth', 'LDA50_keys_4table.csv'))['key'].to_list()
  100. dff_list = []
  101. for i in dff_dict.keys():
  102. df = dff_dict[i].loc[:,['r','key']]
  103. df = df.set_index('key')
  104. df = df.rename(columns={"r": f"{i}_r"})
  105. dff = df.reindex(key_list)
  106. dff_list.append(dff)
  107. df_all = pd.concat(dff_list, axis=1)
  108. df_all.to_csv(os.path.join(out_dir, 'functional_decoding_summary.csv'), index=True)
  109. # %% [markdown]
  110. # ## Radar plot
  111. # %%
  112. df1 = dff_dict['grad1'].loc[:,['key','r']]
  113. df1.columns = ['key', 'grad1_r']
  114. df2 = dff_dict['er_beta'].loc[:,['key','r']]
  115. df2.columns = ['key', 'er_r']
  116. dff = pd.merge(df1, df2, on='key')
  117. key_radar = dff['key'].to_list()
  118. dff_list = []
  119. for i in dff_dict.keys():
  120. df = dff_dict[i].loc[:,['r','key']]
  121. df = df.set_index('key')
  122. df = df.rename(columns={"r": f"{i}_r"})
  123. dff = df.reindex(key_radar)
  124. dff_list.append(dff)
  125. df_radar = pd.concat(dff_list, axis=1)
  126. # %%
  127. def decoding_radar_plot(df_decoding, map1, map2, map1_legend, map2_legend, label=True):
  128. categories=df_decoding.index.to_list()
  129. N = 25
  130. # We are going to plot the first line of the data frame.
  131. # But we need to repeat the first value to close the circular graph:
  132. value1=df_decoding[map1].to_list()
  133. value1 += value1[:1]
  134. value1
  135. value2=df_decoding[map2].to_list()
  136. value2 += value2[:1]
  137. value2
  138. # What will be the angle of each axis in the plot? (we divide the plot / number of variable)
  139. angles = [n / float(N) * 2 * np.pi for n in range(N)]
  140. angles += angles[:1]
  141. # Initialise the spider plot
  142. plt.figure(figsize=(8, 8))
  143. fig, ax = plt.subplots(figsize=(6, 6), subplot_kw=dict(polar=True))
  144. # Plot two map
  145. ax.fill(angles, value1, color='#7F7F7F', alpha=0.5, label=map1_legend)
  146. ax.plot(angles, value1, color='#4A4A4A', alpha=0.6, linewidth=1)
  147. ax.fill(angles, value2, color='#9ACD32', alpha=0.6, label=map2_legend)
  148. ax.plot(angles, value2, color='#6B8E23', alpha=0.6,linewidth=1)
  149. # Draw one axe per variable + add labels
  150. if label:
  151. plt.xticks(angles[:-1], categories, color='black', size=8,fontdict={'family':'Arial', 'size':10} )
  152. else:
  153. plt.xticks(angles[:-1], [], color='black', size=8,fontdict={'family':'Arial', 'size':10} )
  154. # Draw ylabels
  155. ax.set_rlabel_position(0)
  156. plt.yticks([-0.5,0,0.5], ['','0',''], color="grey", size=7)
  157. plt.ylim(-0.5,0.5)
  158. legend_font = fm.FontProperties(family='Arial', size=15)
  159. ax.legend(loc='center left', bbox_to_anchor=(1, 1.05), prop=legend_font)
  160. # Show the graph
  161. #plt.show()
  162. return fig
  163. # %%
  164. decoding_radar_plot(df_radar, 'grad1_r', 'er_beta_r', 'Gradient 1 Map', 'Regulatory success (RS)\ncovariate map', True)
  165. # %%
  166. for i in [1,2,3,4,5]:
  167. fig = decoding_radar_plot(df_radar, f'grad{str(i)}_r', 'er_beta_r', f'Gradient {str(i)} Map', 'RS covariate map', False)
  168. fig.savefig(f'D:/0_ER_Gradient/Manuscript/plots/raw/func_decoding_rada_grad{str(i)}.png',bbox_inches='tight',dpi=900,pad_inches=0.1,transparent=False)

Neurosynth_Functional_Decoding.ipynb, no license · at the source

Overview

Authors: Ruien Wang1, Remi Janet1,2, Carmen Morawetz3, Anita Tusche1,4
ORCID iDs: Ruien Wang
  1. Department of Psychology, Queen’s University, Kingston, Canada
  2. Institut des Sciences Cognitives Marc Jeannerod, UMR-5229 CNRS, Bron, France
  3. Department of Psychology, University of Innsbruck, Innsbruck, Austria
  4. Center for Neuroscience Studies, Queen’s University, Kingston, Canada
Journal: PLoS biology, volume 24, issue 4, article e3003666
Dates: received 2 August 2025; accepted 6 February 2026; published online 2 April 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pbio.3003666 · PMID 41926350 · PMCID PMC13046165 · OpenAlex W7148532673
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), human (organism), cognitive (subfield)
Methods: Statistics, Machine learning, Preprocessing, Connectivity, fMRI & imaging, Single-unit activity, calcium imaging
MeSH: Brain*, Emotional Regulation*, Emotions*, Adult, Brain Mapping, Connectome, Female, Humans, Magnetic Resonance Imaging, Male, Young Adult (* major topic)
Journal subjects: Biology and Life Sciences, Psychology, Emotions, Social Sciences, Neuroscience, Brain Mapping, Functional Magnetic Resonance Imaging, Medicine and Health Sciences, Diagnostic Medicine, Diagnostic Radiology, Magnetic Resonance Imaging, Research and Analysis Methods, Imaging Techniques, Radiology and Imaging, Neuroimaging, Cognitive Science, Cognitive Psychology, Attention, Computer and Information Sciences, Neural Networks, Mathematical and Statistical Techniques, Statistical Methods, Metaanalysis, Physical Sciences, Mathematics, Statistics, Perception, Sensory Perception
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: cited by 1 paper (Europe PMC); 104 references in the paper
Notices: A comment on this paper has been published (41931465, from Europe PMC)

Abstract

Emotion regulation is essential for well-being and mental health, yet individuals vary widely in their emotion regulation success. Why? Traditional neuroimaging studies of emotion regulation often focus on localized neural activity or isolated networks, overlooking how large-scale brain organization relates to the integration of distributed systems and sub-processes supporting regulatory success. Here, we applied a novel system-level framework based on spatial gradients of macroscale brain organization to study variance in emotion regulation success. Using two large functional magnetic resonance imaging (fMRI) datasets (n = 358, n = 263), we projected global activation patterns from a laboratory emotion regulation task onto principal gradients derived from independent resting-state fMRI data from the Human Connectome Project. These gradients capture low-dimensional patterns of neural variation, providing a topographical framework within which complex mental phenomena, such as emotion regulation, emerge. In both datasets, individual differences in regulation success were associated with systematic reconfiguration along Gradient 1—a principal axis differentiating unimodal and heteromodal brain areas. This gradient-based neural reconfiguration also associates with lower negative affect in daily life, as measured via smartphone-based experience sampling in a subset of participants (n = 55). Meta-analytic decoding via Neurosynth revealed that Gradient 1 and regulation success align with multiple psychological processes, including social cognition, memory, attention, and negative emotion, suggesting this gradient reflects diverse, integrative demands during effective emotion regulation. These findings introduce a gradient-based perspective on emotion regulation success that is biologically grounded in well-established large-scale brain organization and ecologically valid through its links with real-world emotional experience. Such gradient-based dynamics may serve as predictive biomarkers of regulatory success and inform targeted interventions in clinical populations.

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 2 matches between paragraphs and lines of code.

OSF yk85c

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Languages: Jupyter (2), R (2), Python (1)
Size: 221 files, 5 scripts
Software Heritage: not checked
Found in: “Data Availability”
Holds: 2 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Matplotlib (3 files), NumPy (3 files), pandas (3 files), easystats (2 files), ggplot2 (2 files), lme4 (2 files), lmerTest (2 files), scikit-learn (2 files), SciPy (2 files), seaborn (2 files), tidyverse (2 files), data.table (1 file), emmeans (1 file), NiBabel (1 file), Nilearn (1 file), NiMARE (1 file), statsmodels (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
5 files
At the source: osf.io/yk85c/

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;
  • 5 scripts, each with its path and the digest of its content;
  • 2 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

Relevant data and analysis code supporting the key findings of this study have been made available on the Open Science Framework (OSF, https://osf.io/yk85c/).

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, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 11 MeSH terms, 2 funders, 96 references, 1 integrity notice.

Cite

This paper

Wang, R., Janet, R., Morawetz, C., & Tusche, A. (2026). Emotion regulation success involves systematic gradient-based reconfigurations of large-scale activation patterns in the human brain. PLoS biology, 24(4), e3003666. https://doi.org/10.1371/journal.pbio.3003666

BibTeX

@article{wang2026emotion,
author = {Wang, Ruien and Janet, Remi and Morawetz, Carmen and Tusche, Anita},
title = {{Emotion regulation success involves systematic gradient-based reconfigurations of large-scale activation patterns in the human brain}},
journal = {PLoS biology},
year = {2026},
month = apr,
volume = {24},
number = {4},
pages = {e3003666},
publisher = {PLOS},
issn = {1544-9173},
doi = {10.1371/journal.pbio.3003666},
url = {https://doi.org/10.1371/journal.pbio.3003666},
pmid = {41926350},
pmcid = {PMC13046165}
}

RIS

TY - JOUR
AU - Wang, Ruien
AU - Janet, Remi
AU - Morawetz, Carmen
AU - Tusche, Anita
TI - Emotion regulation success involves systematic gradient-based reconfigurations of large-scale activation patterns in the human brain
T2 - PLoS biology
J2 - PLoS Biol
PY - 2026
DA - 2026/04/02
VL - 24
IS - 4
SP - e3003666
SN - 1544-9173
PB - PLOS
DO - 10.1371/journal.pbio.3003666
UR - https://doi.org/10.1371/journal.pbio.3003666
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pbio.3003666",
"type": "article-journal",
"title": "Emotion regulation success involves systematic gradient-based reconfigurations of large-scale activation patterns in the human brain",
"container-title": "PLoS biology",
"author": [
{
"family": "Wang",
"given": "Ruien"
},
{
"family": "Janet",
"given": "Remi"
},
{
"family": "Morawetz",
"given": "Carmen"
},
{
"family": "Tusche",
"given": "Anita"
}
],
"container-title-short": "PLoS Biol",
"volume": "24",
"issue": "4",
"page": "e3003666",
"DOI": "10.1371/journal.pbio.3003666",
"PMID": "41926350",
"PMCID": "PMC13046165",
"ISSN": "1544-9173",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pbio.3003666",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
2
]
]
}
}

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.1360 [code]
A dual-fMRI investigation of interpersonal emotion regulation: Predicting strategy selection and implementation success from effective brain connectivity.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: emmeans, lmerTest, lme4, fMRI, cognitive, 8 references
[2] doi:10.1038/s41467-026-71568-9 [code]
Convergent and selective representations of pain, appetitive processes, aversive processes, and cognitive control in the insula.
Journal: Nature communications
In common: Nilearn, statsmodels, NiBabel, 5 other tools, cognitive, 7 references
[3] doi:10.1038/s41598-026-49157-z
Supportive neural mechanisms underlying successful emotion regulation for reappraisal success.
Journal: Scientific reports
In common: 11 references
[4] 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: easystats, emmeans, lmerTest, 11 other tools, 1 reference
[5] doi:10.1038/s41597-026-07377-y [code]
An open-access multi-site fMRI dataset for investigating conscious visual perception.
Journal: Scientific data
In common: easystats, emmeans, lmerTest, 11 other tools, fMRI
[6] doi:10.1162/imag.a.1282 [code]
Metabolic syndrome severity and the energetic cost of brain network transitions: A normative modeling study of accelerated brain aging.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: NiMARE, Nilearn, statsmodels, 7 other tools, 3 references
[7] 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: easystats, emmeans, lmerTest, 11 other tools, cognitive
[8] doi:10.1038/s41467-026-71270-w [code]
Spatiotemporal dynamics of the human cortical functional hierarchy across the lifespan.
Journal: Nature communications
In common: Nilearn, NiBabel, ggplot2, 6 other tools, fMRI, 5 references
[9] doi:10.1162/imag.a.1321 [code]
Phase similarity between similar objects indicates representational merging across retrieval training but not sleep.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: easystats, emmeans, lmerTest, 10 other tools, cognitive
[10] doi:10.7554/elife.103097 [code]
Canonical neurodevelopmental trajectories of structural and functional manifolds.
Journal: eLife
In common: Nilearn, data.table, statsmodels, 7 other tools, 4 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.