allensdk.brain_observatory.vbn_2022.metadata_writer.lims_queries module

allensdk.brain_observatory.vbn_2022.metadata_writer.lims_queries.channels_table_from_ecephys_session_id_list(lims_connection: PostgresQueryMixin, ecephys_session_id_list: List[int], probe_ids_to_skip: List[int] | None) DataFrame[source]

Perform the database query that will return the channels table.

Parameters:
lims_connection: PostgresQueryMixin
ecephys_session_id_list: List[int]

The list of ecephys_sessions.id values of the ecephys sessions for which to construct the units table

probe_ids_to_skip: Optional[List[int]]

The IDs of probes not being released

Returns:
channels_table: pd.DataFrame

A pandas DataFrame corresponding to the channels metadata table

allensdk.brain_observatory.vbn_2022.metadata_writer.lims_queries.get_list_of_bad_probe_ids(lims_connection: PostgresQueryMixin, probes_to_skip: List[Dict[str, Any]]) List[int][source]

Given a list of probes to skip,each of the form

{‘session’: ecephys_session_id,

‘probe’: probe_name}

return a list of the ecephys_probe_ids associated with the bad probes.

Parameters:
lims_connection: PostgressQueryMixin
probes_to_skip: List[Dict[str, Any]]

List of dicts specifying the probes to skip (see above for the form each dict needs to take)

Returns:
bad_probe_id_list: List[int]

List of the globally unique ecephys_probe_id values that need to be skipped

allensdk.brain_observatory.vbn_2022.metadata_writer.lims_queries.probes_table_from_ecephys_session_id_list(lims_connection: PostgresQueryMixin, ecephys_session_id_list: List[int], probe_ids_to_skip: List[int] | None) DataFrame[source]

Perform the database query that will return the probes table.

Parameters:
lims_connection: PostgresQueryMixin
ecephys_session_id_list: List[int]

The list of ecephys_sessions.id values of the ecephys sessions for which to construct the units table

probe_ids_to_skip: Optional[List[int]]

The IDs of probes not being released

Returns:
probes_table: pd.DataFrame

A pandas DataFrame corresponding to the probes metadata table

allensdk.brain_observatory.vbn_2022.metadata_writer.lims_queries.session_tables_from_ecephys_session_id_list(lims_connection: PostgresQueryMixin, ecephys_session_id_list: List[int], failed_ecephys_session_id_list: List[int] | None, probe_ids_to_skip: List[int] | None, n_workers: int | None = None) Tuple[DataFrame, DataFrame][source]

Perform the database query to generate the ecephys_session_table

Parameters:
lims_connection: PostgresQueryMixin
ecephys_session_id_list: List[int]

The list of ecephys_sessions.id values of the ecephys sessions for which to construct the units table

failed_ecephys_session_id_list: Optional[List[int]]

A list of ecephys_sessions that are ultimately failed and should not be included in the release. The purpose of this list is so that these sessions can be accounted for in the various dataframe manipulations that calculate a mouse’s history passing through the apparatus (i.e. if the day 1 session is failed but the day 2 session is not)

probe_ids_to_skip: Optional[List[int]]

The IDs of probes not being released

n_workers

Number of workers for reading from pkl file

Returns:
session_table: pd.DataFrame

A pandas DataFrame corresponding to the session table

allensdk.brain_observatory.vbn_2022.metadata_writer.lims_queries.units_table_from_ecephys_session_id_list(lims_connection: PostgresQueryMixin, ecephys_session_id_list: List[int], probe_ids_to_skip: List[int] | None) DataFrame[source]

Perform the database query that will return the units table.

Parameters:
lims_connection: PostgresQueryMixin
ecephys_session_id_list: List[int]

The list of ecephys_sessions.id values of the ecephys sessions for which to construct the units table

probe_ids_to_skip: Optional[List[int]]

The IDs of probes not being released

Returns:
units_table: pd.DataFrame

A pandas DataFrame corresponding to the units metadata table