allensdk.brain_observatory.behavior.behavior_project_lims_api module

class allensdk.brain_observatory.behavior.behavior_project_lims_api.BehaviorProjectLimsApi(lims_engine, mtrain_engine, app_engine)[source]

Bases: allensdk.brain_observatory.behavior.internal.behavior_project_base.BehaviorProjectBase

classmethod default(lims_credentials: Union[allensdk.core.authentication.DbCredentials, NoneType] = None, mtrain_credentials: Union[allensdk.core.authentication.DbCredentials, NoneType] = None, app_kwargs: Union[Dict[str, Any], NoneType] = None) → 'BehaviorProjectLimsApi'[source]

Construct a BehaviorProjectLimsApi instance with default postgres and app engines.

Parameters:
lims_credentials: Optional[DbCredentials]

Credentials to pass to the postgres connector to the lims database. If left unspecified, will check environment variables for the appropriate values.

mtrain_credentials: Optional[DbCredentials]

Credentials to pass to the postgres connector to the mtrain database. If left unspecified, will check environment variables for the appropriate values.

app_kwargs: Dict

Dict of arguments to pass to the app engine. Currently unused.

Returns:
BehaviorProjectLimsApi
get_behavior_only_session_data(self, behavior_session_id: int) → allensdk.brain_observatory.behavior.behavior_data_session.BehaviorDataSession[source]

Returns a BehaviorDataSession object that contains methods to analyze a single behavior session. :param behavior_session_id: id that corresponds to a behavior session :type behavior_session_id: int :rtype: BehaviorDataSession

get_behavior_only_session_table(self, behavior_session_ids: Union[List[int], NoneType] = None) → pandas.core.frame.DataFrame[source]

Returns a pd.DataFrame table with all behavior session_ids to the user with additional metadata.

Can’t return age at time of session because there is no field for acquisition date for behavior sessions (only in the stimulus pkl file) :rtype: pd.DataFrame

get_experiment_table(self, ophys_experiment_ids: Union[List[int], NoneType] = None) → pandas.core.frame.DataFrame[source]

Return a pd.Dataframe table with all ophys_experiment_ids and relevant metadata. This is the most specific and most informative level to examine the data. Return columns:

ophys_experiment_id, ophys_session_id, behavior_session_id, container_id, project_code, container_workflow_state, experiment_workflow_state, session_name, session_type, equipment_name, date_of_acquisition, isi_experiment_id, specimen_id, sex, age_in_days, full_genotype, reporter_line, driver_line, imaging_depth, targeted_structure, published_at
Parameters:ophys_experiment_ids – optional list of ophys_experiment_ids to include
Return type:pd.DataFrame
get_natural_movie_template(self, number: int) → Iterable[bytes][source]

Download a template for the natural scene stimulus. This is the actual image that was shown during the recording session. :param number: idenfifier for this movie (note that this is an int,

so to get the template for natural_movie_three should pass 3)
Returns:iterable yielding a tiff file as bytes
get_natural_scene_template(self, number: int) → Iterable[bytes][source]

Download a template for the natural movie stimulus. This is the actual movie that was shown during the recording session. :param number: identifier for this scene :type number: int :returns: An iterable yielding an npy file as bytes

get_session_data(self, ophys_session_id: int) → allensdk.brain_observatory.behavior.behavior_ophys_session.BehaviorOphysSession[source]

Returns a BehaviorOphysSession object that contains methods to analyze a single behavior+ophys session. :param ophys_session_id: id that corresponds to a behavior session :type ophys_session_id: int :rtype: BehaviorOphysSession

get_session_table(self, ophys_session_ids: Union[List[int], NoneType] = None) → pandas.core.frame.DataFrame[source]

Return a pd.Dataframe table with all ophys_session_ids and relevant metadata. Return columns: ophys_session_id, behavior_session_id,

ophys_experiment_id, project_code, session_name, session_type, equipment_name, date_of_acquisition, specimen_id, full_genotype, sex, age_in_days, reporter_line, driver_line
Parameters:ophys_session_ids – optional list of ophys_session_ids to include
Return type:pd.DataFrame