allensdk.brain_observatory.behavior.session_apis.data_io.behavior_lims_api module

class allensdk.brain_observatory.behavior.session_apis.data_io.behavior_lims_api.BehaviorLimsApi(behavior_session_id: Optional[int] = None, lims_credentials: Optional[allensdk.core.authentication.DbCredentials] = None, mtrain_credentials: Optional[allensdk.core.authentication.DbCredentials] = None, extractor: Optional[allensdk.brain_observatory.behavior.session_apis.abcs.data_extractor_base.behavior_data_extractor_base.BehaviorDataExtractorBase] = None)[source]

Bases: allensdk.brain_observatory.behavior.session_apis.data_transforms.behavior_data_transforms.BehaviorDataTransforms, allensdk.core.cache_method_utilities.CachedInstanceMethodMixin

A data fetching and processing class that serves processed data from a specified raw data source (extractor). Contains all methods needed to fill a BehaviorSession.

class allensdk.brain_observatory.behavior.session_apis.data_io.behavior_lims_api.BehaviorLimsExtractor(behavior_session_id: int, lims_credentials: Optional[allensdk.core.authentication.DbCredentials] = None, mtrain_credentials: Optional[allensdk.core.authentication.DbCredentials] = None)[source]

Bases: allensdk.brain_observatory.behavior.session_apis.abcs.data_extractor_base.behavior_data_extractor_base.BehaviorDataExtractorBase

A data fetching class that serves as an API for fetching ‘raw’ data from LIMS necessary (but not sufficient) for filling a ‘BehaviorSession’.

Most ‘raw’ data provided by this API needs to be processed by BehaviorDataTransforms methods in order to usable by ‘BehaviorSession’s

classmethod from_foraging_id(foraging_id: Union[str, uuid.UUID, int], lims_credentials: Union[allensdk.core.authentication.DbCredentials, NoneType] = None) → 'BehaviorLimsApi'[source]

Create a BehaviorLimsAPI instance from a foraging_id instead of a behavior_session_id.

NOTE: ‘foraging_id’ in the LIMS behavior_session table should be
the same as the ‘behavior_session_uuid’ in mtrain which should also be the same as the ‘session_uuid’ field in the .pkl returned by ‘get_behavior_stimulus_file()’.
get_age(self) → str[source]

Return the age code of the subject (ie P123) :rtype: str

get_behavior_session_id(self) → int[source]

Getter to be consistent with BehaviorOphysLimsApi.

get_behavior_stimulus_file(self) → str[source]

Return the path to the StimulusPickle file for a session. :rtype: str

get_birth_date(self) → datetime.datetime[source]

Returns the birth date of the animal. :rtype: datetime.date

get_date_of_acquisition(self) → datetime.datetime[source]

Get the acquisition date of a behavior_session in UTC :rtype: datetime

get_driver_line(self) → List[str][source]

Returns the genotype name(s) of the driver line(s). :rtype: list

get_equipment_name(self) → str[source]

Returns the name of the experimental rig. :rtype: str

get_foraging_id(self) → int[source]

Get the foraging ID for the behavior session

get_full_genotype(self) → str[source]

Return the name of the subject’s genotype :rtype: str

get_mouse_id(self) → int[source]

Returns the LabTracks ID :rtype: int

get_ophys_container_id(self) → Union[int, NoneType][source]
get_ophys_experiment_ids(self) → Union[List[int], NoneType][source]
get_ophys_session_id(self) → Union[int, NoneType][source]
get_reporter_line(self) → List[str][source]

Returns the genotype name(s) of the reporter line(s). :rtype: list

get_sex(self) → str[source]

Returns sex of the animal (M/F) :rtype: str