allensdk.brain_observatory.ecephys.ecephys_project_api package¶
Submodules¶
- allensdk.brain_observatory.ecephys.ecephys_project_api.ecephys_project_api module
EcephysProjectApiEcephysProjectApi.get_channels()EcephysProjectApi.get_isi_experiments()EcephysProjectApi.get_natural_movie_template()EcephysProjectApi.get_natural_scene_template()EcephysProjectApi.get_probe_lfp_data()EcephysProjectApi.get_probes()EcephysProjectApi.get_session_data()EcephysProjectApi.get_sessions()EcephysProjectApi.get_unit_analysis_metrics()EcephysProjectApi.get_units()
- allensdk.brain_observatory.ecephys.ecephys_project_api.ecephys_project_fixed_api module
EcephysProjectFixedApiEcephysProjectFixedApi.get_channels()EcephysProjectFixedApi.get_isi_experiments()EcephysProjectFixedApi.get_natural_movie_template()EcephysProjectFixedApi.get_natural_scene_template()EcephysProjectFixedApi.get_probe_lfp_data()EcephysProjectFixedApi.get_probes()EcephysProjectFixedApi.get_session_data()EcephysProjectFixedApi.get_sessions()EcephysProjectFixedApi.get_targeted_regions()EcephysProjectFixedApi.get_units()
MissingDataError
- allensdk.brain_observatory.ecephys.ecephys_project_api.ecephys_project_lims_api module
EcephysProjectLimsApiEcephysProjectLimsApi.STIMULUS_TEMPLATE_NAMESPACEEcephysProjectLimsApi.default()EcephysProjectLimsApi.get_channels()EcephysProjectLimsApi.get_natural_movie_template()EcephysProjectLimsApi.get_natural_scene_template()EcephysProjectLimsApi.get_probe_lfp_data()EcephysProjectLimsApi.get_probes()EcephysProjectLimsApi.get_session_data()EcephysProjectLimsApi.get_sessions()EcephysProjectLimsApi.get_unit_analysis_metrics()EcephysProjectLimsApi.get_units()
SplitPublishedAt
- allensdk.brain_observatory.ecephys.ecephys_project_api.ecephys_project_warehouse_api module
EcephysProjectWarehouseApiEcephysProjectWarehouseApi.default()EcephysProjectWarehouseApi.get_channels()EcephysProjectWarehouseApi.get_natural_movie_template()EcephysProjectWarehouseApi.get_natural_scene_template()EcephysProjectWarehouseApi.get_probe_lfp_data()EcephysProjectWarehouseApi.get_probes()EcephysProjectWarehouseApi.get_session_data()EcephysProjectWarehouseApi.get_sessions()EcephysProjectWarehouseApi.get_unit_analysis_metrics()EcephysProjectWarehouseApi.get_units()EcephysProjectWarehouseApi.movie_reEcephysProjectWarehouseApi.scene_reEcephysProjectWarehouseApi.stimulus_templates
- allensdk.brain_observatory.ecephys.ecephys_project_api.http_engine module
- allensdk.brain_observatory.ecephys.ecephys_project_api.rma_engine module
- allensdk.brain_observatory.ecephys.ecephys_project_api.utilities module
Module contents¶
- class allensdk.brain_observatory.ecephys.ecephys_project_api.EcephysProjectApi[source]¶
Bases:
object- get_channels(channel_ids: ArrayLike | None = None, probe_ids: ArrayLike | None = None, session_ids: ArrayLike | None = None, published_at: str | None = None)[source]¶
- get_probes(probe_ids: ArrayLike | None = None, session_ids: ArrayLike | None = None, published_at: str | None = None)[source]¶
- class allensdk.brain_observatory.ecephys.ecephys_project_api.EcephysProjectFixedApi[source]¶
Bases:
EcephysProjectApi
- class allensdk.brain_observatory.ecephys.ecephys_project_api.EcephysProjectLimsApi(postgres_engine, app_engine)[source]¶
Bases:
EcephysProjectApi- STIMULUS_TEMPLATE_NAMESPACE = 'brain_observatory_1.1'¶
- classmethod default(lims_credentials: DbCredentials | None = None, app_kwargs=None, asynchronous=False)[source]¶
Construct a “straightforward” lims api that can fetch data from lims2.
- Parameters:
- lims_credentialsDbCredentials
Credentials and configuration for postgres queries against the LIMS database. If left unspecified will attempt to provide credentials from environment variables.
- app_kwargsdict
High-level configuration for http requests. See allensdk.brain_observatory.ecephys.ecephys_project_api.http_engine.HttpEngine and AsyncHttpEngine for details.
- asynchronousbool
If true, (http) queries will be made asynchronously.
- Returns:
- EcephysProjectLimsApi
- get_channels(channel_ids: ArrayLike | None = None, probe_ids: ArrayLike | None = None, session_ids: ArrayLike | None = None, published_at: str | None = None) 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(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(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(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(probe_ids: ArrayLike | None = None, session_ids: ArrayLike | None = None, published_at: str | None = None) 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(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(session_ids: ArrayLike | None = None, published_at: str | None = None) 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(unit_ids: ArrayLike | None = None, ecephys_session_ids: ArrayLike | None = None, session_types: ArrayLike | None = None) 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)
Parameters¶
- 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(unit_ids: ArrayLike | None = None, channel_ids: ArrayLike | None = None, probe_ids: ArrayLike | None = None, session_ids: ArrayLike | None = None, published_at: str | None = None) 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.
- class allensdk.brain_observatory.ecephys.ecephys_project_api.EcephysProjectWarehouseApi(rma_engine=None)[source]¶
Bases:
EcephysProjectApi- get_unit_analysis_metrics(unit_ids=None, ecephys_session_ids=None, session_types=None)[source]¶
Download analysis metrics - precalculated descriptions of unitwise responses to visual stimulation.
- Parameters:
- unit_idsarray-like of int, optional
Unique identifiers for ecephys units. If supplied, only download metrics for these units.
- ecephys_session_idsarray-like of int, optional
Unique identifiers for ecephys sessions. If supplied, only download metrics for units collected during these sessions.
- session_typesarray-like of str, optional
Names of session types. e.g. “brain_observatory_1.1” or “functional_connectivity”. If supplied, only download metrics for units collected during sessions of these types
- Returns:
- pd.DataFrame
A table of analysis metrics, indexed by unit_id.
- movie_re = re.compile('.*natural_movie_(?P<num>\\d+).npy')¶
- scene_re = re.compile('.*/(?P<num>\\d+).tiff')¶
- property stimulus_templates¶