Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit 54d3a55

Browse files
author
Antonio Ulloa
committed
Added DMS, passive viewing and resting state simulation scripts
1 parent bdeb113 commit 54d3a55

File tree

11 files changed

+78
-415
lines changed

11 files changed

+78
-415
lines changed

analysis/avg_FC_TVB_ROIs_across_subjects.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
subjects = np.arange(10)
9393

9494
# define output file where means, standard deviations, and variances will be stored
95-
RS_FC_avg_file = 'rs_fc_avg.npy'
95+
RS_FC_avg_file = 'tvb_only_rs_fc_avg.npy'
9696
TB_FC_avg_file = 'tb_fc_avg.npy'
9797

9898
# declare ROI labels
@@ -132,16 +132,16 @@
132132

133133

134134
# define the names of the input files where the correlation coefficients were stored
135-
FC_RS_subj1 = 'subject_11/output.RestingState/xcorr_matrix_33_regions.npy'
136-
FC_RS_subj2 = 'subject_12/output.RestingState/xcorr_matrix_33_regions.npy'
137-
FC_RS_subj3 = 'subject_13/output.RestingState/xcorr_matrix_33_regions.npy'
138-
FC_RS_subj4 = 'subject_14/output.RestingState/xcorr_matrix_33_regions.npy'
139-
FC_RS_subj5 = 'subject_15/output.RestingState/xcorr_matrix_33_regions.npy'
140-
FC_RS_subj6 = 'subject_16/output.RestingState/xcorr_matrix_33_regions.npy'
141-
FC_RS_subj7 = 'subject_17/output.RestingState/xcorr_matrix_33_regions.npy'
142-
FC_RS_subj8 = 'subject_18/output.RestingState/xcorr_matrix_33_regions.npy'
143-
FC_RS_subj9 = 'subject_19/output.RestingState/xcorr_matrix_33_regions.npy'
144-
FC_RS_subj10 = 'subject_20/output.RestingState/xcorr_matrix_33_regions.npy'
135+
FC_RS_subj1 = 'subject_tvb/output.RestingState_01/xcorr_matrix_33_regions.npy'
136+
FC_RS_subj2 = 'subject_tvb/output.RestingState_02/xcorr_matrix_33_regions.npy'
137+
FC_RS_subj3 = 'subject_tvb/output.RestingState_03/xcorr_matrix_33_regions.npy'
138+
FC_RS_subj4 = 'subject_tvb/output.RestingState_04/xcorr_matrix_33_regions.npy'
139+
FC_RS_subj5 = 'subject_tvb/output.RestingState_05/xcorr_matrix_33_regions.npy'
140+
FC_RS_subj6 = 'subject_tvb/output.RestingState_06/xcorr_matrix_33_regions.npy'
141+
FC_RS_subj7 = 'subject_tvb/output.RestingState_07/xcorr_matrix_33_regions.npy'
142+
FC_RS_subj8 = 'subject_tvb/output.RestingState_08/xcorr_matrix_33_regions.npy'
143+
FC_RS_subj9 = 'subject_tvb/output.RestingState_09/xcorr_matrix_33_regions.npy'
144+
FC_RS_subj10 = 'subject_tvb/output.RestingState_10/xcorr_matrix_33_regions.npy'
145145

146146
FC_TB_subj1 = 'subject_11/output.TaskBased/xcorr_matrix_33_regions.npy'
147147
FC_TB_subj2 = 'subject_12/output.TaskBased/xcorr_matrix_33_regions.npy'

analysis/compute_syn_visual_33_regions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
}
110110

111111
# Load TVB nodes synaptic activity
112-
tvb_synaptic = np.load("tvb_synaptic.npy")
112+
tvb_synaptic = np.load("tvb_abs_syn.npy")
113113

114114
# create a numpy array of synaptic time-series, with a number of elements defined
115115
# by the number of ROIs above and the number of time points in each synaptic time-series

simulation/sim.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# This file (sim.py) was created on February 5, 2015.
3737
#
3838
#
39-
# Author: Antonio Ulloa. Last updated by Antonio Ulloa on April 16 2016
39+
# Author: Antonio Ulloa. Last updated by Antonio Ulloa on December 6 2016
4040
#
4141
# Based on computer code originally developed by Malle Tagamets and
4242
# Barry Horwitz (Tagamets and Horwitz, 1998)
@@ -734,9 +734,8 @@ def run(self):
734734
# initialize timestep counter for LSNM timesteps
735735
t = 0
736736

737-
# initialize random seed
738-
seed = 20
739-
random_state = np.random.RandomState(seed)
737+
# declare random number generator
738+
random_state = np.random.RandomState()
740739

741740
# import the experimental script given by user's script file
742741
exec(experiment_script)

simulation/sim_without_LSNM.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# This program makes use of The Virtual Brain library toolbox, downloaded
4343
# from the TVB GitHub page.
4444
#
45-
# Author: Antonio Ulloa. Last updated by Antonio Ulloa on December 5 2016
45+
# Author: Antonio Ulloa. Last updated by Antonio Ulloa on December 6 2016
4646
# **************************************************************************/
4747
#
4848
# sim_without_LSNM.py
@@ -263,9 +263,8 @@ def dfun(self, state_variables, coupling, local_coupling=0.0):
263263
range(39200, 39401)
264264
))
265265

266-
# initialize random seed
267-
seed = 20
268-
random_state = np.random.RandomState(seed)
266+
# declare random number generator
267+
random_state = np.random.RandomState()
269268

270269
# Run the simulation
271270
raw_data = []

visual_model/script_DMS_198_seconds.py

Lines changed: 20 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22
#
33
# Script created on December 5 2016
44
#
5-
# There are 6 Delayed match-to-sample (DMS) trials for each of twelve blocks
5+
# There are 6 Delayed match-to-sample (DMS) task blocks in this script, interspersed
6+
# with 6 rest blocks
67
#
78
# The total number of timesteps is 39600 = 198 seconds
89
#
910
# The number of timesteps in each trial is 1100 = 5.5 seconds
1011
#
1112
# Each block is 3300 timesteps = 16.5 seconds
1213
#
13-
# DMS trials are in the following order: MATCH, MISMATCH, MATCH, MATCH, MISMATCH, MATCH.
14-
# The attention parameter in DMS trials is 0.3
14+
# Each task block is composed of 3 DMS trials in the following order: MATCH, MISMATCH, MATCH.
15+
# The attention parameter in the task trials is 0.3 and the attention parameter in the rest
16+
# blocks is 0.05
1517
#
16-
# The first 200 timesteps = 1000 ms we do nothing. We assume 1 timestep = 5 ms, as in
17-
# Horwitz et al (2005)
18+
# We assume 1 timestep = 5 ms, as in Horwitz et al (2005)
1819
#
1920
# To maintain consistency with Husain et al (2004) and Tagamets and Horwitz (1998),
2021
# we are assuming that each simulation timestep is equivalent to 5 milliseconds
@@ -125,33 +126,9 @@ def intertrial_interval(modules, script_params):
125126

126127
# define a dictionary of simulation events functions, each associated with
127128
# a specific simulation timestep
128-
simulation_events = {
129-
################### FIRST BLOCK OF 3 DMS TRIALS (MATCH, MISMATCH, MATCH)
130-
'200': o_shape,
131-
132-
'400': delay_period,
133-
134-
'700': o_shape,
135-
136-
'900': intertrial_interval,
137-
138-
'1300': o_shape,
139-
140-
'1500': delay_period,
141-
142-
'1800': t_shape,
143-
144-
'2000': intertrial_interval,
145-
146-
'2400': t_shape,
147-
148-
'2600': delay_period,
149-
150-
'2900': t_shape,
151-
152-
'3100': intertrial_interval,
153-
154-
################### SECOND BLOCK
129+
simulation_events = {
130+
'0' : intertrial_interval, # rest block begins
131+
################### BLOCK 1
155132
'3500': o_shape,
156133

157134
'3700': delay_period,
@@ -174,34 +151,9 @@ def intertrial_interval(modules, script_params):
174151

175152
'6200': t_shape,
176153

177-
'6400': intertrial_interval,
178-
179-
################### THIRD BLOCK
180-
'6800': o_shape,
181-
182-
'7000': delay_period,
183-
184-
'7300': o_shape,
185-
186-
'7500': intertrial_interval,
187-
188-
'7900': o_shape,
189-
190-
'8100': delay_period,
154+
'6400': intertrial_interval, # rest block begins
191155

192-
'8400': t_shape,
193-
194-
'8600': intertrial_interval,
195-
196-
'9000': t_shape,
197-
198-
'9200': delay_period,
199-
200-
'9500': t_shape,
201-
202-
'9700': intertrial_interval,
203-
204-
################### FOURTH BLOCK
156+
################### BLOCK 2
205157
'10100': o_shape,
206158

207159
'10300': delay_period,
@@ -224,34 +176,9 @@ def intertrial_interval(modules, script_params):
224176

225177
'12800': t_shape,
226178

227-
'13000': intertrial_interval,
179+
'13000': intertrial_interval, # rest block begins
228180

229-
################### FIFTH BLOCK
230-
'13400': o_shape,
231-
232-
'13600': delay_period,
233-
234-
'13900': o_shape,
235-
236-
'14100': intertrial_interval,
237-
238-
'14500': o_shape,
239-
240-
'14700': delay_period,
241-
242-
'15000': t_shape,
243-
244-
'15200': intertrial_interval,
245-
246-
'15600': t_shape,
247-
248-
'15800': delay_period,
249-
250-
'16100': t_shape,
251-
252-
'16300': intertrial_interval,
253-
254-
################### SIXTH BLOCK
181+
################### BLOCK 3
255182
'16700': o_shape,
256183

257184
'16900': delay_period,
@@ -274,34 +201,9 @@ def intertrial_interval(modules, script_params):
274201

275202
'19400': t_shape,
276203

277-
'19600': intertrial_interval,
204+
'19600': intertrial_interval, # rest block begins
278205

279-
################### SEVENTH BLOCK
280-
'20000': o_shape,
281-
282-
'20200': delay_period,
283-
284-
'20500': o_shape,
285-
286-
'20700': intertrial_interval,
287-
288-
'21100': o_shape,
289-
290-
'21300': delay_period,
291-
292-
'21600': t_shape,
293-
294-
'21800': intertrial_interval,
295-
296-
'22200': t_shape,
297-
298-
'22400': delay_period,
299-
300-
'22700': t_shape,
301-
302-
'22900': intertrial_interval,
303-
304-
################### EIGHT BLOCK
206+
################### BLOCK 4
305207
'23300': o_shape,
306208

307209
'23500': delay_period,
@@ -324,34 +226,9 @@ def intertrial_interval(modules, script_params):
324226

325227
'26000': t_shape,
326228

327-
'26200': intertrial_interval,
229+
'26200': intertrial_interval, # rest block begins
328230

329-
################### NINTH BLOCK
330-
'26600': o_shape,
331-
332-
'26800': delay_period,
333-
334-
'27100': o_shape,
335-
336-
'27300': intertrial_interval,
337-
338-
'27700': o_shape,
339-
340-
'27900': delay_period,
341-
342-
'28200': t_shape,
343-
344-
'28400': intertrial_interval,
345-
346-
'28800': t_shape,
347-
348-
'29000': delay_period,
349-
350-
'29300': t_shape,
351-
352-
'29500': intertrial_interval,
353-
354-
################### TENTH BLOCK
231+
################### BLOCK 5
355232
'29900': o_shape,
356233

357234
'30100': delay_period,
@@ -374,34 +251,9 @@ def intertrial_interval(modules, script_params):
374251

375252
'32600': t_shape,
376253

377-
'32800': intertrial_interval,
254+
'32800': intertrial_interval, # rest block begins
378255

379-
################### ELEVENTH BLOCK
380-
'33200': o_shape,
381-
382-
'33400': delay_period,
383-
384-
'33700': o_shape,
385-
386-
'33900': intertrial_interval,
387-
388-
'34300': o_shape,
389-
390-
'34500': delay_period,
391-
392-
'34800': t_shape,
393-
394-
'35000': intertrial_interval,
395-
396-
'35400': t_shape,
397-
398-
'35600': delay_period,
399-
400-
'35900': t_shape,
401-
402-
'36100': intertrial_interval,
403-
404-
################### TWELVE BLOCK
256+
################### BLOCK 6
405257
'36500': o_shape,
406258

407259
'36700': delay_period,
@@ -424,7 +276,7 @@ def intertrial_interval(modules, script_params):
424276

425277
'39200': t_shape,
426278

427-
'39400': intertrial_interval,
279+
'39400': intertrial_interval,
428280

429281
}
430282

0 commit comments

Comments
 (0)