OSCR

Binding items to contexts through conjunctive neural representations with the method of loci.

Code ↔ Paper

6 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 6 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § Methods › fMRI preprocessing › Functional data preprocessing ↔ post_fmriprep.ipynb, lines 56–199 · score 0.95 · framewise displacement, motion outliers, preprocessed BOLD, brain mask, CompCor, aseg
  2. [2] § Methods › Activity pattern extraction ↔ post_fmriprep.ipynb, lines 56–199 · score 0.82 · motion outlier, linear regression, zero, cosine, derivatives, signals
  3. [3] § Methods › Relating the similarity of encoding residuals to the similarity of stories (Fig. 3) ↔ scripts/rsa.ipynb, lines 487–521 · score 0.82 · neural semantic correlation, semantic correlation matrices, Spearman correlation, lower triangles, encoding residual, permutation
  4. [4] § Results › Encoding residuals track idiosyncratic semantic combinations of loci and items ↔ scripts/rsa.ipynb, lines 487–521 · score 0.66 · Spearman correlation, lower triangles, neural representations, encoding residual, semantic, cross
  5. [5] § Methods › fMRI preprocessing › Functional data preprocessing ↔ runSingularity.sh, the whole file · a weak match · score 0.62 · MNI152NLin2009cAsym, singular, fMRIPrep, fsaverage6, space, variable
  6. [6] § Results › Relationship between conjunctive representation in the DMN and training and behavior ↔ scripts/hipp_sem.ipynb, lines 328–370 · score 0.55 · univariate activity, story deviation, duration, ROIs, neural, AG

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 · 200 lines · 8.3 KB · no license · 2 matches

  1. # %%
  2. import nibabel as nib
  3. import os
  4. import h5py
  5. from sklearn import linear_model
  6. from scipy import stats
  7. import numpy as np
  8. import json
  9. import glob
  10. #path to data (change to your path)
  11. fmripreppath = '/data/MoL_clean/fmriprep/'
  12. #path to output (change to your path)
  13. prepath = '/data/MoL_clean/preprocessed/'
  14. #list of sessions
  15. sesslist=['ses-01','ses-02','ses-03']
  16. #list of tasks/#runs in each session
  17. tasklist = [[('Loci', 2),('Item',2),('Encode',1),('Retrieve',1)],
  18. [('Loci', 2),('Item',2),('Encode',1),('Retrieve',1)],
  19. [('Loci', 2),('Item',2),('Encode',1),('Retrieve',1)]]
  20. #list of subjects
  21. subs= ['sub-%02d' % i for i in range(1,26)]
  22. # %%
  23. os.path.exists(os.path.exists(sess_prefix + '_task-' + task[0] + ('_run-%.2d' % offset) + '_desc-confounds_timeseries.tsv'))
  24. # %%
  25. # identify group masks for hippocampus
  26. regional_mask_filenames = sorted([f for f in glob.glob(fmripreppath+'*/ses-01/func/*_ses-01_task-Loci_run-01_space-MNI152NLin2009cAsym_desc-aseg_dseg.nii.gz') ])
  27. regional_mask_filenames = regional_mask_filenames[:10]+regional_mask_filenames[16:]
  28. regional_masks = []
  29. hippo_masks = []
  30. for regional_mask_fname in regional_mask_filenames:
  31. regional_mask = nib.load(regional_mask_fname).get_fdata()
  32. regional_masks.append(regional_mask)
  33. hippo_masks.append(np.where(np.logical_or(regional_mask == 17, regional_mask == 53)))
  34. hippo_group_mask_template = np.zeros(regional_mask.shape)
  35. hippo_group_mask = np.zeros(regional_mask.shape)
  36. for hippo_mask in hippo_masks:
  37. hippo_group_mask_template[hippo_mask] += 1
  38. hippo_group_mask[hippo_group_mask_template==25] = 1
  39. anterior_group,posterior_group = hippo_group_mask.copy(),hippo_group_mask.copy()
  40. anterior_group[:,55:,:] = False
  41. posterior_group[:,:55,:] = False
  42. anterior_group = anterior_group.astype(bool)
  43. posterior_group = posterior_group.astype(bool)
  44. hippo_group_mask = hippo_group_mask.astype(bool)
  45. # %%
  46. for sub in subs:
  47. print('Processing subject:', sub)
  48. for sess_ind, sess in enumerate(sesslist):
  49. print('session:', sess)
  50. if sess == '':
  51. sess_prefix = os.path.join(fmripreppath, sub, sess, 'func', sub)
  52. else:
  53. sess_prefix = os.path.join(fmripreppath, sub, sess, 'func', sub + '_' + sess)
  54. sess_tasknames = []
  55. for task in tasklist[sess_ind]:
  56. if task[1] == 1:
  57. sess_tasknames.append(task[0]+'_run-01')
  58. else:
  59. # For run numbers that don't start at zero
  60. offset = 0
  61. while not os.path.exists(sess_prefix + '_task-' + task[0] + ('_run-%.2d' % offset) + '_desc-confounds_timeseries.tsv'):
  62. print('looping')
  63. offset += 1
  64. if offset>10:
  65. print("something is wrong")
  66. break
  67. for r in range(task[1]):
  68. sess_tasknames.append('%s_run-%.2d' % (task[0], r+offset))
  69. for task_name in sess_tasknames:
  70. print('task:', task_name)
  71. task_prefix = sess_prefix + '_task-' + task_name
  72. D = dict()
  73. for hem in ['L', 'R', 'Vol']:
  74. if hem == 'Vol':
  75. # Load all timecourses in the 3d brain mask
  76. fname = task_prefix + '_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz'
  77. print(' Loading ', fname)
  78. nii_4d = nib.load(fname).get_fdata()
  79. mask_fname = task_prefix + '_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz'
  80. mask_3d = nib.load(mask_fname).get_fdata().astype(bool)
  81. regional_mask_fname = task_prefix + '_space-MNI152NLin2009cAsym_desc-aseg_dseg.nii.gz'
  82. regional_mask = nib.load(regional_mask_fname).get_fdata()
  83. hippo_mask = np.logical_or(regional_mask == 17, regional_mask == 53)
  84. anterior,posterior = hippo_mask.copy(),hippo_mask.copy()
  85. anterior[:,55:,:] = False
  86. posterior[:,:55,:] = False
  87. D['anterior_hipp'] = nii_4d[anterior]
  88. D['posterior_hipp'] = nii_4d[posterior]
  89. D['hippo'] = nii_4d[hippo_mask]
  90. D['anterior_hipp_group'] = nii_4d[anterior_group]
  91. D['posterior_hipp_group'] = nii_4d[posterior_group]
  92. D['hippo_group'] = nii_4d[hippo_group_mask]
  93. D[hem] = nii_4d[mask_3d]
  94. else:
  95. # Load all timecourses for one cortical hemisphere
  96. fname = task_prefix +'_hemi-'+hem+'_space-fsaverage6_bold.func.gii'
  97. print(' Loading ', fname)
  98. gi = nib.load(fname)
  99. D[hem] = np.column_stack([gi.darrays[t].data for t in range(len(gi.darrays))])
  100. # Load confound regressors
  101. conf = np.genfromtxt(task_prefix + '_desc-confounds_timeseries.tsv', names=True)
  102. conf_json = json.load(open(task_prefix + '_desc-confounds_timeseries.json'))
  103. # Find first combined compcor regressor
  104. first_cc = 0
  105. while True:
  106. if conf_json['a_comp_cor_%02d' % first_cc]['Mask'] == 'combined':
  107. break
  108. first_cc += 1
  109. reg = np.column_stack((
  110. # Motion and motion derivatives
  111. conf['trans_x'],
  112. conf['trans_x_derivative1'],
  113. conf['trans_y'],
  114. conf['trans_y_derivative1'],
  115. conf['trans_z'],
  116. conf['trans_z_derivative1'],
  117. conf['rot_x'],
  118. conf['rot_x_derivative1'],
  119. conf['rot_y'],
  120. conf['rot_y_derivative1'],
  121. conf['rot_z'],
  122. conf['rot_z_derivative1'],
  123. conf['framewise_displacement'],
  124. # First six compcor components (white matter + CSF signals)
  125. conf['a_comp_cor_%02d' % first_cc],
  126. conf['a_comp_cor_%02d' % (first_cc+1)],
  127. conf['a_comp_cor_%02d' % (first_cc+2)],
  128. conf['a_comp_cor_%02d' % (first_cc+3)],
  129. conf['a_comp_cor_%02d' % (first_cc+4)],
  130. conf['a_comp_cor_%02d' % (first_cc+5)],
  131. # Cosine (drift) and motion spikes
  132. np.column_stack([conf[k] for k in conf.dtype.names if ('cosine' in k) or ('motion_outlier' in k)])))
  133. # Remove nans, e.g. from framewise_displacement
  134. reg = np.nan_to_num(reg)
  135. print(' Cleaning and zscoring')
  136. for hem in ['L', 'R', 'Vol', 'anterior_hipp','posterior_hipp','hippo','anterior_hipp_group','posterior_hipp_group','hippo_group']:
  137. # Regress out confounds from data
  138. regr = linear_model.LinearRegression()
  139. regr.fit(reg, D[hem].T)
  140. D[hem] = D[hem] - np.dot(regr.coef_, reg.T) - regr.intercept_[:, np.newaxis]
  141. # Note 8% of values on cortical surface are NaNs, and the following will therefore throw an error
  142. D[hem] = stats.zscore(D[hem], axis=1)
  143. # Save hdf5 file
  144. if sess == '':
  145. savepath = os.path.join(prepath, sub + '_' + task_name + '.h5')
  146. else:
  147. savepath = os.path.join(prepath, sub + '_' + sess + '_' + task_name + '.h5')
  148. with h5py.File(savepath,'w') as hf:
  149. grp = hf.create_group(task_name)
  150. grp.create_dataset('L', data=D['L'])
  151. grp.create_dataset('R', data=D['R'])
  152. grp.create_dataset('Vol', data=D['Vol'])
  153. grp.create_dataset('anterior_hipp', data=D['anterior_hipp'])
  154. grp.create_dataset('posterior_hipp', data=D['posterior_hipp'])
  155. grp.create_dataset('hippo', data=D['hippo'])
  156. grp.create_dataset('anterior_hipp_group', data=D['anterior_hipp_group'])
  157. grp.create_dataset('posterior_hipp_group', data=D['posterior_hipp_group'])
  158. grp.create_dataset('hippo_group', data=D['hippo_group'])
  159. grp.create_dataset('reg',data=reg)
  160. grp.create_dataset('mask', data=mask_3d)
  161. grp.create_dataset('hippo_mask', data=hippo_mask)
  162. print(' saved hdf5 file')

post_fmriprep.ipynb at commit 1cf2ce5, no license · at the source

Overview

Authors: Jiawen Huang1, Akshay Manglik1, Nick Dutra1, Hannah Tarder-Stoll1,2,3, Taylor Chamberlain1, Robert Ajemian4,5, Qiong Zhang6,7, Kenneth A Norman8,9, Christopher Baldassano1
  1. Department of Psychology, Columbia University, New York, NY USA
  2. Baycrest Health Sciences, Rotman Research Institute, Toronto, ON Canada
  3. Department of Psychology, Glendon Campus, York University, Toronto, ON, Canada
  4. Department of Brain and Cognitive Sciences, MIT, Cambridge, MA USA
  5. McGovern Institute for Brain Research, MIT, Cambridge, MA USA
  6. Department of Psychology, Rutgers University, New Brunswick, NJ USA
  7. Department of Computer Science, Rutgers University, New Brunswick, NJ USA
  8. Princeton Neuroscience Institute, Princeton University, Princeton, NJ USA
  9. Department of Psychology, Princeton University, Princeton, NJ USA
Journal: Nature communications, volume 17, issue 1, article 5347
Dates: received 28 March 2025; accepted 11 March 2026; published online 17 April 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41467-026-71428-6 · PMID 41997927 · PMCID PMC13273176 · OpenAlex W4405966708
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), systems (subfield)
Methods: Connectivity, Statistics, Smoothing, state filtering, decompositions, Preprocessing, fMRI & imaging, Machine learning
Keywords: Language, Long-term memory
MeSH: Memory, Episodic*, Prefrontal Cortex*, Adult, Brain Mapping, Female, Humans, Magnetic Resonance Imaging, Male, Mental Recall, Young Adult (* major topic)
Topic: Memory and Neural Mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Science Foundation (2024587)
Citations: not cited yet (Europe PMC); 105 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) 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 6 matches between paragraphs and lines of code.

dpmlab/MoL_code

License: none: the authors keep all their rights
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 1cf2ce5193614e9146343e217b2273a4ad94b49c, 4 August 2025
Languages: Jupyter (7), Shell (1), R (1), Python (1)
Size: 549 files, 10 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, 8 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (8 files), SciPy (7 files), h5py (6 files), Matplotlib (6 files), pandas (6 files), scikit-learn (6 files), statsmodels (4 files), seaborn (3 files), fMRIPrep (1 file), ggplot2 (1 file), lme4 (1 file), lmerTest (1 file), NiBabel (1 file), Nilearn (1 file), Plotly (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 29 September 2026: the link answers
  • 29 September 2026: the link answers
11 files

Zenodo 17703712

License: CC-BY-4.0
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the references
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (8 files), SciPy (7 files), h5py (6 files), Matplotlib (6 files), pandas (6 files), scikit-learn (6 files), statsmodels (4 files), seaborn (3 files), fMRIPrep (1 file), ggplot2 (1 file), lme4 (1 file), lmerTest (1 file), NiBabel (1 file), Nilearn (1 file), Plotly (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 29 September 2026: the link answers (HTTP 200)
  • 29 September 2026: the link answers (HTTP 200)
11 files
At the source:

Code availability statement

The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41467-026-71428-6.

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;
  • 20 scripts, each with its path and the digest of its content;
  • 6 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 (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41467-026-71428-6.

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

Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 2 keywords, 10 MeSH terms, 1 funder, 85 references, 8 RRIDs.

Cite

This paper

Huang, J., Manglik, A., Dutra, N., Tarder-Stoll, H., Chamberlain, T., Ajemian, R., Zhang, Q., Norman, K. A., & Baldassano, C. (2026). Binding items to contexts through conjunctive neural representations with the method of loci. Nature communications, 17(1), 5347. https://doi.org/10.1038/s41467-026-71428-6

BibTeX

@article{huang2026binding,
author = {Huang, Jiawen and Manglik, Akshay and Dutra, Nick and Tarder-Stoll, Hannah and Chamberlain, Taylor and Ajemian, Robert and Zhang, Qiong and Norman, Kenneth A and Baldassano, Christopher},
title = {{Binding items to contexts through conjunctive neural representations with the method of loci}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5347},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-71428-6},
url = {https://doi.org/10.1038/s41467-026-71428-6},
pmid = {41997927},
pmcid = {PMC13273176}
}

RIS

TY - JOUR
AU - Huang, Jiawen
AU - Manglik, Akshay
AU - Dutra, Nick
AU - Tarder-Stoll, Hannah
AU - Chamberlain, Taylor
AU - Ajemian, Robert
AU - Zhang, Qiong
AU - Norman, Kenneth A
AU - Baldassano, Christopher
TI - Binding items to contexts through conjunctive neural representations with the method of loci
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/04/17
VL - 17
IS - 1
SP - 5347
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-71428-6
UR - https://doi.org/10.1038/s41467-026-71428-6
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-71428-6",
"type": "article-journal",
"title": "Binding items to contexts through conjunctive neural representations with the method of loci",
"container-title": "Nature communications",
"author": [
{
"family": "Huang",
"given": "Jiawen"
},
{
"family": "Manglik",
"given": "Akshay"
},
{
"family": "Dutra",
"given": "Nick"
},
{
"family": "Tarder-Stoll",
"given": "Hannah"
},
{
"family": "Chamberlain",
"given": "Taylor"
},
{
"family": "Ajemian",
"given": "Robert"
},
{
"family": "Zhang",
"given": "Qiong"
},
{
"family": "Norman",
"given": "Kenneth A"
},
{
"family": "Baldassano",
"given": "Christopher"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "5347",
"DOI": "10.1038/s41467-026-71428-6",
"PMID": "41997927",
"PMCID": "PMC13273176",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-71428-6",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
17
]
]
}
}

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.1371/journal.pbio.3003755 [code]
Action information is integrated into entorhinal representations of conceptual space and is reflected in eye movements.
Journal: PLoS biology
In common: Nilearn, NiBabel, statsmodels, 5 other tools, 14 references
[2] doi:10.1371/journal.pbio.3003684 [code]
The retrieval of previously learned motor memories is facilitated by the reinstatement of default mode network manifold structures.
Journal: PLoS biology
In common: Nilearn, NiBabel, seaborn, 5 other tools, 15 references
[3] doi:10.1073/pnas.2512071123 [code]
Narrative "twist" shifts within-individual neural representations of dissociable story features.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: lmerTest, Nilearn, lme4, 8 other tools, 7 references
[4] doi:10.1038/s41467-026-71151-2 [code]
Common and distinct neural correlates of social interaction processing and theory of mind in narratives.
Journal: Nature communications
In common: fMRIPrep, Nilearn, NiBabel, 7 other tools, 10 references
[5] doi:10.1523/eneuro.0370-25.2026 [code]
Pretraining for Large-Scale Functional Connectome Fingerprinting Supports Generalization and Transfer Learning in Functional Neuroimaging.
Journal: eNeuro
In common: Nilearn, scikit-learn, pandas, 2 other tools, 14 references
[6] doi:10.1162/netn.a.547 [code]
An evaluation of the efficacy of single-echo and multi-echo fMRI denoising strategies.
Journal: Network neuroscience (Cambridge, Mass.)
In common: fMRIPrep, Nilearn, NiBabel, 7 other tools, 8 references
[7] doi:10.7554/elife.103097 [code]
Canonical neurodevelopmental trajectories of structural and functional manifolds.
Journal: eLife
In common: Nilearn, Plotly, h5py, 8 other tools, 6 references
[8] doi:10.1162/imag.a.1347 [code]
Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: fMRIPrep, lmerTest, Nilearn, 9 other tools, 3 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: lmerTest, Nilearn, Plotly, 9 other tools, 3 references
[10] doi:10.1016/j.isci.2026.117180 [code]
Developmental changes in similarity between neural representations of mental arithmetic and artificial neural networks.
Journal: iScience
In common: Nilearn, h5py, NiBabel, 7 other tools, 6 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.