Skip to content

Commit

Permalink
Change plotting for report, add list of interesting cells
Browse files Browse the repository at this point in the history
  • Loading branch information
ycanerol committed Jun 22, 2017
1 parent f48bed1 commit 5ab0d09
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 7 deletions.
107 changes: 100 additions & 7 deletions figure_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,112 @@
import matplotlib.pyplot as plt


plotthis = [['2017_02_14', '901', 'On cell'],
['2017_01_17', '201', 'Off cell']]
# Exp date Cluster Label Flipped
plotthis = [['2017_02_14', '901', 'On cell', False],
['2017_01_31', '8401', 'Off cell', True],
['2017_01_17', '201', 'On off 1', True]]

for i in plotthis:

main_dir = '/Users/ycan/Documents/official/gottingen/lab rotations/\
LR3 Gollisch/data/Experiments/Mouse/'

currentfile_c = main_dir + i[0] +\
'/analyzed/2_SP_C' + i[1] + '.npz'
'/analyzed/2_SP_C' + i[1] + '.npz'
currentfile_f = main_dir + i[0] +\
'/analyzed/3_SP_C' + i[1] + '.npz'


'/analyzed/3_SP_C' + i[1] + '.npz'

c = np.load(str(currentfile_c))
f = np.load(str(currentfile_f))

savepath = '/Users/ycan/Documents/official/gottingen/lab rotations/\
LR3 Gollisch/figures' + i[2]

flipper = 1
if i[3]:
flipper = -1

# %% plot all
plt.figure(figsize=(12, 12), dpi=200)
plt.suptitle(str(' '.join(str(c['spike_path'])
.split('rasters')[0].split('Experiments')[1]
.split('/'))+str(i[1])))
plt.subplot(3, 3, 1)
plt.plot(f['sta']*flipper)
plt.plot(f['v'][:, 0]*flipper)
plt.title('Filters')
plt.legend(['STA', 'Eigenvalue 0'], fontsize='small')
plt.xticks(np.linspace(0, 20, 3), np.linspace(0, 600, 3).astype(int))
plt.ylabel('Full field flicker\n$\\regular_{Linear\,\,\,output}$',
fontsize=16)
plt.xlabel('Time [ms]')

ax = plt.subplot(3, 3, 2)
plt.plot(f['bins_sta'], f['spikecount_sta'][::flipper], '-')
plt.plot(f['bins_stc'], f['spikecount_stc'][::flipper], '-')
plt.text(.5, .99, 'On-Off Bias: {:2.2f}\nTotal spikes: {}'
.format(float(f['onoffindex']), f['total_spikes']),
horizontalalignment='center',
verticalalignment='top',
transform=ax.transAxes)
plt.title('Non-linearities')
plt.ylabel('Firing rate')
plt.xlabel('Linear output')

plt.subplot(3, 3, 3)
plt.plot(f['w'], 'o')
plt.title('Eigenvalues of covariance matrix')
plt.xticks(np.linspace(0, 20, 3))
plt.xlabel('Eigenvalue index')
plt.ylabel('Variance')

plt.subplot(3, 3, 4)
plt.plot(c['sta_weighted']*flipper)
plt.plot(c['v'][:, 0]*flipper)
plt.plot(c['temporal'])
plt.title('Filters')
plt.ylabel('Checkerflicker\n$\\regular_{Linear\,\,\,output}$', fontsize=16)
plt.xlabel('Time [ms]')
plt.xticks(np.linspace(0, 20, 3), np.linspace(0, 600, 3).astype(int))
plt.legend(['Weighted stimulus', 'Eigenvalue 0', 'Brightest pixel'],
fontsize='small')

ax = plt.subplot(3, 3, 5)
for j in range(len(c['bins'])):
plt.plot(c['bins'][j], c['spike_counts_in_bins'][j][::flipper], '-')
plt.text(.5, .99, 'On-Off Bias: {:2.2f}\nTotal spikes: {}'
.format(float(c['onoffindex']), c['total_spikes']),
horizontalalignment='center',
verticalalignment='top',
transform=ax.transAxes)
plt.title('Non-linearities')
plt.xlabel('Linear output')
plt.ylabel('Firing rate')

plt.subplot(3, 3, 6)
plt.plot(c['w'], 'o')
plt.title('Eigenvalues of covariance matrix')
plt.xticks(np.linspace(0, 20, 3))
plt.xlabel('Eigenvalue index')
plt.ylabel('Variance')

plt.subplot(3, 3, 7)
plt.imshow(c['sta_unscaled'][:, :, c['max_i'][2]].reshape((60, 80,)),
cmap='Greys',
vmin=np.min(c['sta_unscaled']),
vmax=np.max(c['sta_unscaled']))
plt.title('Receptive field')

plt.subplot(3, 3, 8)
f_size = 5
plt.imshow(c['sta_unscaled'][c['max_i'][0]-f_size:c['max_i'][0]+f_size+1,
c['max_i'][1]-f_size:c['max_i'][1]+f_size+1,
int(c['max_i'][2])],
cmap='Greys',
vmin=np.min(c['sta_unscaled']),
vmax=np.max(c['sta_unscaled']))
plt.title('Brightest pixel: {}'.format(c['max_i']))
plt.tight_layout(pad=5, h_pad=1, w_pad=1.8)
plt.show()
# plt.savefig(savepath, dpi=200, bbox_inches='tight')
plt.close()
32 changes: 32 additions & 0 deletions interesting_cells.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
2016-10-21
3002 exponential for both
3201 quadratic for checker
4403 exponential for both
4704 quadratic for checker
9702 exponential
11101 upside down temporal fff filter
23803 flips nlt from off to on

2017-01-17
103 exponential for both, higher ooi for onoffsteps
703 onoff for checker, exponential FFF
902 quadratic for FF, exponential checker
3101 quadratic to exponential
3307 quadratic to exponential, interesting RF
4105 flips, quadratic to exponential
6205 flips, sigmoid to exponential, interesting RF
7703 flips for onoffsteps, exponential otherwise
9502 flips, both exponential
14103 typical onoff cell?
23101 flips for onoffsteps, linear otherwise

2017-01-31 small number of cells
301 extreme exponential, flips for onoffsteps
1101 flips, linear for both
8401 typical off cell
8501 typical on cell

2017-02-14
901 typical on cell
20601 typical off cell but onoff with onoffsteps
22302 flips from on to off

0 comments on commit 5ab0d09

Please sign in to comment.