"Add a marker if..."

Discussions and questions about topics not covered above
jpenabravo
Posts: 2
Joined: 13 Mar 2019, 18:42
Software used: Spike2
Contact:

"Add a marker if..."

Unread postby jpenabravo » 07 Aug 2019, 15:43

Hi,

Caveat* I have no experience with Spike 2 syntax.

I didn't do a thorough search through the forum for this but would much appreciate any help:

I have a file from a session where I recorded the amount of licks during a behavioral task where the animal was supposed to sample an odor and a reward would become available at the end of the trial.

In order to analyze the data, I need to be able to only select the trials where the animal did not lick during the "odor on" period.

I have a channel (Odor) with TextMarks that tell me the exact time when the odor turns on for each trial during the entire session.
A different channel (Lick) has TextMarks for every lick that occurs during the session.

I would like to use the the Odor channel for generating the range of time ("odor on") for searching the Lick channel. The range will be constant - 7 seconds long: 3 seconds before each Odor TextMark and 4 seconds after.

Then, I would like to use that 7 seconds rage to search the Lick channel for TextMarks. If there is a TextMark in the Lick channel, a new TextMark is created "BadTrial" that would allow me to filter out the trials where there is a lick during the "odor on" period.

Thank you in advance for any help.

Andre Costa
Major contributor
Posts: 107
Joined: 13 Nov 2015, 12:56
Contact:

Re: "Add a marker if..."

Unread postby Andre Costa » 08 Aug 2019, 11:45

You can either write a script to create a new 'BadTrial' TextMark or you can create a new Marker channel using the Measurements to Data channel, which will iterate on the Odor channel to check for any events on that range. Once on the Process dialog to choose the time range for processing, choosing the Gated by events (of an optional hexadecimal marker code) allows you to choose a pre and post range after the gatted channel, and if there is an event there, a new marker is added to the newly created channel.

Fortunately in your case this is a fixed range of 7 seconds, but for the new version of Spike2 we are planning to implement a variable end time for the gated analysis based on events on the same or a different channel, allowing more flexibility.

jpenabravo
Posts: 2
Joined: 13 Mar 2019, 18:42
Software used: Spike2
Contact:

Re: "Add a marker if..."

Unread postby jpenabravo » 08 Aug 2019, 14:23

Great. This answer really helps.

Thank you for your reply!


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron