AllenInstitute / visual_behavior_analysis

Python package for analyzing behavioral data for Brain Observatory: Visual Behavior
Other
22 stars 6 forks source link

'session_type' missing for some sessions in cache.behavior_session_table #687

Closed dougollerenshaw closed 3 years ago

dougollerenshaw commented 4 years ago

The session_type attribute is missing for some, but not all, sessions in the cache.behavior_session_table. Here's an example where it's missing:

import visual_behavior.data_access.loading as loading

cache = loading.get_visual_behavior_cache()
behavior_session_table = cache.get_behavior_session_table().reset_index()
filtered_ophys_experiment_table = loading.get_filtered_ophys_experiment_table()

ophys_session_id = 1046147323
print(behavior_session_table.query('ophys_session_id == {}'.format(ophys_session_id)).iloc[0]['session_type'])
print(filtered_ophys_experiment_table.query('ophys_session_id == {}'.format(ophys_session_id)).iloc[0]['session_type'])

nan OPHYS_4_images_B

However, for a different ophys_session_id, both tables return a session_type:

ophys_session_id = 1053696498
print(behavior_session_table.query('ophys_session_id == {}'.format(ophys_session_id)).iloc[0]['session_type'])
print(filtered_ophys_experiment_table.query('ophys_session_id == {}'.format(ophys_session_id)).iloc[0]['session_type'])

OPHYS_2_images_A_passive OPHYS_2_images_A_passive

Why is this attribute missing for some sessions, but not others?

dougollerenshaw commented 4 years ago

@matchings suspects that the issue is originating with the SDK functions that generate the behavior_session_table.

dougollerenshaw commented 4 years ago

AllenSDK issue created: https://github.com/AllenInstitute/AllenSDK/issues/1772

dougollerenshaw commented 3 years ago

Looks like @matchings was correct that it was an SDK/LIMS issue. @wbwakeman has a solution in mind. Closing this issue.