juliencarponcy / trialexp

MIT License
2 stars 4 forks source link

Bug fix in the time period used to extract trials #30

Closed teristam closed 1 year ago

teristam commented 1 year ago

This PR contains various bugfix and improvements to the current pipeline for extracting trial information

  1. Added a column of trial window into task_params.csv to define the trial window for each task, as a universal trial window definition doesn't make a lot of sense in some tasks (e.g. some tasks have very short time periods between two trials, and don't have pre-trial time as a control
  2. Now a trial is defined as from trigger_time[I] + trial_window[0] to to trigger_time[i+1] + trial_window[0] (note that trial_window[0] is negative most of the time). This ensures that we capture all the events in a trial for tasks with variable inter-trial intervals (e.g. the inter-trial interval in aborted trial and successful trial are not the same). This makes the event extract more accurate and close to what is actually happening during the experiment
  3. Added more error checks when extracting events from trials
  4. Switch to using our own script to handle deleting and overwriting spike2 files gracefully. It is because they are known to have problems frequently when someone else is keeping a spike2 file open. When that happens, it will cause the pipeline to fail.
  5. Added missing dependencies to environment files

This PR has already been tested to run successfully for all the data in the by_session folder