5-choice serial reaction time task species: rat, mouse
Maintainer Filip van den Bergh Current version 0.1 View the changelog
Original Author Filip van den Bergh Date last modified Jun-31-2004
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 version allows for the presentation of auditory signals during the ITI, to indicate the onset of the stimulus.
This program assumes the inputs and outputs for the apertures are numbered from 1 to 5 (^S1=^R1=1, etc). This aspect of the design could use some cleaning up.

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
 
\Z-Pulses
\1 Start session
\2 End session
\3 Start trial
\4 Correct
\5 Incorrect during stim
\6 Incorrect during limited hold
\7 Omission
\8 Premature response
\9 Perseverative response
\10 Timeout response
\11 Present tone
\12 Stimulus present
\13 Limited hold period
\14 Intertrial interval
\15 Timeout


^Houselight=7
^Reward=8
^Motion=7
^Tone=9


\Training parameters
DIM A=11
LIST Y=0.1, 0.5 \Stimduration
VAR_ALIAS ITI duration = W
VAR_ALIAS Limited hold = A(1)
VAR_ALIAS Timeout period = A(3)
VAR_ALIAS Maximum commmenced trials = A(4)
VAR_ALIAS Maximum total duration = A(5)
VAR_ALIAS Seconds after ITI to start the tone = A(7)
VAR_ALIAS Tone length = A(8)
VAR_ALIAS Number of divisions in data = A(10)


\Dependents
DIM X=13
VAR_ALIAS Correct = X(0)
VAR_ALIAS Incorrect during stimulus = X(1)
VAR_ALIAS Incorrect during limited hold = X(2)
VAR_ALIAS Omissions = X(3)
VAR_ALIAS Prematures = X(4)
VAR_ALIAS Perseveratives = X(5)
VAR_ALIAS Timeout reponses = X(6)
VAR_ALIAS Timeouts = X(7)
VAR_ALIAS Magazine reponses = X(8)
VAR_ALIAS Commenced trials = X(9)
VAR_ALIAS Completed trials = X(10)
VAR_ALIAS Activity = X(12)


\Latencies
DIM L=4
VAR_ALIAS Latency to collect reward = L(0)
VAR_ALIAS Latency to correct response = L(1)
VAR_ALIAS Latency to incorrect response = L(2)
VAR_ALIAS Timeout duration = L(3)

\System variables
LIST Z=1,2,3,4,5
VAR_ALIAS Selected stimulus = C
VAR_ALIAS Selected stimulus duration = P

\Per-trial registration
VAR_ALIAS D(0)=Trial number
VAR_ALIAS E(0)=Selected pokehole
VAR_ALIAS F(0)=Selected stimulus duration
VAR_ALIAS G(0)=Selected inter-trial interval
VAR_ALIAS H(0)=Accuracy
VAR_ALIAS I(0)=Latency
VAR_ALIAS J(0)=Premature
VAR_ALIAS K(0)=Perseverative
DIM D=500
DIM E=500
DIM F=500
DIM G=500
DIM H=500
DIM I=500
DIM J=500
DIM K=500

\Peak deviation analysis of 5CT responding
DIM M=160
DIM N=160
DIM O=160
DIM T=120
DIM U=120
DIM V=120
VAR_ALIAS M(0)=Total number of responses
VAR_ALIAS N(0)=Total IRT
VAR_ALIAS O(0)=Total correct responses
VAR_ALIAS T(0)=Total number of timeout responses
VAR_ALIAS U(0)=Total timeout IRT
VAR_ALIAS V(0)=Tone length

DIM S=4
VAR_ALIAS Current duration = S(0)
VAR_ALIAS Current latency = S(1)
VAR_ALIAS Current block = S(2)
VAR_ALIAS Bincounter = S(3)
VAR_ALIAS ITI counter = S(4)

\============================================================================
S.S.1,
\Time definitions, session start, session end
S1,
	.01": 	SET Y(0)=.5;
		SET Y(1)=.1;
		SET W=10;     \ITI
		SET A(1)=5;   \limited hold
		SET A(3)=5;   \to period
		SET A(4)=100; \max #trials
		SET A(5)=60;  \max duration in minutes (See S2: *1')
		SET A(7)=0;   \Time after collection to present tone
		SET A(8)=W;   \Duration of the tone
		SET A(10)=1 ---> S2 \Data is divided in 1 block
S2,
	#START:	SET Y(0)=Y(0)*1";
		SET Y(1)=Y(1)*1";
		SET W=W*1";
		SET A(1)=A(1)*1";
		SET A(3)=A(3)*1";
                SET A(5)=A(5)*1';
		SET A(7)=A(7)*1";
		SET A(8)=A(8)*1";
	        SET X(9)=1;
	        SET C=17;      \Set C to a dummy value to prevent the
                               \  'Read of address FFFFFFFF' Error.
		ON ^Houselight; ON ^Reward;
                SHOW 2, Collect first, 0;
		IF A(8)=999" [@True, @False]
			@True: SET A(8)=W-A(7)---> S3
			@False: ---> S3
S3,
	#R^Reward:OFF ^Reward; Z1; Z14 ---> S4
		
S4,
	#Z2:    SHOW 1, Session closed, S(0)/60;
		SHOW 2, %Correct, X(0)/(X(10)+.0000001);
		SHOW 3, %Omissions, X(3)/(X(9)+.0000001);
		SHOW 4, Commenced trials, X(9);
		SHOW 5, %Premature, X(4)/(X(9)+.0000001) ---> STOPABORTFLUSH
S5,
	5" ---> STOPABORTFLUSH \REDUNDANT

\============================================================================
S.S.2,
\Timer and session end (Z2) at A(5) minutes
S1,
	#Z1 ---> S2
S2,
	.01": 	SET S(0)=S(0)+.01;
		IF (S(0)*1') >= (A(5)*60) [@TrueEnd, @FalseContinue]
			@TrueEnd: Z2 ---> SX
			@FalseContinue: ---> S2

\============================================================================
S.S.3,
\Flags every (total duration/number of blocks)
S1,
	#Z1 ---> S2
S2,
	(A(5)/(A(10)+.0000001))#T: ADD S(2);
		FLUSH ---> S2


\============================================================================
S.S.4,
\Trial counter and session end (Z2) at A(4) trials
S1,
	#Z3: 	ADD X(9);
		IF X(9) >= A(4) [@TrueEnd, @FalseContinue]
			@TrueEnd: Z2 ---> SX
			@FalseContinue: ---> S1



\============================================================================
S.S.6,
\Motion sensor
S1,
	#Z1 ---> S2
S2,
	#R^Motion: ADD X(12) ---> S2


\============================================================================
S.S.8,
\Trial

S10,
	#Z1: Z3; Z11 ---> S2
S1,
	#R^Reward: 	Z3; 
			Z14;
			Z11;
 			SET D(X(9))=X(9); 
			SET G(X(9))=W ---> S2
	#R1 ! #R2 ! #R3 ! #R4 ! #R5: Z9; 
			---> S1 \Perseverative
S2,
	#R1 ! #R2 ! #R3 ! #R4 ! #R5: Z8; \Z15; IF PUNISHED
			ADD M(0); 
			ADD M(S(3)); 
			SET N(S(3))=N(S(3))+S(3);
			SET V(S(3))=A(8);
			SET S(4)=S(4)+.01 ---> S2 \Premature S5 if punished
        0.01": 		IF S(4)>=W/1" [@TrueContinue, @FalseITI]
				@TrueContinue: SET S(4)=0;
					Z12; 
					RANDI P=Y; 
					SET F(X(9))=P ---> S3 \Stimulus presentation \Inter-trial interval
				@FalseITI: SET S(4)=S(4)+.01 ---> S2
S3, 
	P#T: 		Z13 ---> S4 \Limited hold period \Stimulus duration
	#RC:		Z4; 
			ADD O(0); 
			ADD O(S(3)); 
			ADD M(0); 
			ADD M(S(3));
			SET N(S(3))=N(S(3))+S(3) ---> S1 \Correct response
	#R1 ! #R2 ! #R3 ! #R4 ! #R5: Z5; 
			Z15; 
			ADD M(0); 
			ADD M(S(3));
			SET N(S(3))=N(S(3))+S(3) ---> S5 \Incorrect during stimulus
S4,
	A(1)#T: 	Z7; 
			Z15 ---> S5 \Omission\Limited hold
	#RC:		ADD O(0); 
			ADD O(S(3)); 
			ADD M(0); 
			ADD M(S(3));
			SET N(S(3))=N(S(3))+S(3);
			Z4 ---> S1 \Correct response
	#R1 ! #R2 ! #R3 ! #R4 ! #R5: Z6; 
			Z15;
			ADD M(0); 
			ADD M(S(3));
			SET N(S(3))=N(S(3))+S(3) ---> S5\Incorrect during limited hold
S5,
	A(3)#T: ON ^Houselight ---> S1\Timeout period
	#R1 ! #R2 ! #R3 ! #R4 ! #R5: Z10 ---> S5\Response during TO


\============================================================================
S.S.9,
\Reward if correct
S1,
	#Z4: 	ON ^Reward; OFF C ---> S2
S2,
        .5":    OFF ^Reward ---> S1

\============================================================================
S.S.10,
\Stimulus presentation
S1,
	#Z12: 	RANDI C=Z; SET E(X(9))=C;
		ON C ---> S1
	#Z13:	OFF C ---> S1

S.S.16,
\Tone presentation
S1,
	#Z11:	---> S2
S2,
	A(7)#T: IF A(8)=0 [@TrueNoTone, @FalseTone]
		@TrueNoTone: ---> S3
		@FalseTone: ON^Tone ---> S3
S3,
	A(8)#T: OFF^Tone ---> S1
\       A(8)#T ! #Z8: OFF^Tone ---> S1 IF PUNISHED


\============================================================================
S.S.11,
\TO period
S1,
	#Z15:	OFF ^Houselight;
		OFF ^Tone;
		OFF C;
                ADD X(7) ---> S1



\============================================================================
S.S.12,
\Data 
S1,
	#Z4:	ADD X(0); \Correct
		SET H(X(9))=1;
		ADD X(10);
		OFF C ---> S1
	#Z5:	ADD X(1); \Incorrect during stim
		SET H(X(9))=0;
		ADD X(10);
		OFF C ---> S1
	#Z6:	ADD X(2); \Incorrect during hold
		SET H(X(9))=-1;
		ADD X(10);
		OFF C ---> S1 \Redundant OFF
	#Z7:	ADD X(3); \Omission
		SET I(X(9))=-1;
		OFF C ---> S1 \Redundant OFF
	#Z8:	ADD X(4); 
		SET J(X(9))=1 ---> S1\Premature
	#Z9:	ADD X(5); 
		SET K(X(9))=1;
		OFF C ---> S1\Perseverative
	#Z10:	ADD X(6) ---> S1\TO response

S.S.13,
\Data 2
S1,
	#R^Reward:ADD X(8) ---> S1

\============================================================================

S.S.15
\Peak deviation: bin counter
S1,
	#Z3 ---> S2
S2,
	0.5": SET S(3)=S(3)+1 ---> S2
        #Z3: SET S(3)=16-W/1" ---> S2



\============================================================================
S.S.18
\Latencies
S1,
	#Z1 ---> S2
S2,
	#Z12 ! #Z13: SET S(1)=0 ---> S6  \Stimulus presentation and limited hold
S6,
	.01": SET S(1)=S(1)+.01 ---> S6
	#Z4: SET L(1)=L(1)+S(1); SET I(X(9))=S(1); SET S(1)=0 ---> S7\Correct
	#Z5: SET L(2)=L(2)+S(1); SET I(X(9))=S(1) ---> S2\Incorrect during stimulus
	#Z6: SET L(2)=L(2)+S(1); SET I(X(9))=S(1) ---> S2\Incorrect during limited hold \Redundant
	#Z7 ! #Z8 ! #Z9 ---> S2
S7, 
	.01": 	SET S(1)=S(1)+.01 ---> S7
	#Z3: 	SET L(0)=L(0)+S(1) ---> S2
                \New trial after nosepoke, so this is the magazine latency
		\NOTE THAT PERSEVERATIVES ARE NOT HANDLED!

S.S.19,
\Timeout duration, wouldn't fit into latency code
S1,
	#Z1 ---> S2
S2,
	#Z15 ---> S3
S3,
	.01": 	SET L(3)=L(3)+.01 ---> S3
	#Z3     ---> S2


\============================================================================
S.S.20,
\Screen write code
S1,
	#Z1 ---> S2
S2,
	.1":	SHOW 1, Minutes, S(0)/60;

		SHOW 3, Trial, X(9);
		SHOW 4, Correct, X(0);
		SHOW 5, Omission, X(3);

		SHOW 11, Commenced, X(9);
		SHOW 12, Completed, X(10);
		
		SHOW 16, Correct, X(0);
		SHOW 17, Incorrect [st], X(1);
		SHOW 18, Incorrect [lh], X(2);
		SHOW 19, Omissions, X(3);
		SHOW 20, Premature, X(4);
		
		SHOW 21, Perseverative, X(5);
		SHOW 22, TO resp, X(6);
		SHOW 23, Magazine resp, X(8);
		SHOW 24, Activity, X(12);
		SHOW 25, Timeouts [#], X(7);

		SHOW 26, Current lat, S(1);
		SHOW 27, Correct lat, L(1);
		SHOW 28, Incorrect lat, L(2);
		SHOW 29, Magazine lat, L(0);
		SHOW 30, Total timeout, L(3);

		\SHOW 35, Average timeout time, 
		
		SHOW 36, Stimulus [s], A(0);
		SHOW 37, Limited hold [s], A(1);
		SHOW 38, ITI [s], A(2);
		SHOW 39, Timeout [s], A(3);
	
		SHOW 41, Max completed tr, A(4);
		SHOW 42, Max total dur, A(5);
		SHOW 43, Total blocks, A(10);
		SHOW 44, Current block, S(2);

        SHOW 46, Bincount, S(3) ;
        SHOW 47, ITI count, S(4) ---> S2
	#Z12:	SHOW 2, Stimulus, P/1" ---> S2
	#Z13:	SHOW 2, Limited hold, A(1) ---> S2
	#Z14:	SHOW 2, ITI, W/1" ---> S2
	#Z15:	SHOW 2, Timeout, A(3) ---> S2
        #Z4:    SHOW 2, Collection, 0 ---> S2

             
              
Related programs Other versions
No training programs submitted/required

No older versions available
No experimental versions available