allensdk.brain_observatory.behavior.behavior_project_cache.behavior_project_cache module

exception allensdk.brain_observatory.behavior.behavior_project_cache.behavior_project_cache.UpdatedStimulusPresentationTableWarning[source]

Bases: UserWarning

class allensdk.brain_observatory.behavior.behavior_project_cache.behavior_project_cache.VBOLimsCache(manifest=None, cache=True, version=None, **kwargs)[source]

Bases: Cache

A class that ineherits from the warehouse Cache and provides that functionality to VisualBehaviorOphysProjectCache

BEHAVIOR_SESSIONS_KEY = 'behavior_sessions'
MANIFEST_CONFIG = {'behavior_sessions': {'parent_key': 'BASEDIR', 'spec': 'behavior_sessions.csv', 'typename': 'file'}, 'ophys_cells': {'parent_key': 'BASEDIR', 'spec': 'ophys_cells.csv', 'typename': 'file'}, 'ophys_experiments': {'parent_key': 'BASEDIR', 'spec': 'ophys_experiments.csv', 'typename': 'file'}, 'ophys_sessions': {'parent_key': 'BASEDIR', 'spec': 'ophys_sessions.csv', 'typename': 'file'}}
MANIFEST_VERSION = '0.0.1-alpha.3'
OPHYS_CELLS_KEY = 'ophys_cells'
OPHYS_EXPERIMENTS_KEY = 'ophys_experiments'
OPHYS_SESSIONS_KEY = 'ophys_sessions'
class allensdk.brain_observatory.behavior.behavior_project_cache.behavior_project_cache.VisualBehaviorOphysProjectCache(fetch_api: BehaviorProjectLimsApi | BehaviorProjectCloudApi | None = None, fetch_tries: int = 2, manifest: str | Path | None = None, version: str | None = None, cache: bool = True)[source]

Bases: ProjectCacheBase

BUCKET_NAME: str = 'visual-behavior-ophys-data'
PROJECT_NAME: str = 'visual-behavior-ophys'
classmethod cloud_api_class()[source]
get_behavior_ophys_experiment(ophys_experiment_id: int) BehaviorOphysExperiment[source]

Gets BehaviorOphysExperiment for ophys_experiment_id Parameters ———- ophys_experiment_id: ophys experiment id

Returns:
BehaviorOphysExperiment
get_behavior_session(behavior_session_id: int) BehaviorSession[source]

Gets BehaviorSession for behavior_session_id Parameters ———- behavior_session_id: behavior session id

Returns:
BehaviorSession
get_behavior_session_table(suppress: List[str] | None = None, as_df=True, include_ophys_data=True, include_trial_metrics: bool = False) DataFrame | SessionsTable[source]

Return summary table of all behavior_session_ids in the database. :param suppress: optional list of columns to drop from the resulting

dataframe.

Parameters:

as_df – whether to return as df or as SessionsTable

:param include_ophys_data

Whether to include ophys data

:param include_trial_metrics

Whether to include trial metrics. Set to False to skip. Is expensive to calculate these metrics since the data must be read from the pkl file for each session

Return type:

pd.DataFrame

get_natural_movie_template(n_workers=None) DataFrame[source]

Download the movie if needed and process it into warped and unwarped frames as presented to the mouse. The DataFrame is indexed with the same frame index as shown in the stimulus presentation table.

The processing of the movie requires significant processing and its return size is very large so take care in requesting this data.

Parameters:
n_workersint

Number of processes to use to transform the movie to what was shown on the monitor. Default=None (use all cores).

Returns:
processed_moviepd.DataFrame
get_ophys_cells_table() DataFrame[source]

Return summary table of all cells in this project cache :rtype: pd.DataFrame

get_ophys_experiment_table(suppress: List[str] | None = None, as_df=True) DataFrame | SessionsTable[source]

Return summary table of all ophys_experiment_ids in the database. :param suppress: optional list of columns to drop from the resulting

dataframe.

Parameters:

as_df – whether to return as df or as SessionsTable

Return type:

pd.DataFrame

get_ophys_session_table(suppress: List[str] | None = None, index_column: str = 'ophys_session_id', as_df=True, include_behavior_data=True) DataFrame | BehaviorOphysSessionsTable[source]

Return summary table of all ophys_session_ids in the database. :param suppress: optional list of columns to drop from the resulting

dataframe.

Parameters:

index_column – (default=”ophys_session_id”). Column to index

on, either

“ophys_session_id” or “ophys_experiment_id”. If index_column=”ophys_experiment_id”, then each row will only have one experiment id, of type int (vs. an array of 1>more).

Parameters:

as_df – whether to return as df or as BehaviorOphysSessionsTable

:param include_behavior_data

Whether to include behavior data

Return type:

pd.DataFrame

get_raw_natural_movie() ndarray[source]

Download the raw movie data from the cloud and return it as a numpy array.

Returns:
raw_movienp.ndarray
classmethod lims_api_class()[source]