Stop task species: rat
Maintainer Filip van den Bergh Current version 0.1 View the changelog
Original Author Filip van den Bergh Date last modified Mar-7-2005
License BSD MED-PC version 4

This is a rather messy stop-task, although it does seem to work fine. In this adaptation from the procedure used by Eagle et al., rats are to make quick responses on a first lever and then a second (the go-trial). Succesfully completing this response is reinforced with a food reward. In a number of trials, a short tone is presented after the first response. In those trials, animals are to inhibit their response (the stop-trial), and success is again reinforced with a food reward.
To successfully use this task, you need to make good use of the macros and keep in mind that all animals have an individual schedule. There are four programs used in training, and all are available with the main program. Macros are also available, as is the MEDPC2XL profile and the SPSS syntax used in analysis. I realise this program is messy, but it works. Feel free to adapt the code and send your improvements to us.

Eagle DM, Robbins TW. Behav Neurosci. 2003 Dec;117(6):1302-17.
Inhibitory control in rats performing a stop-signal reaction-time task: effects of lesions of the medial striatum and d-amphetamine.
How to use this code Download the code Download an example macro Download the profile
\ Fourth version (4.0): January 19, 2004
\ Animals are trained according to DM Eagle and TW Robbins (2003).
\ Training proceeds in four phases, several programs need input
\ individual to the animals, and provides output for the following 
\ session.
\  [1] Nosepoke training
\  [2] Left lever training
\  [3] Go trials training
\ *[4] Stop-signal task   *

\ Adaptation (4.1): 19 July 19, 2004
\ In this adaptation, stop-task determination is no longer based on 
\ chance alone. A certain number (F) of correct go-trials must be 
\ initiated before a stop-trial is presented. This adaptation was
\ made to ensure that the animals could not develop a preference
\ (for stop trials, at least).

\End common code

^StartSession=1		\Start session
^ES=2		\End session
^ST=3		\Start trial
^Stop=4		\Stop trial
^Go=5		\Go trial
^Leftpress=6	\Left lever press
^Rightpress=7	\Right lever press
^Reward=8	\Reward
^OmissionLeft=11\Omission left lever
^OmissionRight=12\Omission right lever
^EarlyResponse=13\Response before the tone is presented

VAR_ALIAS Maximum duration = A(0)
VAR_ALIAS Maximum trials = A(1)
VAR_ALIAS Inter-trial interval = A(2)
VAR_ALIAS Left lever extension time = A(3)
VAR_ALIAS Timeout time = A(4)
VAR_ALIAS Right lever extension time go trials   (LHgo)  = A(5) \Define from macro
VAR_ALIAS Right lever extension time stop trials (LHstop)= A(6) \Define from macro
VAR_ALIAS Tone duration = A(7)
LIST B=0.10", 0.12", 0.14", 0.16", 0.18", 0.2"
VAR_ALIAS Additional time on A(5) to add to mRT of previous day = B(0)
LIST Z=0, 0, 0, 0, 0, 0, 0, 1, 1
VAR_ALIAS Frequency of stop trials = Z(0)
LIST F=1, 1, 2, 2, 2, 2, 3, 3
VAR_ALIAS Frequency to stop trials expressed as ratio to succesful go-trials = F(0)
VAR_ALIAS Go-trials downcounter = E
LIST S=50, 0.9, 0.8, 0.7, 0.6
VAR_ALIAS Stop signal presentation times relative to mRT = S(0)
LIST U=0, 1, 2, 3, 4

\Per C-value (per presented initiating lever)
DIM I=1000
VAR_ALIAS Time of presentation of lever=I(0)
DIM T=1000
VAR_ALIAS Speed of response=T(0)
DIM X=1000
VAR_ALIAS Chosen stop signal delay = X(0)
DIM Y=1000
VAR_ALIAS Response outcome time = Y(0)	\Time to make a response on the right lever, 
					\will be -1 if correct stop trial
\Per S-value (per SS-delay)
DIM P=20
VAR_ALIAS Response outcome time per S-value (stop signal delay) = P(0)
VAR_ALIAS Response outcome time for go-trials = P(20) /-1 in case of an omission
DIM N=20
VAR_ALIAS Number of presentations of S-value (stop signal delay) = N(0)
DIM W=20
VAR_ALIAS Response times per S-value = W(0)
VAR_ALIAS Response times for go-trials = W(20)
VAR_ALIAS Number of go-trials = N(20)
VAR_ALIAS Total response time for mean GO trials = K
VAR_ALIAS Duration=D
VAR_ALIAS Right lever presentation counter = C
VAR_ALIAS Omission left = O(0)
VAR_ALIAS Omission right = O(1)
VAR_ALIAS Number of Go-trials to be replaced by Nogo trials because the rat responded befor ethe tone = V

\Temporary variables (used in same or next state)
VAR_ALIAS Is the tone presented yet = Q(4)
VAR_ALIAS Tone presentation greater than 0.01 = Q(5)

\Basic logic
	A(2)#T:	SET A(0)=60; 
		SET A(1)=200;
		SET A(2)=10; \*1"
		SET A(3)=60; \*1"
		SET A(4)=5; \*1"
		SET A(5)=5; \*1" LHgo from macro
		SET A(6)=1; \*1" LHstop from macro
		SET A(7)=0.4  ---> S25 \*1"

	#START:	SET A(2)=A(2)*1";
		SET A(3)=A(3)*1";
		SET A(4)=A(4)*1";
		SET A(5)=A(5)*1";
		SET A(6)=A(6)*1";
		SET A(7)=A(7)*1";
		SET S(0)=S(0)*1";
		SET S(1)=S(1)*1";
		SET S(2)=S(2)*1";
		SET S(3)=S(3)*1";
		SET S(4)=S(4)*1";
		RANDD E=F; \Determine stop-trial countdown
		Z^StartSession ---> S2
		A(2)#T: ON^LeftLight,^LeftExt ---> S3
S3, \Left response [1]
	#R^Left: Z^LeftLever;
		ADD C;
		SET I(C)=D; \For each presentation of the right lever, a session time
		RANDD Q(0)=Z; \Legacy of previous stop-trial determination routine
		RANDD Q(2)=B;
		RANDD Q(1)=U; \Q1 contains a digit from 1-8, indicating the chosen SS-delay
		SET X(C)=Q(1); \For each presentation, the chosen stop signal delay
		\IF Q(0)=1 [@Truestop, @Falsego] \Legacy of previous stop-trial determination routine
		IF E=0 [@Truestop, @Falsego]
			@Truestop:	RANDD E=F; \Determine new stop-trial countdown
					SET X(C)=S(Q(1));
					ADD N(Q(1)); \Total go trials
					SHOW 5,Stop,S(Q(1))---> S5
			@Falsego:  	IF V>0 [@TrueMakeThisStop,@FalseKeepItGo]
				@TrueMakeItStop: SUB V;
					SET X(C)=S(Q(1));
					ADD N(Q(1)); \Total go trials
					SHOW 5,Stop,S(Q(1))---> S5
				@FalseKeepItGo: Z^Go;
					SET X(C)=-1;
					ADD N(20); \Total # of nogo trial per ss
					SHOW 5,Go,0---> S4
	A(3)#T:	OFF^LeftLight; 
		ADD O(0) ---> S20
S4, \Right response, go trial [2a]
	#R^Right: Z^RightLever; \Correct
		SUB E; \New stop-trial determination routine, substract if correct go
		ADD P(20); \If correct, add to P
		SET K=K+T(C);
 		SET W(20)=W(20)+T(C);
		OFF ^RightExt,^RightLight;
		IF C>=A(1) [@TrueStop; @FalseCont]
			@TrueStop: 	Z^ES ---> S10
			@FalseCont:	---> S2
	(A(5)+Q(2))#T: OFF^RightLight; 
		SET W(20)=-1;
		IF C>=A(1) [@TrueStop; @FalseCont]
			@TrueStop: 	Z^ES ---> S10
			@FalseCont:	---> S20
S5, \Right response, stop trial [2b]
	#R^Right: IF Q(4)=0 [@TrueToneNotPresented,@FalseTrueNogoTrial]
			@TrueToneNotPresentedYet: Z13;
				SET X(C)=-1;
				ADD V;
				ADD N(20); \Total # of nogo trial per ss, which is a go trial retrospectively
				SUB N(Q(1)); \Since the tone was not presented, this was no stop-trial
				SHOW 5,Corrected Go,0;
				Z^RightLever; \Correct
				ADD P(20); \If correct, add to P
				SET K=K+T(C);
		 		SET W(20)=W(20)+T(C);
				OFF ^RightExt,^RightLight;
				IF C>=A(1) [@TrueStop; @FalseCont]
					@TrueStop: 	Z^ES ---> S10
					@FalseCont:	---> S2
			@FalseTrueNogoTrial: Z^RightLever;
				OFF ^RightExt,^RightLight,^HouseLight;
				SET W(Q(1))=W(Q(1))+T(C);
				IF C>=A(1) [@TrueStop; @FalseCont]
					@TrueStop: 	Z^ES ---> S10
					@FalseCont:	---> S20
	(A(6)+Q(2))#T: OFF^RightLight;
		ADD P(Q(1)); \Add in case of correct only
		IF C>=A(1) [@TrueStop; @FalseCont]
			@TrueStop: 	Z^ES ---> S10
			@FalseCont:	---> S2

S20, \TimeOut
	A(4)#T:	ON^HouseLight ---> S21
	#R^Feeder ---> S2
	A(3)#T: OFF^HouseLight; 
		SET I(R+1)=-987.987;
		SET T(C+1)=-987.987; 
		SHOW 2, %Cor Go, P(20)/N(20)*100;
		SHOW 3, %Cor Nogo, (P(0)+P(1)+P(2)+P(3)+P(4)+P(5)+P(6)+P(7))/(N(0)+N(1)+N(2)+N(3)+N(4)+N(5)+N(6)+N(7))*100; 

	#Z^Reward: ON^CentreLight,^Feeder; ADD R---> S2
	#R^Feeder: OFF^CentreLight,^Feeder ---> S1

\Stop signal presentation
	#Z^Stop: SET Q(4)=0; SET Q(5)=A(6)-S(Q(1)); IF Q(5)<0.01 [@Smaller, @OK]
                @Smaller: SET Q(5)=0.01 ---> S2
                @OK: ---> S2
	#Z13: ---> S3
	Q(5)#T: ON^Tone; ADD Q(4) ---> S3
\	A(6)-S(Q(1))#T: ON^Tone; ADD Q(4) ---> S3
	A(7)#T:	OFF^Tone ---> S1

	#Z^StartSession: ---> S2
	0.1": 	SET D=D+0.1; IF D>(A(0)*60) [@TrueStop, @FalseContinue]
		@TrueStop:	Z^ES; 	
				SET I(C+1)=-987.987;
				SET T(C+1)=-987.987;
				SHOW 2, %Cor Go, P(20)/N(20)*100;
				SHOW 3, %Cor Nogo, (P(0)+P(1)+P(2)+P(3)+P(4)+P(5)+P(6)+P(7))/(N(0)+N(1)+N(2)+N(3)+N(4)+N(5)+N(6)+N(7))*100 ;
				SHOW 5, Trials, C ---> STOPABORTFLUSH
		@FalseContinue:		---> S2
	#Z^LeftLever: ---> S2
	#Z^RightLever: ---> S1
	#Z^OmissionRight: SET T(C)=-1 ---> S1
	0.01":	SET T(C)=T(C)+0.01 ---> S2

\Screen writer
	#Z^StartSession: ---> S2
	.1":	SHOW 1, Duration, D/60;
		SHOW 2, Rewards, R;
		SHOW 4, mRT-GO,K/(P(20)+.000000001);
		\SHOW 4, maxRT GO, A(5)+Q(2);
		SHOW 3, Trials, C;
		\SHOW 5, maxRT NOGO, A(6)+Q(2);
		SHOW 6, IRT, I(R);
		SHOW 7, OmLeft, O(0);
		SHOW 8, OmRght, O(1); 
		SHOW 9, prev mRT GO, A(5);
		SHOW 10, prev mRT NOGO, A(6);
		SHOW 11, #Go, N(20);
		SHOW 12, #Cor go, P(20);
		SHOW 13, Countdown, E;
		SHOW 15, Ratio, ((N(0)+N(1)+N(2)+N(3)+N(4)+N(5)+N(6)+N(7))/(N(20)+.00000001));
		SHOW 16, #Nogo 0, N(0);
		SHOW 17, #Cor nogo 0, P(0);
		SHOW 18, #Nogo 0 time, S(0);
		SHOW 21, #Nogo 1, N(1);
		SHOW 22, #Cor nogo 1, P(1);
		SHOW 23, #Nogo 1 time, S(1);
		SHOW 26, #Nogo 2, N(2);
		SHOW 27, #Cor nogo 2, P(2);
		SHOW 28, #Nogo 2 time, S(2);
		SHOW 31, #Nogo 3, N(3);
		SHOW 32, #Cor nogo 3, P(3);
		SHOW 33, #Nogo 3 time, S(3);
		SHOW 36, #Nogo 4, N(4);
		SHOW 37, #Cor nogo 4, P(4);
		SHOW 38, #Nogo 4 time, S(4)---> S2

Related programs Other versions
Training programs are included with the code.

No older versions available
No experimental versions available