allensdk.brain_observatory.drifting_gratings module

class allensdk.brain_observatory.drifting_gratings.DriftingGratings(data_set, **kwargs)[source]

Bases: allensdk.brain_observatory.stimulus_analysis.StimulusAnalysis

Perform tuning analysis specific to drifting gratings stimulus.

Parameters:
data_set: BrainObservatoryNwbDataSet object
static from_analysis_file(data_set, analysis_file)[source]
get_noise_correlation(self, corr='spearman')[source]
get_peak(self)[source]

Computes metrics related to each cell’s peak response condition.

Returns:
Pandas data frame containing the following columns (_dg suffix is
for drifting grating):
  • ori_dg (orientation)
  • tf_dg (temporal frequency)
  • reliability_dg
  • osi_dg (orientation selectivity index)
  • dsi_dg (direction selectivity index)
  • peak_dff_dg (peak dF/F)
  • ptest_dg
  • p_run_dg
  • run_modulation_dg
  • cv_dg (circular variance)
get_representational_similarity(self, corr='spearman')[source]
get_response(self)[source]

Computes the mean response for each cell to each stimulus condition. Return is a (# orientations, # temporal frequencies, # cells, 3) np.ndarray. The final dimension contains the mean response to the condition (index 0), standard error of the mean of the response to the condition (index 1), and the number of trials with a significant response (p < 0.05) to that condition (index 2).

Returns:
Numpy array storing mean responses.
get_signal_correlation(self, corr='spearman')[source]
number_ori
number_tf
open_star_plot(self, cell_specimen_id=None, include_labels=False, cell_index=None)[source]
orivals
plot_direction_selectivity(self, si_range=[0, 1.5], n_hist_bins=50, color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_orientation_selectivity(self, si_range=[0, 1.5], n_hist_bins=50, color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_preferred_direction(self, include_labels=False, si_range=[0, 1.5], color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_preferred_temporal_frequency(self, si_range=[0, 1.5], color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
populate_stimulus_table(self)[source]

Implemented by subclasses.

reshape_response_array(self)[source]
Returns:response array in cells x stim x repetition for noise correlations
tfvals