allensdk.brain_observatory.ecephys.ecephys_project_api.ecephys_project_lims_api module¶
-
class
allensdk.brain_observatory.ecephys.ecephys_project_api.ecephys_project_lims_api.
EcephysProjectLimsApi
(postgres_engine, app_engine)[source]¶ Bases:
allensdk.brain_observatory.ecephys.ecephys_project_api.ecephys_project_api.EcephysProjectApi
-
STIMULUS_TEMPLATE_NAMESPACE
= 'brain_observatory_1.1'¶
-
classmethod
default
(lims_credentials: Union[allensdk.core.authentication.DbCredentials, NoneType] = None, app_kwargs=None, asynchronous=False)[source]¶ Construct a “straightforward” lims api that can fetch data from lims2.
Parameters: - lims_credentials : DbCredentials
Credentials and configuration for postgres queries against the LIMS database. If left unspecified will attempt to provide credentials from environment variables.
- app_kwargs : dict
High-level configuration for http requests. See allensdk.brain_observatory.ecephys.ecephys_project_api.http_engine.HttpEngine and AsyncHttpEngine for details.
- asynchronous : bool
If true, (http) queries will be made asynchronously.
Returns: - EcephysProjectLimsApi
-
get_channels
(self, channel_ids: Union[~ArrayLike, NoneType] = None, probe_ids: Union[~ArrayLike, NoneType] = None, session_ids: Union[~ArrayLike, NoneType] = None, published_at: Union[str, NoneType] = None) → pandas.core.frame.DataFrame[source]¶ Download a table of ecephys channel records.
Parameters: - channel_ids :
A collection of integer identifiers for ecephys channels. If provided, results will be filtered to these channels.
- probe_ids :
A collection of integer identifiers for ecephys probes. If provided, results will be filtered to channels on these probes.
- session_ids :
A collection of integer identifiers for ecephys sessions. If provided, results will be filtered to channels recorded from during these sessions.
- published_at :
A date (rendered as “YYYY-MM-DD”). If provided, only channels recorded from during sessions published before this date will be returned.
Returns: - a pd.DataFrame whose rows are ecephys channels.
-
get_natural_movie_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.
Parameters: - number :
idenfifier for this movie (note that this is an integer, so to get the template for natural_movie_three you should pass in 3)
Returns: - An iterable yielding an npy file as bytes
-
get_natural_scene_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.
Parameters: - number :
idenfifier for this scene
Returns: - An iterable yielding a tiff file as bytes.
-
get_probe_lfp_data
(self, probe_id: int) → Iterable[bytes][source]¶ Download an NWB file containing detailed data for the local field potential recorded from an ecephys probe.
Parameters: - probe_id :
Download an NWB file for this probe’s LFP
Returns: - An iterable yielding an NWB file as bytes.
-
get_probes
(self, probe_ids: Union[~ArrayLike, NoneType] = None, session_ids: Union[~ArrayLike, NoneType] = None, published_at: Union[str, NoneType] = None) → pandas.core.frame.DataFrame[source]¶ Download a table of ecephys probe records.
Parameters: - probe_ids :
A collection of integer identifiers for ecephys probes. If provided, results will be filtered to these probes.
- session_ids :
A collection of integer identifiers for ecephys sessions. If provided, results will be filtered to probes recorded from during these sessions.
- published_at :
A date (rendered as “YYYY-MM-DD”). If provided, only probes recorded from during sessions published before this date will be returned.
Returns: - a pd.DataFrame whose rows are ecephys probes.
-
get_session_data
(self, session_id: int) → Iterable[bytes][source]¶ Download an NWB file containing detailed data for an ecephys session.
Parameters: - session_id :
Download an NWB file for this session
Returns: - An iterable yielding an NWB file as bytes.
-
get_sessions
(self, session_ids: Union[~ArrayLike, NoneType] = None, published_at: Union[str, NoneType] = None) → pandas.core.frame.DataFrame[source]¶ Download a table of ecephys session records.
Parameters: - session_ids :
A collection of integer identifiers for ecephys sessions. If provided, results will be filtered to these sessions.
- published_at :
A date (rendered as “YYYY-MM-DD”). If provided, only sessions published before this date will be returned.
Returns: - a pd.DataFrame whose rows are ecephys sessions.
-
get_unit_analysis_metrics
(self, unit_ids: Union[~ArrayLike, NoneType] = None, ecephys_session_ids: Union[~ArrayLike, NoneType] = None, session_types: Union[~ArrayLike, NoneType] = None) → pandas.core.frame.DataFrame[source]¶ Fetch analysis metrics (stimulus set-specific characterizations of unit response patterns) for ecephys units. Note that the metrics returned depend on the stimuli that were presented during recording ( and thus on the session_type)
- unit_ids :
- integer identifiers for a set of ecephys units. If provided, the response will only include metrics calculated for these units
- ecephys_session_ids :
- integer identifiers for a set of ecephys sessions. If provided, the response will only include metrics calculated for units identified during these sessions
- session_types :
- string names identifying ecephys session types (e.g. “brain_observatory_1.1” or “functional_connectivity”)
Returns: - a pandas dataframe indexed by ecephys unit id whose columns are
- metrics.
-
get_units
(self, unit_ids: Union[~ArrayLike, NoneType] = None, channel_ids: Union[~ArrayLike, NoneType] = None, probe_ids: Union[~ArrayLike, NoneType] = None, session_ids: Union[~ArrayLike, NoneType] = None, published_at: Union[str, NoneType] = None) → pandas.core.frame.DataFrame[source]¶ Download a table of records describing sorted ecephys units.
Parameters: - unit_ids :
A collection of integer identifiers for sorted ecephys units. If provided, only return records describing these units.
- channel_ids :
A collection of integer identifiers for ecephys channels. If provided, results will be filtered to units recorded from these channels.
- probe_ids :
A collection of integer identifiers for ecephys probes. If provided, results will be filtered to units recorded from these probes.
- session_ids :
A collection of integer identifiers for ecephys sessions. If provided, results will be filtered to units recorded during these sessions.
- published_at :
A date (rendered as “YYYY-MM-DD”). If provided, only units recorded during sessions published before this date will be returned.
Returns: - a pd.DataFrame whose rows are ecephys channels.
-