Skip to content
Dan Meliza edited this page Jul 30, 2013 · 1 revision

Much of the data in the Margoliash lab is collected with 'saber', which generates a 'explog' file with details about when each entry was recorded, how many samples, and what stimuli were played during recording. The arfxplog script reads in an explog file and converts the associated data from saber's native pcm_seq2 file to ARF format. The arfxplog script takes many of the same options as arfx, but some metadata can be supplied by the explog file. Specifically, arfxplog takes care of figuring out what stimuli were presented during a recording episode, and it names episodes according using saber's internal timestamp.

Acoustic recordings, triggered by threshold crossings

$ arfxplog -v -a myanimal -e myname -k location=soundroom -T ACOUSTIC -k amp=dmp5 \
   -k mike=shotgun -k card=internal -k software=saber myexperiment.explog

created myexperiment.arf
myexperiment_20070601d.pcm_seq2/1 -> myexperiment.arf/e91487566/channel-name
myexperiment_20070601d.pcm_seq2/2 -> myexperiment.arf/e91547566/channel-name
myexperiment_20070601d.pcm_seq2/3 -> myexperiment.arf/e91607566/channel-name
...

Recordings from multi-channel extracellular electrode

With associated stimulus playback times.

$ arfxplog -v -a myanimal -e myname -T EXTRAC_HP -s myexperiment.explog

created myexperiment_4_1.arf
myexperiment_1_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_1
myexperiment_2_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_2
myexperiment_3_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_3
myexperiment_4_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_4
myexperiment_5_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_5
myexperiment_6_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_6
myexperiment_7_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_7
myexperiment_8_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_8
myexperiment_9_20110713a.pcm_seq2/1 -> myexperiment_4_1.arf/e16925005/channel_9
myexperiment_1_20110713a.pcm_seq2/2 -> myexperiment_4_1.arf/e17205005/channel_1
...

The '-s' flag is extremely important here, as it tells arfxplog to split the data into separate files, one for each recording site. Also, specifying a datatype of EXTRAC_HP will help in later spike-sorting steps. At the end of the run, arfxplog marks each entry with the stimulus that was presented (if any) in the 'protocol' metadata field, and also creates a label entity in each entry which indicates the time when the stimulus started.

Also, note that the entries are given a long numeric name, which is based on the 'sample offset' in the explog. This the time, in number of samples, since saber was started, and it uniquely identifies the entry for a given experiment. The entries are also timestamped, based on the timestamp of the data in the pcm_seq2 file.

If you are recording multiple types of data at the same time, you will need to edit the explog file. Open the file and add a line for each channel. For example, if there is one extracellular electrode and two EEG electrodes:

%%%% 09-Apr-2011:15:16:07.01 add ch1 datatype=EXTRAC_HP
%%%% 09-Apr-2011:15:16:10.44 add ch2 datatype=EXTRAC_EEG
%%%% 09-Apr-2011:15:16:13.91 add ch3 datatype=EXTRAC_EEG

If the exp command was entered into saber before adding channels these lines will already exist, and all that needs to be added is the datatype=XXX to each line. Be careful not to put any space around the equals sign; the parser for this is not especially bright. This step is optional, but it will help mspike_extract to determine which channels it should do spike sorting on. If these lines are in the file the -T commandline argument will be ignored.