I have been trying to find this module that is used in several of the swdb notebooks, to no avail.
For example, referenced here:
from swdb_2018_neuropixels.ephys_nwb_adapter import NWB_adapter
Does anyone know where I can get the swdb_2018_neuropixels library?
Hi Jacob – What are the files you’re trying to load with this adapter? This was created for some pilot sessions packaged in NWB 1.0 format for use in this summer course. All of the publicly released Neuropixels data is in NWB 2.0 format, and can be loaded with standard AllenSDK functions.
I am using the NWB 2.0 format and AllenSDK functions to load it.
I’ve been trying to convert an old script to use the new functions/format, but the dataframe created is a black box so I was looking for the source code.
The script assigns the output of NWB_adapter to a dataframe
ds = NWB_adapter(os.path.join(dpath, exp_name + “.nwb”))
and then gets the table for natural scenes
stim_df = ds.stim_tables[‘natural_scenes’].copy()
this is then later merged on and uses several column names I have never seen before (probably due to different nomenclature):
on=[‘frame’, ‘occur’, ‘orientation’, ‘phase’, ‘trial’,
‘spatial_frequency’, ‘stim_type’, ‘wnd_start’]
and finally after this merge it accesses a property ‘fr’, which I think is firing rate, but I don’t know how it gets this (it doesn’t come from the other merged dataframe).
tu_df[‘fr’]
The NWB adapter serves the same purpose as the EcephysSession object in the AllenSDK…it provides a convenient interface for retrieving data from an NWB file. To get the natural scenes table, you can just call session.get_stimulus_table("natural_scenes").
I’m not sure where those column names are coming from…frame is the only one that would apply to the natural scenes stimulus.
What is the next step after accessing the fr property? Without more context, I’m not sure how firing rate could be computed from the stimulus table.