OSCR

Protocol to build open-source Discrimin8 maze to study discrimination of reward-context associations in mice during open-field foraging.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 211 lines · 6.5 KB · CC-BY-4.0

  1. %% Gergely Tarcsay, 2025 Ewell lab. MATLAB script to recreate learning curve and performance (Figure 1)
  2. close all
  3. clearvars -except behavior_struct
  4. cd("G:\Behavior only\")
  5. if ~exist("behavior_struct", "var")
  6. load BehaviorData
  7. behavior_struct.details.GPassed(5) =behavior_struct.details.GPassed(5)-1; % count the first day of > 70% for M99 because 2nd had behavior problems (cold room)
  8. end
  9. [N_days_d, N_mice] = size(behavior_struct.D_events);
  10. Performance_d = nan(N_days_d,N_mice+8, 3); % to store performance - total, ctxt A & ctxt B
  11. %% get Performance for discrimination
  12. for m = 1:N_mice
  13. disp(behavior_struct.details.Mouse(m))
  14. for d = 1:N_days_d
  15. event = behavior_struct.D_events{d,m};
  16. if isempty(event)
  17. break;
  18. end
  19. [TrialStart, TrialStop, ZoneTriggered, context] = ParseTrials(event);
  20. [Correct, Incorrect, Timeout, port, time, TrainingTrials, all_outcome] = GetTrialOutcome(event,TrialStart,TrialStop,ZoneTriggered);
  21. TrialType = ones(length(all_outcome),1);
  22. if ~isempty(TrainingTrials)
  23. TrialType([1; TrainingTrials(:,1)]) = 0; %1st trial is training when training trials are included in the session
  24. end
  25. Performance_d(d,m,:) = GetPerformance(TrialType, context, all_outcome);
  26. end
  27. end
  28. %% get performance for generalization
  29. [N_days_g, N_mice] = size(behavior_struct.G_events);
  30. Performance_g = nan(N_days_g,N_mice+8, 3); % to store performance - total, ctxt A & ctxt B
  31. for m = 1:N_mice
  32. disp(behavior_struct.details.Mouse(m))
  33. for d = 1:N_days_g
  34. event = behavior_struct.G_events{d,m};
  35. if isempty(event)
  36. break;
  37. end
  38. [TrialStart, TrialStop, ZoneTriggered, context] = ParseTrials(event);
  39. [Correct, Incorrect, Timeout, port, time, TrainingTrials, all_outcome] = GetTrialOutcome(event,TrialStart,TrialStop,ZoneTriggered);
  40. TrialType = ones(length(all_outcome),1);
  41. if ~isempty(TrainingTrials)
  42. TrialType([1; TrainingTrials(:,1)]) = 0; %1st trial is training when training trials are included in the session
  43. end
  44. Performance_g(d,m,:) = GetPerformance(TrialType, context, all_outcome);
  45. end
  46. end
  47. %% get performance for miniscope mice
  48. rootdir = strings(2,1);
  49. folders = strings(5,2);
  50. rootdir(1) = "F:\Included miniscope Mice\";
  51. folders(:,1) = ["\M119\" "\M120\" "\M292\" "M319\" "M210\"];
  52. rootdir(2) = "D:\Grouping First\";
  53. folders(:,2) = ["\M231\" "\M314\" "\M316\" "M318\" ""];
  54. nMice = [5 4];
  55. MiniscopeSex = ["f" "f" "f" "m" "m" "m", "f" "m" "m"];
  56. counter = 1;
  57. for r = 1:2
  58. for f = 1:nMice(r)
  59. load(strcat(rootdir(r), folders(f,r), "Performance_d.mat"))
  60. [days, ~,~] = size(Performance);
  61. Performance_d(1:days,counter+10,:) = Performance;
  62. clear Performance
  63. if exist(strcat(rootdir(r), folders(f,r), "Performance_g.mat"), "file")
  64. load(strcat(rootdir(r), folders(f,r), "Performance_g.mat"))
  65. [days, ~,~] = size(Performance);
  66. Performance_g(1:days,counter+10,:) = Performance;
  67. clear Performance
  68. else
  69. Performance_g(1:days,counter+10,:) = nan(days,3);
  70. end
  71. counter = counter +1;
  72. end
  73. end
  74. % plot results
  75. males = [find(behavior_struct.details.Sex == "m"); find(MiniscopeSex == "m")'+10];
  76. females = [find(behavior_struct.details.Sex == "f"); find(MiniscopeSex == "f")'+10];
  77. %% get when they reached 70%
  78. Main_Perform_D = Performance_d(:,:,1);
  79. Main_Perform_G = Performance_g(:,:,1);
  80. Discrimination_70 = nan(19,2);
  81. Grouping_70 = nan(19,2);
  82. for i = 1:19
  83. idx = find(Main_Perform_D(:,i) >= 70);
  84. Discrimination_70(i,1) = idx(1);
  85. Discrimination_70(i,2) = Main_Perform_D(idx(1),i);
  86. idx = find(Main_Perform_G(:,i) >= 70);
  87. if ~isempty(idx)
  88. Grouping_70(i,1) = idx(1);
  89. Grouping_70(i,2) = Main_Perform_G(idx(1),i);
  90. end
  91. end
  92. %% plot learning curves - separate for males and females
  93. figure
  94. tiledlayout(1,2)
  95. nexttile;
  96. hold on
  97. box off
  98. axis square
  99. for i = 1:length(females)
  100. plot(Main_Perform_D(1:Discrimination_70(females(i),1),females(i)),"o-", "MarkerSize",5, "Color","#a8cfc3")
  101. end
  102. for i = 1:length(males)
  103. plot(Main_Perform_D(1:Discrimination_70(males(i),1),males(i)),"o-", "MarkerSize",5, "Color","#27a37d")
  104. end
  105. ylim([0 100])
  106. xlim([0 11])
  107. nexttile;
  108. hold on
  109. box off
  110. axis square
  111. for i = 1:length(females)
  112. disp(i)
  113. if ~isnan(Grouping_70(females(i),1))
  114. plot(Main_Perform_G(1:Grouping_70(females(i),1),females(i)),"o-", "MarkerSize",5, "Color","#bea7d9")
  115. end
  116. end
  117. for i = 1:length(males)
  118. if ~isnan(Grouping_70(males(i),1))
  119. plot(Main_Perform_G(1:Grouping_70(males(i),1),males(i)),"o-", "MarkerSize",5, "Color","#854bc9")
  120. end
  121. end
  122. xlim([0 7])
  123. ylim([0 100])
  124. %% make violin plots for grouping and discrimination
  125. figure
  126. tiledlayout(1,2)
  127. Y_D = nan(10,2);
  128. Y_G = nan(10,2);
  129. Y_D(1:length(females),1) = Discrimination_70(females,2);
  130. Y_D(1:length(males),2) = Discrimination_70(males,2);
  131. nexttile;
  132. violin(Y_D, 'x', [1 2], 'facecolor', [.85 .85 .85; 0 0 0; .85 .85 .85; 0 0 0], 'edgecolor', 'k', 'mc', [], 'medc', [])
  133. box off
  134. hold on
  135. plot(repmat(1,10,1), Y_D(:,1), 'o', 'MarkerEdgeColor', [.5 .5 .5], 'MarkerFaceColor',[.5 .5 .5], 'MarkerSize', 3)
  136. plot(repmat(2,10,1), Y_D(:,2), 'o', 'MarkerEdgeColor', [.5 .5 .5].*0, 'MarkerFaceColor',[.5 .5 .5].*0, 'MarkerSize', 3)
  137. xlim([0.5 2.5])
  138. ylim([40 120])
  139. yticks(10:20:90)
  140. ylabel("Performance (%)")
  141. box off
  142. Y_G(1:length(females),1) = Grouping_70(females,2);
  143. Y_G(1:length(males),2) = Grouping_70(males,2);
  144. nexttile;
  145. violin(Y_G, 'x', [1 2], 'facecolor', [.85 .85 .85; 0 0 0; .85 .85 .85; 0 0 0], 'edgecolor', 'k', 'mc', [], 'medc', [])
  146. box off
  147. hold on
  148. plot(repmat(1,10,1), Y_G(:,1), 'o', 'MarkerEdgeColor', [.5 .5 .5], 'MarkerFaceColor',[.5 .5 .5], 'MarkerSize', 3)
  149. plot(repmat(2,10,1), Y_G(:,2), 'o', 'MarkerEdgeColor', [.5 .5 .5].*0, 'MarkerFaceColor',[.5 .5 .5].*0, 'MarkerSize', 3)
  150. xlim([0.5 2.5])
  151. ylim([40 120])
  152. yticks(10:20:90)
  153. ylabel("Performance (%)")
  154. box off
  155. %% statistics
  156. [~,p_D, ci_D, stats_D] = ttest2(Y_D(:,1), Y_D(:,2));
  157. [~,p_G,ci_G,stats_G] = ttest2(Y_G(:,1), Y_G(:,2));
  158. %% plot days to reach criteria
  159. Y_D = nan(10,2);
  160. Y_G = nan(10,2);
  161. Y_D(1:length(females),1) = Discrimination_70(females,1);
  162. Y_D(1:length(males),2) = Discrimination_70(males,1);
  163. Y_G(1:length(females),1) = Grouping_70(females,1);
  164. Y_G(1:length(males),2) = Grouping_70(males,1);
  165. figure
  166. tiledlayout(1,2)
  167. nexttile;
  168. boxplot(Y_D)
  169. box off
  170. ylim([0 12])
  171. nexttile;
  172. boxplot(Y_G)
  173. box off
  174. ylim([0 12])

BehaviorLearning.m, under CC-BY-4.0 · at the source

Overview

  1. Anatomy & Neurobiology, School of Medicine, University of California, Irvine, Irvine, CA, USA
  2. Neurobiology of Brain and Behavior, Charlie Dunlop School of Biological Sciences, University of California, Irvine, Irvine, CA, USA
  3. Center for Learning and Memory, University of California, Irvine, Irvine, CA, USA
Institutions: University of California, Irvine (United States)
Journal: STAR protocols, volume 7, issue 1, article 104415
Dates: published online 5 March 2026; in print March 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1016/j.xpro.2026.104415 · PMID 41790546 · PMCID PMC12969727 · OpenAlex W7133651954
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: behavior only (modality), mouse (organism), methods / tools (subfield)
Methods: Statistics
Keywords: neuroscience, behavior, computer sciences
MeSH: Maze Learning*, Reward*, Animals, Hippocampus, Memory, Mice (* major topic)
Topic: Memory and Neural Mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Institute of Neurological Disorders and Stroke (R01 1R01NS128222); National Institutes of Health
Citations: not cited yet (Europe PMC); 12 references in the paper

Abstract

The hippocampus is known to process context-specific memories. We provide a protocol for studying context discrimination in mice utilizing the open-source Discrimin8 maze. We describe the steps for building the maze and using custom-written codes implementing the task. Finally, instructions are provided to train mice on the task. This protocol implements a low-cost, automated maze allowing for investigation of context discrimination in freely moving mice.

For complete details on the use and execution of this protocol, please refer to Tarcsay et al.1

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above.

Zenodo 17488388

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the text, “Setting up the Arduino code”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
115 files

Zenodo 17488387

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
115 files
At the source:

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;
  • 228 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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

No dataset and no data link were found in the paper.

Data and code availability

The code generated during this study is available on GitHub (https://doi.org/10.5281/zenodo.17488387).

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

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 3 keywords, 6 MeSH terms, 2 funders, 12 references.

Cite

This paper

Tarcsay, G., & Ewell, L. A. (2026). Protocol to build open-source Discrimin8 maze to study discrimination of reward-context associations in mice during open-field foraging. STAR protocols, 7(1), 104415. https://doi.org/10.1016/j.xpro.2026.104415

BibTeX

@article{tarcsay2026protocol,
author = {Tarcsay, Gergely and Ewell, Laura A},
title = {{Protocol to build open-source Discrimin8 maze to study discrimination of reward-context associations in mice during open-field foraging}},
journal = {STAR protocols},
year = {2026},
month = mar,
volume = {7},
number = {1},
pages = {104415},
publisher = {Elsevier},
issn = {2666-1667},
doi = {10.1016/j.xpro.2026.104415},
url = {https://doi.org/10.1016/j.xpro.2026.104415},
pmid = {41790546},
pmcid = {PMC12969727}
}

RIS

TY - JOUR
AU - Tarcsay, Gergely
AU - Ewell, Laura A
TI - Protocol to build open-source Discrimin8 maze to study discrimination of reward-context associations in mice during open-field foraging
T2 - STAR protocols
J2 - STAR Protoc
PY - 2026
DA - 2026/03/05
VL - 7
IS - 1
SP - 104415
SN - 2666-1667
PB - Elsevier
DO - 10.1016/j.xpro.2026.104415
UR - https://doi.org/10.1016/j.xpro.2026.104415
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.xpro.2026.104415",
"type": "article-journal",
"title": "Protocol to build open-source Discrimin8 maze to study discrimination of reward-context associations in mice during open-field foraging",
"container-title": "STAR protocols",
"author": [
{
"family": "Tarcsay",
"given": "Gergely"
},
{
"family": "Ewell",
"given": "Laura A"
}
],
"container-title-short": "STAR Protoc",
"volume": "7",
"issue": "1",
"page": "104415",
"DOI": "10.1016/j.xpro.2026.104415",
"PMID": "41790546",
"PMCID": "PMC12969727",
"ISSN": "2666-1667",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.xpro.2026.104415",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
5
]
]
}
}

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.neuron.2026.03.034 [code]
Dentate gyrus interneurons modulate winner-take-all network dynamics in freely behaving mice.
Journal: Neuron
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, mouse, 3 references
[2] 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 Neuroscience
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, 2 references
[3] doi:10.1038/s41593-026-02357-2 [code]
Experience reorganizes content-specific memory traces in macaques.
Journal: Nature neuroscience
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, 1 reference
[4] doi:10.1523/eneuro.0417-25.2026 [code]
Learning and Motivation State Fluctuations from Motoric and Neurophysiologic Metrics during a Somatosensory Task in Mice.
Journal: eNeuro
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, behavior only, mouse
[5] doi:10.1038/s41467-026-76581-6 [code]
Thalamocortical bursts encode reward contingencies and drive associative learning.
Journal: Nature communications
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, mouse
[6] doi:10.1038/s41467-026-75347-4 [code]
Sleep reveals dynamics integrating and segregating movement and stimulus representations in V1.
Journal: Nature communications
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, mouse
[7] 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 reports
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, mouse
[8] doi:10.1038/s41467-026-73622-y [code]
Contextual gating of whisker-evoked responses by frontal cortex supports flexible decision making.
Journal: Nature communications
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, mouse
[9] doi:10.1038/s41467-026-73106-z [code]
Respiratory pauses highlight sleep architecture in mice.
Journal: Nature communications
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, mouse
[10] doi:10.1038/s41467-026-72620-4 [code]
Grid maps are disrupted after large-scale arena expansion and recover with experience.
Journal: Nature communications
In common: CircStat, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, mouse

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.