everything for 1ms kernels
This commit is contained in:
@@ -6,9 +6,6 @@ from scipy.stats import mannwhitneyu
|
||||
from thunderlab.tabledata import TableData
|
||||
from plotstyle import plot_style, lighter, significance_str
|
||||
|
||||
|
||||
data_path = Path('data')
|
||||
|
||||
from noisesplit import model_cell as model_split_example
|
||||
from modelsusceptcontrasts import model_cells as model_contrast_examples
|
||||
from modelsusceptlown import model_cell as model_lown_example
|
||||
@@ -18,6 +15,9 @@ from noisesplit import example_cell as punit_split_example
|
||||
from ampullaryexamplecell import example_cell as ampul_example
|
||||
from ampullaryexamplecell import example_cells as ampul_examples
|
||||
|
||||
|
||||
data_path = Path('data')
|
||||
|
||||
model_examples = ([[model_lown_example, 0.01],
|
||||
[model_lown_example, 0.03],
|
||||
[model_lown_example, 0.1]],
|
||||
@@ -26,6 +26,8 @@ model_examples = ([[model_lown_example, 0.01],
|
||||
punit_examples = (punit_example, [punit_split_example], punit_examples)
|
||||
ampul_examples = (ampul_example, [], ampul_examples)
|
||||
|
||||
respmod = 'respmod1'
|
||||
|
||||
|
||||
def plot_corr(ax, data, xcol, ycol, zcol, zmin, zmax, xpdfmax, cmap, color,
|
||||
si_thresh, example=[], split_example=[], examples=[]):
|
||||
@@ -266,7 +268,7 @@ def si_stats(title, data, sicol, si_thresh, nsegscol):
|
||||
print(f' total duration: {np.min(duration):.1f}s - {np.max(duration):.1f}s, median={np.median(duration):.1f}s, mean={np.mean(duration):.1f}s, std={np.std(duration):.1f}s')
|
||||
duration = data['durationbase']
|
||||
print(f' baseline duration: {np.min(duration):.1f}s - {np.max(duration):.1f}s, median={np.median(duration):.1f}s, mean={np.mean(duration):.1f}s, std={np.std(duration):.1f}s')
|
||||
cols = ['cvbase', 'respmod2', 'ratebase', 'vsbase', 'serialcorr1', 'burstfrac', 'ratestim', 'cvstim']
|
||||
cols = ['cvbase', respmod, 'ratebase', 'vsbase', 'serialcorr1', 'burstfrac', 'ratestim', 'cvstim']
|
||||
for i in range(len(cols)):
|
||||
for j in range(i + 1, len(cols)):
|
||||
xcol = cols[i]
|
||||
@@ -285,7 +287,7 @@ def plot_cvbase_si_punit(ax, data, ycol, si_thresh, color):
|
||||
ax.set_ylim(0, 6.5)
|
||||
ax.set_yticks_delta(2)
|
||||
examples = punit_examples if 'stimindex' in data else model_examples
|
||||
#cax = plot_corr(ax, data, 'cvbase', ycol, 'respmod2', 0, 250, 3,
|
||||
#cax = plot_corr(ax, data, 'cvbase', ycol, respmod, 0, 250, 3,
|
||||
# 'coolwarm', color, si_thresh, *examples)
|
||||
#cax.set_ylabel('Response mod.', 'Hz')
|
||||
plot_corr_contrast(ax, data, 'cvbase', ycol, 3, color,
|
||||
@@ -300,7 +302,7 @@ def plot_cvstim_si_punit(ax, data, ycol, si_thresh, color):
|
||||
ax.set_ylim(0, 6.5)
|
||||
ax.set_yticks_delta(2)
|
||||
examples = punit_examples if 'stimindex' in data else model_examples
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'respmod2', 0, 250, 2,
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, respmod, 0, 250, 2,
|
||||
# 'coolwarm', color, si_thresh, *examples)
|
||||
#cax.set_ylabel('Response mod.', 'Hz')
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'cvbase', 0, 1.5, 2,
|
||||
@@ -318,16 +320,16 @@ def plot_cvstim_si_punit(ax, data, ycol, si_thresh, color):
|
||||
|
||||
def plot_rmod_si_punit(ax, data, ycol, si_thresh, color):
|
||||
ax.set_xlabel('Response modulation', 'Hz')
|
||||
ax.set_xlim(0, 250)
|
||||
ax.set_xlim(0, 350)
|
||||
ax.set_xticks_delta(100)
|
||||
ax.set_ylabel('SI($r$)')
|
||||
ax.set_ylim(0, 6.5)
|
||||
ax.set_yticks_delta(2)
|
||||
examples = punit_examples if 'stimindex' in data else model_examples
|
||||
#cax = plot_corr(ax, data, 'respmod2', ycol, 'cvbase', 0, 1.5, 0.016,
|
||||
#cax = plot_corr(ax, data, respmod, ycol, 'cvbase', 0, 1.5, 0.016,
|
||||
# 'coolwarm', color, si_thresh, *examples)
|
||||
#cax.set_ylabel('CV$_{\\rm base}$')
|
||||
plot_corr_contrast(ax, data, 'respmod2', ycol, 0.016, color,
|
||||
plot_corr_contrast(ax, data, respmod, ycol, 0.016, color,
|
||||
si_thresh, *examples)
|
||||
|
||||
|
||||
@@ -355,7 +357,7 @@ def plot_cvbase_si_ampul(ax, data, ycol, si_thresh, color):
|
||||
ax.set_ylabel('SI($r$)')
|
||||
ax.set_ylim(0, 10)
|
||||
ax.set_yticks_delta(2)
|
||||
#cax = plot_corr(ax, data, 'cvbase', ycol, 'respmod2', 0, 80, 20,
|
||||
#cax = plot_corr(ax, data, 'cvbase', ycol, respmod, 0, 80, 20,
|
||||
# 'coolwarm', color, si_thresh, *ampul_examples)
|
||||
#cax.set_ylabel('Response mod.', 'Hz')
|
||||
plot_corr_contrast(ax, data, 'cvbase', ycol, 20, color,
|
||||
@@ -369,7 +371,7 @@ def plot_cvstim_si_ampul(ax, data, ycol, si_thresh, color):
|
||||
ax.set_ylabel('SI($r$)')
|
||||
ax.set_ylim(0, 10)
|
||||
ax.set_yticks_delta(2)
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'respmod2', 0, 80, 6,
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, respmod, 0, 80, 6,
|
||||
# 'coolwarm', color, si_thresh, *ampul_examples)
|
||||
#cax.set_ylabel('Response mod.', 'Hz')
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'cvbase', 0, 0.2, 6,
|
||||
@@ -386,16 +388,16 @@ def plot_cvstim_si_ampul(ax, data, ycol, si_thresh, color):
|
||||
|
||||
def plot_rmod_si_ampul(ax, data, ycol, si_thresh, color):
|
||||
ax.set_xlabel('Response modulation', 'Hz')
|
||||
ax.set_xlim(0, 80)
|
||||
ax.set_xticks_delta(20)
|
||||
ax.set_xlim(0, 100)
|
||||
ax.set_xticks_delta(30)
|
||||
ax.set_ylabel('SI($r$)')
|
||||
ax.set_ylim(0, 10)
|
||||
ax.set_yticks_delta(2)
|
||||
#cax = plot_corr(ax, data, 'respmod2', ycol, 'cvbase', 0, 0.2, 0.06,
|
||||
#cax = plot_corr(ax, data, respmod, ycol, 'cvbase', 0, 0.2, 0.06,
|
||||
# 'coolwarm', color, si_thresh, *ampul_examples)
|
||||
#cax.set_ylabel('CV$_{\\rm base}$')
|
||||
#cax.set_yticks_delta(0.1)
|
||||
plot_corr_contrast(ax, data, 'respmod2', ycol, 0.06, color,
|
||||
plot_corr_contrast(ax, data, respmod, ycol, 0.06, color,
|
||||
si_thresh, *ampul_examples)
|
||||
|
||||
|
||||
@@ -412,7 +414,7 @@ def plot_rate_si_ampul(ax, data, ycol, si_thresh, color):
|
||||
#cax.set_yticks_delta(0.1)
|
||||
plot_corr_contrast(ax, data, 'ratebase', ycol, 0.06, color,
|
||||
si_thresh, *ampul_examples)
|
||||
ax.legend(title='contrast', loc='upper right', bbox_to_anchor=(1.95, 1),
|
||||
ax.legend(title='contrast', loc='upper right', bbox_to_anchor=(1.9, 1),
|
||||
markerfirst=False, handletextpad=0.5)
|
||||
|
||||
|
||||
@@ -453,8 +455,8 @@ if __name__ == '__main__':
|
||||
print(f' baseline rate model: min={np.min(ratemodel):3.0f}Hz max={np.max(ratemodel):3.0f}Hz median={np.median(ratemodel):3.0f}Hz')
|
||||
print(f' baseline rate data: min={np.min(ratedata):3.0f}Hz max={np.max(ratedata):3.0f}Hz median={np.median(ratedata):3.0f}Hz')
|
||||
print()
|
||||
rmmodel = punit_model['respmod2']
|
||||
rmdata = punit_data['respmod2']
|
||||
rmmodel = punit_model[respmod]
|
||||
rmdata = punit_data[respmod]
|
||||
u, p = mannwhitneyu(rmmodel, rmdata)
|
||||
print('Response modulation differs between P-unit models and data:')
|
||||
print(f' U={u:g}, p={p:.2g}')
|
||||
@@ -489,7 +491,7 @@ if __name__ == '__main__':
|
||||
s = plot_style()
|
||||
fig, axs = plt.subplots(3, 3, cmsize=(s.plot_width, 0.75*s.plot_width),
|
||||
height_ratios=[1, 0, 1, 0.3, 1])
|
||||
fig.subplots_adjust(leftm=6.5, rightm=18, topm=4.5, bottomm=4,
|
||||
fig.subplots_adjust(leftm=6.5, rightm=17.5, topm=4.5, bottomm=4,
|
||||
wspace=0.6, hspace=0.6)
|
||||
|
||||
si_stats('P-unit model:', punit_model, 'dsinorm100', si_thresh,
|
||||
|
||||
Reference in New Issue
Block a user