Foraging session animal response#99
Conversation
|
|
||
| # Merge on 'trial' | ||
| df_trials = df_trials.merge(avg_activity[['trial', output_col]], on='trial', how='left') | ||
| df_trials = nwb.df_trials.merge(avg_activity[['trial', output_col]], on='trial', how='left') |
There was a problem hiding this comment.
I don't think we want this, because above on 364/365 we do some filtering on nwb.df_trials
There was a problem hiding this comment.
the filtering is so that if we are timelocking to an event that doesn't occur in all trials, it will not cause an error.
however, if we timelock to choice, this would mean all ignore trials are automatically dropped.
There was a problem hiding this comment.
But we might be timelocking to other events. This line would then make all the previous filtering get ignored
There was a problem hiding this comment.
previous filtering is just for getting the averages. by merging onto the original nwb, we make sure we don't discard any data, just that the average activity will be set to nan.
|
|
||
| if "side_bias" not in nwb.df_trials: | ||
| fig, axes = plot_foraging_session( | ||
| [np.nan if x == 2 else x for x in nwb.df_trials["animal_response"].values], |
There was a problem hiding this comment.
I'm confused by this. The column name that is in the NWB is "animal_response". I agree choice would be a better name, but thats not how its named in the file.
Are you sure you aren't renaming animal_response somewhere?
There was a problem hiding this comment.
let me double check
There was a problem hiding this comment.
found the rename. it was when i added the foraging model. i'll fix that.
|
Closing this. fixed it differently. |
choice column should be called 'choice', not 'animal response'.
Also, found a minor bug that dropped ignore trials when getting average signal.