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

Simulating a multi trial, multi subject auditory experiment

ulloaa edited this page Dec 16, 2014 · 1 revision

Written by Brent Warner, Summer 2003 (Updated by Antonio Ulloa, Summer 2014)

Making the necessary programs

Each batch job runs a number of the same programs which must be made so that they exist in your bin directory.

In the directory code, type the following:

$ make altgenw_au
$ make altgenw_L_au
$ make crossws_au
$ make crosswt_au_i
$ make genw_au
$ make mkattn_au

In the directory code/netgen, type the following:

$ make netgenC_au
$ make netgenC_L_au

In the directory code/sim, type the following:

$ make au_sim1

Note that there are other programs (*.cc files) that exist in these directories. These are others will be made when they are necessary.

Running a simulation

The simulations are all run in a batch format, meaning that several simulations are run using varying parameters to represent multiple subjects, inputs, attention levels, region connections, etc. The batches that I have used are:

  • mkbatchr_au.cc -- Right hemisphere only. Can alter attention level and one region-region connection (usually STG->FS, but can be changed in genw.in) Uses auseqr.rs for sequence file

  • mkbatchw_au.cc -- Both R and L hemispheres. R receives form input, L receives noise. Can alter attention levels and one region-region connection as in above. Uses au_test.rs for sequence file (currently)

  • mkbatchb_au.cc -- Same as mkbatchw_au, except now allows user to change connection strengths for multiple region-region connections in RIGHT HEMISPHERE ONLY. Additionally, cross-hemisphere connections are regenerated for each trial. Uses auseq1.rsb, auseq2.rsb,... for sequence files (number corresponds to total number of trials)

  • mkbatchrlc_au.cc -- Essentially like mkbatchb_au, except the left and right hemispheres have been combined into one large hemisphere with half specific neurons (old right) that are task-dedicated and half non-specific neurons (old left) that are "distracted". The only real difference from mkbatchb_au is that now any alterations of connection strength in the specific (right) are mirrored in the non-specific (left). Before, the left hemisphere connections remained constant. Uses same sequence files as mkbatchb_au.

Each of these has a *.in file to go along with it. Before running one, check *.in file and set the desired values. This file will specify many parameters, which are explained in the actual file. Also, you should change the sequence file(s) that particular batch uses to reflect the organization of inputs you want.

How To actually run a simulation (using mkbatchb_au as an example)

Go the the /code directory and use the following command sequence.

$ make mkbatchb_au        # makes the executable in the /bin
$ cd ..
$ ./bin/mkbatchb_au       # runs the executable to produce the batchfile,
$ ./batchb_au               # runs the batch

All of the output files from the batch will be placed in the directory specified in line 1 of the corresponding *.in file.

Some other useful programs

C++ programs: The mkbatchb_au and mkbatchrlc_au versions have a sequence file for each trial that is done. Thus, the output files are split up trial-by-trial. Since it is useful to see all of the trials at once when analyzing the data, there is a program that combines them called mkcatout_au.cc. mkcatout_au is run similarly to the batch jobs. Go to its *.in file, change the necessary parameters outlined there (make sure the output directory is set) and use the following sequence of commands while in the directory code:

$ make mkcatout_au
$ ../bin/mkcatout_au
$ ./catout_au

Depending on the number of subjects/attention level/trials, this program can take quite awhile. It traverses all of the output directories, unzips the files, concatenates them for a subject/attn level, places the new files in the attention level directory (/b30 for example), and then rezips everything.

Matlab programs: There are several useful matlab programs for visualizing output. Make sure this is added to you matlab path (or copy them over to your directory and add that path). Note that each of these programs only work on the files in the current directory.

  • loadmovieB_au -- creates a movie of the output. Left hemisphere regions are on the top row, right on the bottom. The order in both from left to right is: MGN, A1, A2, STG, FS, D1, D2, FR

  • plotauditory -- plots the electrical activity for the right hemisphere. pre-STG units are on figure 1, STG-PFC are on figure 2.

  • plot_audleft -- same as above but left hemisphere.

  • plotaud_rl -- plots the homologous left and right hemisphere regions on top of each other on the same plot to represent a combined hemisphere. Used with mkbatchrlc_au.cc

  • maketopo -- useful when you would like to see the shape of your inputs. Run this and then plot mgns or gmgn.