allensdk.brain_observatory.behavior.behavior_project_cache.behavior_neuropixels_project_cache module

class allensdk.brain_observatory.behavior.behavior_project_cache.behavior_neuropixels_project_cache.VisualBehaviorNeuropixelsProjectCache(fetch_api: VisualBehaviorNeuropixelsProjectCloudApi, fetch_tries: int = 2)[source]

Bases: ProjectCacheBase

Entrypoint for accessing Visual Behavior Neuropixels data.

Supports access to metadata tables: get_ecephys_session_table() get_behavior_session_table() get_probe_table() get_channel_table() get_unit_table

Provides methods for instantiating session objects from the nwb files: get_ecephys_session() to load BehaviorEcephysSession get_behavior_sesion() to load BehaviorSession

Provides tools for downloading data:

Will download data from the s3 bucket if session nwb file is not in the local cache, otherwise will use file from the cache.

BUCKET_NAME: str = 'visual-behavior-neuropixels-data'
PROJECT_NAME: str = 'visual-behavior-neuropixels'
classmethod cloud_api_class()[source]
get_behavior_session(behavior_session_id: int) BehaviorSession[source]

Loads all data for behavior_session_id into an allensdk.brain_observatory.behavior.behavior_session.BehaviorSession instance

Parameters:
behavior_session_id: int

The behavior session id

Returns:
allensdk.brain_observatory.behavior.behavior_session.BehaviorSession
instance
get_behavior_session_table() DataFrame[source]
Returns:
behavior_sessions_table: pd.DataFrame

pandas dataframe representing metadata for all behavior sessions in the data release

get_channel_table() DataFrame[source]
Returns:
channels table: pd.DataFrame
Index: id
Columns:
  • properties of allensdk.ecephys._channel.Channel

except for ‘impedance’

get_ecephys_session(ecephys_session_id: int) BehaviorEcephysSession[source]

Loads all data for ecephys_session_id into an allensdk.ecephys.behavior_ecephys_session.BehaviorEcephysSession instance

Parameters:
ecephys_session_id: int

The ecephys session id

Returns:
allensdk.ecephys.behavior_ecephys_session.BehaviorEcephysSession
instance
get_ecephys_session_table(filter_abnormalities: bool = True) DataFrame[source]
Parameters:
filter_abnormalities: bool

If True, do not return rows corresponding to sessions with identified abnormalities in histology or activity

Returns:
ecephys_sessions_table: pd.DataFrame

pandas dataframe representing metadata for all ecephys sessions in the data release

get_probe_table() DataFrame[source]
Returns:
probes table: pd.DataFrame
Columns:
  • id: probe id

  • name: probe name

  • location: probe location

  • lfp_sampling_rate: LFP sampling rate

  • has_lfp_data: Whether this probe has LFP data

get_unit_table() DataFrame[source]
Returns:
units table: pd.DataFrame
Columns:
  • properties of allensdk.ecephys._unit.Unit

except for ‘spike_times’, ‘spike_amplitudes’, ‘mean_waveforms’ which are returned separately