Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

behavior session 875471358 has incorrect stimulus and errors on loading the dataset #2220

Open
matchings opened this issue Sep 3, 2021 · 10 comments
Labels
behavior bug NWB file Relating to the released NWB files project tables Relating to the released project-level metadata tables requires data release Requires a data release to make change accessible vbo visual behavior ophys

Comments

@matchings
Copy link
Collaborator

behavior_session_id = 875471358 has a few issues with it.

First, the behavior_session_table says the session_type is OPHYS_6_images_A, however that session_type should not exist for VisualBehaviorMultiscope experiments because the novel image set (which is supposed to be shown on OPHYS_6) should be image set B, not A. This is either a mistake in the stimulus that was run during the experiment, or a mistake in how the session is labeled in the behavior_session_table.

Second, when I try to load the behavior_session dataset object for this behavior_session_id, i get an error, shown below.

image

image

@matchings
Copy link
Collaborator Author

This session appears to be one of the ones mentioned in this issue: #2202

@matchings
Copy link
Collaborator Author

Just want to make a note that this issue still exists even when the session_type is loaded from the pkl file instead of mTrain or lims, so it appears to be an instance of the incorrect stimulus being shown, not the session_type being incorrect

@aamster aamster added the vbo visual behavior ophys label Jul 13, 2022
@aamster
Copy link
Contributor

aamster commented Jul 15, 2022

@matchings what do you want to do about this session since the incorrect stimulus was shown?

@aamster
Copy link
Contributor

aamster commented Jul 15, 2022

Also please if possible break down an issue into smallest possible. Here you have included 2 separate issues in 1: an issue about incorrect session type and a separate issue about not being able to load session

@aamster
Copy link
Contributor

aamster commented Jul 15, 2022

The reason why retrieving this behavior session is failing is because all of the ophys experiments failed for this behavior session. And there is no "behavior-only" nwb file associated with it. So there is no nwb file to retrieve. @matchings how do you want to deal with it?

@matchings
Copy link
Collaborator Author

@aamster There should be a 'behavior-only' NWB file for every behavior session experienced by any mouse that has ophys data. This behavior session (875471358) is from mouse 449653, which has ophys data listed in the ophys_experiment_table and ophys_session_table, which means that all of its behavior sessions should have NWB files.

My expectation is that any behavior sessions that do not have ophys data should have an empty list in the ophys_experiment_id column of the behavior_sessions table. For this behavior_session_id, that column is populated with a list of 7 ophys_experiment_ids. However none of those experiments appear in the ophys_experiment_table, which means that they failed QC.

There are other behavior sessions that took place on an ophys rig, but do not have passing ophys data for that session (indicated by an empty list or NaN in the ophys_experiment_id column of the behavior_session_table ) that have behavior-only NWB files and are able to be loaded via SDK.

Here is a gist showing my exploration that led to the statements above: https://gist.github.com/matchings/670175b68893d020e0ec2c3983d79feb

I think the real issue here is that metadata in the ophys_experiment_id column of the behavior_session table is somehow incorrect for this session, and somehow no behavior-only NWB file was generated for it.

This issue probably also applies to another 8 sessions documented in VBA as lacking behavior-only NWB files: AllenInstitute/visual_behavior_analysis#824

@matchings
Copy link
Collaborator Author

I think this should probably be tracked in a new issue that describes the actual problem here, which is that behavior-only NWBs are missing when they shouldnt be.

Regarding the "incorrect stimulus set", i think this is actually not a problem in this case.

@aamster
Copy link
Contributor

aamster commented Jul 20, 2022

Behavior session 875471358 is the only behavior session I know of which should have a behavior-only nwb file but doesn't. Only behavior sessions without ophys data should have a behavior-only nwb file.

Using the latest behavior session table:

beh_sessions_new[(beh_sessions_new['ophys_session_id'].isna()) & (beh_sessions_new['file_id'].isna())]
Out[22]: 
                    equipment_name                                  full_genotype  mouse_id  ...      date_of_acquisition file_id isilon_filepath
behavior_session_id                                                                          ...                                                 
875471358                   MESO.1  Vip-IRES-Cre/wt;Ai148(TIT2L-GC6f-ICL-tTA2)/wt    449653  ...  2019-05-24 13:30:24.606     NaN             NaN

[1 rows x 21 columns]

I checked the behavior sessions in the vba issue you linked to above, and at least using branch 2.13.5, I could not reproduce the issue. I could instantiate BehaviorSession for all except 875471358. FYI all these sessions which couldn't instantiate lack eye tracking data, which we might have fixed in 2.13.5 so that they can be instantiated.

I will create a behavior only nwb file for session 875471358.

@aamster aamster added project tables Relating to the released project-level metadata tables requires data release Requires a data release to make change accessible NWB file Relating to the released NWB files labels Jul 20, 2022
@aamster
Copy link
Contributor

aamster commented Jul 20, 2022

Update: found out that there was a behavior-only nwb file for this session but for some reason it doesn't have a published_at date which makes it excluded. I will give it a published_at date.

@matchings
Copy link
Collaborator Author

@aamster great, thanks, that all makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior bug NWB file Relating to the released NWB files project tables Relating to the released project-level metadata tables requires data release Requires a data release to make change accessible vbo visual behavior ophys
Projects
None yet
Development

No branches or pull requests

2 participants