-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActionSpectra.m
executable file
·2264 lines (1741 loc) · 112 KB
/
ActionSpectra.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function ActionSpectra
%{
Function to plot action spectra of photoreceptor sensitivites, light sources, flurophores,
filters and others.
Defined spectra:
Intrinsic Opsins:
- macaque photoreceptor action spectra - Schnapf etal 1988 Vis Neurosci
- mouse photoreceptor action spectra - Wang etal 2011 J Neurosci
- marmoset photoreceptor action spectra - In the marmoset three alleles code opsins that are
most sensitive to 543, 556, or 563 nm (Travis et al., 1988; Tovée et al., 1992;
Williams et al., 1992; Hunt et al., 1993; Shyue et al., 1995)
Thorlabs LED:
- M365L2 - ThorLabs
- M405L2 - ThorLabs
- M420L3 - ThorLabs
- M455L3 - ThorLabs
- M470L3 - ThorLabs
- M490L3 - ThorLabs
- M505L3 - ThorLabs
- M530L3 - ThorLabs
- M565L3 - ThorLabs
- M590L3 - ThorLabs
- M595L3 - ThorLabs
- M617L3 - ThorLabs
- M625L3 - ThorLabs
- MCWHL5 - ThorLabs (cool white)
- MWWHL4 - ThorLabs (warm white)
Flurophore:
- Alexa488 - Life Technologies
- Alexa568 - Life Technologies
- YFP - Life Technologies
- CFP - Life Technologies
- GFP -
- Citrine -
- Rhodamine Red -
- Texas Red -
- DAPI - Life Technologies
- Fluorescein - Life Technologies
- mCherry -
- tdTomato - chroma
- Cy3 - chroma
- GCaMP5g - Akerboom etal 2012 J Neruosci
- RCaMP1e - Akerboom etal 2013 Front Molec Neurosci, Abs: Fig 2; Ems: Fig 8D
- RCaMP2 - Inoue etal 2015 Nat Methods
- R-GECO1 - Zhao etal 2011 Science (1P spectra), Dana etal 2014 (SFN poster, 2P spectrum)
- peredox - Hung etal 2011 Cell Metabol. NADH-NAD+ FLIM sensor
- DsRed - (from Semrock SearchLight)
Filters:
- BP545/25 - Zeiss/Delta
- BP605/70 - Zeiss/Delta
- EO65141_455_10 - Edmund Optics
- EO65160_568_10 - Edmund Optics
- ET535_70 - Chroma
- FF01_448_20 - Semrock
- FF01_460_14 - Semrock
- FF01_469_35 - Semrock
- FF01_470_28 - Semrock
- FF01_475_42 - Semrock
- FF01_496_LP - Semrock
- FF01_500_10 - Semrock
- FF01_500_15 - Semrock
- FF01_504_12 - Semrock
- FF01_520_35 - Semrock
- FF01_520_70 - Semrock
- FF01_525_45 - Semrock
- FF01_530_55 - Semrock
- FF01_550_49 - Semrock
- FF01_565_24 - Semrock
- FF01_571_72 - Semrock
- FF01_580_60 - Semrock
- FF01_582_75 - Semrock
- FF01_630_92 - Semrock
Zeiss Filter sets:
- Filter Set 43 - BP545/25 & BP605/70 - cy3, tdTomato (https://www.micro-shop.zeiss.com/?s=227735774c82f69&l=en&p=us&f=f&a=v&b=f&id=000000-1114-101&o=)
Biology:
- channelrhodopsin 2 - Nagel etal 2003 PNAS
- mouseWholeEyeTrasmittance - Henricksson etal 2010 Exp Eye Res
- ReaChR - red-shifted ChR - Lin etal 2013 Nat Neurosci
- C1V1 - red-shifted ChR - Yhizar etal 2011 Nature
- ChrimsonR - red-shifted channelrhodopsin - Klapoetke etal 2014 Nat Methods
- chronos - blue light activated channelrhodopsin - Klapoetke etal 2009 Nat Methods
- jaws - red-shifted halorhodopsin - Chuong etal 2014 Nat Neurosci
Other:
- Solar irradiance at sea level (http://www.newport.com/Introduction-to-Solar-Radiation/411919/1033/content.aspx)
- irradiance units (Wm^-2nm^-1)
TODO:
Changelog:
- tidied code
Written By: Kenny Cheong
Date: 1 Janurary 2015
%}
% ---- Construction of spectra curves ----
% construct photoreceptor sensitivity spectra
wavelengths = (350 : 1 : 700)';
Photoreceptor.WAVELENGTH = wavelengths;
% mouse sensitivities (Wang etal 2011 J Neurosci)
Photoreceptor.mouse_scone = StandardTemplate(360, wavelengths);
Photoreceptor.mouse_mcone = StandardTemplate(508, wavelengths);
Photoreceptor.mouse_rods = StandardTemplate(498, wavelengths);
Photoreceptor.mouse_melanopsin = StandardTemplate(480, wavelengths); % lmax from Fig 1 Lall etal 2010 Neuron
% macaque sensitivities (Schnapf etal 1988 Vis Neurosci)
Photoreceptor.macaque_scone = StandardTemplate(430, wavelengths);
Photoreceptor.macaque_mcone = StandardTemplate(530, wavelengths);
Photoreceptor.macaque_lcone = StandardTemplate(561, wavelengths);
Photoreceptor.macaque_rod = StandardTemplate(491, wavelengths);
Photoreceptor.macaque_melanopsin = StandardTemplate(480, wavelengths);
% marmoset sensitivities ()
Photoreceptor.marmoset_scone = StandardTemplate(423, wavelengths);
Photoreceptor.marmoset_543 = StandardTemplate(543, wavelengths);
Photoreceptor.marmoset_556 = StandardTemplate(556, wavelengths);
Photoreceptor.marmoset_563 = StandardTemplate(563, wavelengths);
Photoreceptor.marmoset_rod = StandardTemplate(491, wavelengths); % ?
Photoreceptor.marmoset_melanopsin = StandardTemplate(480, wavelengths); % ?
% optogenetic molecules
Optogenetics.WAVELENGTH = wavelengths;
Optogenetics.ChR2 = StandardTemplate(460, wavelengths); % lmax from Nagel etal 2003 PNAS
Optogenetics.CatCh = StandardTemplate(474, wavelengths); % lmax from Kleinlogel etal 2011 Nat Neurosci
% lmax of 463 results in a better with with the standard template than the reported 474
% according to supp. fig. 2, few data points were measured posibly resulting in poor lmax estimation
% load in other biological data
Biology = loadTablesFromFolder(fullfile(pwd, 'Biology'));
% load in led spectra
% automatically load led spectra from txt files in .\LED folder
% see existing file for example format
LED = loadTablesFromFolder(fullfile(pwd, 'LED'));
% % special case normalisation
% LED.M565L3_real.INTENSITY = LED.M565L3_real.INTENSITY - min(LED.M565L3_real.INTENSITY);
% LED.M565L3_real.NORM_INTENSITY = LED.M565L3_real.INTENSITY ./ max(LED.M565L3_real.INTENSITY);
% load in dichroic
Optics = loadTablesFromFolder(fullfile(pwd, 'Optics'));
% load in filters
Filter = loadTablesFromFolder(fullfile(pwd, 'Filter'));
% load in flurophores
Flurophore = loadTablesFromFolder(fullfile(pwd, 'Flurophore'));
% load in other
Other = loadTablesFromFolder(fullfile(pwd, 'Other'));
% load in measured system spectra
% measurements were taked at the animal pupil through system / stimulus aparatus and pellicle
System = loadTablesFromFolder(fullfile(pwd, 'System'));
% normalise curves
System_fieldnames = fieldnames(System);
for qq = 1:length(System_fieldnames)
System.(System_fieldnames{qq}).INTENSITY = System.(System_fieldnames{qq}).INTENSITY - min(System.(System_fieldnames{qq}).INTENSITY);
System.(System_fieldnames{qq}).NORM_INTENSITY = System.(System_fieldnames{qq}).INTENSITY ./ max(System.(System_fieldnames{qq}).INTENSITY);
end
% load in measured power calibration curves
PowerCurves = loadTablesFromFolder(fullfile(pwd, 'PowerCurves'));
% references
References.macaque = 'Schnapf etal 1988 Vis Neurosci';
References.mouse = 'Wang etal 2011 J Neurosci';
References.marmoset = 'Tovee etal 1992 VisRes';
References.ChR2 = 'Nagel etal 2003 PNAS';
References.ChrimsonR = 'Klapoetke etal 2014 Nat Methods';
References.Chronos = 'Klapoetke etal 2014 Nat Methods';
References.ReaChR = 'Lin etal 2013 Nat Neurosci';
References.C1V1 = 'Yhizar etal 2011 Nature';
References.jaws = 'Chuong etal 2014 Nat Neurosci';
References.GCaMP5g = 'Akerboom etal 2012 J Neruosci';
References.RCaMP1e = 'Akerboom etal 2013 Front Molec Neurosci';
References.RCaMP2 = 'Inoue etal 2015 Nat Methods';
References.RGECO1 = '1P: Zhao etal 2011 Science; 2P: Dana etal 2014';
References.peredox = 'Hung etal 2011 Cell Metabol';
References.mouseWholeEyeTrasmittance = 'Henricksson etal 2010 Exp Eye Res';
'pause'
% ==== Plots ====
% manually code figures as there are too many possilbe combinations of plots to justify a standard format or GUI
%% -- plot --
% histology
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% Fluorephores
plot(Flurophore.DAPI.WAVELENGTH, Flurophore.DAPI.NORM_EXCITATION, 'LineWidth', 1.5, 'LineStyle', '-'); hold on
plot(Flurophore.DAPI.WAVELENGTH, Flurophore.DAPI.NORM_EMISSION, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EXCITATION, 'LineWidth', 1.5, 'LineStyle', '-'); hold on
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EMISSION, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
plot(Flurophore.Fluorescein.WAVELENGTH, Flurophore.Fluorescein.NORM_EXCITATION, 'LineWidth', 1.5, 'LineStyle', '-'); hold on
plot(Flurophore.Fluorescein.WAVELENGTH, Flurophore.Fluorescein.NORM_EMISSION, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
plot(Flurophore.tdTomato.WAVELENGTH, Flurophore.tdTomato.NORM_EXCITATION, 'LineWidth', 1.5, 'LineStyle', '-'); hold on
plot(Flurophore.tdTomato.WAVELENGTH, Flurophore.tdTomato.NORM_EMISSION, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
plot(Flurophore.Cy3.WAVELENGTH, Flurophore.Cy3.NORM_EXCITATION, 'LineWidth', 1.5, 'LineStyle', '-'); hold on
plot(Flurophore.Cy3.WAVELENGTH, Flurophore.Cy3.NORM_EMISSION, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
plot(Flurophore.Alexa647.WAVELENGTH, Flurophore.Alexa647.NORM_EXCITATION, 'LineWidth', 1.5, 'LineStyle', '-'); hold on
plot(Flurophore.Alexa647.WAVELENGTH, Flurophore.Alexa647.NORM_EMISSION, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
plot(Flurophore.Cy5.WAVELENGTH, Flurophore.Cy5.NORM_EXCITATION, 'LineWidth', 1.5, 'LineStyle', '-'); hold on
plot(Flurophore.Cy5.WAVELENGTH, Flurophore.Cy5.NORM_EMISSION, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
title('Histology spectra')
xlim([350 700])
ylim([0 1.01])
l = legend('DAPI - excitation', 'DAPI - emission',...
'GCaMP5g - excitation', 'GCaMP5g - emission', 'Fluorescein - excitation', 'Fluorescein - emission',...
'tdTomato - excitation', 'tdTomato - emission', 'Cy3 - excitation', 'Cy3 - emission',...
'Alexa647 - excitation', 'Alexa647 - emission', 'Cy5 - excitation', 'Cy5 - emission');
set(l, 'Fontsize', 12, 'Box', 'off')
save_name = 'histology.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- Plot --
% compute stimulus equivalency for mcone for 455 vs 565
% mcone and 455
mouse_mcone_455 = StandardTemplate(508, LED.M455L3.WAVELENGTH);
mouse_mcone_455_product = mouse_mcone_455 .* LED.M455L3.NORM_INTENSITY;
mouse_mcone_455_integral = trapz(LED.M455L3.WAVELENGTH, mouse_mcone_455_product);
mouse_mcone_565 = StandardTemplate(508, LED.M565L3.WAVELENGTH);
mouse_mcone_565_product = mouse_mcone_565 .* LED.M565L3.NORM_INTENSITY;
mouse_mcone_565_integral = trapz(LED.M565L3.WAVELENGTH, mouse_mcone_565_product);
ratio_455_565 = mouse_mcone_565_integral / mouse_mcone_455_integral; % 565 as a multiple of 455
ratio_455_565_inv = 1/ratio_455_565; % ratio of 565 for 1 unit intensity of 455
% approximate power using peak led wavelength
% use photon_calculator
f = figure('position', [541 152 1386 719]);
plot(LED.M455L3.WAVELENGTH, mouse_mcone_455); hold on
plot(LED.M455L3.WAVELENGTH, LED.M455L3.NORM_INTENSITY); hold on
plot(LED.M455L3.WAVELENGTH, mouse_mcone_455_product); hold on
plot(LED.M565L3.WAVELENGTH, LED.M565L3.NORM_INTENSITY); hold on
plot(LED.M565L3.WAVELENGTH, mouse_mcone_565_product); hold on
xlim([350 700])
%% -- Plot --
% compare ChR2 activation from 455 vs 565
% conclusion: relative activation of ChR2 from 455 : 565 => 1 : 0.3850
% ChR2 and 455
chr2_455 = StandardTemplate(460, LED.M455L3.WAVELENGTH);
chr2_455_product = chr2_455 .* LED.M455L3.NORM_INTENSITY;
chr2_455_integral = trapz(LED.M455L3.WAVELENGTH, chr2_455_product);
% ChR2 and 565
chr2_565 = StandardTemplate(460, LED.M565L3.WAVELENGTH);
chr2_565_product = chr2_565 .* LED.M565L3.NORM_INTENSITY;
chr2_565_integral = trapz(LED.M565L3.WAVELENGTH, chr2_565_product);
ratio_455_565 = chr2_565_integral / chr2_455_integral; % 565 as a multiple of 455
ratio_455_565_inv = 1/ratio_455_565; % ratio of 565 for 1 unit intensity of 455
% approximate power using peak led wavelength
% use photon_calculator
f = figure('position', [541 152 1386 719]);
plot(LED.M455L3.WAVELENGTH, chr2_455); hold on
plot(LED.M455L3.WAVELENGTH, LED.M455L3.NORM_INTENSITY); hold on
plot(LED.M455L3.WAVELENGTH, chr2_455_product); hold on
plot(LED.M565L3.WAVELENGTH, LED.M565L3.NORM_INTENSITY); hold on
plot(LED.M565L3.WAVELENGTH, chr2_565_product); hold on
xlim([350 700])
%% -- Plot --
% plot ChR2 with multiple led spectra to design a combination led stimulus that maximally activates ChR2
f = figure('position', [541 152 1386 719]);
plot(Optogenetics.WAVELENGTH, Optogenetics.ChR2, '--'), hold on
plot(LED.M405L2.WAVELENGTH, LED.M405L2.NORM_INTENSITY); hold on
plot(LED.M420L3.WAVELENGTH, LED.M420L3.NORM_INTENSITY); hold on
plot(LED.M455L3.WAVELENGTH, LED.M455L3.NORM_INTENSITY); hold on
plot(LED.M470L3.WAVELENGTH, LED.M470L3.NORM_INTENSITY); hold on
plot(LED.M490L3.WAVELENGTH, LED.M490L3.NORM_INTENSITY); hold on
plot(LED.M505L3.WAVELENGTH, LED.M505L3.NORM_INTENSITY); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('ChR2', '405', '420', '455', '470', '490', '505');
set(l, 'Fontsize', 12, 'Box', 'off')
%% -- Plot --
% Compare 565 datasheet and measured spectra
f = figure('position', [541 152 1386 719]);
plot(LED.M565L3.WAVELENGTH, LED.M565L3.NORM_INTENSITY); hold on
plot(System.M565L3_system.WAVELENGTH, System.M565L3_system.NORM_INTENSITY); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('M565L3 - datasheet', 'M565L3 - measured');
set(l, 'Fontsize', 12, 'Box', 'off')
%% -- plot --
% LED stimulus aparatus
f = figure('position', [541 152 1386 719]);
area(LED.M565L3.WAVELENGTH, LED.M565L3.NORM_INTENSITY, 'FaceColor', 'g', 'EdgeColor', 'none'); hold on
area(LED.M455L3.WAVELENGTH, LED.M455L3.NORM_INTENSITY, 'FaceColor', 'b', 'EdgeColor', 'none'); hold on
plot(Optics.T510lpxrxt.WAVELENGTH, Optics.T510lpxrxt.NORM_TRANSMISSION, 'r') % dichroic
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('LED stimulus')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('565 - measured', '455 - measured', 'T510lpxrxt');
set(l, 'Fontsize', 12, 'Box', 'off')
%% -- Plot --
% compare 455 stimulus led spectra without filter and with filter 460/14
f = figure('position', [541 152 1386 719]);
plot(System.M455L3_noFilter_system.WAVELENGTH, System.M455L3_noFilter_system.NORM_INTENSITY); hold on
plot(System.M455L3_460_14_system.WAVELENGTH, System.M455L3_460_14_system.NORM_INTENSITY); hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_mcone), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_scone), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_rods ), hold on
plot(Optogenetics.WAVELENGTH, Optogenetics.ChR2), hold on
plot(Filter.FF01_460_14.WAVELENGTH, Filter.FF01_460_14.TRANSMISSION, 'color', colorHex2RGB('#a200ff'), 'LineStyle', '--', 'LineWidth', 0.5); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('455 LED with and without filter')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('455 - no filter', '455 + FF01-460/14', 'mcone', 'scone', 'rods', 'ChR2', 'FF01-460/14');
set(l, 'Fontsize', 12, 'Box', 'off')
%% -- Plot --
% evaluate 455LED filter
f = figure('position', [541 152 1386 719]);
plot(System.M455L3_noFilter_system.WAVELENGTH, System.M455L3_noFilter_system.NORM_INTENSITY); hold on
plot(wavelengths, mouse_scone), hold on
plot(wavelengths, chr2), hold on
plot(Filter.FF01_460_14.WAVELENGTH, Filter.FF01_460_14.TRANSMISSION); hold on
% plot(Filter.FF01_469_35.WAVELENGTH, Filter.FF01_469_35.TRANSMISSION); hold on
% plot(Filter.FF01_470_28.WAVELENGTH, Filter.FF01_470_28.TRANSMISSION); hold on
plot(Filter.FF01_475_42.WAVELENGTH, Filter.FF01_475_42.TRANSMISSION); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('Evaluate 455LED filters')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('455 - no filter', 'scone', 'ChR2', 'FF01-460/14', 'FF01-475/42');
set(l, 'Fontsize', 12, 'Box', 'off')
% calculaiton of 455LED overlap with scone curve with and without filters
% no filter
scone_curve = StandardTemplate(360, System.M455L3_noFilter_system.WAVELENGTH);
M455L3_scone_nofilter = scone_curve .* System.M455L3_noFilter_system.NORM_INTENSITY;
M455L3_scone_nofilter_int = trapz(M455L3_scone_nofilter); % integral under curve
% Filter.FF01_460_14
FF01_460_14_transmission = interp1(Filter.FF01_460_14.WAVELENGTH, Filter.FF01_460_14.TRANSMISSION, System.M455L3_noFilter_system.WAVELENGTH);
M455L3_scone_FF01_460_14 = scone_curve .* FF01_460_14_transmission .* System.M455L3_noFilter_system.NORM_INTENSITY;
M455L3_scone_FF01_460_14(isnan(M455L3_scone_FF01_460_14)) = 0;
M455L3_scone_FF01_460_14_int = trapz(M455L3_scone_FF01_460_14); % integral under curve
M455L3_scone_FF01_460_14_nofilter_ratio = M455L3_scone_FF01_460_14_int / M455L3_scone_nofilter_int;
% Filter.FF01_460_14
FF01_475_42_transmission = interp1(Filter.FF01_475_42.WAVELENGTH, Filter.FF01_475_42.TRANSMISSION, System.M455L3_noFilter_system.WAVELENGTH);
M455L3_scone_FF01_475_42 = scone_curve .* FF01_475_42_transmission .* System.M455L3_noFilter_system.NORM_INTENSITY;
M455L3_scone_FF01_475_42_int = trapz(M455L3_scone_FF01_475_42); % integral under curve
M455L3_scone_FF01_475_42_nofilter_ratio = M455L3_scone_FF01_475_42_int / M455L3_scone_nofilter_int;
% values:
fprintf('integral - NOFILTER = %g\n', M455L3_scone_nofilter_int)
fprintf('integral - FF01-460/14 = %g; relative to NOFILTER = %0.2g%%\n', M455L3_scone_FF01_460_14_int, M455L3_scone_FF01_460_14_nofilter_ratio * 100)
fprintf('integral - FF01-475/42 = %g; relative to NOFILTER = %0.2g%%\n', M455L3_scone_FF01_475_42_int, M455L3_scone_FF01_475_42_nofilter_ratio * 100)
%% -- Plot --
% Compute equvalence of 455 - 565
% plot spectra
f = figure('position', [541 152 1386 719]);
% 365 LED no filter
area(System.M365L2_system.WAVELENGTH, System.M365L2_system.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#a200ff'), 'EdgeColor', 'none'); hold on
% 455 LED with 475/42 filter
area(System.M455L3_475_42.WAVELENGTH, System.M455L3_475_42.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#728ef4'), 'EdgeColor', 'none'); hold on
plot(System.M455L3_475_42_455_10.WAVELENGTH, System.M455L3_475_42_455_10.NORM_INTENSITY, 'LineWidth', 1.5), hold on
% 565 LED with 571/72 filter
area(System.M565L3_571_72.WAVELENGTH, System.M565L3_571_72.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#f9d59c'), 'EdgeColor', 'none'); hold on
plot(System.M565L3_571_72_568_10.WAVELENGTH, System.M565L3_571_72_568_10.NORM_INTENSITY, 'LineWidth', 1.5), hold on
% photoreceptors
plot(Photoreceptor.WAVELENGTH, mouse_mcone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, mouse_scone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, mouse_rods , 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, mouse_melanopsin , 'LineWidth', 1.5), hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
title('Calculating equvalence 455 - 565')
xlim([350 700])
ylim([0 1.01])
l = legend('LED 365 - measured', 'LED 455 - 475/42 - measured', 'LED 455 - 475/42 - 455/10 - measured', 'LED 565 - 571/72 - measured', 'LED 565 - 571/72 - 568/10', 'mouse m-cone', 'mouse s-cone', 'mouse rods', 'mouse melanosin');
set(l, 'Fontsize', 12, 'Box', 'off')
% plot power conversion curves
f = figure('position', [1229 24 1260 937]);
subplot(2, 2, 1)
plot(PowerCurves.Power_400_20150615.VOLTAGE, PowerCurves.Power_400_20150615.POWER, 'LineWidth', 1.5, 'LineStyle', '-', 'Marker', 'o'); hold on
plot(PowerCurves.Power_455_475_42_20150615.VOLTAGE, PowerCurves.Power_455_475_42_20150615.POWER, 'LineWidth', 1.5, 'LineStyle', '-', 'Marker', 'o'); hold on
plot(PowerCurves.Power_565_571_72_20150615.VOLTAGE, PowerCurves.Power_565_571_72_20150615.POWER, 'LineWidth', 1.5, 'LineStyle', '-', 'Marker', 'o'); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('Voltage (V)')
ylabel('Power (uW)')
xlim([0 5])
l = legend('400', '455 - 475/42', '565 - 571/72', 'location', 'northwest');
set(l, 'Fontsize', 12, 'Box', 'off')
subplot(2, 2, 2)
plot(PowerCurves.Power_455_475_42_20150615.POWER, PowerCurves.Power_455_475_42_455_10_20150615.POWER, 'LineWidth', 1.5, 'LineStyle', 'none', 'Marker', 'o'); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('Power (uW) - 455 - 475/42')
ylabel('Power (uW) - 455 - 475/42 - 455/10')
l = legend('455 - 475/42 vs 455 - 475/42 - 455/10', 'location', 'northwest');
set(l, 'Fontsize', 12, 'Box', 'off')
subplot(2, 2, 3)
plot(PowerCurves.Power_565_571_72_20150615.POWER, PowerCurves.Power_568_571_72_568_10_20150615.POWER, 'LineWidth', 1.5, 'LineStyle', 'none', 'Marker', 'o'); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('Power (uW) - 565 - 571/72')
ylabel('Power (uW) - 565 - 571/72 - 568/10')
l = legend('565 - 571/72 vs 455 - 571/72 - 568/10', 'location', 'northwest');
set(l, 'Fontsize', 12, 'Box', 'off')
% compute light equivalence
% compute scale factor for measured part of spectrum to complete spectrum
integral.M455L3_475_42 = trapz(System.M455L3_475_42.WAVELENGTH, System.M455L3_475_42.NORM_INTENSITY);
integral.M455L3_475_42_455_10 = trapz(System.M455L3_475_42_455_10.WAVELENGTH, System.M455L3_475_42_455_10.NORM_INTENSITY);
M455_measured_ratio = integral.M455L3_475_42_455_10 / integral.M455L3_475_42; % proportion of LED curve that is measured
M455_scale = 1/M455_measured_ratio;
integral.M565L3_571_72 = trapz(System.M565L3_571_72.WAVELENGTH, System.M565L3_571_72.NORM_INTENSITY);
integral.System.M565L3_571_72_568_10 = trapz(System.M565L3_571_72_568_10.WAVELENGTH, System.M565L3_571_72_568_10.NORM_INTENSITY);
M565_measured_ratio = integral.System.M565L3_571_72_568_10 / integral.M565L3_571_72; % proportion of LED curve that is measured
M565_scale = 1/M565_measured_ratio;
% product with mcone curve
M455_mcone = crossProduct(System.M455L3_475_42.WAVELENGTH, System.M455L3_475_42.NORM_INTENSITY, Photoreceptor.WAVELENGTH, mouse_mcone);
M565_mcone = crossProduct(System.M565L3_571_72.WAVELENGTH, System.M565L3_571_72.NORM_INTENSITY, Photoreceptor.WAVELENGTH, mouse_mcone);
mcone_M455_M565 = M455_mcone.INTEGRAL / M565_mcone.INTEGRAL; % ratio of M cone stimulation from 455 vs 565
% convert equivalence for 565 to 455 for mcone, with spectrum correction
M455_power = 0:100; % uw (power of 455 that i want to calculate 565 equivalent)
for qq = 1:length(M455_power)
M455_455_power = interp1(PowerCurves.Power_455_475_42_20150615.POWER, PowerCurves.Power_455_475_42_455_10_20150615.POWER, M455_power(qq));
M455_photons = power2density(M455_455_power, 455); % <== ENTER POWER MEAUSREMENT HERE
M455_photons_scaled = M455_photons * M455_scale; % quanta from
M565_photons_scaled = M455_photons_scaled * mcone_M455_M565; % convert to equiv 565 quanta
M565_photons = M565_photons_scaled / M565_scale;
M565_568_power = density2power(M565_photons, 568); % <== ENTER POWER MEAUSREMENT HERE
M565_power(qq) = interp1(PowerCurves.Power_568_571_72_568_10_20150615.POWER, PowerCurves.Power_565_571_72_20150615.POWER, M565_568_power);
end
mcone_M455_M565_corrected = nanmean(M565_power ./ M455_power);
subplot(2, 2, 4)
plot(M455_power, M565_power, 'LineWidth', 1.5, 'LineStyle', 'none', 'Marker', 'o'); hold on
text(0.01, 0.8, sprintf('spectra corrected 455:565 ratio = 1:%0.2f', mcone_M455_M565_corrected), 'units', 'normalized', 'fontsize', 12)
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
xlabel('Power (uW) - 455 - 475/42')
ylabel('Power (uW) - 565 - 571/72')
l = legend('455 - 475/42 vs 565 - 571/72', 'location', 'northwest');
set(l, 'Fontsize', 12, 'Box', 'off')
%% -- plot --
% GCaMP5g vs R-GECO1
f = figure('position', [541 152 1386 719]);
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EXCITATION, 'color', colorHex2RGB('#66cccb')); hold on
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EMISSION, 'color', colorHex2RGB('#66cccb'), 'Linestyle', '--'); hold on
plot(Flurophore.RGECO1.WAVELENGTH, Flurophore.RGECO1.NORM_EXCITATION, 'Linestyle', ':', 'lineWidth', 2)
plot(Flurophore.RGECO1.WAVELENGTH, Flurophore.RGECO1.NORM_EMISSION, 'Linestyle', '--', 'lineWidth', 2)
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('GCaMP RCaMP')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('GCaMP5g excitation', 'GCaMP5g emission', 'R-GECO1 excitation', 'R-GECO1 emission', 'location', 'northwest');
set(l, 'Fontsize', 12, 'Box', 'off')
%% -- Plot --
% compare RCaMP with Alexa 568
f = figure('position', [541 152 1386 719]);
plot(Flurophore.RCaMP1e.WAVELENGTH, Flurophore.RCaMP1e.NORM_EMISSION); hold on
plot(Flurophore.RCaMP1e.WAVELENGTH, Flurophore.RCaMP1e.NORM_EXCITATION); hold on
plot(Flurophore.Alexa568.WAVELENGTH, Flurophore.Alexa568.NORM_EXCITATION, '--');
plot(Flurophore.Alexa568.WAVELENGTH, Flurophore.Alexa568.NORM_EMISSION, '--');
plot([561 561], [0 1], 'color', colorHex2RGB('#4af406'), 'LineStyle', '--', 'LineWidth', 1.5)
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('Comparing RCaMP1e with Alexa568')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('RCaMP1e emission', 'RCaMP1e excitation', 'Alexa568 excitation', 'Alexa568 emission');
set(l, 'Fontsize', 12, 'Box', 'off')
%% -- plot --
% RCaMP mouse experiment
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% LEDs
area(System.M365L2_system.WAVELENGTH, System.M365L2_system.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#a200ff'), 'EdgeColor', 'none'); hold on
area(System.M455L3_475_42.WAVELENGTH, System.M455L3_475_42.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#728ef4'), 'EdgeColor', 'none'); hold on
% calcium indicator spectra
plot(Flurophore.RCaMP1e.WAVELENGTH, Flurophore.RCaMP1e.NORM_EMISSION, '--'); hold on
plot(Flurophore.RCaMP1e.WAVELENGTH, Flurophore.RCaMP1e.NORM_EXCITATION, '--'); hold on
% photoreceptor sensitivites
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_mcone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_scone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_rods , 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_melanopsin, 'LineWidth', 1.5); hold on
% channelrhodopsins
plot(Optogenetics.WAVELENGTH, Optogenetics.ChR2, 'LineWidth', 1.5, 'Linestyle', '-.'), hold on
% barrier filter
plot(Filter.FF01_630_92.WAVELENGTH, Filter.FF01_630_92.TRANSMISSION), hold on
% fluorescence excitation laser
plot(System.L561_system.WAVELENGTH, System.L561_system.NORM_INTENSITY, 'color', colorHex2RGB('#4af406'), 'LineStyle', '--', 'LineWidth', 1);
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('RCaMP mouse experiment')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('365 - measured', '455(475/42) - measured', 'RCaMP1e emssion', 'RCaMP1e excitation', 'mouse M-cone', 'mouse S-cone', 'mouse rod', 'mouse melanopsin', 'ChR2', ...
'FF01-630/92 - emission filter', '561 nm imaging laser', 'location', 'northeast');
set(l, 'Fontsize', 12, 'Box', 'off')
save_name = 'RCaMP mouse experiment.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- plot --
% notes:
% - GFP emission overlap with barrir filter is negligible
% - M490L3 LED is more ideal to activate Chronos, but has much more overlap with jRGECO1a excitation and may cause response artefact.
% JRGECO1a mouse experiment
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% LEDs
area(System.M365L2_system.WAVELENGTH, System.M365L2_system.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#a200ff'), 'EdgeColor', 'none'); hold on
area(System.M455L3_475_42.WAVELENGTH, System.M455L3_475_42.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#728ef4'), 'EdgeColor', 'none'); hold on
area(LED.M490L3.WAVELENGTH, LED.M490L3.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#81def2'), 'EdgeColor', 'none'); hold on
% calcium indicator spectra
plot(Flurophore.RGECO1.WAVELENGTH, Flurophore.RGECO1.NORM_EMISSION, '--'); hold on
plot(Flurophore.RGECO1.WAVELENGTH, Flurophore.RGECO1.NORM_EXCITATION, '--'); hold on
% photoreceptor sensitivites
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_mcone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_scone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_rods , 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_melanopsin, 'LineWidth', 1.5); hold on
% channelrhodopsins
% plot(Optogenetics.WAVELENGTH, Optogenetics.ChR2, 'LineWidth', 1.5, 'Linestyle', '-.'), hold on
plot(Biology.chronos.WAVELENGTH, Biology.chronos.NORM_RESPONSE, '-.'); hold on
% plot(Flurophore.GFP.WAVELENGTH, Flurophore.GFP.NORM_EXCITATION, '-.'); hold on
% plot(Flurophore.GFP.WAVELENGTH, Flurophore.GFP.NORM_EMISSION, '-.'); hold on
% barrier filter
plot(Filter.FF01_630_92.WAVELENGTH, Filter.FF01_630_92.TRANSMISSION), hold on
% fluorescence excitation laser
plot(System.L561_system.WAVELENGTH, System.L561_system.NORM_INTENSITY, 'color', colorHex2RGB('#4af406'), 'LineStyle', '--', 'LineWidth', 1);
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('JRGECO1a mouse experiment')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('365 - measured', '455(475/42) - measured', '490 LED',...
'R-GECO1 emssion', 'R-GECO1 excitation',...
'mouse M-cone', 'mouse S-cone', 'mouse rod', 'mouse melanopsin', 'chronos',...
'FF01-630/92 - emission filter', '561 nm imaging laser', 'location', 'northeast');
set(l, 'Fontsize', 12, 'Box', 'off')
save_name = 'JRGECO1a mouse experiment.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- plot --
% JRGECO1a-2P mouse experiment
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% LEDs
area(System.M365L2_system.WAVELENGTH, System.M365L2_system.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#a200ff'), 'EdgeColor', 'none'); hold on
area(System.M455L3_475_42.WAVELENGTH, System.M455L3_475_42.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#728ef4'), 'EdgeColor', 'none'); hold on
% calcium indicator spectra
plot(Flurophore.RGECO1.WAVELENGTH, Flurophore.RGECO1.NORM_EXCITATION, '--'); hold on
plot(Flurophore.RGECO1.WAVELENGTH, Flurophore.RGECO1.NORM_EXCITATION_2P, 'LineWidth', 1.5, 'LineStyle', '-.'); hold on
plot(Flurophore.RGECO1.WAVELENGTH, Flurophore.RGECO1.NORM_EMISSION, '--'); hold on
% photoreceptor sensitivites
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_mcone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_scone, 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_rods , 'LineWidth', 1.5), hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_melanopsin, 'LineWidth', 1.5); hold on
% channelrhodopsins
% plot(Optogenetics.WAVELENGTH, Optogenetics.ChR2, 'LineWidth', 1.5, 'Linestyle', '-.'), hold on
plot(Biology.chronos.WAVELENGTH, Biology.chronos.NORM_RESPONSE, '-.'); hold on
% barrier filter
plot(Filter.FF01_630_92.WAVELENGTH, Filter.FF01_630_92.TRANSMISSION), hold on
% fluorescence excitation laser
plot(System.L561_system.WAVELENGTH, System.L561_system.NORM_INTENSITY, 'color', colorHex2RGB('#4af406'), 'LineStyle', '--', 'LineWidth', 1);
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('JRGECO1a 2P mouse experiment')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 1100])
ylim([0 1.01])
l = legend('365 - measured', '455(475/42) - measured', 'R-GECO1 excitation', 'R-GECO1 2P excitation', 'R-GECO1 emssion', ...
'mouse M-cone', 'mouse S-cone', 'mouse rod', 'mouse melanopsin', 'chronos', ...
'FF01-630/92 - emission filter', '561 nm imaging laser', 'location', 'northeast');
set(l, 'Fontsize', 12, 'Box', 'off')
save_name = 'JRGECO1a 2P mouse experiment.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- Plot --
% GCaMP mouse experiment (with chrimson)
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% LEDs
area(System.M365L2_system.WAVELENGTH, System.M365L2_system.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#a200ff'), 'EdgeColor', 'none'); hold on
area(System.M455L3_475_42.WAVELENGTH, System.M455L3_475_42.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#728ef4'), 'EdgeColor', 'none'); hold on
% area(System.M565L3_571_72.WAVELENGTH, System.M565L3_571_72.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#f9d59c'), 'EdgeColor', 'none'); hold on
area(System.M595L3_BLP_594R.WAVELENGTH, System.M595L3_BLP_594R.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#ff9999'), 'EdgeColor', 'none'); hold on
% fluorescence excitation laser
plot(System.L488_system.WAVELENGTH, System.L488_system.NORM_INTENSITY, 'color', colorHex2RGB('#00f7ff'), 'LineStyle', '-.', 'LineWidth', 1);
% photoreceptor sensitivites
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_mcone, 'LineWidth', 1.5); hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_scone, 'LineWidth', 1.5); hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_rods , 'LineWidth', 1.5); hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_melanopsin, 'LineWidth', 1.5); hold on
% channelrhodopsins
plot(Biology.chrimson.WAVELENGTH, Biology.chrimson.NORM_RESPONSE, '-.'); hold on
% plot(Biology.C1V1.WAVELENGTH, Biology.C1V1.NORM_RESPONSE, '-.'); hold on
% calcium indicator spectra
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EMISSION, 'color', colorHex2RGB('#00aba9'), 'LineStyle', ':'); hold on
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EXCITATION, 'color', colorHex2RGB('#66cccb'), 'LineStyle', ':'); hold on
% barrier filter
plot(Filter.FF01_520_35.WAVELENGTH, Filter.FF01_520_35.TRANSMISSION, 'color', colorHex2RGB('#36ff00'), 'LineStyle', '-.'), hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('GCaMP mouse experiment')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('365 - measured', '455 - 475/42 - measured', '565 - 571/72 - measured', '488 laser', ...
'mcone', 'scone', 'rod', 'melanopsin', 'chrimson', 'GCaMP5g - excitation', 'GCaMP5g - emission', 'barrier - 520/35');
set(l, 'Fontsize', 12, 'Box', 'off')
save_name = 'GCaMP (Chrimson) mouse experiment.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- light power in daylight --
% put stimulation power in context of daylight spectral irradiance
% convert LED power to irradiance
LED_FOV_r = 8.6/2 * 33; % convert deg to µm
FOV_LED_um = pi * LED_FOV_r^2; % µm^2
FOV_LED_cm = FOV_LED_um / 10^8; % cm^2
led_365_power = 20; % < enter value here
led_620_power = 100; % < enter value here
led_365_I = led_365_power / FOV_LED_cm;
led_620_I = led_620_power / FOV_LED_cm;
solar_I_umcm = Other.SolarIrradianceSeaLevel.IRRADIANCE .* 10^6 ./ 10^4; % convert to µW/cm^2
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
plot(Other.SolarIrradianceSeaLevel.WAVELENGTH, solar_I_umcm, 'k-'); hold on
plot(365, led_365_I, 'bo')
plot(620, led_620_I, 'rs')
box off
set(gca, 'tickdir', 'out', 'FontSize', 12, 'yscale', 'log')
title('Irrandiance for daylight and stimuli')
xlabel('wavelength (nm)')
ylabel('Irradiance (µW/cm^2/nm^1)')
xlim([350 700])
% ylim([0 1.01])
legend('Normal incident daylight at sea level on a clear day', '365 nm LED', '620 nm LED')
save_name = 'Irradiance of daylight and stimuli.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
% plot solar irradiance in terms of LED power as in our setup
solar_power = solar_I_umcm .* FOV_LED_cm;
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
plot(Other.SolarIrradianceSeaLevel.WAVELENGTH, solar_power, 'k-'); hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('Irrandiance for daylight and stimuli')
xlabel('wavelength (nm)')
ylabel('power (µW/nm^1)')
xlim([350 700])
save_name = 'Irradiance of daylight as LED power.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- Plot --
% LED stimuli with peak wavelengths
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% LEDs
area(System.M365L2_system.WAVELENGTH, smooth(System.M365L2_system.NORM_INTENSITY, 20), 'FaceColor', colorHex2RGB('#a200ff'), 'EdgeColor', 'none'); hold on
area(System.M455L3_475_42.WAVELENGTH, smooth(System.M455L3_475_42.NORM_INTENSITY, 20), 'FaceColor', colorHex2RGB('#728ef4'), 'EdgeColor', 'none'); hold on
area(System.M565L3_571_72.WAVELENGTH, smooth(System.M565L3_571_72.NORM_INTENSITY, 20), 'FaceColor', colorHex2RGB('#f9d59c'), 'EdgeColor', 'none'); hold on
area(System.M595L3_BLP_594R.WAVELENGTH, smooth(System.M595L3_BLP_594R.NORM_INTENSITY, 20), 'FaceColor', colorHex2RGB('#ff9999'), 'EdgeColor', 'none'); hold on
[~, M365_max_ind] = max(smooth(System.M365L2_system.NORM_INTENSITY, 20));
[~, M455_max_ind] = max(smooth(System.M455L3_475_42.NORM_INTENSITY, 20));
[~, M565_max_ind] = max(smooth(System.M565L3_571_72.NORM_INTENSITY, 20));
[~, M595_max_ind] = max(smooth(System.M595L3_BLP_594R.NORM_INTENSITY, 20));
text(0.5, 0.95, sprintf('max wavelengths: %03.0f, %03.0f, %03.0f, %03.0f', System.M365L2_system.WAVELENGTH(M365_max_ind),...
System.M455L3_475_42.WAVELENGTH(M455_max_ind), System.M565L3_571_72.WAVELENGTH(M565_max_ind), System.M595L3_BLP_594R.WAVELENGTH(M595_max_ind)),...
'units', 'normalized', 'fontsize', 12, 'horizontalalignment', 'center')
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('LED stimuli 1P mouse')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('365 - measured', '455 - 475/42 - measured', '565 - 571/72 - measured', 'LED 595 - BLP01-594R - measured');
set(l, 'Fontsize', 12, 'Box', 'off')
save_name = '1P mouse LED stimuli.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- Plot --
% mouse GCaMP.jaws experiment
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% LEDs
area(System.M595L3_BLP_594R.WAVELENGTH, System.M595L3_BLP_594R.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#ff9999'), 'EdgeColor', 'none'); hold on
% fluorescence excitation laser
plot(System.L488_system.WAVELENGTH, System.L488_system.NORM_INTENSITY, 'color', colorHex2RGB('#00f7ff'), 'LineStyle', '-.', 'LineWidth', 1);
% photoreceptor sensitivites
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_mcone, 'LineWidth', 1.5); hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_scone, 'LineWidth', 1.5); hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_rods , 'LineWidth', 1.5); hold on
plot(Photoreceptor.WAVELENGTH, Photoreceptor.mouse_melanopsin, 'LineWidth', 1.5); hold on
% channelrhodopsins
plot(Biology.chrimson.WAVELENGTH, Biology.chrimson.NORM_RESPONSE, '-.'); hold on
plot(Biology.jaws.WAVELENGTH, Biology.jaws.NORM_RESPONSE, '-.'); hold on
% calcium indicator spectra
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EMISSION, 'color', colorHex2RGB('#00aba9'), 'LineStyle', ':'); hold on
plot(Flurophore.GCaMP5g.WAVELENGTH, Flurophore.GCaMP5g.NORM_EXCITATION, 'color', colorHex2RGB('#66cccb'), 'LineStyle', ':'); hold on
% barrier filter
plot(Filter.FF01_520_35.WAVELENGTH, Filter.FF01_520_35.TRANSMISSION, 'color', colorHex2RGB('#36ff00'), 'LineStyle', '-.'), hold on
box off
set(gca, 'tickdir', 'out', 'FontSize', 12)
title('GCaMP-Chrimson mouse experiment')
xlabel('wavelength (nm)')
ylabel('normalised sensitivity/intensity')
xlim([350 700])
ylim([0 1.01])
l = legend('LED 595 - BLP01-594R - measured', '488 laser', ...
'mcone', 'scone', 'rod', 'melanopsin',...
'chrimson', 'jaws', 'GCaMP5g - excitation', 'GCaMP5g - emission',...
'barrier - 520/35');
set(l, 'Fontsize', 12, 'Box', 'off')
save_name = 'GCaMP-jaws mouse experiment.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% - plot sensitivity curve of jaws -
% Fig 2e - Chuong etal 2014 Nat Neurosci
data = [15.9819819819820 21.5116279069773
16.5225225225225 105.232558139535
17.0720720720721 134.883720930233
18.0000000000000 197.674418604651];
data(:,1) = 10.^data(:,1); % convert from log scale
% reproduce figure from paper
f = figure('color', [1 1 1]);
semilogx(data(:,1), data(:,2), 'o-')
ylim([0 250])
xlim([10^15, 10^19])
set(gca, 'box', 'off', 'tickdir', 'out', 'FontSize', 12)
xlabel('600 nm light intensity (photons/cm^2/s)')
ylabel('mean ganglion cell spiking rate (Hz)')
% convert light power units
power = density2power(data(:,1), 600); % power in µW
f = figure('color', [1 1 1]);
semilogx(power, data(:,2), 'o-')
ylim([0 250])
% xlim([10^15, 10^19])
set(gca, 'box', 'off', 'tickdir', 'out', 'FontSize', 12)
xlabel('600 nm light intensity (µW/cm^2)')
ylabel('mean ganglion cell spiking rate (Hz)')
% convert to LED power with our setup
LED_FOV_r = 8.6/2 * 33; % convert deg to µm
FOV_LED_um = pi * LED_FOV_r^2; % µm^2
FOV_LED_cm = FOV_LED_um / 10^8; % cm^2
raw_power = power * FOV_LED_cm;
f = figure('color', [1 1 1]);
semilogx(raw_power, data(:,2), 'o-')
ylim([0 250])
% xlim([10^15, 10^19])
set(gca, 'box', 'off', 'tickdir', 'out', 'FontSize', 12)
xlabel('600 nm light intensity (µW over 8.6 deg field)')
ylabel('mean ganglion cell spiking rate (Hz)')
title('Sensitivity of jaws to 600 nm light')
save_name = 'Sensitivity of jaws to 600 nm light.pdf';
save_dir = fullfile('.', 'Figures');
save_path = fullfile(save_dir, save_name);
exportpdf(f, save_path)
%% -- Plot --
% evaluate better LED for mouse GCaMP.Chrimson experiment
% Conclusion:
% LED: 595 nm
% LED filter: BLP01_594R
f = figure('position', [541 152 1386 719], 'color', [1 1 1]);
% LEDs
% area(System.M565L3_571_72.WAVELENGTH, System.M565L3_571_72.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#f9d59c'), 'EdgeColor', 'none'); hold on
area(System.M595L3_BLP_594R.WAVELENGTH, System.M595L3_BLP_594R.NORM_INTENSITY, 'FaceColor', colorHex2RGB('#ff9999'), 'EdgeColor', 'none'); hold on
% % alternative LEDs with filter % theoretical