5-choice serial reaction time task species: rat, mouse
Maintainer Gary Bamberger Current version 1.0 View the changelog
Original Author Gary Bamberger Date last modified Sep-28-2011
License BSD MED-PC version 4
The 5-choice serial reaction time task is an operant procedure designed to measure attention and impulsivity. Animals are trained to respond to brief flashes of light in one of five apertures. Failure to do so during stimulus presentation or during a specified period afterwards (the limited hold period) results in a timeout; a period of darkness in which no rewards can be obtained. Responses before stimulus presentation are similarly punished.
This program assumes the inputs and outputs for the apertures are numbered from 1 to 5 from left to right.

Carli M, Robbins TW, Evenden JL, Everitt BJ. Behav Brain Res. 1983 Sep;9(3):361-80.
Effects of lesions to ascending noradrenergic neurones on performance of a 5-choice serial reaction task in rats; implications for theories of dorsal noradrenergic bundle function based on selective attention and arousal.

Robbins TW. Psychopharmacology (Berl). 2002 Oct;163(3-4):362-80. Epub 2002 Aug 9.
The 5-choice serial reaction time task: behavioural pharmacology and functional neurochemistry.

Hahn B, Shoaib M, Stolerman IP. Psychopharmacology (Berl). 2002 Jul;162(2):129-37. Epub 2002 Mar 23.
Nicotine-induced enhancement of attention in the five-choice serial reaction time task: the influence of task demands.

Code
How to use this code Download the code Download an example macro Download the profile
 
\ 5CSRT.MPC - Five Choice Serial Reaction Time Task
\
\ Ref B.j. Cole and Trevor W. Robbins, Behavior Brain Research,
\ 33(1989) 165-179 and Carli et al, 1983

\ Animals are required to respond to brief flashes of light presented randomly
\ in one of five spatial locations.  Testing begins with the onset of the House
\ Light and the Pellet or Dipper Receptacle Light.  A Head Entry issues a Free
\ Reward Presentation, initiates the Session Timer.  Following the Reward
\ Interval an ITI is activated for the first Trial.  Nose poking during the ITI
\ results in a Time Out and is recorded as a Premature Response.  Stimulus Time
\ Outs also occur following an Incorrect Response, or following an Error of
\ Omission (failure to respond within the Limited Hold Interval).
\
\ By default this procedure runs for 50 Trials or 30 minutes starting with a
\ fixed ITI Interval of 5 seconds and fixed Stimulus Presentation of 0.5 seconds.
\ Both can be randomized by adding to the LIST statements starting on Line 133
\ below.  The Time to Respond (Limited Hold) is 5 seconds while Premature
\ Responses add a 5 second Time Out before repeating the ITI.  Incorrect
\ Responses or Errors of Omission add a 5 second Time Out before starting a new
\ Trial.  Responses in Time Out reset the Time-Out Timer.


\ Nose Poke Inputs and Outputs must be connected in order from Left to Right.
\ Edit Additional Input and Output constants if necessary to match your Hardware.

\ Inputs
^HeadEntry = 6

\ Outputs
^ReceptacleLight = 6
^HouseLight      = 7
^RewardOp        = 8


\ A() = Control Variables with Assigned Aliases as Defined
Var_Alias Trials to Run                      = A(0)  \ Default = 50
Var_Alias Response (Limited Hold) Time (sec) = A(1)  \ Default = 5 seconds
Var_Alias Time Out (sec)                     = A(2)  \ Default = 5 seconds
Var_Alias Reward (1=Pellet  2=Dipper)        = A(3)  \ Default = 1-Pellet
Var_Alias Reward Duration (sec)              = A(4)  \ Default = 2 seconds
Var_Alias Session Time (min)                 = A(5)  \ Default = 30 minutes

^Trials      = 0
^LimitedHold = 1
^TimeOut     = 2
^RewardCode  = 3
^RewardDur   = 4
^Session     = 5
^Latency     = 6
^StimulusLoc = 7
^StimulusDur = 8
^ITIDur      = 9


\ List Data Variables Here
\  D() = Summary Response Data
\  D(0) = Correct Responses
\  D(1) = Incorrect Responses
\  D(2) = Omissions
\  D(3) = Premature Responses
\  D(4) = Perseverant Responses
\  D(5) = Time Out Responses
\  D(6) = Total Receptacle Head Entries
\  D(7) - D(9) = Not Used
\  D(10) = % Correct   {D(0) / B(^Trials) * 100}
\  D(11) = % Incorrect {D(1) / B(^Trials) * 100}
\  D(12) = % Omission  {D(2) / B(^Trials) * 100}

\  G() = Summary Latency Data
\  G(0) = Average Latency to Correct Response   {G(5) / D(0)}
\  G(1) = Average Latency to Incorrect Response {G(6) / D(1)}
\  G(2) = Average Latency to Reward             {G(7) / D(0)}
\  G(3) & (4) Not Used
\  G(5) = Total Latency Time to Correct Response
\  G(6) = Total Latency Time to Incorrect Response
\  G(7) = Total Latency Time to Reward

\  K() = Trial by Trial Data (22 Elements Displayed in Two Rows)
\  K(I)    = Trial Number
\  K(I+1)  = Nose Poke Stimulus Location 1 - 5
\  K(I+2)  = First Response to Stimulus (1 - 5)
\  K(I+3)  = Correct Response Latency
\  K(I+4)  = Incorrect Response Latency
\  K(I+5)  = Latency to Reward
\  K(I+6)  = Omission Error (No Response)
\  K(I+7)  = Perseverant Responses to NP #1
\  K(I+8)  = Perseverant Responses to NP #2
\  K(I+9)  = Perseverant Responses to NP #3
\  K(I+10) = Perseverant Responses to NP #4
\  K(I+11) = Perseverant Responses to NP #5
\  K(I+12) = Not Used
\  K(I+13) = Not Used
\  K(I+14) = Not Used
\  K(I+15) = Not Used
\  K(I+16) = Premature ITI Responses
\  K(I+17) = Time Out Responses
\  K(I+18) = Receptacle Head Entries (All)
\  K(I+19) = Cue Duration
\  K(I+20) = ITI Duration
\  K(I+21) = Not Used


\ List Working Variables Here
\  B() = Working Variables that Parallel the Control Variables.
\        These are Converted to MED Units or Used as Counters
\        or Elapsed Timers
\  N = List of Stimulus Location
\  P = List of Cue Duration for Stimulus Hole 1
\  Q = List of Cue Duration for Stimulus Hole 2
\  R = List of Cue Duration for Stimulus Hole 3
\  S = List of Cue Duration for Stimulus Hole 4
\  T = List of Cue Duration for Stimulus Hole 5
\  Y = 99999 if Illegal Stimulus Location Drawn from List N
\  Z = List of ITI Durations


DIM A = 5
DIM B = 9
DIM D = 12
DIM G = 7
DIM K = 5000

\ List of Stimulus Locations 1 - 5
LIST N = 1, 2, 3, 4, 5

\ List of Stimulus Cue Durations.  Note this has been repeated 5 times so that a
\ separate list is used for each Stimulus Location when multiple durations are
\ used.  Add as many values as you want.  Repeating the values would allow them
\ to potentially repeat before a different value is drawn.  To obtain a balanced
\ design, you need to have the Total Number of Trials be an even multiple of the
\ (Number of Stimuli Used) * (# of Times in the List).
LIST P = 0.5  \ Stimulus Duration Time.  Fixed at 0.5 Seconds.
LIST Q = 0.5
LIST R = 0.5
LIST S = 0.5  \ Use Change Variables or Add Additional Values
LIST T = 0.5

\ ITI Duration Lists
LIST Z = 5, 5, 5  \ Fixed at 5 Seconds.


\ Z-Pulses Used in this Program
^Stimulus  = 1   \ Z1  = Signals Stimulus Timer
^Dipper    = 2   \ Z2  = Signals Dipper Timer
^Correct   = 3   \ Z3  = Signal Correct Response
^Incorrect = 4   \ Z4  = Signal Incorrect Response
^Omission  = 5   \ Z5  = Signal Omission Error (No Response)
^Reward_NP = 6   \ Z6  = Signal Reward Control
^EndReward = 7   \ Z7  = Signal End of Reward Cycle
^End       = 32  \ Z32 = End of Session


DISKCOLUMNS = 11
DISKFORMAT  = 6.2


\***************************************************
\     Five Choice Serial Reaction Time Schedule
\  S1 - Set Default Values
\       Trials to Run                 (50)
\       Response (Limited Hold) Time  (5 seconds)
\       Time Out                      (5 seconds)
\       Reward                        (1-Pellet)
\       Reward Duration               (2 seconds)
\       Session Time                  (30 minutes)
\***************************************************
S.S.1,
S1,
  0.001": SET A(^Trials)     = 50, A(^LimitedHold) = 5, A(^TimeOut) = 5;
          SET A(^RewardCode) = 1,  A(^RewardDur)   = 2, A(^Session) = 30 ---> S2

S2,     \ Wait for START command
  #START: CLEAR 1,60;
          SET B(^LimitedHold) = A(^LimitedHold) * 1";
          SET B(^TimeOut)     = A(^TimeOut)     * 1";
          ON ^HouseLight; Z^Reward_NP ---> S3
  1": SHOW 1,Trials,A(^Trials),          2,Limited Hold,A(^LimitedHold),  3,Time Out,A(^TimeOut);
      SHOW 4,Reward Code,A(^RewardCode), 5,Reward Duration,A(^RewardDur), 6,Session,A(^Session) ---> SX

S3,     \ Wait for Completion of Free Reward Cycle
  #Z^EndReward: ---> S5

S5,     \ Trial Set Up: Draw Values for Stimulus Value (Location),
        \ Stimulus Duration, and ITI Value
  0.01": ADD B(^Trials);
         SET K(I) = B(^Trials), K(I+22) = -987.987;
         RANDD K(I+1) = N; SET B(^StimulusLoc) = K(I+1);
         IF K(I+1) = 1 [@Draw1Values, @Next]
            @Draw1: RANDD K(I+19) = P, K(I+20) = Z ---> S7
            @Next: IF K(I+1) = 3 [@Draw3Values, @Next]
                      @Draw3: RANDD K(I+19) = R, K(I+20) = Z ---> S7
                      @Next: IF K(I+1) = 5 [@Draw5Values, @Next]
                                @Draw5: RANDD K(I+19) = T, K(I+20) = Z ---> S7
                                @Next: ---> S6

S6,     \ Used to Draw Stimuli 2 & 4 in 5 Choice Studies
  0.01": IF K(I+1) = 2 [@Draw2Values, @Next]
            @Draw2: RANDD K(I+19) = Q, K(I+20) = Z ---> S7
            @Next: IF K(I+1) = 4 [@Draw4Values, @Abort]
                      @Draw4: RANDD K(I+19) = S, K(I+20) = Z ---> S7
                      @Abort: SET Y = 99999 ---> STOPABORTFLUSH

S7,     \ Convert Drawn Values to MED Clock Units
  0.01": SET B(^StimulusDur) = K(I+19) * 1";
         SET B(^ITIDur)      = K(I+20) * 1" ---> S8

S8,     \ Time ITI - Record Premature Response
        \ Record Nose Pokes & Reset Timer
        \ Record Head Entries
  B(^ITIDur)#T: Z^Stimulus ---> S10  \ See S.S.3 for Stimulus Control
  #R1 ! #R2 ! #R3 ! #R4 ! #R5: OFF ^HouseLight;
                               ADD D(3), K(I+16) ---> S9
  #R^HeadEntry: ADD D(6), K(I+18) ---> SX

S9,     \ Time Out to Premature Response
        \ Record Nose Pokes & Reset Timer
        \ Record Head Entries
  B(^TimeOut)#T: ON ^HouseLight ---> S8
  #R1 ! #R2 ! #R3 ! #R4 ! #R5: ADD D(5), K(I+17) ---> S9
  #R^HeadEntry: ADD D(6), K(I+18) ---> SX

S10,    \ Wait for Response or End of Limited Hold
  #RK(I+1): SET K(I+2) = K(I+1);
            Z^Reward_NP; Z^Correct ---> S12
  #R1: SET K(I+2) = 1; OFF ^HouseLight; Z^Incorrect ---> S11
  #R2: SET K(I+2) = 2; OFF ^HouseLight; Z^Incorrect ---> S11
  #R3: SET K(I+2) = 3; OFF ^HouseLight; Z^Incorrect ---> S11
  #R4: SET K(I+2) = 4; OFF ^HouseLight; Z^Incorrect ---> S11
  #R5: SET K(I+2) = 5; OFF ^HouseLight; Z^Incorrect ---> S11
  #R^HeadEntry: ADD D(6), K(I+18) ---> SX
  B(^LimitedHold)#T: OFF ^HouseLight; Z^Omission ---> S11

S11,    \ Time Out to Incorrect or Omission Response
  B(^TimeOut)#T: ON ^HouseLight ---> S14
  #R1 ! #R2 ! #R3 ! #R4 ! #R5: ADD D(5), K(I+17) ---> S11
  #R^HeadEntry: ADD D(6), K(I+18) ---> SX

S12,    \ Wait for Head Entry Detection
        \ Record Perseverant Responses
  #R^HeadEntry: ADD D(6), K(I+18) ---> S13
  #R1: ADD D(4), K(I+7)  ---> SX
  #R2: ADD D(4), K(I+8)  ---> SX
  #R3: ADD D(4), K(I+9)  ---> SX
  #R4: ADD D(4), K(I+10) ---> SX
  #R5: ADD D(4), K(I+11) ---> SX

S13,    \ Wait for Completion of Reward Cycle
  #Z^EndReward: ---> S14

S14,    \ Test for End of Session
  0.01": IF (B(^Trials) >= A(^Trials)) OR (B(^Session)/60 >= A(^Session)) [@EndSession, @NextTrial]
            @End: OFF ^HouseLight; Z^End ---> S15
            @NextTrial: SET I = I + 22 ---> S5

S15,    \ Delay for Screen Update
  2": ---> STOPABORTFLUSH


\***************************************************
\              RESPONSE LATENCY TIMER
\***************************************************
S.S.2,
S1,
  #START: ---> S2

S2,     \ Wait for Stimulus Signal Z^Stimulus
  #Z^Stimulus: SET B(^Latency) = 0 ---> S3

S3,     \ Response Latency
        \ 1st Statement: Increment Latency w/0.01 sec. Resolution
        \ 2nd Statement: Add Correct Response, Calculate % Correct
        \                Set Trial Latency, Total Latency & Calc Ave Lat.
        \ 3rd Statement: Same as above for Incorrect Response
        \ 4th Statement: Same as above for Omission Error
  0.01": SET B(^Latency) = B(^Latency) + 0.01 ---> SX
  #Z^Correct: ADD D(0);                         \ Add Correct Response
              SET K(I+3) = B(^Latency);         \ Set Correct Latency
              SET G(5)   = G(5) + B(^Latency);  \ Set Total Correct Latency
              SET G(0)   = G(5) / D(0);         \ Calculate Average Correct Latency
              SET B(^Latency) = 0 ---> S4       \ Reset Latency Variable
  #Z^Incorrect: ADD D(1);
                SET K(I+4) = B(^Latency);
                SET G(6)   = G(6) + B(^Latency);
                SET G(1)   = G(6) / D(1) ---> S5
  #Z^Omission: ADD D(2), K(I+6) ---> S5

S4,     \ Reward Latency
  #R^HeadEntry: SET K(I+5) = B(^Latency);
                SET G(7)   = G(7) + B(^Latency);
                SET G(2)   = G(7) / D(0) ---> S5
  0.01": SET B(^Latency) = B(^Latency) + 0.01 ---> SX

S5,     \ Calculate % Correct, % Incorrect, & % Omission
  0.01": SET D(10) = D(0) / B(^Trials) * 100;
         SET D(11) = D(1) / B(^Trials) * 100;
         SET D(12) = D(2) / B(^Trials) * 100 ---> S2


\***************************************************
\              STIMULUS DURATION TIMER
\***************************************************
S.S.3,
S1,
  #Z^Stimulus: ON B(^StimulusLoc) ---> S2

S2,
  B(^StimulusDur)#T: OFF 1,2,3,4,5 ---> S1
  #Z^Correct ! #Z^Incorrect ! #Z^Omission: OFF 1,2,3,4,5 ---> S1


\***************************************************
\                  UPDATE DISPLAY
\***************************************************
S.S.5,
S1,
  #START: ---> S2

S2,
  1": SHOW 1,Trial #,B(^Trials), 2,Stimulus #,K(I+1), 3,Correct,D(0);
      SHOW 4,Incorrect,D(1),     5,Omission,D(2);
      SHOW 8,% Correct,D(10),    9,% Incorrect,D(11), 10,% Omission,D(12) ---> S3

S3,
  0.01": SHOW 13,Avg Cor Lat,G(0), 14,Avg Incor Lat,G(1), 15,Avg Rew Lat,G(2);
         SHOW 16,Premature,D(3),   17,Perseverative,D(4), 18,TO_Resp,D(5);
         SHOW 19,Head Entry,D(6) ---> S2


\***************************************************
\               REWARD CONTROL CYCLE
\***************************************************
S.S.6,
S1,
  #START: SET B(^RewardDur) = A(^RewardDur) * 1";
          IF A(^RewardCode) = 1 [@Pellet, @Next]
             @Pellet: ---> S2
             @Next: IF A(^RewardCode) = 2 [@Dipper, @Abort]
                       @Dipper: ---> S10
                       @Abort:  ---> STOPABORTFLUSH

S2,     \ Pellet Reward Control
  #Z^Reward_NP: ON ^ReceptacleLight, ^RewardOP ---> S3

S3,     \ Pulse Pellet Dispenser for 50ms
  0.05": OFF ^RewardOP ---> S4

S4,     \ Wait for Head Entry Detection
  #R^HeadEntry: ---> S5

S5,     \ Time to End of Reward Cycle (Reward Duration)
  B(^RewardDur)#T: OFF ^ReceptacleLight; Z^EndReward ---> S2

S10,    \ Dipper Reward Control
  #Z^Reward_NP: ON ^ReceptacleLight ---> S11

S11,    \ Wait for Head Entry Detection
  #R^HeadEntry: ON ^RewardOP ---> S12

S12,    \ Time to End of Reward Cycle (Reward Duration)
  B(^RewardDur)#T: OFF ^ReceptacleLight, ^RewardOP; Z^EndReward ---> S10


\***************************************************
\                   SESSION TIMER
\***************************************************
S.S.10, \ This State Set Increments the Elapsed Time
        \ Counter only.  Values are tested at the end
        \ of each Trial in S.S.1, S14 above.
S1,
  #START: SHOW 21,Session,B(^Session)/60 ---> S2

S2,     \ Wait for First Head Entry to Start Timing
  #R^HeadEntry: ---> S3

S3,
  1": ADD B(^Session); SHOW 21,Session,B(^Session)/60 ---> SX
  #Z^End: ---> S1
Related programs Other versions
No training programs submitted/required

Version 0.1