Distinct CA3 inputs differentially shape the learning-dependent evolution of right CA1 spatial maps.
The 1 match
- [1] § Methods › Place field selection ↔ MATLAB/opto_align_with_beh.m, lines 97–205 · score 0.54 · PF width, boundaries, noise, shuffled, track, laps
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 · 264 lines · 9.7 KB · no license · 1 match
- %% Sig PF code updated for CA1 analysis and good behavior
- clear all
- close all
- [behavior_filepaths, beh_temp]=uigetfile('*cond.mat', 'Chose behavior files to load:','MultiSelect','on');
- load([beh_temp behavior_filepaths]);
- % start_frame = 258;
- % end_frame = 25000;
- % behavior.ybinned = behavior.ybinned(start_frame:end_frame);
- [cellsort_filepaths, cell_temp]=uigetfile('*suite2p.mat', 'Chose cellsort files to load:','MultiSelect','on');
- load([cell_temp cellsort_filepaths]);
- % beh_temp = '/home/sheffieldlab/Desktop/NoReward/PlaceFieldCodeTest/NR6/BehaviorData/';
- % behavior_filepaths = '/home/sheffieldlab/Desktop/NoReward/PlaceFieldCodeTest/NR6/BehaviorData/';
- % cellsort_filepaths = '/home/sheffieldlab/Desktop/NoReward/PlaceFieldCodeTest/NR6/';
- % load([behavior_filepaths, 'NR6_Task1_FamiliarReward1_beh_plain1.mat']);
- % load([cellsort_filepaths, 'NR6_famrew_famnorewnoclick_famrew_novrew_MotCor_converted_non_rigid_cellsorted_Area-83.25_850_mu-0.6_Th-2_Win-3_3.mat']);
- %% Important inputs
- % prompt = ['Is optogenetics on or off? 1 for on; 0 for off; 2 for all '];
- % opto = input(prompt);
- opto = 2;
- % startF=484; % behavior
- % endF= 30000;
- % startt = 10484; % imaging
- % endt = 40000;
- lick_stop_flag = 0;
- lick_stop_frame = 1361;
- remove_good_beh = 0;
- tunnellength= 200;
- % if lick_stop_flag
- % figure_folder = fullfile(beh_temp, ['PCFigures' behavior_filepaths(end-10:end-4)] );
- % mkdir(figure_folder);
- % else
- % figure_folder = fullfile(beh_temp,['PCFigures' behavior_filepaths(end-10:end-4)]);
- % mkdir(figure_folder);
- % end
- %Important place cell parameters
- %minfieldwidth=10; %in cm
- %maxfieldwidth = 125;
- minratio=10;%original =3
- thresh1=0.15; %only coninous parts of the mean place field above this value are included
- minDF=0.09; %orignal = 0.1 %peak of the mean PF must be larger than this value
- minrate=0.2; % Change from percetage to number of laps the cell should fire. changefrom 0.4, original =3 %percentage of times a tranisent must occur in the PF
- baselength=0.25; %number of lowest values used to calculate a mean baseline value
- PVAL_thresh=0.05; %only PF that have pvals lower than this generated by shuffle test will be included
- numrand=100;%num iterations for shuffle
- % select the corresponding frames in imaging
- ind_cell = cell(1,length(start_frame));
- for n = 1:length(start_frame)
- ind_cell{1,n} = start_frame(n):end_frame(n);
- end
- ind = cell2mat(ind_cell);
- onFrames_ind = zeros(length(onFrames),1);
- offFrames_ind = zeros(length(onFrames),1);
- for o = 1:length(onFrames)
- onFrames_ind(o) = min(find(ind>onFrames(o)),[],'all');
- offFrames_ind(o) = max(find(ind<offFrames(o)),[],'all');
- end
- F=data.F(ind, :);
- Fc3_DF=data.Fc3(ind,:);
- Fc2=data.Fc(ind,:);
- ybinned=behavior.ybinned;
- if remove_good_beh==1
- if isfield(behavior,'velocity') && max(behavior.velocity)>0.1
- good_behavior = remove_bad_behavior_ver2(behavior, behavior_filepaths, lick_stop_flag);
- else
- good_behavior = remove_bad_behavior_ver2_withoutvelocity(behavior, behavior_filepaths, lick_stop_flag);
- end
- ybinned_GoodBehav=good_behavior.good_runs;
- F_GoodBehav = F(good_behavior.good_runs_index, :);
- Fc3_DF_GoodBehav=Fc3_DF(good_behavior.good_runs_index, :);
- Fc2_GoodBehav = Fc2(good_behavior.good_runs_index, :);
- else
- ybinned_GoodBehav = ybinned;
- F_GoodBehav = F;
- Fc3_DF_GoodBehav=Fc3_DF;
- Fc2_GoodBehav = Fc2;
- end
- if lick_stop_flag
- Fc3_DF_GoodBehav=Fc3_DF_GoodBehav(lick_stop_frame:end, :);
- Fc2_GoodBehav = Fc2_GoodBehav(lick_stop_frame:end, :);
- ybinned_GoodBehav = ybinned_GoodBehav(lick_stop_frame:end);
- end
- %%%%%%%%%%%%%%%%%%%parameters%%%%%%%%%%%%%%%%%
- ybinned_GoodBehav=ybinned_GoodBehav';
- E=bwlabel(double_thresh(ybinned_GoodBehav,0.02,0.018)); %labels each traversal
- bad_E = bwlabel(double_thresh(ybinned,0.02,0.018));
- w=NaN(200,2);
- sig_PFs=cell(3,size(Fc2_GoodBehav,2));
- sig_PFs_with_noise=cell(3,size(Fc2_GoodBehav,2));
- numneurons=size(Fc3_DF_GoodBehav,2);
- trackstart=0.01+0.005; %track start location in quake units (+10 accounts for any noise in the track start location after teleportation)
- trackend=0.6-0.005; %track end location in quake units
- ZThreshDivisor=4;%used to further break up the data in cases of long silent stretches
- total_pos_randfields_shuffle=zeros(size(Fc2_GoodBehav,2), 1);
- PF_PVALS=NaN(size(Fc2_GoodBehav,2), 1);
- PF_width=NaN(3,size(Fc2_GoodBehav,2));
- PF_rate=NaN(3,size(Fc2_GoodBehav,2));
- PF_ratio=NaN(3,size(Fc2_GoodBehav,2));
- PF_dff=NaN(3,size(Fc2_GoodBehav,2));
- PF_start_bins=NaN(3,size(Fc2_GoodBehav,2));
- PF_end_bins=NaN(3,size(Fc2_GoodBehav,2));
- number_of_PFs=NaN(1,size(Fc2_GoodBehav,2));
- Allbinned_F = cell(1,size(Fc2_GoodBehav,2));
- long = 1:length(E); %check if the behavior and imaging data aligns well
- numbins=round(tunnellength/5);
- binsize=(trackend-trackstart)/numbins;%in Quake units
- width_M=zeros(1000,1000);
- % figure; plot(E); hold on; plot(ybinned_GoodBehav); title('good E')
- % figure; plot(bad_E); hold on; plot(ybinned); title('bad E')
- % correct E
- % construct savefile name
- % pat = '-' + wildcardPattern(3,4) + '_';
- % env = extract(behavior_filepaths,pat);
- % env = env{1,1}(2:end-1);
- % env = 'nov2';
- pat = textBoundary + lettersPattern + digitsPattern;
- mouse = extract(cellsort_filepaths, pat);
- mouse = mouse{1,1};
- %mouse = 'JR';
- pat = '_' + "day" + digitsPattern + '_';
- day = extract(cellsort_filepaths, pat);
- day = day{1,1}(2:end-1);
- wrong_lap=0;
- for i=1:max(E)
- onpoint=find(E==i,1);
- offpoint=find(E==i,1,'last');
- % end
- count=1;
- while max(ybinned_GoodBehav(onpoint:offpoint))<0.55
- count=count+1;
- if i~=max(E)
- offpoint=find(E==i+1,1,'last');
- E(onpoint:offpoint)=i;
- E(offpoint+1:end)=E(offpoint+1:end)-1;
- else
- E(onpoint:offpoint)=0;
- end
- end
- end
- wrong_lap=0;
- for i=1:max(bad_E)
- onpoint=find(bad_E==i,1);
- offpoint=find(bad_E==i,1,'last');
- % end
- count=1;
- while max(ybinned(onpoint:offpoint))<0.55
- count=count+1;
- if i~=max(bad_E)
- offpoint=find(bad_E==i+1,1,'last');
- bad_E(onpoint:offpoint)=i;
- bad_E(offpoint+1:end)=bad_E(offpoint+1:end)-1;
- else
- bad_E(onpoint:offpoint)=0;
- end
- end
- end
- % % Correct first one's jump
- % onpoint=find(E==1,1);
- % if ybinned_GoodBehav(onpoint)>0.02
- % start_correct = onpoint;
- % while ybinned_GoodBehav(start_correct)>0.02
- % E(start_correct) = 0;
- % start_correct = start_correct+1;
- % end
- % E = E - 1;
- % end
- % figure; plot(E); hold on; plot(ybinned_GoodBehav); title('good E corrected')
- % figure; plot(bad_E); hold on; plot(ybinned); title('bad E corrected')
- nlaps = max(E);
- topEdge = trackend; % define limits
- botEdge = trackstart; % define limits
- binEdges = linspace(botEdge, topEdge, numbins+1);
- cell_binMean = zeros(numbins, nlaps, numneurons);
- %cell_mean_PF = zeros(numbins,numneurons);
- for ii = 1:numneurons
- %fprintf('Analysing Neuron %d \n', ii)
- %%%%%%%%now cut out transients from each lap and bin them%%%%%%%%%%%%%%%%%
- %% Plot data if required
- %combinedYpos_rew=[ybinned_GoodBehav Fc3_DF_GoodBehav(:,ii)];
- % Fc2_combined = [ybinned_GoodBehav F_GoodBehav(:,ii)];
- % figure; subplot(2, 1, 1); plot(combinedYpos_rew); subplot(2, 1,
- % 2); plot(Fc2_combined); pause(2)
- %% Separate data into laps and find mean
- [binMean, pos_Fpos_rew] = bindata_bylap(Fc3_DF_GoodBehav(:,ii), ybinned_GoodBehav, E, numbins, binEdges);
- cell_binMean(:,:,ii) = binMean;
- end
- if opto == 0
- optoCond = '_opto_off';
- elseif opto ==1
- optoCond = '_opto_on';
- elseif opto ==2
- optoCond = '_all';
- end
- [cell_pair_corr, mean_corr] = cell_corr_by_trial(Fc3_DF, E, 30, 300, 0.05);
- PCo = pop_coor(cell_pair_corr);
- hold on
- opto_on_lap = zeros(length(onFrames_ind),1);
- opto_off_lap = zeros(length(offFrames_ind),1);
- for n = 1:length(onFrames_ind)
- opto_on_lap(n) = max(E(1:onFrames_ind(n)));
- % line([0, opto_on_lap(n)],[opto_on_lap(n),opto_on_lap(n)],'Color','red','LineStyle','--')
- % line([opto_on_lap(n),opto_on_lap(n)],[0, opto_on_lap(n)],'Color','red','LineStyle','--')
- opto_off_lap(n) = max(E(1:offFrames_ind(n)));
- % line([0, opto_off_lap(n)],[opto_off_lap(n),opto_off_lap(n)],'Color','white','LineStyle','--')
- % line([opto_off_lap(n),opto_off_lap(n)],[0, opto_off_lap(n)],'Color','white','LineStyle','--')
- line([opto_on_lap(n),opto_on_lap(n)],[opto_on_lap(n),opto_off_lap(n)],'Color','red','LineStyle','--')
- line([opto_on_lap(n),opto_off_lap(n)],[opto_on_lap(n),opto_on_lap(n)],'Color','red','LineStyle','--')
- line([opto_off_lap(n),opto_off_lap(n)],[opto_on_lap(n),opto_off_lap(n)],'Color','red','LineStyle','--')
- line([opto_on_lap(n),opto_off_lap(n)],[opto_off_lap(n),opto_off_lap(n)],'Color','red','LineStyle','--')
- end
- switch_lap = zeros(length(start_frame),1);
- end_frame_ind = cumsum(cellfun(@length, ind_cell));
- for m = 1:length(start_frame)
- switch_lap(m) = max(E(1:end_frame_ind(m)));
- line([0, switch_lap(m)],[switch_lap(m),switch_lap(m)],'Color','black','LineStyle','--')
- line([switch_lap(m),switch_lap(m)],[0, switch_lap(m)],'Color','black','LineStyle','--')
- end
- env_switch_lap = switch_lap(1:end-1);
- switch_frame = end_frame_ind(1:end-1);
- saveas(gcf, ['PCo_all_conds_' day '.png'],'png')
- save([behavior_filepaths(1:end-4) optoCond '_align_cell_mean'],'cell_binMean', 'Fc3_DF', 'E', 'start_frame','opto_on_lap','opto_off_lap','onFrames_ind', 'offFrames_ind', 'env_switch_lap', 'switch_frame')
- %save([behavior_filepaths(1:end-4) optoCond '_align_cell_mean'],'cell_binMean', 'Fc3_DF', 'E', 'start_frame', 'env_switch_lap')
- %save([behavior_filepaths(1:end-4) optoCond '_align_cell_mean'],'cell_binMean', 'Fc3_DF', 'E', 'start_frame', 'env_switch_lap', 'switch_frame')
- % py_var = permute(cell_binMean, [2,1,3]);
- % save([mouse '_' day optoCond '_py_var'],'py_var')
opto_align_with_beh.m at commit 57b7111, no license · at the source
Overview
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.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
anqijiang/opto_analysis
57b711134b3421d3e51e44ac607fa88c1fc4a5b4, 17 March 2025Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
8 files
- .ipynb_checkpoints/
Heather_axon_sample-chec , Jupyter, 1,084 lineskpoint.ipynb - MATLAB/
concat_behav.m , MATLAB, 69 lines - MATLAB/
opto_align_with_beh.m , MATLAB, 264 lines, 1 match - jupyter/
.ipynb_checkpoints/ , Jupyter, 72 linesExample_no_opto-checkpoi nt.ipynb - jupyter/
.ipynb_checkpoints/ , Jupyter, 140 lineseL121_day2_day3_day4_day 5-checkpoint.ipynb - jupyter/
Example_no_opto.ipynb , Jupyter, 73 lines - jupyter/
Heather_axon_sample.ipyn , Jupyter, 1,084 linesb - repository limit reached (2,000 files or 30 MB): the rest is at the source (17 files)
- README.md, Text, 1 line
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:
- it points to the authors' code: anqijiang/
opto_analysis
Read it in the paper: doi.org/10.1038/s41467-026-72275-1.
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;
- 7 scripts, each with its path and the digest of its content;
- 1 match 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
- zenodo:18934294, at Zenodo; found in “Data availability”
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to a dataset: Zenodo 18934294
- it says that the data are available on request
Read it in the paper: doi.org/10.1038/s41467-026-72275-1.
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, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 3 keywords, 7 MeSH terms, 4 funders, 63 references, 1 RRID.
Cite
This paper
Jiang, A., GoodSmith, D., Ramirez-Matias, J., Tortolani, A. F., & Sheffield, M. E. J. (2026). Distinct CA3 inputs differentially shape the learning-dependent evolution of right CA1 spatial maps. Nature communications, 17(1), 5682. https://
BibTeX
@article{jiang2026distin
author = {Jiang, Anqi and GoodSmith, Douglas and Ramirez-Matias, Julliana and Tortolani, Ariana F. and Sheffield, Mark E. J.},
title = {{Distinct CA3 inputs differentially shape the learning-dependent evolution of right CA1 spatial maps}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5682},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42049756},
pmcid = {PMC13319192}
}
RIS
TY - JOUR
AU - Jiang, Anqi
AU - GoodSmith, Douglas
AU - Ramirez-Matias, Julliana
AU - Tortolani, Ariana F.
AU - Sheffield, Mark E. J.
TI - Distinct CA3 inputs differentially shape the learning-dependent evolution of right CA1 spatial maps
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 5682
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Distinct CA3 inputs differentially shape the learning-dependent evolution of right CA1 spatial maps",
"container-title": "Nature communications",
"author": [
{
"family": "Jiang",
"given": "Anqi"
},
{
"family": "GoodSmith",
"given": "Douglas"
},
{
"family": "Ramirez-Matias",
"given": "Julliana"
},
{
"family": "Tortolani",
"given": "Ariana F."
},
{
"family": "Sheffield",
"given": "Mark E. J."
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "5682",
"DOI": "10.1038/
"PMID": "42049756",
"PMCID": "PMC13319192",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
28
]
]
}
}
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.1016/j.celrep.2026.117793 [code]
- Clustered inputs engage dendritic nonlinearities and calcium signaling to support efficient place-field formation in CA1 pyramidal neurons.Journal: Cell reportsIn common: statannotations, seaborn, scikit-learn, 4 other tools, 5 references
- [2] doi:10.1038/s41467-026-74834-y [code]
- Voltage imaging of CA1 pyramidal cells and SST+ interneurons reveals stability and plasticity mechanisms of spatial firing.Journal: Nature communicationsIn common: mouse, 9 references
- [3] doi:10.1038/s41593-026-02357-2 [code]
- Experience reorganizes content-specific memory traces in macaques.Journal: Nature neuroscienceIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 6 other tools, 2 references
- [4] doi:10.1016/j.neuron.2026.03.034 [code]
- Dentate gyrus interneurons modulate winner-take-all network dynamics in freely behaving mice.Journal: NeuronIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 6 other tools, mouse, 1 reference
- [5] doi:10.1016/j.celrep.2026.117646 [code]
- Medial entorhinal-hippocampal desynchronization parallels the emergence of memory impairment in a mouse model of Alzheimer's disease pathology.Journal: Cell reportsIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 4 other tools, mouse, 2 references
- [6] doi:10.1038/s42003-026-10276-y [code]
- The cellular correlates and adolescent reorganisation of cortical myelination networks in the common marmoset.Journal: Communications biologyIn common: statannotations, Image Processing Toolbox, Signal Processing Toolbox, 6 other tools
- [7] doi:10.7554/elife.108352 [code]
- Analysis of dendritic input currents during place field dynamics.Journal: eLifeIn common: pandas, Matplotlib, NumPy, 5 references
- [8] doi:10.1038/s41593-026-02232-0 [code]
- Entorhinal cortex represents task-relevant remote locations independently of CA1.Journal: Nature neuroscienceIn common: Image Processing Toolbox, Signal Processing Toolbox, seaborn, 5 other tools, mouse, 1 reference
- [9] doi:10.1016/j.isci.2026.116586 [code]
- Condition-specific neural signatures of reactivation during post-retrieval rest: An EEG study.Journal: iScienceIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 6 other tools
- [10] doi:10.1523/jneurosci.2001-25.2026 [code]
- Dynamics of Dentate Gyrus Place Cells and Dentate Spikes during Spatial and Nonspatial Changes in Environments.Journal: The Journal of neuroscience : the official journal of the Society for NeuroscienceIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 4 other tools, 1 reference
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: 1 repository of the authors' code, each at its verified commit and with its license, 7 scripts, and 1 match 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:af2c65b12d91ab25…
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.
