allensdk.brain_observatory.ecephys.stimulus_analysis.flashes module

class allensdk.brain_observatory.ecephys.stimulus_analysis.flashes.Flashes(ecephys_session, col_color='color', trial_duration=0.25, **kwargs)[source]

Bases: allensdk.brain_observatory.ecephys.stimulus_analysis.stimulus_analysis.StimulusAnalysis

A class for computing single-unit metrics from the full-field flash stimulus of an ecephys session NWB file.

To use, pass in a EcephysSession object::
session = EcephysSession.from_nwb_path(‘/path/to/my.nwb’) fl_analysis = Flashes(session)
or, alternatively, pass in the file path::
fl_analysis = Flashes(‘/path/to/my.nwb’)

You can also pass in a unit filter dictionary which will only select units with certain properties. For example to get only those units which are on probe C and found in the VISp area:

fl_analysis = Flashes(session, filter={'location': 'probeC', 'ecephys_structure_acronym': 'VISp'})
To get a table of the individual unit metrics ranked by unit ID::
metrics_table_df = fl_analysis.metrics()
METRICS_COLUMNS
colors

Array of ‘color’ conditions (black vs. white flash)

classmethod known_stimulus_keys()[source]

Used for discovering the correct stimulus_name key for a given StimulusAnalysis subclass (when stimulus_key is not explicity set). Should return a list of “stimulus_name” strings.

metrics

Returns a pandas DataFrame of the stimulus response metrics for each unit.

name

Return the stimulus name.

null_condition

Stimulus condition ID for null stimulus (not used, so set to -1)

number_colors

Number of ‘color’ conditions (black vs. white flash)

plot_raster(self, stimulus_condition_id, unit_id)[source]

Plot raster for one condition and one unit

plot_response(self, unit_id)[source]

Plot a histogram for the two conditions