allensdk.internal.api.behavior_data_lims_api module¶
-
class
allensdk.internal.api.behavior_data_lims_api.
BehaviorDataLimsApi
(behavior_session_id: int, lims_credentials: Optional[allensdk.core.authentication.DbCredentials] = None, mtrain_credentials: Optional[allensdk.core.authentication.DbCredentials] = None)[source]¶ Bases:
allensdk.core.cache_method_utilities.CachedInstanceMethodMixin
,allensdk.brain_observatory.behavior.internal.behavior_base.BehaviorBase
-
get_behavior_stimulus_file
(self) → str[source]¶ Return the path to the StimulusPickle file for a session. :rtype: str
-
get_birth_date
(self) → <method 'date' of 'datetime.datetime' objects>[source]¶ Returns the birth date of the animal. :rtype: datetime.date
-
get_driver_line
(self) → List[str][source]¶ Returns the genotype name(s) of the driver line(s). :rtype: list
-
get_experiment_date
(self) → datetime.datetime[source]¶ Return timestamp the behavior stimulus file began recording in UTC :rtype: datetime
-
get_licks
(self) → pandas.core.frame.DataFrame[source]¶ Get lick data from pkl file. This function assumes that the first sensor in the list of lick_sensors is the desired lick sensor. If this changes we need to update to get the proper line.
Since licks can occur outside of a trial context, the lick times are extracted from the vsyncs and the frame number in lick_events. Since we don’t have a timestamp for when in “experiment time” the vsync stream starts (from self.get_stimulus_timestamps), we compute it by fitting a linear regression (frame number x time) for the start_trial and end_trial events in the trial_log, to true up these time streams.
Returns: pd.DataFrame – A dataframe containing lick timestamps
-
get_reporter_line
(self) → List[str][source]¶ Returns the genotype name(s) of the reporter line(s). :rtype: list
-
get_rewards
(self) → pandas.core.frame.DataFrame[source]¶ Get reward data from pkl file, based on pkl file timestamps (not sync file).
Returns: pd.DataFrame – A dataframe containing timestamps of delivered rewards.
-
get_running_data_df
(self) → pandas.core.frame.DataFrame[source]¶ Get running speed data.
Returns: pd.DataFrame – dataframe containing various signals used to compute running speed.
-
get_running_speed
(self) → allensdk.brain_observatory.running_speed.RunningSpeed[source]¶ Get running speed using timestamps from self.get_stimulus_timestamps.
NOTE: Do not correct for monitor delay.
Returns: RunningSpeed – a NamedTuple containing the subject’s timestamps and running speeds (in cm/s)
-
get_stimulus_name
(self) → str[source]¶ Returns the name of the stimulus set used for the session. :rtype: str
-
get_stimulus_presentations
(self) → pandas.core.frame.DataFrame[source]¶ Get stimulus presentation data.
NOTE: Uses timestamps that do not account for monitor delay.
Returns: pd.DataFrame – Table whose rows are stimulus presentations (i.e. a given image, for a given duration, typically 250 ms) and whose columns are presentation characteristics.
-
get_stimulus_templates
(self) → Dict[str, numpy.ndarray][source]¶ Get stimulus templates (movies, scenes) for behavior session.
Returns: - Dict[str, np.ndarray]
A dictionary containing the stimulus images presented during the session. Keys are data set names, and values are 3D numpy arrays.
-
get_stimulus_timestamps
(self) → numpy.ndarray[source]¶ Get stimulus timestamps (vsyncs) from pkl file. Align to the (frame, time) points in the trial events.
NOTE: Located with behavior_session_id. Does not use the sync_file which requires ophys_session_id.
Returns: - np.ndarray
Timestamps associated with stimulus presentations on the monitor that do no account for monitor delay.
-