allensdk.brain_observatory.ecephys.ecephys_session_api package

Submodules

Module contents

class allensdk.brain_observatory.ecephys.ecephys_session_api.EcephysNwb1Api(path, *args, **kwargs)[source]

Bases: EcephysSessionApi

An EcephySession adaptor for reading NWB1.0 files.

Was created by sight using an assortment of existing NWB1 files. It is possible that parts of the NWB1 standard (?!) is missing or not properly implemented.

NWB1 vs NWB2 issues: * In NWB 1 there is no difference between global unit-ids and probe’s local-index. A unit is unique to one channel * Units are missing information about firing_rate, isi_violation, and quality.

  • So that EcephysSession._build_units() actually return values I had

to set quality=good for all units

  • NWB Stimulus_presentations missing stimulus_block, stimulus_index and

Image column
  • To get EcephysSession.conditionwise_spikes() working had to make up

a block number for every stimulus type

  • NWB1 missing a ‘valid_data’ tag for channels. Had to set to True

otherwise EcephysSession won’t see any channels * There were no ‘channels’ table/group in NWB1. Instead we had to iterate through all the units and pull out the

distinct channel info.

  • In NWB2 each unit has a mean-waveform for every channel on the probe.

In NWB1 A unit only has a single waveform * The NWB1 identifier is a string

classmethod from_path(path, **kwargs)[source]
get_channels() DataFrame[source]
get_ecephys_session_id() int[source]
get_invalid_times() DataFrame[source]
get_mean_waveforms() Dict[int, ndarray][source]
get_probes() DataFrame[source]
get_running_speed()[source]
get_spike_times() Dict[int, ndarray][source]
get_stimulus_presentations() DataFrame[source]
get_units() DataFrame[source]
property processing_grp
property running_speed_grp
class allensdk.brain_observatory.ecephys.ecephys_session_api.EcephysNwbSessionApi(path, probe_lfp_paths: Dict[int, Callable[[], NWBFile]] | None = None, additional_unit_metrics=None, external_channel_columns=None, **kwargs)[source]

Bases: NwbApi, EcephysSessionApi

get_channels() DataFrame[source]
get_current_source_density(probe_id)[source]
get_ecephys_session_id() int[source]
get_lfp(probe_id: int) DataArray[source]
get_mean_waveforms() Dict[int, ndarray][source]
get_metadata()[source]
get_optogenetic_stimulation() DataFrame[source]
get_probes() DataFrame[source]
get_pupil_data() DataFrame | None[source]
get_raw_running_data()[source]
get_rig_metadata() dict | None[source]
get_running_speed(include_rotation=False) DataFrame[source]

Gets the running speed Parameters ———- lowpass: bool

Whether to return the running speed with lowpass filter applied or without

Returns:
RunningSpeed:

The running speed

get_screen_gaze_data(include_filtered_data=False) DataFrame | None[source]
get_session_start_time()[source]
get_spike_amplitudes() Dict[int, ndarray][source]
get_spike_times() Dict[int, ndarray][source]
get_stimulus_presentations()[source]
get_units() DataFrame[source]
path
test()[source]

A minimal test to make sure that this API’s NWB file exists and is readable. Ecephys NWB files use the required session identifier field to store the session id, so this is guaranteed to be present for any uncorrupted NWB file.

Of course, this does not ensure that the file as a whole is correct.

class allensdk.brain_observatory.ecephys.ecephys_session_api.EcephysSessionApi(*args, **kwargs)[source]

Bases: object

get_channels() DataFrame[source]
get_ecephys_session_id() int[source]
get_invalid_times() DataFrame[source]
get_lfp(probe_id: int) DataArray[source]
get_mean_waveforms() Dict[int, ndarray][source]
get_metadata()[source]
get_optogenetic_stimulation() DataFrame[source]
get_probes() DataFrame[source]
get_pupil_data() DataFrame | None[source]
get_rig_metadata() dict | None[source]
get_running_speed() RunningSpeed[source]
get_screen_gaze_data(include_filtered_data=False) DataFrame | None[source]
get_session_start_time() datetime[source]
get_spike_amplitudes() Dict[int, ndarray][source]
get_spike_times() Dict[int, ndarray][source]
get_stimulus_presentations() DataFrame[source]
get_units() DataFrame[source]
session_na = -1
test() bool[source]