OSCR

Representations of the intrinsic value of information in mouse orbitofrontal cortex.

Code ↔ Paper

21 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 21 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 › Imaging data processing ↔ 03 ImagingCellExtractionPipeline/CNMFE_pipe.m, lines 37–148 · score 0.99 · gSig, gSiz, min_corr_res, min_pnr_res, min_pixel, minimum peak
  2. [2] § Methods › Imaging data processing ↔ 04 ImagingAnalysis/CellRegistrationMulti.m, lines 95–141 · score 0.92 · CaImAn, options.dist_maxthr, options.dist_thr, register_multisession, Cell registration, rois
  3. [3] § Methods › Imaging data processing ↔ 03 ImagingCellExtractionPipeline/CNMFE_pipe.m, lines 37–148 · score 0.89 · background fluctuation, spatially downsampled, motion corrected, Gaussians, smaller, filtered
  4. [4] § Methods › Analysis of neural activity ↔ 01 Bpod/InfoseekWaterVal/InfoseekWaterVal.m, lines 73–120 · score 0.81 · valve opening, odor onset, odor valves, Bpod system, side port odor, center port odor
  5. [5] § Methods › Analysis of neural activity ↔ 01 Bpod/InfoseekSyncSignal2/InfoseekSyncSignal2.m, lines 54–104 · score 0.81 · valve opening, odor onset, odor valves, Bpod system, side port odor, center port odor
  6. [6] § Methods › Behavior training and testing › Main task ↔ 01 Bpod/InfoseekWaterVal/InfoseekWaterVal.m, lines 2–59 · score 0.78 · mineral oil, Latch valves, Bpod system, olfactometers, modules, side port
  7. [7] § Methods › Imaging data processing ↔ 04 ImagingAnalysis/CellRegistrationMulti.m, lines 95–141 · score 0.78 · bin_width, max_shift, iter, NormCorre, template, CNMF
  8. [8] § Results › Mice value information ↔ 02 BehaviorAnalysis/InfoseekBehaviorModel_Finalized_CV.m, lines 373–425 · score 0.77 · delay discounted, lose shift, RLinfo, RLwater, win stay, exponential
  9. [9] § Methods › Behavior training and testing › Main task ↔ 01 Bpod/InfoseekSyncToneGo/InfoseekSyncToneGo.m, lines 1–50 · score 0.75 · alternative forced choice, reward outcome, amplifier, speaker, hardware, module
  10. [10] § Methods › Behavior training and testing › Main task ↔ 01 Bpod/InfoseekWaterVal/InfoseekWaterVal.m, lines 2–59 · score 0.72 · HiFi, forced choice, sound, hardware, water reward, module
  11. [11] § Methods › Behavior training and testing › Main task ↔ 01 Bpod/InfoseekSyncSignal2/InfoseekSyncSignal2.m, lines 970–1007 · score 0.71 · Lee Company, Latch valves, Bpod system, modules, ports, odors
  12. [12] § Methods › Behavior training and testing › Main task ↔ 01 Bpod/InfoseekWaterVal/InfoseekWaterVal.m, lines 73–120 · score 0.70 · grace period, go cue, side port odor, correct side port, poking, center odor
  13. [13] § Methods › Behavioral models ↔ Functions/fitPsyche.m, lines 1–42 · score 0.61 · psychometric curve, fitPsycheCurveWH, fitting, model
  14. [14] § Methods › Behavior analysis ↔ 02 BehaviorAnalysis/BehaviorAnalysisAll.m, lines 1075–1168 · score 0.61 · choice preference, glmfit, binomial, logit, binofit, signrank
  15. [15] § Methods › Behavioral models ↔ 02 BehaviorAnalysis/InfoseekBehaviorModel_Finalized_CV.m, lines 373–425 · score 0.61 · win stay lose, shift, model, weighted, Behavioral, reward
  16. [16] § Methods › Behavior training and testing › Water and delay titration experiments ↔ 02 BehaviorAnalysis/InfoseekBehaviorModel_Finalized_CV.m, lines 122–218 · score 0.57 · delay titration, reward amount, water reward, reverse, preference, modeling
  17. [17] § Methods › Analysis of neural activity ↔ Functions/absolute_rocarea.m, the whole file · a weak match · score 0.56 · vice versa, halves, split, odd
  18. [18] § Methods › CEBRA modeling ↔ 04 ImagingAnalysis/InfoseekNeuralAnalysisLearning.m, lines 33–109 · score 0.56 · long delay, JB433, JB424, JB434, JB425, JB426
  19. [19] § Methods › Behavioral models ↔ 02 BehaviorAnalysis/InfoseekBehaviorModel_Finalized_CV.m, lines 122–218 · score 0.54 · negative log likelihood, minimization, Behavioral, models
  20. [20] § Methods › Behavior training and testing › Behavioral training ↔ 01 Bpod/InfoseekSyncSignal2/InfoseekSyncSignal2.m, lines 54–104 · score 0.53 · center poke, center port odor, side port, duration, interval, Delivery
  21. [21] § Methods › Cells with significant conditional responses to task events (responding cells) ↔ 04 ImagingAnalysis/InfoseekNeuralAnalysis.m, lines 485–546 · score 0.52 · exponential decay, responding, baseline, post, event, pre

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 · 1,278 lines · 56 KB · no license · 4 matches

  1. %{
  2. ----------------------------------------------------------------------------
  3. InfoseekWaterVal — Protocol for task with 4 center ports odors to compare information and water value
  4. ----------------------------------------------------------------------------
  5. Runs four forced-choice trial types cued by odor at the center port: information, no information (random),
  6. high water value (big), low water value (small). Usually, the same side (left/right) is assigned to information
  7. and small.
  8. TASK STRUCTURE (per trial):
  9. 1. Mouse pokes center port → receives an odor cueing the forced side
  10. for this trial (info, rand, big, small)
  11. 2. Mouse pokes the cued side port
  12. 3. Side port delivers a second odor (only on information or random trials)
  13. 4. After a delay (with an auditory warning tone predicting reward size),
  14. water reward is delivered at the same port
  15. (mouse must be present in port only at outcome time to receive reward)
  16. TRIAL TYPES (set by S.GUI.TrialTypes):
  17. 1 = Small — center odor = SmallOdor
  18. 2 = Info Forced — center odor = InfoOdor
  19. 3 = Rand Forced — center odor = RandOdor
  20. 4 = Big — center odor = BigOdor
  21. SIDE ASSIGNMENT:
  22. S.GUI.InfoSide (0/1): 0 = Info odors (A/B) go LEFT, Rand odors (C/D) go RIGHT
  23. 1 = Info odors (A/B) go RIGHT, Rand odors (C/D) go LEFT
  24. S.GUI.BigSide (0/1): 0 = Big water trials go LEFT, Small water trials go RIGHT
  25. 1 = Big water trials go RIGHT, Small water trials go LEFT
  26. Info and small water normally set to the same side.
  27. HARDWARE:
  28. ValveModule1 — control mineral oil (center / left / right)
  29. ValveModule2/3 — odor valves (8 positions each)
  30. DIOmodule (Teensy) — buzzer, latch valves (flip side port odors from left to right)
  31. HiFi module (H) — go-cue tone and reward-predictive tones (sounds 1-3 loaded at start)
  32. BNC1/2 — sync signals to DAQ/miniscope/tracking camera via GlobalTimers 7/8
  33. REWARD DROPS:
  34. Drops are delivered via looping GlobalTimers (3 = left valve, 4 = right).
  35. Drop counts controlled by S.GUI.Info/Rand Big/SmallDrops and S.GUI.Big/SmallDrops.
  36. OUTCOME CODES (BpodSystem.Data.Outcomes):
  37. 1 = Small no-choice 5 = Info no-choice 11 = Rand no-choice 17 = Big no-choice
  38. 2 = Small correct 6 = Info big 12 = Rand big 18 = Big correct
  39. 3 = Small NP 7 = Info big NP 13 = Rand big NP 19 = Big NP
  40. 4 = Small incorrect 8 = Info small 14 = Rand small 20 = Big incorrect
  41. 9 = Info small NP 15 = Rand small NP
  42. 10 = Info incorrect 16 = Rand incorrect
  43. ----------------------------------------------------------------------------
  44. Three valve control modules control airflow in the custom dilution
  45. olfactometer.
  46. One Teensy 3.2 connected as a module with the Bpod Teensy Shield controls
  47. a buzzer (not used when Hifi tones in use) and latch valves via 2 H-bridges.
  48. %}
  49. function InfoseekWaterVal
  50. global BpodSystem
  51. %% Assert HiFi module is present + USB-paired (via USB button on console GUI)
  52. BpodSystem.assertModule('HiFi', 1); % The second argument (1) indicates that the HiFi module must be paired with its USB serial port
  53. % Create an instance of the HiFi module
  54. H = BpodHiFi(BpodSystem.ModuleUSB.HiFi1); % The argument is the name of the HiFi module's USB serial port (e.g. COM3)
  55. %% Create trial manager object
  56. TrialManager = TrialManagerObject;
  57. %% Define parameters
  58. S = BpodSystem.ProtocolSettings; % Load settings chosen in launch manager into current workspace as a struct called S
  59. if isempty(fieldnames(S)) % No saved settings — populate with defaults
  60. % Session structure
  61. S.GUI.SessionTrials = 1000;
  62. S.GUI.TrialTypes = 2; % 1=Small, 2=Info, 3=Rand, 4=Big, 5-8=mixes (see SetTrialTypes)
  63. S.GUI.InfoSide = 0; % 0=info→left/rand→right, 1=info→right/rand→left
  64. S.GUI.BigSide = 0; % 0=big→left/small→right, 1=big→right/small→left
  65. % Center-port odor valve indices (positions on ValveModule2/3)
  66. S.GUI.InfoOdor = 2;
  67. S.GUI.RandOdor = 0;
  68. S.GUI.BigOdor = 3;
  69. S.GUI.SmallOdor = 1;
  70. % Side-port odor valve indices
  71. S.GUI.OdorA = 3; % Info big
  72. S.GUI.OdorB = 2; % Info small
  73. S.GUI.OdorC = 0; % Rand big
  74. S.GUI.OdorD = 1; % Rand small
  75. % Timing (seconds)
  76. S.GUI.CenterDelay = 0; % delay after center poke before odor onset
  77. S.GUI.CenterOdorTime = 0.2; % duration of center-port odor (s)
  78. S.GUI.StartDelay = 0; % delay after center odor before go cue
  79. S.GUI.OdorDelay = 0; % delay after go cue before side odor onset
  80. S.GUI.OdorTime = 0; % duration of side-port odor (s)
  81. S.GUI.RewardDelay = 0.5; % delay from odor offset to reward delivery (s)
  82. S.GUI.Signal = 0.2; % fraction of RewardDelay spent as an audible/light warning before reward
  83. S.GUI.GracePeriod = 100000000; % additional time (s) to wait for response after go cue on top of OdorDelay; odor then delivered immediately upon correct side port entry
  84. S.GUI.Interval = 1; % inter-trial interval (s)
  85. % Reward drops (number of valve open/close cycles per reward)
  86. S.GUI.InfoBigDrops = 1;
  87. S.GUI.InfoSmallDrops = 1;
  88. S.GUI.RandBigDrops = 1;
  89. S.GUI.RandSmallDrops = 1;
  90. S.GUI.BigDrops = 8;
  91. S.GUI.SmallDrops = 2;
  92. % Reward probability (fraction of trials that give big reward; rest give small)
  93. S.GUI.InfoRewardProb = 1;
  94. S.GUI.RandRewardProb = 1;
  95. BpodSystem.ProtocolSettings = S;
  96. SaveProtocolSettings(BpodSystem.ProtocolSettings);
  97. end
  98. %% Set Latch Valves
  99. SetLatchValves(S);
  100. %% Set up trial types and rewards
  101. S.TrialTypes = [];
  102. S.RewardTypes = [];
  103. S.RandOdorTypes = [];
  104. S = SetTrialTypes(S,1); % Sets S.TrialTypes from trial 1 to maxTrials
  105. S = SetRewardTypes(S,1); % Sets S.RewardTypes, S.RandOdorTypes from trial 1 to maxTrials
  106. %% SET INITIAL TYPE COUNTS
  107. BpodSystem.Data.TrialCounts = [0,0,0,0];
  108. BpodSystem.Data.PlotOutcomes = [];
  109. %% SAVE EVENT NAMES AND NUMBER
  110. BpodSystem.Data.TrialTypes = []; % The trial type of each trial completed will be added here.
  111. BpodSystem.Data.Outcomes = [];
  112. BpodSystem.Data.OrigTrialTypes = S.TrialTypes; % take out if working?
  113. BpodSystem.Data.OrigRewardTypes = S.RewardTypes; % take out if working?
  114. BpodSystem.Data.EventNames = BpodSystem.StateMachineInfo.EventNames;
  115. SaveBpodSessionData;
  116. %% Initialize plots
  117. BpodSystem.ProtocolFigures.TrialTypePlotFig = figure('Position', [50 640 1000 250],'name','Trial Type','numbertitle','off', 'MenuBar', 'none');
  118. BpodSystem.GUIHandles.TrialTypePlot = axes('OuterPosition', [0 0 1 1]);
  119. TrialTypePlotInfoWater(BpodSystem.GUIHandles.TrialTypePlot,'init',S.TrialTypes,min([S.GUI.SessionTrials 40])); % trial choice types
  120. % EventsPlot('init', getStateColors(S.GUI.InfoSide)); % events within trial
  121. BpodSystem.ProtocolFigures.OutcomePlotFig = figure('Position', [50 100 600 400],'name','TrialOutcomes','numbertitle','off', 'MenuBar', 'none');
  122. BpodSystem.GUIHandles.OutcomePlot = axes('OuterPosition', [0 0 1 1]);
  123. InfoWaterOutcomesPlot(BpodSystem.GUIHandles.OutcomePlot,'init');
  124. BpodNotebook('init');
  125. InfoParameterGUI('init', S); % Initialize parameter GUI plugin
  126. TotalRewardDisplayInfo('init');
  127. %% INITIALIZE SERIAL MESSAGES / DIO
  128. ResetSerialMessages();
  129. buzzer1 = [254 1];
  130. buzzer2 = [253 1];
  131. modules = BpodSystem.Modules.Name;
  132. DIOmodule = [modules(strncmp('DIO',modules,3))];
  133. DIOmodule = DIOmodule{1};
  134. % Set serial messages for Teensy module to control box, communicate with
  135. % DAQ/miniscope
  136. LoadSerialMessages(DIOmodule, {buzzer1, buzzer2,...
  137. [22 1],[22 0],[23 1], [23 0]});
  138. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  139. % ODOR CONTROL SERIAL MESSAGES
  140. LoadSerialMessages('ValveModule1',{[1 2],[3 4],[5 6]}); % control by port
  141. %% Define sounds and send to sound module
  142. sf = 192000; % Use max supported sampling rate
  143. H.SamplingRate = sf;
  144. noRewardFreq=500;
  145. rewardFreq=2000;
  146. toneDuration=0.5;
  147. rewardSound = GenerateSineWave(sf, noRewardFreq, toneDuration)*.9;
  148. % Sampling freq (hz), Sine frequency (hz), duration (s)
  149. noRewardSound = GenerateSineWave(sf, rewardFreq, toneDuration)*.9;
  150. goSound = GenerateSineWave(sf, 1200, 0.05)*.9;
  151. % Setup HiFi module
  152. % H.HeadphoneAmpEnabled = true; H.HeadphoneAmpGain = 10; % Ignored if using HD version of the HiFi module
  153. H.DigitalAttenuation_dB = -50; % Set a negative value here if necessary for digital volume control.
  154. H.load(1, rewardSound);
  155. H.load(2, noRewardSound);
  156. H.load(3, goSound);
  157. % Define 1ms linear ramp envelope of amplitude coefficients, to apply at sound onset + in reverse at sound offset
  158. envelope = 1/(sf*0.001):1/(sf*0.001):1;
  159. H.AMenvelope = envelope;
  160. %% INITIALIZE STATE MACHINE
  161. [sma,S,nextRewardLeft,nextRewardRight] = PrepareStateMachine(S, 1, []); % Prepare state machine for trial 1 with empty "current events" variable
  162. TrialManager.startTrial(sma); % Sends & starts running first trial's state machine. A MATLAB timer object updates the
  163. % console UI, while code below proceeds in parallel.
  164. RewardLeft = nextRewardLeft; RewardRight = nextRewardRight;
  165. %% MAIN TRIAL LOOP
  166. for currentTrial = 1:S.GUI.SessionTrials
  167. currentS = S;
  168. currentTrialEvents = TrialManager.getCurrentEvents({'WaitForOdorLeft','WaitForOdorRight','NoChoice','Incorrect'}); % Hangs here until Bpod enters one of the listed trigger states, then returns current trial's states visited + events captured to this point
  169. if BpodSystem.Status.BeingUsed == 0
  170. TurnOffAllOdors();
  171. return; end % If user hit console "stop" button, end session
  172. [sma, S, nextRewardLeft,nextRewardRight] = PrepareStateMachine(S, currentTrial+1, currentTrialEvents); % Prepare next state machine.
  173. SendStateMachine(sma, 'RunASAP'); % send the next trial's state machine while the current trial is ongoing
  174. RawEvents = TrialManager.getTrialData; % Hangs here until trial is over, then retrieves full trial's raw data
  175. if BpodSystem.Status.BeingUsed == 0
  176. TurnOffAllOdors();
  177. return; end % If user hit console "stop" button, end session
  178. HandlePauseCondition; % Checks to see if the protocol is paused. If so, waits until user resumes.
  179. TrialManager.startTrial(); % Start processing the next trial's events
  180. if ~isempty(fieldnames(RawEvents)) % If trial data was returned from last trial, update plots and save data
  181. BpodSystem.Data = AddTrialEvents(BpodSystem.Data,RawEvents); % Computes trial events from raw data
  182. [rewardAmount,outcome] = UpdateOutcome(currentTrial,currentS,RewardLeft,RewardRight);
  183. BpodSystem.Data.TrialSettings(currentTrial) = currentS.GUI; % Adds the settings used for the current trial to the Data struct (to be saved after the trial ends)
  184. BpodSystem.Data.TrialTypes(currentTrial) = currentS.TrialTypes(currentTrial); % Adds the trial type of the current trial to data
  185. BpodSystem.Data.Outcomes(currentTrial) = outcome;
  186. BpodSystem.Data = BpodNotebook('sync', BpodSystem.Data); % Sync with Bpod notebook plugin
  187. TotalRewardDisplayInfo('add',rewardAmount);
  188. RewardLeft = nextRewardLeft; RewardRight = nextRewardRight;
  189. TrialTypePlotInfoWater(BpodSystem.GUIHandles.TrialTypePlot,'update',currentTrial,S.TrialTypes);
  190. InfoWaterOutcomesPlot(BpodSystem.GUIHandles.OutcomePlot,'update');
  191. tic
  192. SaveBpodSessionData;
  193. toc
  194. end
  195. end
  196. end % end of protocol main function
  197. %% PREPARE STATE MACHINE
  198. function [sma, S, RewardLeft, RewardRight] = PrepareStateMachine(S, nextTrial, currentTrialEvents)
  199. % Build state machine for nextTrial.
  200. % currentTrialEvents: events captured so far from the current (running) trial,
  201. % used to detect early port entry and extend trial type arrays if needed.
  202. % Returns updated S, and the reward valve timer counts for left/right.
  203. global BpodSystem;
  204. modules = BpodSystem.Modules.Name;
  205. DIOmodule = [modules(strncmp('DIO',modules,3))];
  206. DIOmodule = DIOmodule{1};
  207. lastS = S;
  208. S = InfoParameterGUI('sync', S); % Sync parameters with BpodParameterGUI plugin
  209. if S.GUI.TrialTypes ~= lastS.GUI.TrialTypes
  210. S = SetTrialTypes(S,nextTrial);
  211. end
  212. if (S.GUI.InfoRewardProb ~= lastS.GUI.InfoRewardProb || S.GUI.RandRewardProb ~= lastS.GUI.RandRewardProb)
  213. S = SetRewardTypes(S,nextTrial);
  214. end
  215. if (S.GUI.InfoSide ~= lastS.GUI.InfoSide)
  216. SetLatchValves(S);
  217. end
  218. % DETERMINE TRIAL TYPE
  219. if nextTrial>1
  220. previousStates = currentTrialEvents.StatesVisited;
  221. if sum(contains(previousStates,'NoChoice') | contains(previousStates,'Incorrect'))>0
  222. S = UpdateTrialTypes(nextTrial,S);
  223. end
  224. end
  225. nextTrialType = S.TrialTypes(nextTrial);
  226. infoSide = S.GUI.InfoSide;
  227. TrialCounts = BpodSystem.Data.TrialCounts;
  228. bigSide = S.GUI.BigSide;
  229. % Determine trial-specific state matrix fields
  230. % Set trialParams (reward and odor)
  231. switch nextTrialType
  232. case 1 % SMALL
  233. ThisCenterOdor = S.GUI.SmallOdor;
  234. LeftSideOdor = 0;
  235. RightSideOdor = 0;
  236. if bigSide == 0 % BIG LEFT
  237. ChooseLeft = 'Incorrect'; ChooseRight = 'WaitForOdorRight';
  238. RewardLeft = 0; RewardRight = 1;
  239. OutcomeStateLeft = 'TimeoutOutcome';
  240. LeftRewardDrops = 0;
  241. SideOdorStateLeft = 'TimeoutOdor';
  242. SideOdorStateRight = 'OdorWaterRight';
  243. SideOdorOffActionRight = [];
  244. SideOdorOffActionLeft = [];
  245. ToneCmd =[];
  246. OutcomeStateRight = 'RightSmallReward';
  247. RightRewardDrops = S.GUI.SmallDrops;
  248. else
  249. ChooseLeft = 'WaitForOdorLeft'; ChooseRight = 'Incorrect';
  250. RewardLeft = 1; RewardRight = 0;
  251. OutcomeStateRight = 'TimeoutOutcome';
  252. RightRewardDrops = 0;
  253. SideOdorStateRight = 'TimeoutOdor';
  254. SideOdorStateLeft = 'OdorWaterLeft';
  255. SideOdorOffActionRight = [];
  256. SideOdorOffActionLeft = [];
  257. ToneCmd =[];
  258. OutcomeStateLeft = 'LeftSmallReward';
  259. LeftRewardDrops = S.GUI.SmallDrops;
  260. end
  261. case 2 % INFO FORCED
  262. ThisCenterOdor = S.GUI.InfoOdor;
  263. if infoSide == 0
  264. % info on left
  265. RewardLeft = S.RewardTypes(TrialCounts(2)+1,1); RewardRight = 0;
  266. ChooseLeft = 'WaitForOdorLeft'; ChooseRight = 'Incorrect';
  267. RightSideOdor = 0;
  268. if RewardLeft == 1
  269. OutcomeStateLeft = 'LeftBigReward';
  270. LeftRewardDrops = S.GUI.InfoBigDrops;
  271. LeftSideOdor = S.GUI.OdorA;
  272. SideOdorStateLeft = 'OdorALeft';
  273. ToneCmd = {'HiFi1', ['P' 0]};
  274. else
  275. OutcomeStateLeft = 'LeftSmallReward';
  276. LeftRewardDrops = S.GUI.InfoSmallDrops;
  277. LeftSideOdor = S.GUI.OdorB;
  278. SideOdorStateLeft = 'OdorBLeft';
  279. ToneCmd = {'HiFi1', ['P' 1]};
  280. end
  281. SideOdorOffActionLeft = RunOdor(LeftSideOdor,1);
  282. SideOdorOffActionRight =[];
  283. OutcomeStateRight = 'TimeoutOutcome';
  284. RightRewardDrops = 0;
  285. SideOdorStateRight = 'TimeoutOdor';
  286. else
  287. RewardLeft = 0; RewardRight = S.RewardTypes(TrialCounts(2)+1,1);
  288. ChooseLeft = 'Incorrect'; ChooseRight = 'WaitForOdorRight';
  289. LeftSideOdor = 0;
  290. if RewardRight == 1
  291. OutcomeStateRight = 'RightBigReward';
  292. RightRewardDrops = S.GUI.InfoBigDrops;
  293. RightSideOdor = S.GUI.OdorA;
  294. SideOdorStateRight = 'OdorARight';
  295. ToneCmd = {'HiFi1', ['P' 0]};
  296. else
  297. OutcomeStateRight = 'RightSmallReward';
  298. RightRewardDrops = S.GUI.InfoSmallDrops;
  299. RightSideOdor = S.GUI.OdorB;
  300. SideOdorStateRight = 'OdorBRight';
  301. ToneCmd = {'HiFi1', ['P' 1]};
  302. end
  303. SideOdorOffActionRight = RunOdor(RightSideOdor,2);
  304. SideOdorOffActionLeft =[];
  305. OutcomeStateLeft = 'TimeoutOutcome';
  306. LeftRewardDrops = 0;
  307. SideOdorStateLeft = 'TimeoutOdor';
  308. end
  309. case 3 % RAND FORCED
  310. ThisCenterOdor = S.GUI.RandOdor;
  311. if infoSide == 0 % INFO ON LEFT
  312. RewardLeft = 0; RewardRight = S.RewardTypes(TrialCounts(3)+1,2);
  313. ChooseLeft = 'Incorrect'; ChooseRight = 'WaitForOdorRight';
  314. RightSideOdorFlag = S.RandOdorTypes(TrialCounts(3)+1,1);
  315. if RightSideOdorFlag == 0
  316. RightSideOdor = S.GUI.OdorC;
  317. SideOdorStateRight = 'OdorCRight';
  318. else
  319. RightSideOdor = S.GUI.OdorD;
  320. SideOdorStateRight = 'OdorDRight';
  321. end
  322. LeftSideOdor = 0;
  323. SideOdorOffActionRight = RunOdor(RightSideOdor,2);
  324. SideOdorOffActionLeft =[];
  325. if RewardRight == 1
  326. OutcomeStateRight = 'RightBigReward';
  327. RightRewardDrops = S.GUI.RandBigDrops;
  328. ToneCmd = {'HiFi1', ['P' 0]};
  329. else
  330. OutcomeStateRight = 'RightSmallReward';
  331. RightRewardDrops = S.GUI.RandSmallDrops;
  332. ToneCmd = {'HiFi1', ['P' 1]};
  333. end
  334. OutcomeStateLeft = 'TimeoutOutcome';
  335. LeftRewardDrops = 0;
  336. SideOdorStateLeft = 'TimeoutOdor';
  337. else
  338. RewardLeft = S.RewardTypes(TrialCounts(3)+1,2); RewardRight = 0;
  339. ChooseLeft = 'WaitForOdorLeft'; ChooseRight = 'Incorrect';
  340. LeftSideOdorFlag = S.RandOdorTypes(TrialCounts(3)+1,1);
  341. if LeftSideOdorFlag == 0
  342. LeftSideOdor = S.GUI.OdorC;
  343. SideOdorStateLeft = 'OdorCLeft';
  344. else
  345. LeftSideOdor = S.GUI.OdorD;
  346. SideOdorStateLeft = 'OdorDLeft';
  347. end
  348. RightSideOdor = 0;
  349. SideOdorOffActionLeft = RunOdor(LeftSideOdor,1);
  350. SideOdorOffActionRight =[];
  351. if RewardLeft == 1
  352. OutcomeStateLeft = 'LeftBigReward';
  353. LeftRewardDrops = S.GUI.RandBigDrops;
  354. ToneCmd = {'HiFi1', ['P' 0]};
  355. else
  356. OutcomeStateLeft = 'LeftSmallReward';
  357. LeftRewardDrops = S.GUI.RandSmallDrops;
  358. ToneCmd = {'HiFi1', ['P' 1]};
  359. end
  360. OutcomeStateRight = 'TimeoutOutcome';
  361. RightRewardDrops = 0;
  362. SideOdorStateRight = 'TimeoutOdor';
  363. end
  364. case 4 % BIG
  365. ThisCenterOdor = S.GUI.BigOdor;
  366. LeftSideOdor = 0;
  367. RightSideOdor = 0;
  368. if bigSide == 0 % BIG LEFT
  369. ChooseLeft = 'WaitForOdorLeft'; ChooseRight = 'Incorrect';
  370. RewardLeft = 1; RewardRight = 0;
  371. OutcomeStateRight = 'TimeoutOutcome';
  372. RightRewardDrops = 0;
  373. SideOdorStateRight = 'TimeoutOdor';
  374. SideOdorStateLeft = 'OdorWaterLeft';
  375. SideOdorOffActionLeft = [];
  376. SideOdorOffActionRight =[];
  377. ToneCmd =[];
  378. OutcomeStateLeft = 'LeftBigReward';
  379. LeftRewardDrops = S.GUI.BigDrops;
  380. else
  381. ChooseLeft = 'Incorrect'; ChooseRight = 'WaitForOdorRight';
  382. RewardLeft = 0; RewardRight = 1;
  383. OutcomeStateLeft = 'TimeoutOutcome';
  384. LeftRewardDrops = 0;
  385. SideOdorStateLeft = 'TimeoutOdor';
  386. SideOdorStateRight = 'OdorWaterRight';
  387. SideOdorOffActionRight = [];
  388. SideOdorOffActionLeft =[];
  389. ToneCmd =[];
  390. OutcomeStateRight = 'RightBigReward';
  391. RightRewardDrops = S.GUI.BigDrops;
  392. end
  393. end
  394. % Water parameters
  395. R = GetValveTimes(4, [1 3]);
  396. % R = [0.100 0.100];
  397. LeftValveTime = R(1); RightValveTime = R(2); % Update reward amounts
  398. MaxValveTime = max(R);
  399. maxDrops = max([S.GUI.InfoBigDrops,S.GUI.InfoSmallDrops,S.GUI.RandBigDrops,S.GUI.RandSmallDrops,S.GUI.SmallDrops,S.GUI.BigDrops]);
  400. RewardPauseTime = 0.05;
  401. % Time for reward lights
  402. WarningTime = ceil(S.GUI.Signal*S.GUI.RewardDelay);
  403. DelayTime = S.GUI.RewardDelay - WarningTime;
  404. sma = NewStateMatrix(); % Assemble state matrix
  405. sma = SetCondition(sma, 1, 'Port1', 1); % Condition 1: Port 1 high (is in) (left)
  406. sma = SetCondition(sma, 2, 'Port2', 1); % Condition 2: Port 2 high (is in) (center)
  407. sma = SetCondition(sma, 3, 'Port3', 1); % Condition 3: Port 3 high (is in) (right)
  408. sma = SetCondition(sma, 4, 'Port1', 0); % Condition 4: Port 1 low (is out) (left)
  409. sma = SetCondition(sma, 5, 'Port2', 0); % Condition 5: Port 2 low (is out) (center)
  410. sma = SetCondition(sma, 6, 'Port3', 0); % Condition 6: Port 3 low (is out) (right)
  411. % TIMERS
  412. sma = SetCondition(sma, 7, 'GlobalTimer1', 0);
  413. % sma = SetGlobalTimer(sma, 'TimerID', 1, 'Duration', S.GUI.OdorDelay+0.05); % ODOR DELAY + GO CUE
  414. sma = SetGlobalTimer(sma, 'TimerID', 1, 'Duration', S.GUI.OdorDelay+0.05,...
  415. 'OnsetDelay', 0, 'Channel', 'SoftCode', 'OnMessage', 0, 'OffMessage', 0,...
  416. 'Loop', 0, 'SendEvents', 1, 'LoopInterval', 0,'OnsetTrigger','010000'); %also turn on timer 5
  417. % TIMER 2 FOR MAX REWARD
  418. if maxDrops > 1
  419. sma = SetGlobalTimer(sma, 'TimerID', 2, 'Duration', MaxValveTime,...
  420. 'OnsetDelay', 0, 'Channel', 'SoftCode', 'OnMessage',0, 'OffMessage', 0,...
  421. 'Loop', maxDrops, 'SendEvents', 1, 'LoopInterval', RewardPauseTime); % timer to stay in reward state
  422. else
  423. sma = SetGlobalTimer(sma, 'TimerID', 2, 'Duration', MaxValveTime,...
  424. 'OnsetDelay', 0, 'Channel', 'SoftCode', 'OnMessage', 0, 'OffMessage', 0,...
  425. 'Loop', 0, 'SendEvents', 1, 'LoopInterval', 0); % timer to stay in reward state
  426. end
  427. sma = SetGlobalCounter(sma, 2, 'GlobalTimer2_End', maxDrops);
  428. % reward states all wait for timers to end
  429. % set multiple timers for each outcome--one for drops, one for blanks
  430. % get rid of reward states
  431. % Timers for delivering reward drops
  432. if LeftRewardDrops > 1
  433. sma = SetGlobalTimer(sma,'TimerID',3,'Duration',LeftValveTime,'OnsetDelay',0,...
  434. 'Channel', 'Valve1', 'OnMessage', 1, 'OffMessage', 0, 'Loop',...
  435. LeftRewardDrops, 'SendEvents', 1, 'LoopInterval', RewardPauseTime,'OnsetTrigger', '10');
  436. sma = SetGlobalCounter(sma, 3, 'GlobalTimer3_End', LeftRewardDrops);
  437. elseif LeftRewardDrops == 1
  438. sma = SetGlobalTimer(sma,'TimerID',3,'Duration',LeftValveTime,'OnsetDelay',0,...
  439. 'Channel','Valve1','OnMessage', 1, 'OffMessage', 0, 'Loop', 0, 'SendEvents', 1,'LoopInterval',0,'OnsetTrigger', '10');
  440. sma = SetGlobalCounter(sma, 3, 'GlobalTimer3_End', 1);
  441. else
  442. sma = SetGlobalTimer(sma,'TimerID',3,'Duration',0,'OnsetDelay',0,...
  443. 'Channel','Valve1','OnMessage', 0, 'OffMessage', 0, 'Loop', 0, 'SendEvents', 1,'LoopInterval',0,'OnsetTrigger', '10');
  444. sma = SetGlobalCounter(sma, 3, 'GlobalTimer3_End', 1);
  445. end
  446. if RightRewardDrops > 1
  447. sma = SetGlobalTimer(sma,'TimerID',4,'Duration', RightValveTime,'OnsetDelay',0,...
  448. 'Channel', 'Valve3', 'OnMessage', 1, 'OffMessage', 0, 'Loop',...
  449. RightRewardDrops, 'SendEvents', 1, 'LoopInterval', RewardPauseTime,'OnsetTrigger', '10');
  450. sma = SetGlobalCounter(sma, 4, 'GlobalTimer4_End', RightRewardDrops);
  451. elseif RightRewardDrops == 1
  452. sma = SetGlobalTimer(sma,'TimerID',4,'Duration',RightValveTime,'OnsetDelay',0,...
  453. 'Channel', 'Valve3', 'OnMessage', 1, 'OffMessage', 0, 'Loop', 0, 'SendEvents', 1,'LoopInterval',0,'OnsetTrigger', '10');
  454. sma = SetGlobalCounter(sma, 4, 'GlobalTimer4_End', 1);
  455. else
  456. sma = SetGlobalTimer(sma,'TimerID',4,'Duration',0,'OnsetDelay',0,...
  457. 'Channel', 'Valve3', 'OnMessage', 0, 'OffMessage', 0, 'Loop', 0, 'SendEvents', 1,'LoopInterval',0,'OnsetTrigger', '10');
  458. sma = SetGlobalCounter(sma, 4, 'GlobalTimer4_End', 1);
  459. end
  460. sma = SetGlobalTimer(sma, 'TimerID', 7,...
  461. 'Duration',0.01, 'OnsetDelay', 0,...
  462. 'Channel', 'BNC1', 'OnMessage', 1,...
  463. 'OffMessage', 0, 'Loop', 1,...
  464. 'SendEvents', 1, 'LoopInterval', 0.1);
  465. % sma = SetGlobalTimer(sma, 'TimerID', 8,...
  466. % 'Duration',0.1, 'OnsetDelay', 0,...
  467. % 'Channel', 'BNC2', 'OnMessage', 1,...
  468. % 'OffMessage', 0, 'Loop', 0,...
  469. % 'SendEvents', 1);
  470. sma = SetGlobalTimer(sma, 'TimerID', 8, 'Duration', 0.01, 'OnsetDelay', 0,...
  471. 'Channel', 'BNC2', 'OnLevel', 1, 'OffLevel', 0,...
  472. 'Loop', 1, 'SendGlobalTimerEvents', 1, 'LoopInterval', 0.04);
  473. % STATES
  474. sma = AddState(sma, 'Name', 'TimerStart', ...
  475. 'Timer', 0,...
  476. 'StateChangeConditions', {'Tup', 'InterTrialInterval'},...
  477. 'OutputActions', {'GlobalTimerTrig',7,'HiFi1','*'});
  478. sma = AddState(sma, 'Name', 'InterTrialInterval', ...
  479. 'Timer', S.GUI.Interval,...
  480. 'StateChangeConditions', {'Tup', 'StartTrial'},...
  481. 'OutputActions', {'GlobalTimerTrig',8});
  482. sma = AddState(sma, 'Name', 'StartTrial', ...
  483. 'Timer', 0,...
  484. 'StateChangeConditions', {'Tup', 'WaitForCenter'},...
  485. 'OutputActions', {});
  486. sma = AddState(sma, 'Name', 'WaitForCenter', ...
  487. 'Timer', 0,...
  488. 'StateChangeConditions', {'Port2In', 'CenterDelay','Condition2','CenterDelay'},... % test how these are different!
  489. 'OutputActions', {'PWM2',50}); % port light on
  490. sma = AddState(sma, 'Name', 'CenterDelay', ...
  491. 'Timer', S.GUI.CenterDelay,...
  492. 'StateChangeConditions', {'Tup', 'CenterOdor','Port2Out','WaitForCenter'},...
  493. 'OutputActions', {'PWM2',50});
  494. sma = AddState(sma, 'Name', 'CenterOdor', ...
  495. 'Timer', S.GUI.CenterOdorTime,...
  496. 'StateChangeConditions', {'Port2Out', 'CenterOdorOff', 'Tup', 'CenterPostOdorDelay'},...
  497. 'OutputActions',[{DIOmodule,3,'PWM2',50},RunOdor(ThisCenterOdor,0)]);
  498. sma = AddState(sma, 'Name', 'CenterOdorOff',...
  499. 'Timer', 0,...
  500. 'StateChangeConditions', {'Tup','WaitForCenter'},...
  501. 'OutputActions', [{DIOmodule,4,'PWM2',50},RunOdor(ThisCenterOdor,0)]);
  502. sma = AddState(sma, 'Name', 'CenterPostOdorDelay', ...
  503. 'Timer', S.GUI.StartDelay,...
  504. 'StateChangeConditions', {'Port2Out','WaitForCenter','Tup','GoCue'},... % is that right?
  505. 'OutputActions', [{DIOmodule,4,'PWM2',50},RunOdor(ThisCenterOdor,0)]);
  506. sma = AddState(sma, 'Name', 'GoCue', ...
  507. 'Timer', 0.05,...
  508. 'StateChangeConditions', {'Tup','Response'},...
  509. 'OutputActions', {'GlobalTimerTrig',1,'HiFi1', ['P' 2]});
  510. % RESPONSE (CHOICE) --> MAKE SURE STAY IN SIDE FOR AT LEAST A SMALL TIME TO INDICATE CHOICE?
  511. sma = AddState(sma, 'Name', 'Response', ...
  512. 'Timer', S.GUI.OdorDelay,...
  513. 'StateChangeConditions', {'Tup','GracePeriod','Port1In',ChooseLeft,'Port3In',ChooseRight},...
  514. 'OutputActions', {});
  515. sma = AddState(sma, 'Name', 'GracePeriod',...
  516. 'Timer', S.GUI.GracePeriod,...
  517. 'StateChangeConditions', {'Tup','NoChoice','Port1In',ChooseLeft,'Port3In',ChooseRight},...
  518. 'OutputActions', {});
  519. % AFTER CHOICE
  520. % LEFT
  521. sma = AddState(sma, 'Name', 'WaitForOdorLeft', ...
  522. 'Timer', 0,...
  523. 'StateChangeConditions', {'GlobalTimer1_End',SideOdorStateLeft,'Condition7',SideOdorStateLeft},...
  524. 'OutputActions', {});
  525. sma = AddState(sma, 'Name', 'OdorALeft', ...
  526. 'Timer', S.GUI.OdorTime,...
  527. 'StateChangeConditions', {'Tup','RewardDelayLeft'},...
  528. 'OutputActions', [{DIOmodule,5}, RunOdor(LeftSideOdor,1)]);
  529. sma = AddState(sma, 'Name', 'OdorBLeft', ...
  530. 'Timer', S.GUI.OdorTime,...
  531. 'StateChangeConditions', {'Tup','RewardDelayLeft'},...
  532. 'OutputActions', [{DIOmodule,5}, RunOdor(LeftSideOdor,1)]);
  533. sma = AddState(sma, 'Name', 'OdorCLeft', ...
  534. 'Timer', S.GUI.OdorTime,...
  535. 'StateChangeConditions', {'Tup','RewardDelayLeft'},...
  536. 'OutputActions', [{DIOmodule,5}, RunOdor(LeftSideOdor,1)]);
  537. sma = AddState(sma, 'Name', 'OdorDLeft', ...
  538. 'Timer', S.GUI.OdorTime,...
  539. 'StateChangeConditions', {'Tup','RewardDelayLeft'},...
  540. 'OutputActions', [{DIOmodule,5}, RunOdor(LeftSideOdor,1)]);
  541. sma = AddState(sma, 'Name', 'OdorWaterLeft', ...
  542. 'Timer', S.GUI.OdorTime,...
  543. 'StateChangeConditions', {'Tup','RewardDelayWaterLeft'},...
  544. 'OutputActions', {DIOmodule,5});
  545. sma = AddState(sma, 'Name', 'RewardDelayWaterLeft', ...
  546. 'Timer', DelayTime,...
  547. 'StateChangeConditions', {'Tup','LeftWarning'},...
  548. 'OutputActions', {DIOmodule,6});
  549. sma = AddState(sma, 'Name', 'RewardDelayLeft', ...
  550. 'Timer', DelayTime,...
  551. 'StateChangeConditions', {'Tup','LeftWarning'},...
  552. 'OutputActions', [{DIOmodule,6}, RunOdor(LeftSideOdor,1)]);
  553. % LEFT REWARD
  554. sma = AddState(sma, 'Name', 'LeftWarning', ...
  555. 'Timer', WarningTime,...
  556. 'StateChangeConditions', {'Tup','LeftPortCheck'},...
  557. 'OutputActions', [{'PWM1',50},ToneCmd]);
  558. sma = AddState(sma, 'Name', 'LeftPortCheck',...
  559. 'Timer',0,...
  560. 'StateChangeConditions',{'Condition4','LeftNotPresent','Condition1',OutcomeStateLeft},...
  561. 'OutputActions',{});
  562. sma = AddState(sma, 'Name', 'LeftBigReward', ...
  563. 'Timer', 0,...
  564. 'StateChangeConditions', {'Tup','OutcomeDelivery','Condition4','LeftNotPresent'},...
  565. 'OutputActions', {'GlobalTimerTrig', 3}); %, 'GlobalTimerTrig', 3
  566. sma = AddState(sma, 'Name', 'LeftSmallReward', ...
  567. 'Timer', 0,...
  568. 'StateChangeConditions', {'Tup','OutcomeDelivery','Condition4','LeftNotPresent'},...
  569. 'OutputActions', {'GlobalTimerTrig', 3}); %, 'GlobalTimerTrig', 3
  570. sma = AddState(sma, 'Name', 'LeftNotPresent', ...
  571. 'Timer', 0,...
  572. 'StateChangeConditions', {'Tup','OutcomeDelivery'},...
  573. 'OutputActions', {'GlobalTimerTrig', 2});
  574. % CHOOSE RIGHT
  575. sma = AddState(sma, 'Name', 'WaitForOdorRight', ...
  576. 'Timer', 0,...
  577. 'StateChangeConditions', {'GlobalTimer1_End',SideOdorStateRight,'Condition7',SideOdorStateRight},...
  578. 'OutputActions', {});
  579. sma = AddState(sma, 'Name', 'OdorARight', ...
  580. 'Timer', S.GUI.OdorTime,...
  581. 'StateChangeConditions', {'Tup','RewardDelayRight'},...
  582. 'OutputActions', [{DIOmodule,5}, RunOdor(RightSideOdor,2)]);
  583. sma = AddState(sma, 'Name', 'OdorBRight', ...
  584. 'Timer', S.GUI.OdorTime,...
  585. 'StateChangeConditions', {'Tup','RewardDelayRight'},...
  586. 'OutputActions', [{DIOmodule,5}, RunOdor(RightSideOdor,2)]);
  587. sma = AddState(sma, 'Name', 'OdorCRight', ...
  588. 'Timer', S.GUI.OdorTime,...
  589. 'StateChangeConditions', {'Tup','RewardDelayRight'},...
  590. 'OutputActions', [{DIOmodule,5}, RunOdor(RightSideOdor,2)]);
  591. sma = AddState(sma, 'Name', 'OdorDRight', ...
  592. 'Timer', S.GUI.OdorTime,...
  593. 'StateChangeConditions', {'Tup','RewardDelayRight'},...
  594. 'OutputActions', [{DIOmodule,5}, RunOdor(RightSideOdor,2)]);
  595. sma = AddState(sma, 'Name', 'OdorWaterRight', ...
  596. 'Timer', S.GUI.OdorTime,...
  597. 'StateChangeConditions', {'Tup','RewardDelayWaterRight'},...
  598. 'OutputActions', {DIOmodule,5});
  599. sma = AddState(sma, 'Name', 'RewardDelayWaterRight', ...
  600. 'Timer', DelayTime,...
  601. 'StateChangeConditions', {'Tup','RightWarning'},...
  602. 'OutputActions', {DIOmodule,6});
  603. sma = AddState(sma, 'Name', 'RewardDelayRight', ...
  604. 'Timer', DelayTime,...
  605. 'StateChangeConditions', {'Tup','RightWarning'},...
  606. 'OutputActions', [{DIOmodule,6}, RunOdor(RightSideOdor,2)]);
  607. % RIGHT REWARD
  608. sma = AddState(sma, 'Name', 'RightWarning', ...
  609. 'Timer', WarningTime,...
  610. 'StateChangeConditions', {'Tup','RightPortCheck'},...
  611. 'OutputActions', [{'PWM3',50},ToneCmd]);
  612. sma = AddState(sma, 'Name', 'RightPortCheck',...
  613. 'Timer',0,...
  614. 'StateChangeConditions',{'Condition6','RightNotPresent','Condition3',OutcomeStateRight},...
  615. 'OutputActions',{});
  616. sma = AddState(sma, 'Name', 'RightBigReward', ...
  617. 'Timer', 0,...
  618. 'StateChangeConditions', {'Tup','OutcomeDelivery','Condition6','RightNotPresent'},...
  619. 'OutputActions', {'GlobalTimerTrig', 4}); %, 'GlobalTimerTrig', 4
  620. sma = AddState(sma, 'Name', 'RightSmallReward', ...
  621. 'Timer', 0,...
  622. 'StateChangeConditions', {'Tup','OutcomeDelivery','Condition6','RightNotPresent'},...
  623. 'OutputActions', {'GlobalTimerTrig', 4}); %, 'GlobalTimerTrig', 4
  624. sma = AddState(sma, 'Name', 'RightNotPresent', ...
  625. 'Timer', 0,...
  626. 'StateChangeConditions', {'Tup','OutcomeDelivery'},...
  627. 'OutputActions', {'GlobalTimerTrig', 2});
  628. % Waits for max drops time
  629. sma = AddState(sma, 'Name','OutcomeDelivery','Timer',0,...
  630. 'StateChangeConditions',{'GlobalCounter2_End','EndTrial'},...
  631. 'OutputActions',{});
  632. % if no choice during response
  633. sma = AddState(sma, 'Name', 'NoChoice', ...
  634. 'Timer', 0,...
  635. 'StateChangeConditions', {'GlobalTimer1_End', 'TimeoutOdor', 'Condition7', 'TimeoutOdor'},...
  636. 'OutputActions', {});
  637. % For incorrect choices (left/right on forced trials)
  638. sma = AddState(sma, 'Name', 'Incorrect', ...
  639. 'Timer', 0,...
  640. 'StateChangeConditions', {'GlobalTimer1_End','TimeoutOdor','Condition7', 'TimeoutOdor'},...
  641. 'OutputActions', {});
  642. sma = AddState(sma, 'Name', 'TimeoutOdor', ...
  643. 'Timer', S.GUI.OdorTime,...
  644. 'StateChangeConditions', {'Tup','TimeoutRewardDelay'},...
  645. 'OutputActions', {});
  646. sma = AddState(sma, 'Name', 'TimeoutRewardDelay', ...
  647. 'Timer', S.GUI.RewardDelay,...
  648. 'StateChangeConditions', {'Tup','TimeoutPortCheck'},...
  649. 'OutputActions', {});
  650. sma = AddState(sma, 'Name', 'TimeoutPortCheck', ...
  651. 'Timer', 0,...
  652. 'StateChangeConditions', {'Tup','TimeoutOutcome'},...
  653. 'OutputActions', {});
  654. sma = AddState(sma, 'Name', 'TimeoutOutcome', ...
  655. 'Timer', 0,...
  656. 'StateChangeConditions', {'GlobalCounter2_End','EndTrial'},...
  657. 'OutputActions', {'GlobalTimerTrig', 2});
  658. sma = AddState(sma, 'Name', 'EndTrial', ...
  659. 'Timer', 1,...
  660. 'StateChangeConditions', {'Tup', '>exit'},...
  661. 'OutputActions', {'GlobalTimerCancel',2});
  662. end
  663. %% TRIAL TYPES
  664. function S = UpdateTrialTypes(i,S)
  665. % Insert a repeat of trial i-1 at position i, shifting everything else forward.
  666. % Called when a mouse enters a side port before odor delivery, to re-present
  667. % the current trial type before advancing.
  668. TrialTypes = S.TrialTypes;
  669. S.TrialTypes = [TrialTypes(1:i-1); TrialTypes(i-1); TrialTypes(i:end-1)];
  670. S.RewardTypes = [S.RewardTypes(1:i-1,:); S.RewardTypes(i-1,:); S.RewardTypes(i:end-1,:)];
  671. S.RandOdorTypes = [S.RandOdorTypes(1:i-1); S.RandOdorTypes(i-1); S.RandOdorTypes(i:end-1)];
  672. end
  673. function S = SetTrialTypes(S,currentTrial)
  674. % Build S.TrialTypes array from currentTrial to SessionTrials.
  675. % Trial types (1=Small, 2=Info, 3=Rand, 4=Big) are shuffled in blocks of blockSize
  676. % according to the percentages set by S.GUI.TrialTypes.
  677. global BpodSystem;
  678. %% Define trial choice types
  679. maxTrials = S.GUI.SessionTrials;
  680. typesAvailable = S.GUI.TrialTypes;
  681. blockSize = 12;
  682. blockToShuffle = zeros(blockSize,1);
  683. typeBlockSize = 8;
  684. bigPercent = 0; smallPercent = 0; infoPercent = 0; randPercent = 0;
  685. switch typesAvailable
  686. case 1
  687. smallPercent = 1; bigPercent = 0; infoPercent = 0; randPercent = 0;
  688. blockToShuffle = [1 1 1 1 1 1 1 1 1 1 1 1];
  689. case 2
  690. smallPercent = 0; bigPercent = 0; infoPercent = 1; randPercent = 0;
  691. blockToShuffle = [2 2 2 2 2 2 2 2 2 2 2 2];
  692. case 3
  693. smallPercent = 0; bigPercent = 0; infoPercent = 0; randPercent = 1;
  694. blockToShuffle = [3 3 3 3 3 3 3 3 3 3 3 3];
  695. case 4
  696. smallPercent = 0; bigPercent = 1; infoPercent = 0; randPercent = 0;
  697. blockToShuffle = [4 4 4 4 4 4 4 4 4 4 4 4];
  698. case 5
  699. smallPercent = 0.25; bigPercent = 0.25; infoPercent = 0.25; randPercent = 0.25;
  700. blockToShuffle = [1 1 1 2 2 2 3 3 3 4 4 4];
  701. case 6
  702. smallPercent = 0.5; bigPercent = 0.5; infoPercent = 0; randPercent = 0;
  703. blockToShuffle = [1 1 1 1 1 1 4 4 4 4 4 4];
  704. case 7
  705. smallPercent = 0.5; bigPercent = 0; infoPercent = 0.5; randPercent = 0;
  706. blockToShuffle = [1 1 1 1 1 1 2 2 2 2 2 2];
  707. case 8
  708. smallPercent = 0; bigPercent = 0.5; infoPercent = 0; randPercent = 0.5;
  709. blockToShuffle = [4 4 4 4 4 4 3 3 3 3 3 3];
  710. end
  711. blocks = ceil(maxTrials/blockSize);
  712. TrialTypes = zeros(blocks*blockSize,1);
  713. block=blockToShuffle;
  714. for n = 1:blocks
  715. for m = 1:blockSize
  716. i = randi(blockSize);
  717. temp = block(m);
  718. block(m) = block(i);
  719. block(i) = temp;
  720. end
  721. if n == 1
  722. TrialTypes(1:blockSize) = block;
  723. else
  724. TrialTypes((n-1)*blockSize+1:n*blockSize) = block;
  725. end
  726. end
  727. % TrialTypes = [2; 2; 3; 3; 2; 2; 3; 3; TrialTypes];
  728. TrialTypes=TrialTypes(1:maxTrials);
  729. if currentTrial==1
  730. S.TrialTypes = TrialTypes;
  731. else
  732. S.TrialTypes = [S.TrialTypes(1:currentTrial-1); TrialTypes(1:end-currentTrial+1)];
  733. TrialTypePlotInfoWater(BpodSystem.GUIHandles.TrialTypePlot,'update',currentTrial,S.TrialTypes);
  734. end
  735. end
  736. function S = SetRewardTypes(S,currentTrial)
  737. % Build S.RewardTypes (Nx2 matrix) and S.RandOdorTypes (Nx1) from currentTrial to SessionTrials.
  738. % Columns of RewardTypes: [InfoForced, RandForced] — each column holds a shuffled
  739. % list of 1s (big) and 0s (small) per block, giving the reward size for each
  740. % successive Info or Rand forced trial.
  741. maxTrials = S.GUI.SessionTrials;
  742. typeBlockSize = 8;
  743. %% SET REWARD BLOCKS
  744. infoBigCount = round(S.GUI.InfoRewardProb*typeBlockSize);
  745. randBigCount = round(S.GUI.RandRewardProb*typeBlockSize);
  746. infoBlockShuffle = zeros(typeBlockSize,1);
  747. randBlockShuffle = zeros(typeBlockSize,1);
  748. randOdorBlockShuffle = zeros(typeBlockSize,1);
  749. infoBlockShuffle(1:infoBigCount) = 1;
  750. randBlockShuffle(1:randBigCount) = 1;
  751. if S.GUI.RandRewardProb == 0 | S.GUI.RandRewardProb == 1
  752. randOdorBigCount = ceil(typeBlockSize/2);
  753. else
  754. randOdorBigCount = randBigCount;
  755. end
  756. randOdorBlockShuffle(1:randOdorBigCount) = 1;
  757. typeBlockCount = ceil(maxTrials/typeBlockSize);
  758. RewardTypes = zeros(typeBlockCount*typeBlockSize,2);
  759. RandOdorTypes = zeros(typeBlockCount*typeBlockSize,1);
  760. infoBlock = infoBlockShuffle;
  761. randBlock = randBlockShuffle;
  762. randOdorBlock = randOdorBlockShuffle;
  763. % info forced
  764. for n = 1:typeBlockCount
  765. for m = 1:typeBlockSize
  766. i = randi(typeBlockSize);
  767. temp = infoBlock(m);
  768. infoBlock(m) = infoBlock(i);
  769. infoBlock(i) = temp;
  770. end
  771. if n == 1
  772. RewardTypes(1:typeBlockSize,1) = infoBlock';
  773. else
  774. RewardTypes((n-1)*typeBlockSize+1:n*typeBlockSize,1) = infoBlock';
  775. end
  776. end
  777. % rand forced
  778. for n = 1:typeBlockCount
  779. for m = 1:typeBlockSize
  780. i = randi(typeBlockSize);
  781. temp = randBlock(m);
  782. randBlock(m) = randBlock(i);
  783. randBlock(i) = temp;
  784. end
  785. if n == 1
  786. RewardTypes(1:typeBlockSize,2) = randBlock';
  787. else
  788. RewardTypes((n-1)*typeBlockSize+1:n*typeBlockSize,2) = randBlock';
  789. end
  790. end
  791. % rand odors
  792. for n = 1:typeBlockCount
  793. for m = 1:typeBlockSize
  794. i = randi(typeBlockSize);
  795. temp = randOdorBlock(m);
  796. randOdorBlock(m) = randOdorBlock(i);
  797. randOdorBlock(i) = temp;
  798. end
  799. if n == 1
  800. RandOdorTypes(1:typeBlockSize) = randOdorBlock';
  801. else
  802. RandOdorTypes((n-1)*typeBlockSize+1:n*typeBlockSize) = randOdorBlock';
  803. end
  804. end
  805. % Trial types (rewards) to pull from
  806. RewardTypes = RewardTypes(1:maxTrials,:);
  807. % Rand Odors to pull from
  808. % RandOdorTypes = repmat(RandOdorTypes,1,4);
  809. RandOdorTypes = RandOdorTypes(1:maxTrials);
  810. if currentTrial == 1
  811. S.RandOdorTypes = RandOdorTypes;
  812. S.RewardTypes = RewardTypes;
  813. else
  814. S.RandOdorTypes = [S.RandOdorTypes(1:currentTrial); RandOdorTypes(1:end-currentTrial)];
  815. S.RewardTypes = [S.RewardTypes(1:currentTrial,:); RewardTypes(1:end-currentTrial,:)];
  816. end
  817. end
  818. %% ODOR CONTROL
  819. function OdorOutputActions = RunOdor(odorID,port)
  820. % Return the {module, valve} output action pairs needed to route odorID through port.
  821. % port: 0=center, 1=left, 2=right
  822. % odorID: 0-3 maps to physical valve positions on ValveModule2/3
  823. switch port
  824. case 0
  825. cmd1 = {'ValveModule1',1}; % center control
  826. switch odorID
  827. case 0
  828. cmd2 = {'ValveModule2',1};
  829. cmd3 = {'ValveModule3',1};
  830. case 1
  831. cmd2 = {'ValveModule2',2};
  832. cmd3 = {'ValveModule3',2};
  833. case 2
  834. cmd2 = {'ValveModule2',3};
  835. cmd3 = {'ValveModule3',3};
  836. case 3
  837. cmd2 = {'ValveModule2',4};
  838. cmd3 = {'ValveModule3',4};
  839. end
  840. case 1 % LEFT
  841. cmd1 = {'ValveModule1',2}; % left control
  842. switch odorID
  843. case 0
  844. cmd2 = {'ValveModule2',5};
  845. cmd3 = {'ValveModule3',5};
  846. case 1
  847. cmd2 = {'ValveModule2',6};
  848. cmd3 = {'ValveModule3',6};
  849. case 2
  850. cmd2 = {'ValveModule2',7};
  851. cmd3 = {'ValveModule3',7};
  852. case 3
  853. cmd2 = {'ValveModule2',8};
  854. cmd3 = {'ValveModule3',8};
  855. end
  856. case 2 % RIGHT
  857. cmd1 = {'ValveModule1',3}; % right control
  858. switch odorID
  859. case 0
  860. cmd2 = {'ValveModule2',5};
  861. cmd3 = {'ValveModule3',5};
  862. case 1
  863. cmd2 = {'ValveModule2',6};
  864. cmd3 = {'ValveModule3',6};
  865. case 2
  866. cmd2 = {'ValveModule2',7};
  867. cmd3 = {'ValveModule3',7};
  868. case 3
  869. cmd2 = {'ValveModule2',8};
  870. cmd3 = {'ValveModule3',8};
  871. end
  872. end
  873. OdorOutputActions = [cmd1,cmd2,cmd3];
  874. end
  875. function TurnOffAllOdors()
  876. % Close all 8 positions on all three valve modules. Called on session end or abort.
  877. for v = 1:8
  878. ModuleWrite('ValveModule1',['C' v]);
  879. ModuleWrite('ValveModule2',['C' v]);
  880. ModuleWrite('ValveModule3',['C' v]);
  881. end
  882. end
  883. %% SET ODOR SIDES (LATCH VALVES)
  884. function SetLatchValves(S)
  885. % Configure DIOmodule connections to H-bridge powering of Lee Company latch valves to route odors to the correct ports
  886. % based on S.GUI.InfoSide (0=info→left, 1=info→right).
  887. global BpodSystem
  888. infoSide = S.GUI.InfoSide;
  889. modules = BpodSystem.Modules.Name;
  890. % latchValves = [16 15 14 11 10 9 8 7]; % evens to left!
  891. latchModule = [modules(strncmp('DIO',modules,3))];
  892. latchModule = latchModule{1};
  893. % now, latch odds to the left. for 0, 1, 2, 3
  894. latchValves = [7 8 9 10 11 14 15 16]; % evens to left! odor 0 left, odor 0 right, odor 1 left,
  895. if infoSide == 0 % SEND INFO ODORS TO LEFT (A,B)
  896. odorApin = latchValves((S.GUI.OdorA+1)*2-1);
  897. odorBpin = latchValves((S.GUI.OdorB+1)*2-1);
  898. odorCpin = latchValves((S.GUI.OdorC+1)*2);
  899. odorDpin = latchValves((S.GUI.OdorD+1)*2);
  900. else
  901. odorApin = latchValves((S.GUI.OdorA+1)*2);
  902. odorBpin = latchValves((S.GUI.OdorB+1)*2);
  903. odorCpin = latchValves((S.GUI.OdorC+1)*2-1);
  904. odorDpin = latchValves((S.GUI.OdorD+1)*2-1);
  905. end
  906. pins = [odorApin odorBpin odorCpin odorDpin];
  907. for i = 1:4
  908. ModuleWrite(latchModule,[pins(i) 1]);
  909. pause(100/1000);
  910. ModuleWrite(latchModule,[pins(i) 0]);
  911. pause(100/1000);
  912. end
  913. % BpodSystem.GUIHandles.EventsPlot.StateColors = getStateColors(infoSide);
  914. % EventsPlot('init', getStateColors(infoSide));
  915. end
  916. %% OUTCOME
  917. function [rewardAmount, Outcome] = UpdateOutcome(currentTrial,S,RewardLeft,RewardRight)
  918. % Determine outcome code and reward amount from the completed trial's raw events.
  919. % RewardLeft/RewardRight: reward size (big=1, small=0) pre-computed for this trial
  920. % (only meaningful for Info/Rand forced trials; Small/Big trials have a fixed size).
  921. % Outcome codes are defined in the file header.
  922. % Updates BpodSystem.Data.TrialCounts and .PlotOutcomes in place.
  923. global BpodSystem
  924. % BpodSystem.Data.RawEvents(currentTrial)
  925. TrialData = BpodSystem.Data.RawEvents.Trial{currentTrial};
  926. TrialCounts = BpodSystem.Data.TrialCounts;
  927. PlotOutcomes = BpodSystem.Data.PlotOutcomes;
  928. trialType = S.TrialTypes(currentTrial);
  929. infoSide = S.GUI.InfoSide;
  930. bigSide = S.GUI.BigSide;
  931. infoBigReward = S.GUI.InfoBigDrops*4;
  932. infoSmallReward = S.GUI.InfoSmallDrops*4;
  933. randBigReward = S.GUI.RandBigDrops*4;
  934. randSmallReward = S.GUI.RandSmallDrops*4;
  935. bigReward = S.GUI.BigDrops*4;
  936. smallReward = S.GUI.SmallDrops*4;
  937. rewardAmount = 0;
  938. x = currentTrial;
  939. newTrialCounts = TrialCounts;
  940. newPlotOutcomes = PlotOutcomes;
  941. % Plot outcomes: 2 = no choice, incorrect, info correct, rand correct,
  942. % not present
  943. % change to no choice, incorrect, info correct big info correct small
  944. % rand correct big/ not present info big not present info small
  945. switch trialType
  946. case 1
  947. if bigSide == 0
  948. if ~isnan(TrialData.States.NoChoice(1))
  949. newPlotOutcomes(x) = 14;
  950. Outcome = 1; % small no choice
  951. elseif ~isnan(TrialData.States.WaitForOdorRight(1))
  952. newTrialCounts(1) = TrialCounts(1) + 1; % small
  953. if ~isnan(TrialData.States.RightSmallReward(1))
  954. Outcome = 2; % small correct
  955. rewardAmount = smallReward;
  956. newPlotOutcomes(x) = 10;
  957. else
  958. newPlotOutcomes(x) = 12;
  959. Outcome = 3; % small NP
  960. end
  961. else
  962. Outcome = 4; % small incorrect
  963. newPlotOutcomes(x) = 13;
  964. end
  965. else
  966. if ~isnan(TrialData.States.NoChoice(1))
  967. newPlotOutcomes(x) = 14;
  968. Outcome = 1; % small no choice
  969. elseif ~isnan(TrialData.States.WaitForOdorLeft(1))
  970. newTrialCounts(1) = TrialCounts(1) + 1; % small
  971. if ~isnan(TrialData.States.LeftSmallReward(1))
  972. Outcome = 2; % small correct
  973. rewardAmount = smallReward;
  974. newPlotOutcomes(x) = 10;
  975. else
  976. newPlotOutcomes(x) = 12;
  977. Outcome = 3; % small NP
  978. end
  979. else
  980. Outcome = 4; % small incorrect
  981. newPlotOutcomes(x) = 13;
  982. end
  983. end
  984. case 2 % INFO
  985. if ~isnan(TrialData.States.NoChoice(1))
  986. newPlotOutcomes(x) = 14;
  987. Outcome = 5; % info no choice
  988. elseif infoSide==0 & ~isnan(TrialData.States.WaitForOdorLeft(1))
  989. newTrialCounts(2) = TrialCounts(2) + 1; % infoforced
  990. if RewardLeft == 1
  991. if ~isnan(TrialData.States.LeftBigReward(1))
  992. Outcome = 6; % info big
  993. rewardAmount = infoBigReward;
  994. newPlotOutcomes(x) = 1;
  995. else
  996. newPlotOutcomes(x) = 5;
  997. Outcome = 7; % info big NP
  998. end
  999. else
  1000. if ~isnan(TrialData.States.LeftSmallReward(1))
  1001. Outcome = 8; % info small
  1002. rewardAmount = infoSmallReward;
  1003. newPlotOutcomes(x) = 2;
  1004. else
  1005. newPlotOutcomes(x) = 6;
  1006. Outcome = 9; % info small NP
  1007. end
  1008. end
  1009. elseif infoSide==1 & ~isnan(TrialData.States.WaitForOdorRight(1))
  1010. newTrialCounts(2) = TrialCounts(2) + 1; % infoforced
  1011. if RewardRight == 1
  1012. if ~isnan(TrialData.States.RightBigReward(1))
  1013. Outcome = 6; % info big
  1014. rewardAmount = infoBigReward;
  1015. newPlotOutcomes(x) = 1;
  1016. else
  1017. newPlotOutcomes(x) = 5;
  1018. Outcome = 7; % info big NP
  1019. end
  1020. else
  1021. if ~isnan(TrialData.States.RightSmallReward(1))
  1022. Outcome = 8; % info small
  1023. rewardAmount = infoSmallReward;
  1024. newPlotOutcomes(x) = 2;
  1025. else
  1026. newPlotOutcomes(x) = 6;
  1027. Outcome = 9; % info small NP
  1028. end
  1029. end
  1030. else
  1031. newTrialCounts(2) = TrialCounts(2) + 1; % infoforced
  1032. newPlotOutcomes(x) = 13;
  1033. Outcome = 10; % info incorrect
  1034. end
  1035. case 3 %NO INFO
  1036. if ~isnan(TrialData.States.NoChoice(1))
  1037. newPlotOutcomes(x) = 14;
  1038. Outcome = 11; % rand no choice
  1039. elseif infoSide==0 & ~isnan(TrialData.States.WaitForOdorRight(1))
  1040. newTrialCounts(3) = TrialCounts(3) + 1; % randforced
  1041. if RewardRight == 1
  1042. if ~isnan(TrialData.States.RightBigReward(1))
  1043. Outcome = 12; % rand big
  1044. rewardAmount = randBigReward;
  1045. newPlotOutcomes(x) = 3;
  1046. else
  1047. newPlotOutcomes(x) = 7;
  1048. Outcome = 13; % rand big NP
  1049. end
  1050. else
  1051. if ~isnan(TrialData.States.RightSmallReward(1))
  1052. Outcome = 14; % rand small
  1053. rewardAmount = randSmallReward;
  1054. newPlotOutcomes(x) = 4;
  1055. else
  1056. newPlotOutcomes(x) = 8;
  1057. Outcome = 15; % rand small NP
  1058. end
  1059. end
  1060. elseif infoSide==1 & ~isnan(TrialData.States.WaitForOdorLeft(1))
  1061. newTrialCounts(3) = TrialCounts(3) + 1; % randforced
  1062. if RewardLeft == 1
  1063. if ~isnan(TrialData.States.LeftBigReward(1))
  1064. Outcome = 12; % rand big
  1065. rewardAmount = randBigReward;
  1066. newPlotOutcomes(x) = 3;
  1067. else
  1068. newPlotOutcomes(x) = 7;
  1069. Outcome = 13; % rand big NP
  1070. end
  1071. else
  1072. if ~isnan(TrialData.States.LeftSmallReward(1))
  1073. Outcome = 14; % rand small
  1074. rewardAmount = randSmallReward;
  1075. newPlotOutcomes(x) = 4;
  1076. else
  1077. newPlotOutcomes(x) = 8;
  1078. Outcome = 15; % rand small NP
  1079. end
  1080. end
  1081. else
  1082. newTrialCounts(3) = TrialCounts(3) + 1; % rand forced
  1083. newPlotOutcomes(x) = 13;
  1084. Outcome = 16; % rand incorrect
  1085. end
  1086. case 4 % BIG WATER
  1087. if bigSide == 0
  1088. if ~isnan(TrialData.States.NoChoice(1))
  1089. newPlotOutcomes(x) = 14;
  1090. Outcome = 17; % big no choice
  1091. elseif ~isnan(TrialData.States.WaitForOdorLeft(1))
  1092. newTrialCounts(4) = TrialCounts(4) + 1; % big
  1093. if ~isnan(TrialData.States.LeftBigReward(1))
  1094. Outcome = 18; % big correct
  1095. rewardAmount = bigReward;
  1096. newPlotOutcomes(x) = 9;
  1097. else
  1098. newPlotOutcomes(x) = 11;
  1099. Outcome = 19; % big NP
  1100. end
  1101. else
  1102. Outcome = 20; % big incorrect
  1103. newPlotOutcomes(x) = 13;
  1104. end
  1105. else
  1106. if ~isnan(TrialData.States.NoChoice(1))
  1107. newPlotOutcomes(x) = 14;
  1108. Outcome = 17; % big no choice
  1109. elseif ~isnan(TrialData.States.WaitForOdorRight(1))
  1110. newTrialCounts(4) = TrialCounts(4) + 1; % big
  1111. if ~isnan(TrialData.States.RightBigReward(1))
  1112. Outcome = 18; % big correct
  1113. rewardAmount = bigReward;
  1114. newPlotOutcomes(x) = 9;
  1115. else
  1116. newPlotOutcomes(x) = 11;
  1117. Outcome = 19; % big NP
  1118. end
  1119. else
  1120. Outcome = 20; % big incorrect
  1121. newPlotOutcomes(x) = 13;
  1122. end
  1123. end
  1124. end
  1125. BpodSystem.Data.TrialCounts = newTrialCounts;
  1126. BpodSystem.Data.PlotOutcomes = newPlotOutcomes;
  1127. end

InfoseekWaterVal.m at commit 1f3cffd, no license · at the source

Overview

  1. Department of Neuroscience, Columbia University, New York, NY USA
  2. Zuckerman Mind Brain and Behavior Institute, Columbia University, New York, NY USA
  3. Department of Neurobiology, Harvard Medical School, Boston, MA USA
  4. Kempner Institute, Harvard University, Cambridge, MA USA
  5. Solomon H. Snyder Department of Neuroscience, Johns Hopkins University, Baltimore, MD USA
  6. Kavli Institute for Brain Science, Columbia University, New York, NY USA
Institutions: Mortimer B. Zuckerman Mind Brain Behavior Institute (United States); Columbia University (United States); Harvard University (United States); Johns Hopkins University (United States)
Journal: Nature neuroscience, volume 29, issue 9, pages 2261-2272
Dates: received 4 November 2024; accepted 12 June 2026; published online 30 July 2026; in print 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41593-026-02377-y · PMID 42533133 · PMCID PMC13533842 · OpenAlex W7171881172
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: mouse (organism), systems (subfield)
Methods: Connectivity, Statistics, Smoothing, state filtering, decompositions, Machine learning, Preprocessing, fMRI & imaging, Single-unit activity, calcium imaging
Keywords: Motivation, Reward, Olfactory cortex
MeSH: Neurons*, Prefrontal Cortex*, Reward*, Animals, Male, Mice, Mice, Inbred C57BL, Odorants (* major topic)
Topic: Neural dynamics and brain function (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: U.S. Department of Health & Human Services | National Institutes of Health (R01MH116937, MH106435, RF1 DA056403, R01MH110594); NIDA NIH HHS (RF1 DA056403); Gatsby Charitable Foundation; Simons Foundation; National Science Foundation (2427124); James S. McDonnell Foundation (220020466); McKnight Foundation; NIMH NIH HHS (R01 MH110594, P50 MH106435, R01 MH116937); U.S. Department of Health & Human Services | National Institutes of Health (NIH) (R01MH110594, MH106435, R01MH116937, RF1 DA056403)
Citations: cited by 1 paper (Europe PMC); 91 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 21 matches between paragraphs and lines of code.

Zenodo 20477351

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

Zenodo 20479276

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

Zenodo 20480778

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

jjbussell/Bussell2026InfoValue

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 1f3cffda257c23ff315d6a410072af60994392bd, 19 August 2026
Languages: MATLAB (70), C++ (1), C/C++ (1), Python (1), Shell (1)
Size: 90 files, 74 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, 1 notebook
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
75 files

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/s41593-026-02377-y.

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:

  • 4 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 74 scripts, each with its path and the digest of its content;
  • 21 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 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:

Read it in the paper: doi.org/10.1038/s41593-026-02377-y.

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 2, 28 September 2026

  • Publisher: n/a → Nature Portfolio

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 3 keywords, 8 MeSH terms, 9 funders, 80 references.

Cite

This paper

Bussell, J. J., Badman, R. P., Márton, D., Bromberg-Martin, E. S., Abbott, L. F., Rajan, K., & Axel, R. (2026). Representations of the intrinsic value of information in mouse orbitofrontal cortex. Nature neuroscience, 29(9), 2261-2272. https://doi.org/10.1038/s41593-026-02377-y

BibTeX

@article{bussell2026representations,
author = {Bussell, Jennifer J and Badman, Ryan P and Márton, David and Bromberg-Martin, Ethan S and Abbott, L F and Rajan, Kanaka and Axel, Richard},
title = {{Representations of the intrinsic value of information in mouse orbitofrontal cortex}},
journal = {Nature neuroscience},
year = {2026},
month = jul,
volume = {29},
number = {9},
pages = {2261--2272},
publisher = {Nature Portfolio},
issn = {1097-6256},
doi = {10.1038/s41593-026-02377-y},
url = {https://doi.org/10.1038/s41593-026-02377-y},
pmid = {42533133},
pmcid = {PMC13533842}
}

RIS

TY - JOUR
AU - Bussell, Jennifer J
AU - Badman, Ryan P
AU - Márton, David
AU - Bromberg-Martin, Ethan S
AU - Abbott, L F
AU - Rajan, Kanaka
AU - Axel, Richard
TI - Representations of the intrinsic value of information in mouse orbitofrontal cortex
T2 - Nature neuroscience
J2 - Nat Neurosci
PY - 2026
DA - 2026/07/30
VL - 29
IS - 9
SP - 2261
EP - 2272
SN - 1097-6256
PB - Nature Portfolio
DO - 10.1038/s41593-026-02377-y
UR - https://doi.org/10.1038/s41593-026-02377-y
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41593-026-02377-y",
"type": "article-journal",
"title": "Representations of the intrinsic value of information in mouse orbitofrontal cortex",
"container-title": "Nature neuroscience",
"author": [
{
"family": "Bussell",
"given": "Jennifer J"
},
{
"family": "Badman",
"given": "Ryan P"
},
{
"family": "Márton",
"given": "David"
},
{
"family": "Bromberg-Martin",
"given": "Ethan S"
},
{
"family": "Abbott",
"given": "L F"
},
{
"family": "Rajan",
"given": "Kanaka"
},
{
"family": "Axel",
"given": "Richard"
}
],
"container-title-short": "Nat Neurosci",
"volume": "29",
"issue": "9",
"page": "2261-2272",
"DOI": "10.1038/s41593-026-02377-y",
"PMID": "42533133",
"PMCID": "PMC13533842",
"ISSN": "1097-6256",
"publisher": "Nature Portfolio",
"URL": "https://doi.org/10.1038/s41593-026-02377-y",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
30
]
]
}
}

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.21203/rs.3.rs-10419673/v1 [code]
Rapid value learning reveals generalized and context-dependent codes in frontal cortex
Journal: Research Square (preprint)
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, 5 references
[2] doi:10.1038/s41593-026-02342-9 [code]
Interpretable abstractions of artificial neural networks predict behavior and neural activity during human information gathering.
Journal: Nature neuroscience
In common: 5 references
[3] doi:10.1016/j.isci.2026.115897 [code]
Experience and behavior modulate piriform cortex odor representation in freely moving mice.
Journal: iScience
In common: Statistics and Machine Learning Toolbox, systems, mouse, 4 references
[4] doi:10.1038/s41467-026-73263-1 [code]
Distributed neural codes of the 3D position in the marmoset frontal cortex and hippocampus.
Journal: Nature communications
In common: Violinplot-Matlab, Image Processing Toolbox, Statistics and Machine Learning Toolbox, systems, 1 reference
[5] doi:10.1016/j.celrep.2026.117852 [code]
Graph theory identifies altered prefrontal microcircuit organization in Shank3 mice, a mouse Model of autism.
Journal: Cell reports
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, mouse, 3 references
[6] doi:10.1038/s41592-026-03154-2 [code]
Simultaneous single-cell calcium imaging of neuronal population activity and brain-wide BOLD fMRI.
Journal: Nature methods
In common: Violinplot-Matlab, Image Processing Toolbox, Statistics and Machine Learning Toolbox, mouse, 1 reference
[7] doi:10.1371/journal.pbio.3003824 [code]
Flexible goal learning involves coordinated population activity in dCA1 and medial orbitofrontal cortex.
Journal: PLoS biology
In common: systems, 4 references
[8] doi:10.1038/s41593-026-02231-1 [code]
The prefrontal cortex controls memory organization in the hippocampus.
Journal: Nature neuroscience
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, systems, mouse, 2 references
[9] doi:10.1038/s41467-026-76581-6 [code]
Thalamocortical bursts encode reward contingencies and drive associative learning.
Journal: Nature communications
In common: Violinplot-Matlab, Image Processing Toolbox, Statistics and Machine Learning Toolbox, systems, mouse
[10] doi:10.7554/elife.104684 [code]
Regime shift detection and neurocomputational substrates for under and overreactions to change.
Journal: eLife
In common: Statistics and Machine Learning Toolbox, 3 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.