Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

sandbox-pluto-nb backup 4.jl 46 KB

You have to be logged in to leave a comment. Sign In
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
  1. ### A Pluto.jl notebook ###
  2. # v0.15.1
  3. using Markdown
  4. using InteractiveUtils
  5. # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
  6. macro bind(def, element)
  7. quote
  8. local el = $(esc(element))
  9. global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
  10. el
  11. end
  12. end
  13. # ╔═╡ 485d8da0-be94-11eb-183b-e5e105e25b55
  14. begin
  15. using DrWatson
  16. using PlutoUI
  17. using JuMP
  18. using Optim
  19. using Random
  20. import Ipopt
  21. import Juniper
  22. import Alpine
  23. # using NLopt
  24. using Downloads
  25. using ZipFile
  26. using DataFrames
  27. using MAT
  28. using MATLAB
  29. using Plots
  30. using Statistics
  31. using NaNStatistics
  32. using Images
  33. using DelimitedFiles
  34. using CSV
  35. using JLD
  36. using Interpolations
  37. using Convex, SCS # other solvers: GLPK, Mosek, Gurobi, ECOS
  38. using Distributions
  39. using StatsBase
  40. using LinearAlgebra
  41. plotly()
  42. PlutoUI.TableOfContents()
  43. end
  44. # ╔═╡ 8d62b88b-f77f-4d8d-8c6a-ada1d1626b8c
  45. let
  46. using Colors, ColorSchemes
  47. using CuArrays, GPUArrays
  48. # get the number of steps
  49. function get_steps(c::Complex, max_steps)
  50. z = Complex(0.0, 0.0) # 0 + 0im
  51. for i=1:max_steps
  52. z = z*z+c
  53. if abs2(z) >= 4
  54. return i
  55. end
  56. end
  57. return max_steps+1
  58. end
  59. function get_color(colorscheme, step, max_steps)
  60. if step == max_steps+1
  61. return [0.0, 0.0, 0.0]
  62. end
  63. color = get(colorscheme, step, (1, max_steps))
  64. return [color.r, color.g, color.b]
  65. end
  66. function get_cmap(colorscheme, max_steps)
  67. colors = zeros(Float64, (3, max_steps+1))
  68. for i=1:max_steps
  69. colors[:,i] = get_color(colorscheme, i, max_steps)
  70. end
  71. colors[:,max_steps+1] = [0.0, 0.0, 0.0]
  72. return colors
  73. end
  74. function mandelbrot_plot()
  75. width = 1000
  76. height = 600
  77. max_steps = 3500
  78. steps = zeros(Int, (height, width))
  79. # range for real values
  80. cr_min = -0.7491597623
  81. cr_max = -0.7491597623+0.0000000004
  82. # range for imaginary values
  83. ci_min = 0.1005089256
  84. range = cr_max - cr_min
  85. dot_size = range/width
  86. ci_max = ci_min + height*dot_size
  87. # println("cr: $cr_min - $cr_max")
  88. # println("ci: $ci_min - $ci_max")
  89. image = zeros(Float64, (3, height, width))
  90. complexes = zeros(ComplexF64, (height, width))
  91. steps = zeros(Int, (height, width))
  92. cu_steps = CuArray(zeros(Int, (height, width)))
  93. colorscheme = ColorSchemes.inferno
  94. colorscheme_sized = get_cmap(colorscheme, max_steps)
  95. x, y = 1,1
  96. for ci=ci_min:dot_size:ci_max-dot_size
  97. x = 1
  98. for cr=cr_min:dot_size:cr_max-dot_size
  99. complexes[y,x] = Complex(cr, ci)
  100. x += 1
  101. end
  102. y += 1
  103. end
  104. cu_complexes = CuArray(complexes)
  105. cu_steps .= get_steps.(cu_complexes, max_steps)
  106. GPUArrays.synchronize(cu_steps)
  107. steps = Array(cu_steps)
  108. image = colorscheme_sized[:, steps]
  109. save("images/test.bmp", colorview(RGB, image))
  110. end
  111. @time mandelbrot_plot();
  112. end
  113. # ╔═╡ a4dd3c3d-26a8-4c55-8dde-3c7f6301f01e
  114. # begin
  115. # using Pkg
  116. # Pkg.activate("..")
  117. # Pkg.instantiate()
  118. # end
  119. # ╔═╡ ea9907cf-6f0e-495e-a172-bc6fd0cf2863
  120. # @quickactivate
  121. # ╔═╡ 4f275ac2-e986-4eec-bcef-fd7178e96d3d
  122. #= html"""
  123. <style>
  124. main {
  125. max-width: 1200px;
  126. }
  127. </style>
  128. """ =#
  129. # ╔═╡ f0638606-63c0-4541-bd76-2887002557f0
  130. md"""
  131. # Interactive Stuff
  132. In this section, we'll try making interactive features.
  133. """
  134. # ╔═╡ 8b0d2a11-ca25-4d95-bb74-33a5a8f5b5e5
  135. md"""
  136. ## Interactive Plotting
  137. """
  138. # ╔═╡ 69573234-68a8-4e41-bd34-7c5bb013e7f9
  139. md"""
  140. Set the range of x and the amplitude for the signal (A) and noise (N).
  141. """
  142. # ╔═╡ ed292325-e42e-43af-936f-6a98b1c86e3f
  143. md"""
  144. xₘₐₓ = $(@bind xₘₐₓ Slider(0:0.01:62.8, default=7.0, show_value=true))
  145. |
  146. A = $(@bind A Slider(0.01:0.01:10, default=1.0, show_value=true))
  147. |
  148. N = $(@bind N Slider(0.0:0.01:5.0, default=0.1, show_value=true))
  149. Replicates = $(@bind n_signal_replicates Slider(1:1000, default=10, show_value=true))
  150. """
  151. # ╔═╡ d4e4a684-1b0f-45d5-a377-35f005333bcc
  152. x=(0:0.01:xₘₐₓ)
  153. # ╔═╡ b40521ca-9982-4c61-954d-920a766380d2
  154. begin
  155. x_mat = repeat(x,1,n_signal_replicates);
  156. noisy_signals = A.*sin.(x_mat) + N.*randn(Float64,size(x_mat))
  157. μ_signal = mean(noisy_signals,dims=2)
  158. σ_signal = std(noisy_signals,dims=2)
  159. plot(x,μ_signal,
  160. color="black", linewidth=2, legend=false, ribbon=σ_signal, ylims = (-1.5*A, 1.5*A))
  161. title!("Carrier Signal in Noise")
  162. end
  163. # ╔═╡ 097cad13-82b7-4859-adc0-4a0bba8bc632
  164. md"""
  165. # Drosophila Data
  166. """
  167. # ╔═╡ ab4a23bb-dd9e-4455-ba6a-08e007f7092e
  168. md"""
  169. OK, well that was fun. Now, let's try to get the Drosophila data from the Cell paper. The data was downloaded from "https://ars.els-cdn.com/content/image/1-s2.0-S0092867419300406-mmc4.zip", then extracted into `cochlea-positional-information > data > exp_raw > Data_doi.org10.1016j.cell.2019.01.007`
  170. """
  171. # ╔═╡ 51e30cad-30b7-44ff-adf3-d06018541e16
  172. md"""
  173. ## ✅ Access drosophila data.
  174. """
  175. # ╔═╡ 6d6bfc47-b00d-4575-a62f-ac99fd37e641
  176. vars = matread(joinpath("..","data","exp_raw","doi.org10.1016j.cell.2019.01.007","Gap","gap_data_raw_dorsal_wt.mat"))
  177. # ╔═╡ b165c538-a5f5-4ea6-8ce5-6d60943b3cfa
  178. n_replicates = size(vars["data"]["index"])[2]
  179. # ╔═╡ 7456dc7a-fed8-4134-ba4c-f05ad99665f4
  180. gene_set = ["Hb","Gt","Kr","Kni"]
  181. # ╔═╡ 19fa8dc3-fc71-4cfa-87c7-961d94fc2ade
  182. md"""
  183. Extract the data from the MATLAB struct into a data type native to Julia.
  184. Let's first see how we can index into the struct array pulled in from the .mat file and plot one profile at a time for each gene.
  185. """
  186. # ╔═╡ ca5b9a0e-59b4-478d-9347-f500a364a18d
  187. md"""
  188. Now, let's get the data out of the struct array and put it into a dictionary.
  189. """
  190. # ╔═╡ c8a39986-acb9-41ca-bb0b-ad5d005d4c08
  191. begin
  192. # Initialize an empty dictionary with gene names as keys and empty matrices as values to populate in the loop.
  193. gene_data = Dict(name => Matrix{Float64}(undef,1000,102) for name in gene_set)
  194. for gene in gene_set
  195. gene_data
  196. for i_replicate = 1:102
  197. gene_data[gene][:,i_replicate] = vars["data"][gene][i_replicate]'
  198. end
  199. end
  200. end
  201. # ╔═╡ 335bae5d-d0b9-4620-9ec9-71e427bf5dea
  202. begin
  203. gene_data_array = Array{Float64}(undef,1000,102,4)
  204. for i_gene in 1:4
  205. gene_data_array[:,:,i_gene] = gene_data[gene_set[i_gene]]
  206. end
  207. n_points, ~, n_targets = size(gene_data_array)
  208. end
  209. # ╔═╡ 0b49770b-a6cb-44bf-a1e1-f9db3e361cb5
  210. size(vars["data"]["Hb"][1])
  211. # ╔═╡ e64c4b85-3550-43d2-bdf6-8979ff5fcb27
  212. size(gene_data["Hb"][:,1])
  213. # ╔═╡ 8cf2b1e5-a403-4e69-aabd-d712b3b746ac
  214. md"""
  215. Move the slider below to select an embryo from the dataset.
  216. """
  217. # ╔═╡ 1fb671db-4ee7-4756-87ab-7970a701e7bb
  218. @bind i_replicate Slider(1:1:n_replicates, show_value=true)
  219. # ╔═╡ e56f2074-5f94-43ba-9b10-662f65723033
  220. begin
  221. x_dros = collect(range(0.001,1,length=1000))
  222. p = plot()
  223. idx=0
  224. for gene in gene_set
  225. μ_dros = nanmean(gene_data[gene],dims=2)
  226. σ_dros = std(gene_data[gene],dims=2)
  227. μ_dros_v = vec(μ_dros)
  228. σ_dros_v = vec(σ_dros)
  229. n_pts = length(σ_dros)
  230. nan_idcs = findall(isnan,σ_dros_v)
  231. x_nan = x_dros
  232. x_nan[nan_idcs] .= NaN
  233. bnds = zeros(2)
  234. for idx_σ = 2:n_pts-1
  235. if !isnan(σ_dros[idx_σ]) & isnan(σ_dros[idx_σ-1])
  236. bnds[1] = idx_σ
  237. end
  238. if !isnan(σ_dros[idx_σ]) & isnan(σ_dros[idx_σ+1])
  239. bnds[2] = idx_σ
  240. end
  241. end
  242. idx = idx+1
  243. # <<<<<<< HEAD
  244. # # plot!(p,x_dros,gene_data[gene],
  245. # # color=idx, legend=false, ylims=[0,2100],alpha=0.05)
  246. # =======
  247. # # All individual profiles
  248. # plot!(p,x_dros,gene_data[gene],
  249. # color=idx, legend=false, ylims=[0,2100],alpha=0.05)
  250. # >>>>>>> dev-matt
  251. # Highlight one individual profile
  252. plot!(p,x_dros,gene_data[gene][:,i_replicate],
  253. color=idx, ylims=[0,2100],linewidth=1)
  254. σ_dros = nanstd(gene_data[gene],dims=2)
  255. plot!(p,x_dros,nanmean(gene_data[gene],dims=2),
  256. color=idx, ylims=[0,2100],linewidth=4,ribbon=σ_dros)
  257. # color=idx, ylims=[0,2100],linewidth=1.5)
  258. # >>>>>>> dev-matt
  259. # Mean and standard deviation
  260. plot!(p,x_nan,μ_dros,
  261. color=idx, ylims=[0,2100],linewidth=4,ribbon=σ_dros)
  262. end
  263. current()
  264. end
  265. # ╔═╡ 7123c8bc-7e48-4d7a-91dc-d35885407ac7
  266. md"""
  267. We have the data in a reasonable format now. So let's process it.
  268. """
  269. # ╔═╡ 05d085bb-878d-4e93-9985-373e9955892a
  270. md"""
  271. ## ✅ Anchor mean from 0 to 1.
  272. """
  273. # ╔═╡ ef7a4517-be6e-46ab-b85f-f3254e61905a
  274. md"""
  275. ## ✅ Align Y with JuMP.jl
  276. """
  277. # ╔═╡ 7170e92a-ab07-4ee9-aad3-dc30783f016e
  278. # Plot drosophila alignment results.
  279. # ╔═╡ b9c644e8-86c4-4935-8117-bfde3173b0f7
  280. md"""
  281. ____________________________________________________________________________________
  282. """
  283. # ╔═╡ 6cb4b869-dcd0-414b-88c5-67bf69d084a2
  284. md"""
  285. # Cochlea Data
  286. """
  287. # ╔═╡ 3e9036f5-5d11-4950-bba8-a2acfb84bf5e
  288. md"""
  289. ## ✅ Access cochlea images and data.
  290. """
  291. # ╔═╡ 9fabf548-d740-4989-a0e6-4700f8436cfe
  292. ### Set up path string lists.
  293. begin
  294. e12_img_dir = joinpath("..","data","exp_pro","sw","wt","e12.5","psmad-sox2-topro3","tif-orient","sep-ch","mip","_data_")
  295. e13_img_dir = joinpath("..","data","exp_pro","sw","wt","e13.5","psmad-sox2-topro3","tif-orient","sep-ch","mip","_data_")
  296. e12_img_paths = filter(endswith(".tif"),readdir(e12_img_dir,join=true))
  297. e13_img_paths = filter(endswith(".tif"),readdir(e13_img_dir,join=true))
  298. img_paths = Dict([("e12",e12_img_paths),("e13",e13_img_paths)])
  299. e12_prof_paths = filter(endswith(".csv"),readdir(normpath(joinpath(e12_img_dir,"..","quant-prof")),join=true))
  300. e13_prof_paths = filter(endswith(".csv"),readdir(normpath(joinpath(e13_img_dir,"..","quant-prof")),join=true))
  301. prof_paths = Dict([("e12",e12_prof_paths),("e13",e13_prof_paths)])
  302. end
  303. # ╔═╡ b695d442-89e2-4f21-aca6-52d26ca305c2
  304. md"""
  305. ## ✅ Get the data into a dataframe.
  306. """
  307. # ╔═╡ 4c86e3ce-cc11-4644-88d9-c52cb41d09e3
  308. md"""
  309. ## ✅ Resample raw data uniformly.
  310. """
  311. # ╔═╡ ef16f350-ab20-4aa1-ae2f-d68f0d6f8f00
  312. md"""
  313. ## 🚧 Exclude outer 10%.
  314. """
  315. # ╔═╡ a80ca2b0-c4bf-4d9d-9ead-9fe5fff2ae58
  316. md"""
  317. ## ✅ Regress nuclear noise.
  318. """
  319. # ╔═╡ 6895787b-70f3-4cd1-9e9f-243c22662f99
  320. md"""
  321. ## ✅ Anchor mean from 0 to 1.
  322. """
  323. # ╔═╡ 8e6682fa-6790-4275-9ad2-3aa9c1c72c1c
  324. md"""
  325. ## 🚧 Smooth data.
  326. """
  327. # ╔═╡ c3c4517b-aca3-437f-a3ca-8653b91b1e8a
  328. # ╔═╡ 1689ecbf-0750-46c1-82f2-d0e598d15448
  329. md"""
  330. ## ✅ Align Y with JuMP.jl.
  331. Using MATLAB's `fmincon` is a straightforward implementation of a $\chi$``^2`` alignment.
  332. With Julia, we can use JuMP.
  333. """
  334. # ╔═╡ f69ce4e9-3f7f-4928-ad8f-b8d98384565f
  335. md"""
  336. ### ⚠ Mean should be same before and after y-align.
  337. """
  338. # ╔═╡ 3bf6395b-acf2-4396-8b1a-f65291df41ed
  339. md"""
  340. ## 🚧 Align X and Y with JuMP.jl.
  341. """
  342. # ╔═╡ 8f6133fd-2508-4e06-97a9-65985b779a1c
  343. md"""
  344. ### 🚧 begin construction 🚧
  345. """
  346. # ╔═╡ 92bceb54-b2a0-4d82-a2d4-f3770c141834
  347. ones(2,2)
  348. # ╔═╡ bc001ccd-321b-4a9c-80b9-9bf36e79335a
  349. # # ✅ Initialize a 3D matrix (n_points x n_replicates x n_targets)
  350. # begin
  351. # Y_0 = zeros(length(df[1,:topro3_yalign]),nrow(df),2)
  352. # end
  353. # ╔═╡ 1c0ec19a-4229-43e3-83fd-2c07c03b8e44
  354. # nan_pad_percent = 0.1
  355. # ╔═╡ a1965e64-9449-47b2-a706-ebe36080f2a3
  356. # n_nans = convert(Int,round(nan_pad_percent*n_p))
  357. # ╔═╡ c5cdaccd-00b6-4fa8-b2ad-294feead5c90
  358. # nan_pad = replace!(zeros(n_nans,n_r,n_t),0=>NaN)
  359. # ╔═╡ 1934c23e-478f-4404-ad4c-b37c33f526a2
  360. # begin
  361. # shift_array = round.(rand(Uniform(-n_nans,n_nans),1,11))
  362. # Y_0_padded = vcat(nan_pad,Y_0,nan_pad)
  363. # Y_0_shift = Y_0_padded
  364. # for i_r = 1:n_r
  365. # Y_0_shift[:,i_r,:] = circshift(Y_0_padded[:,i_r,:],shift_array[i_r])
  366. # end
  367. # ybar = reshape(nanmean(Y_0_shift,dims=2),n_p+2*n_nans,2)
  368. # end
  369. # ╔═╡ d9edc6c1-07cd-417e-9f81-cb5db71c5185
  370. model_xy = Model(Ipopt.Optimizer)
  371. # ╔═╡ ed85ac59-4332-4c76-8e35-a1e193d5d185
  372. # function xy_objective(α,β,γ,nan_pad_percent,Y_0)
  373. # n_p, n_r, n_t = size(Y_0)
  374. # n_nans = convert(Int,round(nan_pad_percent*n_p))
  375. # # 1. circshift by γ
  376. # shift_array = round.(rand(Uniform(-n_nans,n_nans),1,11))
  377. # nan_pad = replace!(zeros(n_nans,n_r,n_t),0=>NaN)
  378. # Y_0_padded = vcat(nan_pad,Y_0,nan_pad)
  379. # Y_0_shift = Y_0
  380. # for i_r = 1:n_r
  381. # Y_0_shift[:,i_r,:] = circshift(Y_0_padded[:,i_r,:],γ[i_r])
  382. # end
  383. # circshift(Y,(γ,0))
  384. # # 2. take nanmean of each target to reduce variance against
  385. # # ybar = reshape(nanmean(Y_0_shift,dims=2),1200,2) # for reference
  386. # ȳ = reshape(nanmean(Y_0_shift,dims=2),n_p + 2*n_nans, n_t)
  387. # # 3. calculate cost
  388. # χ² = sum((Y_0_shift - (reshape(α,(1,n_replicates)) .+ ȳ*reshape(β,(1,n_replicates)))).^2)
  389. # return χ²
  390. # end
  391. # ╔═╡ 7420d1ae-dd36-478e-96c8-f3c65a3746ce
  392. # ╔═╡ 45cf206d-7405-464c-a86d-a4cfa8af3119
  393. md"""
  394. ### 🚧 end construction zone 🚧
  395. """
  396. # ╔═╡ 9f64c871-04a4-4d33-ac5d-1bc49b4d0485
  397. # xy_align script implementation
  398. # ╔═╡ 64b5deca-ab94-4f74-b960-711d2df20894
  399. md"""
  400. ## 🚧 Positional error.
  401. """
  402. # ╔═╡ 16a12f25-b06a-496c-bd66-c57ff3e15783
  403. md"""
  404. ## 👀 🚧 Direct estimate of I({g};x)
  405. """
  406. # ╔═╡ 0bf8238e-4217-45cb-bb78-28d6ba420a8e
  407. begin
  408. # Using drosophila data
  409. # size(gene_data_array)
  410. # n_points
  411. # n_replicates
  412. # n_targets
  413. xx = collect(1/n_points:1/n_points:1)[100:900]
  414. end
  415. # ╔═╡ 158ba835-4537-485f-b623-5564d1c57338
  416. floor.(xx)
  417. # ╔═╡ 66da211b-0e53-41c1-9ce4-75fb95a35991
  418. begin
  419. n_trials = 1
  420. n_boots = 1e1
  421. bin_counts = collect( 10:2:50)
  422. subsamps = [0.50, 0.75, 0.80, 0.85, 0.90, 0.95]
  423. end
  424. # ╔═╡ ba630ae6-8ab2-4ff8-bfd4-cab5f0cf0d3f
  425. mm = convert.(Int,round.(subsamps*n_replicates))
  426. # ╔═╡ 4d9dded4-923c-41f9-86c5-9a8982e3a5de
  427. n_subsamp_sets = length(mm)
  428. # ╔═╡ e7c1b228-7945-4be6-8c48-891301693b5e
  429. replicate_idcs = 1:n_replicates
  430. # ╔═╡ f3e394f0-401f-41d9-a667-445a3c3d2329
  431. n_bin_sizes = length(bin_counts)
  432. # ╔═╡ 22d52f0f-64cf-48fb-8895-41f504ef2da3
  433. # perm_order = ... # For use with n-D hist
  434. # ╔═╡ 9c2130eb-031c-4fb4-b983-075f6af2ca7b
  435. md"""
  436. ✅ P_g(g)
  437. """
  438. # ╔═╡ 0eb04b09-02d4-4151-9f05-a306eac00719
  439. g = gene_data_array[100:900,:,1][:];
  440. # ╔═╡ 9d1678e1-079e-469a-b9f7-656ae688a628
  441. h_hb = normalize(fit(Histogram,g,nbins=40),mode=:probability)
  442. # ╔═╡ a915181f-4030-4a86-88ed-df804d970a02
  443. length(range(minimum(g),stop=maximum(g),length=29))-1
  444. # ╔═╡ 89ab03c0-1906-4ca2-a7f2-ac3c0d0ccea1
  445. plot(h_hb)
  446. # ╔═╡ d56fd8e0-74b0-40e5-b0ef-b8a7ed54432e
  447. begin
  448. xxx = [1, 1, 1, 1, 1, 1]
  449. h = fit(Histogram, x, range(minimum(xxx), stop=maximum(xxx), length=4))
  450. end
  451. # ╔═╡ e8fc5beb-989f-4486-a798-45b34b4a0753
  452. sum(h_hb.weights)
  453. # ╔═╡ 5d01e544-05ce-4df7-982b-265952bc9bdd
  454. size(h_hb.weights)
  455. # ╔═╡ fd7d9cbe-6b30-4187-9831-b55053600b69
  456. md"""
  457. ✅ Joint P(g,x)
  458. """
  459. # ╔═╡ d96c3c1e-7023-4ae5-8c56-1a4c63ef4263
  460. g1 = gene_data_array[100:900,:,1]
  461. # ╔═╡ f1f5ae30-bbfb-4922-9754-a2f0f907d2dd
  462. G = gene_data_array[100:900,:,:]
  463. # ╔═╡ ca0dec61-20e8-457f-81fd-e4d7df52e6c2
  464. x_column = repeat(xx,n_replicates)
  465. # ╔═╡ e11a583d-d580-42ce-9266-300464761324
  466. size(x_column)
  467. # ╔═╡ 86f2c5a7-8930-4c03-af65-4c56670c1354
  468. begin
  469. hist_data_joint = (x_column,g1[:])
  470. pyx_joint = normalize(fit(Histogram,hist_data_joint, nbins = 30),mode=:probability)
  471. end
  472. # ╔═╡ 064e1fa8-d714-4372-82c4-a5197e11675c
  473. plot(pyx_joint)
  474. # ╔═╡ 113c7c76-b732-45e6-a45c-c2156b5c80fe
  475. md"""
  476. ✅ Random subsample of replicates
  477. """
  478. # ╔═╡ ff14e4b5-9527-4132-8bb4-e6ae76536b00
  479. k = mm[2]
  480. # ╔═╡ 92a21016-f530-4987-beb8-b8ac9cad91a6
  481. # xy-align with test data
  482. begin
  483. # 👇 This is where I don't know what I'm doing 👇
  484. # I don't know how to pass the variables and parameters,
  485. # and I don't know how to access them from within the function.
  486. function xy_objective(α...)
  487. # 👆 This is where I don't know what I'm doing 👆
  488. n_p, n_r, n_t = size(Y_0)
  489. n_nans = convert(Int,round(nan_pad_fraction*n_p))
  490. # 1. circshift by γ
  491. nan_pad = replace!(zeros(n_nans,n_r,n_t),0=>NaN)
  492. Y_0_padded = vcat(nan_pad,Y_0,nan_pad)
  493. Y_0_shift = Y_0
  494. for i_r = 1:n_r
  495. Y_0_shift[:,i_r,:] = circshift(Y_0_padded[:,i_r,:],γ[i_r])
  496. end
  497. # 2. take nanmean of each target to reduce variance against target mean
  498. ȳ = reshape(nanmean(Y_0_shift,dims=2),n_p + 2*n_nans, n_t)
  499. # 3. calculate cost
  500. χ²_t = zeros(n_t)
  501. for i_t = 1:n_t
  502. χ²_t[i_t] =
  503. sum(Y_0_shift[:,:,i_t] -
  504. (reshape(α,(1,n_r)) .+ ȳ[:,i_t]*reshape(β,(1,n_r))).^2)
  505. end
  506. χ² = sum(χ²_t)
  507. return χ²
  508. end
  509. # Sample data
  510. n_pts = 1000 # number of data sample points per experiment
  511. n_reps = 10 # number of experimental replicates
  512. n_targ = 2 # number of experimental targets (simultaneously acquired in each rep)
  513. Y_0 = rand(n_pts, n_reps, n_targ) # data matrix
  514. # Goal: reduce total variance by:
  515. # adding α to each column
  516. # scaling scaling by β for each column
  517. # shifting by γ for each target
  518. # Pad edges with NaN values so data can shift
  519. np_frac = 0.1
  520. # e.g. a vector with 100 elements along the first dimension will have 100*np_frac NaNs added to beginning and end to become 100*(1+np_frac) elements long in the first dimension
  521. # Build model
  522. m = Model(Ipopt.Optimizer)
  523. register(m,
  524. :xy_objective,
  525. n_reps*(2*n_targ + 1),
  526. xy_objective; autodiff=true)
  527. α_test, β_test, γ_test = nothing, nothing, nothing
  528. nan_pad_fraction, Y_0_prob = nothing, nothing
  529. # α: additive variable, 1 for each replicate for each target
  530. @variable(m,
  531. α_test[i=1:n_reps,j=1:n_targ])
  532. set_start_value(α_test, zeros(n_reps,n_targ))
  533. # β: scaling variable, 1 for each replicate for each target
  534. @variable(m,
  535. β_test[i=1:n_reps,j=1:n_targ])
  536. # γ: shifting variable, 1 for each replicate (shift all targets by same amount)
  537. @variable(m,
  538. -convert(Int,floor(np_frac*n_pts)) <=
  539. γ_test[i=1:n_reps] <=
  540. convert(Int,floor(np_frac*n_pts)) ) # also need integer constraint
  541. # Fraction of data length to allow for shifting
  542. @NLparameter(m,
  543. nan_pad_fraction == np_frac)
  544. # Starting point for experimental data
  545. @NLparameter(m,
  546. Y_0_prob[i=1:n_pts,j=1:n_reps,k=1:n_targ] == Y_0[i,j,k])
  547. # 👇 This is where I don't know what I'm doing 👇
  548. # I don't know how to pass the variables and parameters,
  549. # and I don't know how to access them from within the function.
  550. @NLobjective(m,
  551. Min,
  552. xy_objective(α_test..., β_test..., γ_test..., Y_0_prob..., nan_pad_fraction))
  553. # 👆 This is where I don't know what I'm doing 👆
  554. optimize!(m)
  555. # α_test_opt = resha
  556. # optimize!(model)
  557. # α_opt = reshape(value.(α),(1,n_replicates))
  558. # β_opt = reshape(value.(β),(1,n_replicates))
  559. # Y_align = reshape(Y,(n_points,n_replicates))
  560. # Y_align = (Y_align .- α_opt)./β_opt
  561. # for i=1:3 println(".") end
  562. # println(solution_summary(model))
  563. # return Y_align, α_opt, β_opt, model
  564. end
  565. # ╔═╡ fc4483ec-d716-4279-9ca2-d827214e64b8
  566. n_p, n_r, n_t = size(Y_0)
  567. # ╔═╡ 0c3adb9e-8bf1-4f74-a72a-7d89f7129b13
  568. begin
  569. # Align X,Y by doing align_y() for every possible shift in x.
  570. # nan_pad_fraction = 0.1
  571. # n_p, n_r, n_t = size(Y)
  572. # n_nans = convert(Int,round(nan_pad_fraction*n_p_gap))
  573. # 1. circshift by γ
  574. # nan_pad = replace!(zeros(n_nans,n_r,n_t),0=>NaN)
  575. nan_pad = fill(NaN, n_nans, n_r, n_t)
  576. Y_0_padded = vcat(nan_pad,Y_0,nan_pad)
  577. Y_0_shift = Y_0
  578. for i_r = 1:n_r
  579. Y_0_shift[:,i_r,:] = circshift(Y_0_padded[:,i_r,:],γ[i_r])
  580. end
  581. # 2. take nanmean of each target to reduce variance against target mean
  582. ȳ = reshape(nanmean(Y_0_shift,dims=2),n_p + 2*n_nans, n_t)
  583. end
  584. # ╔═╡ 33517f40-2661-4a1b-ba7b-6f8f4d802b4b
  585. function align_xy(Y_0)
  586. shift_array = round.(rand(Uniform(-n_nans,n_nans),1,11))
  587. Y_0_padded = vcat(nan_pad,Y_0,nan_pad)
  588. Y_0_shift = Y_0_padded
  589. for i_r = 1:n_r
  590. Y_0_shift[:,i_r,:] = circshift(Y_0_padded[:,i_r,:],shift_array[i_r])
  591. end
  592. # REFERENCE 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇
  593. # model = Model(Ipopt.Optimizer)
  594. # n_points, n_replicates = size(Y)
  595. # α, β = nothing, nothing
  596. # @variable(model, α[i=1:n_replicates])
  597. # @variable(model, β[i=1:n_replicates])
  598. # @objective(model, Min, sum((Y - (reshape(α,(1,n_replicates)) .+ ȳ*reshape(β,(1,n_replicates)))).^2))
  599. # optimize!(model)
  600. # α_opt = reshape(value.(α),(1,n_replicates))
  601. # β_opt = reshape(value.(β),(1,n_replicates))
  602. # Y_align = reshape(Y,(n_points,n_replicates))
  603. # Y_align = (Y_align .- α_opt)./β_opt
  604. # for i=1:3 println(".") end
  605. # println(solution_summary(model))
  606. # return Y_align, α_opt, β_opt, model
  607. # REFERENCE 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆
  608. end
  609. # ╔═╡ 158a1b8b-c2e5-43fe-a05e-b49d823be9eb
  610. subsample_idcs = sample(replicate_idcs, k, replace=false)
  611. # ╔═╡ 74ce856f-5f00-49f3-a228-9da74e83f359
  612. g1_subsample = g1[:,subsample_idcs]
  613. # ╔═╡ 7189f9ac-b083-425a-b883-7c4fb350dbfe
  614. G_subsample_temp = G[:,subsample_idcs,:] # see line 63 in midirectestimate.m
  615. # ╔═╡ b7067b2a-ee9e-4ddf-bf22-57405585c204
  616. # Reshape G_subsample
  617. # first argument: number of entries in G_subsample[:,:,1]
  618. # second argument: n_targets
  619. # final dims will be ~1bajillion x 4
  620. # ╔═╡ 042c9c93-b7fd-4783-88a1-4106522d27f1
  621. G_subsample = reshape(G_subsample_temp, length(G_subsample_temp[:,:,1]), n_targets)
  622. # ╔═╡ bd47febd-c099-40a2-919f-52e948da0f8b
  623. # Make an x column to correspond to the data columns (subsampled n_replicates)
  624. x_column_sub = repeat(xx,k)
  625. # ╔═╡ c07fec15-c32b-4ae1-857f-87892dc6eecf
  626. size(x_column_sub)
  627. # ╔═╡ d0a77da5-0d0b-4997-be39-82fabc24938d
  628. begin
  629. # Get the joint distribution of the subsampled data and x
  630. hist_data_sub_joint = tuple(x_column_sub,[G_subsample[:,c] for c in 1:size(G_subsample,2)]...)
  631. pyx_joint_sub = normalize(fit(Histogram,hist_data_sub_joint, nbins = (3,3,3,3,3)),mode=:probability)
  632. end
  633. # ╔═╡ f0537a73-c9c7-421a-82d8-32fa22f8ab72
  634. pyx_joint_sub.weights = pyx_joint_sub.weights .+ eps()
  635. # ╔═╡ 619a2c99-b8a9-4b00-b81f-889cdbf726fc
  636. # Permute the order of the n-D histogram to put x at the end ... not sure why this is needed, but it's required to work in MATLAB
  637. perm_order = vcat(collect(2:1:n_targets+1),1)
  638. # ╔═╡ 9c369db4-ff2a-4af6-ad21-3879f7d81e3a
  639. begin
  640. g2 = G[:,:,2]
  641. g1_1 = g1[:,1]/maximum(g1[:,1])
  642. g2_1 = g2[:,1]/maximum(g1[:,1])
  643. end
  644. # ╔═╡ 5d265b5e-3ed7-4ad1-b370-54ca4396fc32
  645. begin
  646. using Trapz
  647. u1 = g1_1
  648. u2 = g2_1
  649. trapz(u1)
  650. end
  651. # ╔═╡ d9399fcf-dfe5-4ca9-acbc-251a2aaf3916
  652. sum(u1.*u2)
  653. # ╔═╡ 69b1aa9e-8bc3-440f-a040-eb09883bb54b
  654. # ╔═╡ f14f5199-87ee-414f-8a02-bc5f7ac58a55
  655. # ╔═╡ 81041290-7b64-46ae-b315-1c3489c52499
  656. # ╔═╡ 80518999-65c1-4a26-8a6c-89319430ed08
  657. # ╔═╡ dd7b721d-fab0-4849-b305-dab72df2c73f
  658. # ╔═╡ db4639b0-17c4-4efc-a42b-d3e51166fd26
  659. # ╔═╡ bdb73836-cd26-4869-b8d3-bc0dac2305ed
  660. md"""
  661. ## 🚧 Extrapolate I({g};x).
  662. """
  663. # ╔═╡ f31e63ad-81c5-48f6-a572-e925141a1b97
  664. md"""
  665. ## 🚧 Decoding maps.
  666. """
  667. # ╔═╡ 90205ce4-dc4b-4b27-9e12-5f9a04e655b4
  668. md"""
  669. # 🚧 Functions
  670. """
  671. # ╔═╡ cba983b5-1813-4c4a-b0e5-bb72f463ce39
  672. md"""
  673. ## Main Analysis Functions
  674. """
  675. # ╔═╡ 4a442a3c-df99-4149-8289-0ca3146cd1ec
  676. md"""
  677. ### ✔ raw\_data\_frame()
  678. """
  679. # ╔═╡ 5f271db7-1dca-4249-aa09-c4260c9da2e3
  680. md"""
  681. ### ✔ uniform\_linear\_sample()
  682. """
  683. # ╔═╡ 4618f68a-ba5a-48a2-ad0e-5595d71368a4
  684. function uniform_linear_sample(data_in, n_samps)
  685. nodes_in = range(1, size(data_in)[1], length=length(data_in))
  686. nodes_eval = range(1, nodes_in[end], length = n_samps)
  687. int = interpolate((nodes_in,), data_in, Gridded(Linear()))
  688. data_out = zeros(length(nodes_eval))
  689. idx = trues(length(nodes_eval))
  690. data_out[idx] = int(nodes_eval[idx])
  691. return data_out
  692. end
  693. # ╔═╡ 9a2e237d-d913-4974-b278-968ca0f9453e
  694. md"""
  695. ### ✔ regress\_noise()
  696. """
  697. # ╔═╡ 9502d39e-a04d-4a44-8415-9e68f05031be
  698. function regress_noise(n_ref,x)
  699. # Correct a signal measurement by accounting for variations in nuclear density.
  700. # Inputs
  701. # > n_ref: measured noise reference (nuclear channel)
  702. # > x: measured signal + noise
  703. # Outputs
  704. # s̃: approximate pure signal (mean ~ 0)
  705. β = (transpose(x)*n_ref)/(transpose(n_ref)*n_ref)
  706. s̃ = x - β*n_ref
  707. end
  708. # ╔═╡ 45e668ef-f791-40d1-b244-524d18f5eb56
  709. md"""
  710. ### ✔ anchor\_mean\_0\_to\_1()
  711. """
  712. # ╔═╡ 2e7252a1-5a1b-49e5-854a-ae75f082eb6d
  713. function anchor_mean_0_to_1(data)
  714. # Inputs
  715. # > data: n_points x n_replicates
  716. #
  717. # Outputs
  718. # > data_anchor: array of same size as data where the minimum and maximum values for the mean profile is 0 and 1, respectively.
  719. # > data_anchor_mean: the mean of the anchored data
  720. n_points, n_reps = size(data)
  721. data_μ= nanmean(data, dims=2)
  722. data_μ_reshape = reshape(data_μ,n_points)
  723. data_μ_mins = reshape(nanminimum(data_μ_reshape, dims=1),1,1)
  724. data_μ_maxes = reshape(nanmaximum(data_μ_reshape, dims=1),1,1)
  725. data_⚓ = (data .- data_μ_mins)./
  726. (data_μ_maxes .- data_μ_mins)
  727. data_⚓_μ = nanmean(data_⚓, dims=2)
  728. data_⚓_μ_reshape = reshape(data_⚓_μ, n_points)
  729. return data_⚓, data_⚓_μ_reshape
  730. end
  731. # ╔═╡ d6a76d2b-f924-42e4-8a17-931baefb51c1
  732. begin
  733. data_anchor = zeros(size(gene_data_array))
  734. data_anchor_mean = zeros(1000,102)
  735. for i_t = 1:4
  736. gene_array = reshape(gene_data_array[:,:,i_t],(1000,102))
  737. data_anchor[:,:,i_t], data_anchor_mean[:,i_t] = anchor_mean_0_to_1(gene_array)
  738. end
  739. end
  740. # ╔═╡ cbf17e2e-47a5-4390-99e6-c3f5882c3a10
  741. md"""
  742. ### ✔ anchor\_mean\_to\_1()
  743. """
  744. # ╔═╡ beb19c28-f5dd-4f36-9e55-85c6b9508024
  745. function anchor_mean_to_1(data)
  746. # Inputs
  747. # > data: n_points x n_replicates
  748. #
  749. # Outputs
  750. # > data_anchor: array of same size as data where the mean value of all profiles is anchored to 1 (for nuclear channel)
  751. # > data_anchor_mean: the mean of the anchored data
  752. n_points, n_reps = size(data)
  753. data_μ= nanmean(data, dims=2)
  754. data_μ_reshape = reshape(data_μ,n_points)
  755. data_μ_mins = reshape(nanminimum(data_μ_reshape, dims=1),1,1)
  756. data_μ_maxes = reshape(nanmaximum(data_μ_reshape, dims=1),1,1)
  757. data_⚓ = (data)./(nanmean(data_μ))
  758. data_⚓_μ = nanmean(data_⚓, dims=2)
  759. data_⚓_μ_reshape = reshape(data_⚓_μ, n_points)
  760. return data_⚓, data_⚓_μ_reshape
  761. end
  762. # ╔═╡ 327d1ba2-226c-4fb7-9a78-6acca773322c
  763. md"""
  764. ### smooth\_data()
  765. """
  766. # ╔═╡ ff920b1e-a2b3-4c5b-8cc4-80aebbffe4b5
  767. function smooth_data()
  768. end
  769. # ╔═╡ 4957bf80-0f7f-4ca2-997b-7c6ff6972004
  770. md"""
  771. ### align\_y()
  772. """
  773. # ╔═╡ 833c1369-b584-4161-b92a-bb9f99280af3
  774. function align_y(Y,ȳ)
  775. # Using JuMP, perform a χ² variance minimization alignment using a linear model to bring individual replicate profiles closer to the sample mean.
  776. # Inputs
  777. # > Y: n_points x n_replicates 2D array
  778. # > ȳ: n_points x 1 2D array
  779. # Outpus
  780. # > Y_align: n_points x n_replicates optimally aligned 2D array
  781. # > α_opt: n_replicates additive parameter 1D array
  782. # > β_opt: n_replicates scaling parameter 1D array
  783. # > model: the full model for minimization
  784. model = Model(Ipopt.Optimizer)
  785. n_points, n_replicates = size(Y)
  786. α, β = nothing, nothing
  787. @variable(model, α[i=1:n_replicates])
  788. @variable(model, β[i=1:n_replicates])
  789. @objective(model,
  790. Min,
  791. sum((Y - (reshape(α,(1,n_replicates)) .+ ȳ*reshape(β,(1,n_replicates)))).^2))
  792. optimize!(model)
  793. α_opt = reshape(value.(α),(1,n_replicates))
  794. β_opt = reshape(value.(β),(1,n_replicates))
  795. Y_align = reshape(Y,(n_points,n_replicates))
  796. Y_align = (Y_align .- α_opt)./β_opt
  797. for i=1:3 println(".") end
  798. println(solution_summary(model))
  799. return Y_align, α_opt, β_opt, model
  800. end
  801. # ╔═╡ d381176e-7653-448a-80d2-d862031743d5
  802. begin
  803. n_p_gap, n_r_gap, n_t_gap = size(data_anchor[100:900,:,:])
  804. Y_yalign_gap = zeros(n_p_gap, n_r_gap, n_t_gap)
  805. for i_t = 1:4
  806. Y_temp = data_anchor[100:900,:,i_t]
  807. ȳ_temp = data_anchor_mean[100:900,i_t]
  808. Y_yalign_gap[:,:,i_t], α_opt_gap, β_opt_gap, model_gap = align_y(Y_temp, ȳ_temp)
  809. end
  810. end
  811. # ╔═╡ 1daee640-7efc-448f-9477-5cac9c5ae9d0
  812. md"""
  813. ### 👀 align\_xy()
  814. """
  815. # ╔═╡ ff9bb147-a271-435b-9cbd-f914b3315864
  816. # function align_xy(Y_0)
  817. # # Input
  818. # # > Y_0: data to align n_points x n_replicates x n_targets
  819. # # Output
  820. # # > Y_xyalign: aligned data
  821. # # > α_opt: additive parameter (1 per profile per replicate)
  822. # # > β_opt: scaling parameter (1 per profile per replicate)
  823. # # > γ_opt: left-right shift parameter (1 per replicate, all targets within a replicate are shifted by the same amount)
  824. # n_points, n_replicates, n_targets = size(Y_0)
  825. # # Pad data with NaN values for shifting indices.
  826. # nan_pad_percent = 0.1
  827. # n_nans = convert(Int64,round(nan_pad_percent*n_points))
  828. # nan_pad = replace!(zeros(n_nans,n_replicates), 0=>NaN)
  829. # Y_0_padded = vcat(nan_pad,Y_0,nan_pad)
  830. # model = Model(Ipopt.Optimizer)
  831. # α, β, γ = nothing, nothing, nothing
  832. # @variable(model, α[i=1:n_replicates,j=1:n_targets]) # n_targest x n_replicates
  833. # @variable(model, β[i=1:n_replicates,j=1:n_targets]) # n_targets x n_replicates
  834. # @variable(model, γ[i=1:n_replicates],Int) # n_replicates - integer array
  835. # @objective(model, Min, xy_objective(α,β,γ,Y_0))
  836. # function xy_objective(α,β,γ,Y_0)
  837. # # 1. circshift by γ
  838. # circshift(Y,(γ,0))
  839. # # 2. take nanmean of each target to reduce variance against
  840. # return χ²
  841. # end
  842. # # REFERENCE 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇
  843. # # model = Model(Ipopt.Optimizer)
  844. # # n_points, n_replicates = size(Y)
  845. # # α, β = nothing, nothing
  846. # # @variable(model, α[i=1:n_replicates])
  847. # # @variable(model, β[i=1:n_replicates])
  848. # # @objective(model, Min, sum((Y - (reshape(α,(1,n_replicates)) .+ ȳ*reshape(β,(1,n_replicates)))).^2))
  849. # # optimize!(model)
  850. # # α_opt = reshape(value.(α),(1,n_replicates))
  851. # # β_opt = reshape(value.(β),(1,n_replicates))
  852. # # Y_align = reshape(Y,(n_points,n_replicates))
  853. # # Y_align = (Y_align .- α_opt)./β_opt
  854. # # for i=1:3 println(".") end
  855. # # println(solution_summary(model))
  856. # # return Y_align, α_opt, β_opt, model
  857. # # REFERENCE 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆
  858. # end
  859. # ╔═╡ 950d747a-d37a-40f2-b872-624f54419de5
  860. md"""
  861. ## Helper Functions
  862. """
  863. # ╔═╡ 64104b9b-cdec-4f8f-a114-c9759d5e5fa3
  864. md"""
  865. ### ✔ path\_matches\_id()
  866. """
  867. # ╔═╡ 393f89d0-2a08-4f34-918a-f6a80b5a278f
  868. function path_matches_id(id, channel, test_string)
  869. # Check if a path contains a specific cochlea ID.
  870. pattern_string = "MAX_($id)_($channel)"
  871. match_obj = match(Regex(pattern_string), test_string)
  872. if match_obj == nothing
  873. return false
  874. else
  875. return true
  876. end
  877. end
  878. # ╔═╡ fef63029-1df9-45cd-81a0-4a511948c358
  879. function raw_data_frame(prof_paths,img_paths)
  880. ### Get the data into data frames.
  881. df_data = DataFrame(id=[],
  882. x=[],
  883. topro3=[], sox2=[], psmad=[])
  884. df_img = DataFrame(topro3_image_data=[], sox2_image_data=[], psmad_image_data=[])
  885. for prof_path in prof_paths
  886. df_data_csv = DataFrame(CSV.File(prof_path))
  887. df_img_temp = DataFrame()
  888. id_obj = match(r"\d{2}\_.+(?=.csv)", prof_path)
  889. id = id_obj.match
  890. for img_path in img_paths
  891. # Get topro3 image for current cochlea
  892. tf_topro3 = path_matches_id(id, "topro3", img_path)
  893. tf_sox2 = path_matches_id(id, "sox2", img_path)
  894. tf_psmad = path_matches_id(id, "psmad", img_path)
  895. if tf_topro3
  896. insertcols!(df_img_temp, 1, :topro3_image_data => [load(img_path)])
  897. elseif tf_sox2
  898. insertcols!(df_img_temp, 1, :sox2_image_data => [load(img_path)])
  899. elseif tf_psmad
  900. insertcols!(df_img_temp, 1, :psmad_image_data => [load(img_path)])
  901. end
  902. end
  903. push!(df_data,[id, df_data_csv.x, df_data_csv.topro3, df_data_csv.sox2,df_data_csv.psmad])
  904. push!(df_img,
  905. [df_img_temp.topro3_image_data,
  906. df_img_temp.sox2_image_data,
  907. df_img_temp.psmad_image_data])
  908. # WIP: add ROI column
  909. global df = hcat(df_data,df_img)
  910. end
  911. return df
  912. end
  913. # ╔═╡ 46fbc4fe-d1dd-4447-917b-031bdb129612
  914. ### Get the data into dataframs.
  915. begin
  916. df_e12 = raw_data_frame(e12_prof_paths, e12_img_paths);
  917. df_e13 = raw_data_frame(e13_prof_paths, e13_img_paths);
  918. end
  919. # ╔═╡ c0c0e2e0-5bc9-435e-a73c-d5a0e69c9640
  920. df_e12
  921. # ╔═╡ 1087a093-3966-450c-b8fe-1c28039c4769
  922. begin
  923. n_e12 = nrow(df_e12)
  924. n_e13 = nrow(df_e13)
  925. n_samples = 1000
  926. raw_data = ["x","topro3","sox2","psmad"]
  927. n_raw_data = length(raw_data)
  928. # can this be condensed with broadcasting???
  929. for i_t = 1:n_raw_data
  930. raw_col = string(raw_data[i_t])
  931. new_col = string(raw_data[i_t],"_usamp")
  932. df_e12[:,new_col] = uniform_linear_sample.(df_e12[:,raw_col], n_samples)
  933. df_e13[:,new_col] = uniform_linear_sample.(df_e13[:,raw_col], n_samples)
  934. end
  935. end
  936. # ╔═╡ c4933e11-8c4c-4e5d-b9f5-975266a0c229
  937. df_e12
  938. # ╔═╡ 00008a70-45ca-42e7-9472-d1353f473b26
  939. begin
  940. noise_col = string("topro3_usamp")
  941. signal_targets = ["topro3","sox2","psmad"]
  942. for t in signal_targets
  943. signal_col = string(t,"_usamp")
  944. est_col = string(t,"_regress")
  945. df_e12[:,est_col] = regress_noise.(df_e12[:,noise_col],df_e12[:,signal_col])
  946. df_e13[:,est_col] = regress_noise.(df_e13[:,noise_col],df_e13[:,signal_col])
  947. end
  948. end
  949. # ╔═╡ 823d5226-79e6-40c9-94db-8df0d75a662e
  950. begin
  951. row_idx = 1
  952. plot(df_e12[row_idx,:topro3_usamp])
  953. plot!(df_e12[row_idx,:topro3_regress])
  954. end
  955. # ╔═╡ 770a6c9d-2ece-4272-8d7f-df8f003ccbe3
  956. df_e12
  957. # ╔═╡ 74a9c8ec-0d6d-4d13-b010-d0a97676bc1a
  958. plot(df_e12[:,:sox2_⚓])
  959. # ╔═╡ 47fd720b-2374-46a9-9208-f9bb9bc3a15e
  960. begin
  961. targets = ["topro3","sox2","psmad"]
  962. n_targets_cochlea = length(targets)
  963. df_e12_⚓ = df_e12
  964. df_e13_⚓ = df_e13
  965. for t in targets
  966. usamp_col = string(t,"_usamp")
  967. d_12 = df_e12[:,usamp_col]
  968. d_13 = df_e13[:,usamp_col]
  969. data_12 = hcat(d_12...)
  970. data_13 = hcat(d_13...)
  971. if t == "topro3"
  972. data_⚓_12, data_⚓_μ_12 = anchor_mean_to_1(data_12)
  973. data_⚓_13, data_⚓_μ_13 = anchor_mean_to_1(data_13)
  974. else
  975. data_⚓_12, data_⚓_μ_12 = anchor_mean_0_to_1(data_12)
  976. data_⚓_13, data_⚓_μ_13 = anchor_mean_0_to_1(data_13)
  977. end
  978. # Next, get each column of data in data_⚓ into a row of df_e12
  979. n_pts_12, n_profs_12 = size(data_⚓_12)
  980. n_pts_13, n_profs_13 = size(data_⚓_13)
  981. new_col = string(t,"_usamp_⚓")
  982. df_temp_12 = DataFrame(new_col => [])
  983. df_temp_13 = DataFrame(new_col => [])
  984. for i_p = 1:n_profs_12
  985. push!(df_temp_12,[data_⚓_12[:,i_p]])
  986. end
  987. for i_p = 1:n_profs_13
  988. push!(df_temp_13,[data_⚓_13[:,i_p]])
  989. end
  990. # Can't get this to add to the global df_e12 ... don't know why
  991. df_e12_⚓ = hcat(df_e12_⚓, df_temp_12)
  992. df_e13_⚓ = hcat(df_e13_⚓, df_temp_13)
  993. end
  994. end
  995. # ╔═╡ 6700db87-4976-4b71-961a-530e6dfea489
  996. begin
  997. for t in targets
  998. if t === "topro3"
  999. col = string(t,"_usamp")
  1000. # Convert from a df column of arrays to a matrix first.
  1001. d_12 = hcat(df_e12[:,col]...)
  1002. d_⚓_12,_ = anchor_mean_to_1(d_12)
  1003. d_13 = hcat(df_e13[:,col]...)
  1004. d_⚓_13,_ = anchor_mean_to_1(d_13)
  1005. else
  1006. col = string(t,"_regress")
  1007. d_12 = hcat(df_e12[:,col]...)
  1008. d_⚓_12,_ = anchor_mean_0_to_1(d_12)
  1009. d_13 = hcat(df_e13[:,col]...)
  1010. d_⚓_13,_ = anchor_mean_0_to_1(d_13)
  1011. end
  1012. _, n_profs_12 = size(d_⚓_12)
  1013. _, n_profs_13 = size(d_⚓_13)
  1014. # Convert the matrix into a temp df to add back to the original df.
  1015. new_col = string(t,"_⚓")
  1016. df_temp_12 = DataFrame(new_col => [])
  1017. df_temp_13 = DataFrame(new_col => [])
  1018. for i_p = 1:n_profs_12
  1019. push!(df_temp_12,[d_⚓_12[:,i_p]])
  1020. end
  1021. for i_p = 1:n_profs_13
  1022. push!(df_temp_13,[d_⚓_13[:,i_p]])
  1023. end
  1024. df_e12[:,new_col] = df_temp_12[:,new_col]
  1025. df_e13[:,new_col] = df_temp_13[:,new_col]
  1026. end
  1027. end
  1028. # ╔═╡ bbbb002a-2098-43ce-8f3e-ebced0ef48f7
  1029. df_e12_⚓
  1030. # ╔═╡ 58fef615-a305-48a2-9daa-e203a139ea6a
  1031. df_e13_⚓
  1032. # ╔═╡ 9fe1f2a9-4d87-42b6-ac3d-1d7282c836eb
  1033. targets
  1034. # ╔═╡ 67f0b3b7-4201-42fd-86ca-16c49d9567fd
  1035. begin
  1036. df_e12_align = df_e12_⚓
  1037. df_e13_align = df_e13_⚓
  1038. for t in targets
  1039. ⚓_col = string(t,"_usamp_⚓")
  1040. d_12 = hcat(df_e12_⚓[:,⚓_col]...)
  1041. d_13 = hcat(df_e13_⚓[:,⚓_col]...)
  1042. loc = joinpath("..","data","exp_pro")
  1043. if t == "psmad"
  1044. matwrite(joinpath(loc,"julia-data-psmad.mat"),Dict("p12" => d_12, "p13" => d_13))
  1045. elseif t == "sox2"
  1046. matwrite(joinpath(loc,"julia-data-sox2.mat"),Dict("s12" => d_12, "s13" => d_13))
  1047. elseif t == "topro3"
  1048. matwrite(joinpath(loc,"julia-data-topro3.mat"),Dict("t12" => d_12, "t13" => d_13))
  1049. end
  1050. d_mean_12 = mean(d_12,dims=2)
  1051. d_mean_13 = mean(d_13,dims=2)
  1052. d_yalign_12,_,_,_ = align_y(d_12, d_mean_12)
  1053. d_yalign_13,_,_, _ = align_y(d_13, d_mean_13)
  1054. if t == "psmad"
  1055. matwrite(joinpath(loc,"julia-data-aligned-psmad.mat"),Dict("p12_al" => d_yalign_12, "p13_al" => d_yalign_13))
  1056. elseif t == "sox2"
  1057. matwrite(joinpath(loc,"julia-data-aligned-sox2.mat"),Dict("s12_al" => d_yalign_12, "s13_al" => d_yalign_13))
  1058. elseif t == "topro3"
  1059. matwrite(joinpath(loc,"julia-data-aligned-topro3.mat"),Dict("t12_al" => d_yalign_12, "t13_al" => d_yalign_13))
  1060. end
  1061. # Convert the matrix into a temp df to add back to the original df.
  1062. _, n_profs_12 = size(d_yalign_12)
  1063. _, n_profs_13 = size(d_yalign_13)
  1064. new_col = string(t,"_yalign")
  1065. df_temp_12 = DataFrame(new_col => [])
  1066. df_temp_13 = DataFrame(new_col => [])
  1067. for i_p = 1:n_profs_12
  1068. push!(df_temp_12,[d_yalign_12[:,i_p]])
  1069. end
  1070. for i_p = 1:n_profs_13
  1071. push!(df_temp_13,[d_yalign_13[:,i_p]])
  1072. end
  1073. df_e12[:,new_col] = df_temp_12[:,new_col]
  1074. df_e13[:,new_col] = df_temp_13[:,new_col]
  1075. end
  1076. end
  1077. # ╔═╡ a20f2a88-9b12-4b66-a6aa-480e9bc038ac
  1078. df_e12
  1079. # ╔═╡ 7f8a3758-5d41-4d1d-a03e-70a0ab9dd0a4
  1080. df_e13
  1081. # ╔═╡ 3ac6aef2-ff95-4828-835e-cb5e0ae8f15a
  1082. begin
  1083. # Plot results to check.
  1084. plot_dict_12 = Dict("topro3"=>plot(title="E12.5 Nuclear Signal"),"sox2"=>plot(title="Sox2"),"psmad"=>plot(title="P-Smad"))
  1085. plot_dict_13 = Dict("topro3"=>plot(title="E13.5 Nuclear Signal"),"sox2"=>plot(title="Sox2"),"psmad"=>plot(title="P-Smad"))
  1086. for t in targets
  1087. raw_col_12 = string(t,"_⚓")
  1088. aln_col_12 = string(t,"_yalign")
  1089. raw_data_12 = hcat(df_e12[:,raw_col_12]...)
  1090. aln_data_12 = hcat(df_e12[:,aln_col_12]...)
  1091. mean_raw_12 = mean(raw_data_12,dims=2)
  1092. std_raw_12 = std(raw_data_12,dims=2)
  1093. mean_aln_12 = mean(aln_data_12,dims=2)
  1094. std_aln_12 = std(aln_data_12,dims=2)
  1095. plot!(plot_dict_12[t],
  1096. mean_raw_12, linewidth=2, ribbon= std_raw_12,
  1097. color=1)
  1098. plot!(plot_dict_12[t],
  1099. mean_aln_12, linewidth=2, ribbon= std_aln_12,
  1100. color=2)
  1101. raw_col_13 = string(t,"_⚓")
  1102. aln_col_13 = string(t,"_yalign")
  1103. raw_data_13 = hcat(df_e13[:,raw_col_13]...)
  1104. aln_data_13 = hcat(df_e13[:,aln_col_13]...)
  1105. mean_raw_13 = mean(raw_data_13,dims=2)
  1106. std_raw_13 = std(raw_data_13,dims=2)
  1107. mean_aln_13 = mean(aln_data_13,dims=2)
  1108. std_aln_13 = std(aln_data_13,dims=2)
  1109. plot!(plot_dict_13[t],
  1110. mean_raw_13, linewidth=2, ribbon= std_raw_13,
  1111. color=3)
  1112. plot!(plot_dict_13[t],
  1113. mean_aln_13, linewidth=2, ribbon= std_aln_13,
  1114. color=4)
  1115. end
  1116. end
  1117. # ╔═╡ 05373280-3e42-4eb3-847c-e9a931909db4
  1118. plot(plot_dict_12["topro3"],
  1119. plot_dict_12["sox2"],
  1120. plot_dict_12["psmad"],
  1121. layout=(1,3),legend=false,ylims=(-0.1,1.3))
  1122. # ╔═╡ 144a99c9-e3cb-44c2-8b77-6d685f0773d7
  1123. begin
  1124. plot(plot_dict_12["sox2"],
  1125. plot_dict_12["psmad"],
  1126. layout=(1,2),legend=false,ylims=(-0.1,1.3))
  1127. end
  1128. # ╔═╡ 80c62ecc-f612-4975-8392-0fb5c6a7c18e
  1129. plot(plot_dict_13["sox2"],
  1130. plot_dict_13["psmad"],
  1131. layout=(1,2),legend=false,ylims=(-0.1,1.3))
  1132. # ╔═╡ b066c1cb-5121-4a3e-bf51-f31844b7dda3
  1133. # ✅ Build the 3D matrix for alignment
  1134. begin
  1135. i_t = 0
  1136. for t in targets[2:3] # Exclude topro3 ... only shift it after.
  1137. i_t = i_t + 1
  1138. yalign_col = string(t,"_yalign")
  1139. d_12 = hcat(df_e12[:,yalign_col]...)
  1140. Y_0[:,:,i_t] = d_12 # working
  1141. end
  1142. end
  1143. # ╔═╡ be2d2b73-c63c-43e0-89d2-ebef2cd0e6c9
  1144. # ╔═╡ ce817927-c6ec-4d9b-84da-11b34eb08022
  1145. # ╔═╡ Cell order:
  1146. # ╠═a4dd3c3d-26a8-4c55-8dde-3c7f6301f01e
  1147. # ╠═485d8da0-be94-11eb-183b-e5e105e25b55
  1148. # ╠═ea9907cf-6f0e-495e-a172-bc6fd0cf2863
  1149. # ╠═4f275ac2-e986-4eec-bcef-fd7178e96d3d
  1150. # ╟─f0638606-63c0-4541-bd76-2887002557f0
  1151. # ╟─8b0d2a11-ca25-4d95-bb74-33a5a8f5b5e5
  1152. # ╟─69573234-68a8-4e41-bd34-7c5bb013e7f9
  1153. # ╟─ed292325-e42e-43af-936f-6a98b1c86e3f
  1154. # ╟─d4e4a684-1b0f-45d5-a377-35f005333bcc
  1155. # ╟─b40521ca-9982-4c61-954d-920a766380d2
  1156. # ╟─097cad13-82b7-4859-adc0-4a0bba8bc632
  1157. # ╟─ab4a23bb-dd9e-4455-ba6a-08e007f7092e
  1158. # ╟─51e30cad-30b7-44ff-adf3-d06018541e16
  1159. # ╠═6d6bfc47-b00d-4575-a62f-ac99fd37e641
  1160. # ╠═b165c538-a5f5-4ea6-8ce5-6d60943b3cfa
  1161. # ╠═7456dc7a-fed8-4134-ba4c-f05ad99665f4
  1162. # ╟─19fa8dc3-fc71-4cfa-87c7-961d94fc2ade
  1163. # ╟─ca5b9a0e-59b4-478d-9347-f500a364a18d
  1164. # ╠═c8a39986-acb9-41ca-bb0b-ad5d005d4c08
  1165. # ╠═335bae5d-d0b9-4620-9ec9-71e427bf5dea
  1166. # ╠═0b49770b-a6cb-44bf-a1e1-f9db3e361cb5
  1167. # ╠═e64c4b85-3550-43d2-bdf6-8979ff5fcb27
  1168. # ╟─8cf2b1e5-a403-4e69-aabd-d712b3b746ac
  1169. # ╠═1fb671db-4ee7-4756-87ab-7970a701e7bb
  1170. # ╠═e56f2074-5f94-43ba-9b10-662f65723033
  1171. # ╟─7123c8bc-7e48-4d7a-91dc-d35885407ac7
  1172. # ╟─05d085bb-878d-4e93-9985-373e9955892a
  1173. # ╠═d6a76d2b-f924-42e4-8a17-931baefb51c1
  1174. # ╟─ef7a4517-be6e-46ab-b85f-f3254e61905a
  1175. # ╠═d381176e-7653-448a-80d2-d862031743d5
  1176. # ╠═0c3adb9e-8bf1-4f74-a72a-7d89f7129b13
  1177. # ╠═7170e92a-ab07-4ee9-aad3-dc30783f016e
  1178. # ╟─b9c644e8-86c4-4935-8117-bfde3173b0f7
  1179. # ╟─6cb4b869-dcd0-414b-88c5-67bf69d084a2
  1180. # ╟─3e9036f5-5d11-4950-bba8-a2acfb84bf5e
  1181. # ╠═9fabf548-d740-4989-a0e6-4700f8436cfe
  1182. # ╟─b695d442-89e2-4f21-aca6-52d26ca305c2
  1183. # ╠═46fbc4fe-d1dd-4447-917b-031bdb129612
  1184. # ╠═c0c0e2e0-5bc9-435e-a73c-d5a0e69c9640
  1185. # ╟─4c86e3ce-cc11-4644-88d9-c52cb41d09e3
  1186. # ╠═1087a093-3966-450c-b8fe-1c28039c4769
  1187. # ╠═c4933e11-8c4c-4e5d-b9f5-975266a0c229
  1188. # ╠═ef16f350-ab20-4aa1-ae2f-d68f0d6f8f00
  1189. # ╟─a80ca2b0-c4bf-4d9d-9ead-9fe5fff2ae58
  1190. # ╠═00008a70-45ca-42e7-9472-d1353f473b26
  1191. # ╠═823d5226-79e6-40c9-94db-8df0d75a662e
  1192. # ╠═770a6c9d-2ece-4272-8d7f-df8f003ccbe3
  1193. # ╟─6895787b-70f3-4cd1-9e9f-243c22662f99
  1194. # ╠═6700db87-4976-4b71-961a-530e6dfea489
  1195. # ╠═74a9c8ec-0d6d-4d13-b010-d0a97676bc1a
  1196. # ╠═47fd720b-2374-46a9-9208-f9bb9bc3a15e
  1197. # ╠═bbbb002a-2098-43ce-8f3e-ebced0ef48f7
  1198. # ╠═58fef615-a305-48a2-9daa-e203a139ea6a
  1199. # ╟─8e6682fa-6790-4275-9ad2-3aa9c1c72c1c
  1200. # ╠═c3c4517b-aca3-437f-a3ca-8653b91b1e8a
  1201. # ╟─1689ecbf-0750-46c1-82f2-d0e598d15448
  1202. # ╠═9fe1f2a9-4d87-42b6-ac3d-1d7282c836eb
  1203. # ╠═67f0b3b7-4201-42fd-86ca-16c49d9567fd
  1204. # ╠═a20f2a88-9b12-4b66-a6aa-480e9bc038ac
  1205. # ╠═7f8a3758-5d41-4d1d-a03e-70a0ab9dd0a4
  1206. # ╟─3ac6aef2-ff95-4828-835e-cb5e0ae8f15a
  1207. # ╠═05373280-3e42-4eb3-847c-e9a931909db4
  1208. # ╠═144a99c9-e3cb-44c2-8b77-6d685f0773d7
  1209. # ╠═80c62ecc-f612-4975-8392-0fb5c6a7c18e
  1210. # ╟─f69ce4e9-3f7f-4928-ad8f-b8d98384565f
  1211. # ╟─3bf6395b-acf2-4396-8b1a-f65291df41ed
  1212. # ╟─8f6133fd-2508-4e06-97a9-65985b779a1c
  1213. # ╠═92a21016-f530-4987-beb8-b8ac9cad91a6
  1214. # ╠═92bceb54-b2a0-4d82-a2d4-f3770c141834
  1215. # ╠═158ba835-4537-485f-b623-5564d1c57338
  1216. # ╠═bc001ccd-321b-4a9c-80b9-9bf36e79335a
  1217. # ╠═b066c1cb-5121-4a3e-bf51-f31844b7dda3
  1218. # ╠═fc4483ec-d716-4279-9ca2-d827214e64b8
  1219. # ╠═1c0ec19a-4229-43e3-83fd-2c07c03b8e44
  1220. # ╠═a1965e64-9449-47b2-a706-ebe36080f2a3
  1221. # ╠═c5cdaccd-00b6-4fa8-b2ad-294feead5c90
  1222. # ╠═1934c23e-478f-4404-ad4c-b37c33f526a2
  1223. # ╠═d9edc6c1-07cd-417e-9f81-cb5db71c5185
  1224. # ╠═ed85ac59-4332-4c76-8e35-a1e193d5d185
  1225. # ╠═7420d1ae-dd36-478e-96c8-f3c65a3746ce
  1226. # ╠═33517f40-2661-4a1b-ba7b-6f8f4d802b4b
  1227. # ╟─45cf206d-7405-464c-a86d-a4cfa8af3119
  1228. # ╠═9f64c871-04a4-4d33-ac5d-1bc49b4d0485
  1229. # ╠═64b5deca-ab94-4f74-b960-711d2df20894
  1230. # ╟─16a12f25-b06a-496c-bd66-c57ff3e15783
  1231. # ╠═0bf8238e-4217-45cb-bb78-28d6ba420a8e
  1232. # ╠═66da211b-0e53-41c1-9ce4-75fb95a35991
  1233. # ╠═ba630ae6-8ab2-4ff8-bfd4-cab5f0cf0d3f
  1234. # ╠═4d9dded4-923c-41f9-86c5-9a8982e3a5de
  1235. # ╠═e7c1b228-7945-4be6-8c48-891301693b5e
  1236. # ╠═f3e394f0-401f-41d9-a667-445a3c3d2329
  1237. # ╠═22d52f0f-64cf-48fb-8895-41f504ef2da3
  1238. # ╟─9c2130eb-031c-4fb4-b983-075f6af2ca7b
  1239. # ╠═0eb04b09-02d4-4151-9f05-a306eac00719
  1240. # ╠═9d1678e1-079e-469a-b9f7-656ae688a628
  1241. # ╠═a915181f-4030-4a86-88ed-df804d970a02
  1242. # ╠═89ab03c0-1906-4ca2-a7f2-ac3c0d0ccea1
  1243. # ╠═d56fd8e0-74b0-40e5-b0ef-b8a7ed54432e
  1244. # ╠═e8fc5beb-989f-4486-a798-45b34b4a0753
  1245. # ╠═5d01e544-05ce-4df7-982b-265952bc9bdd
  1246. # ╟─fd7d9cbe-6b30-4187-9831-b55053600b69
  1247. # ╠═d96c3c1e-7023-4ae5-8c56-1a4c63ef4263
  1248. # ╠═f1f5ae30-bbfb-4922-9754-a2f0f907d2dd
  1249. # ╠═ca0dec61-20e8-457f-81fd-e4d7df52e6c2
  1250. # ╠═e11a583d-d580-42ce-9266-300464761324
  1251. # ╠═86f2c5a7-8930-4c03-af65-4c56670c1354
  1252. # ╠═064e1fa8-d714-4372-82c4-a5197e11675c
  1253. # ╟─113c7c76-b732-45e6-a45c-c2156b5c80fe
  1254. # ╠═ff14e4b5-9527-4132-8bb4-e6ae76536b00
  1255. # ╠═158a1b8b-c2e5-43fe-a05e-b49d823be9eb
  1256. # ╠═74ce856f-5f00-49f3-a228-9da74e83f359
  1257. # ╠═7189f9ac-b083-425a-b883-7c4fb350dbfe
  1258. # ╠═b7067b2a-ee9e-4ddf-bf22-57405585c204
  1259. # ╠═042c9c93-b7fd-4783-88a1-4106522d27f1
  1260. # ╠═bd47febd-c099-40a2-919f-52e948da0f8b
  1261. # ╠═c07fec15-c32b-4ae1-857f-87892dc6eecf
  1262. # ╠═d0a77da5-0d0b-4997-be39-82fabc24938d
  1263. # ╠═f0537a73-c9c7-421a-82d8-32fa22f8ab72
  1264. # ╠═619a2c99-b8a9-4b00-b81f-889cdbf726fc
  1265. # ╠═9c369db4-ff2a-4af6-ad21-3879f7d81e3a
  1266. # ╠═5d265b5e-3ed7-4ad1-b370-54ca4396fc32
  1267. # ╠═d9399fcf-dfe5-4ca9-acbc-251a2aaf3916
  1268. # ╠═8d62b88b-f77f-4d8d-8c6a-ada1d1626b8c
  1269. # ╠═69b1aa9e-8bc3-440f-a040-eb09883bb54b
  1270. # ╠═f14f5199-87ee-414f-8a02-bc5f7ac58a55
  1271. # ╠═81041290-7b64-46ae-b315-1c3489c52499
  1272. # ╠═80518999-65c1-4a26-8a6c-89319430ed08
  1273. # ╠═dd7b721d-fab0-4849-b305-dab72df2c73f
  1274. # ╠═db4639b0-17c4-4efc-a42b-d3e51166fd26
  1275. # ╠═bdb73836-cd26-4869-b8d3-bc0dac2305ed
  1276. # ╠═f31e63ad-81c5-48f6-a572-e925141a1b97
  1277. # ╟─90205ce4-dc4b-4b27-9e12-5f9a04e655b4
  1278. # ╟─cba983b5-1813-4c4a-b0e5-bb72f463ce39
  1279. # ╟─4a442a3c-df99-4149-8289-0ca3146cd1ec
  1280. # ╠═fef63029-1df9-45cd-81a0-4a511948c358
  1281. # ╟─5f271db7-1dca-4249-aa09-c4260c9da2e3
  1282. # ╠═4618f68a-ba5a-48a2-ad0e-5595d71368a4
  1283. # ╟─9a2e237d-d913-4974-b278-968ca0f9453e
  1284. # ╠═9502d39e-a04d-4a44-8415-9e68f05031be
  1285. # ╟─45e668ef-f791-40d1-b244-524d18f5eb56
  1286. # ╠═2e7252a1-5a1b-49e5-854a-ae75f082eb6d
  1287. # ╟─cbf17e2e-47a5-4390-99e6-c3f5882c3a10
  1288. # ╠═beb19c28-f5dd-4f36-9e55-85c6b9508024
  1289. # ╟─327d1ba2-226c-4fb7-9a78-6acca773322c
  1290. # ╠═ff920b1e-a2b3-4c5b-8cc4-80aebbffe4b5
  1291. # ╟─4957bf80-0f7f-4ca2-997b-7c6ff6972004
  1292. # ╠═833c1369-b584-4161-b92a-bb9f99280af3
  1293. # ╟─1daee640-7efc-448f-9477-5cac9c5ae9d0
  1294. # ╠═ff9bb147-a271-435b-9cbd-f914b3315864
  1295. # ╟─950d747a-d37a-40f2-b872-624f54419de5
  1296. # ╟─64104b9b-cdec-4f8f-a114-c9759d5e5fa3
  1297. # ╠═393f89d0-2a08-4f34-918a-f6a80b5a278f
  1298. # ╠═be2d2b73-c63c-43e0-89d2-ebef2cd0e6c9
  1299. # ╠═ce817927-c6ec-4d9b-84da-11b34eb08022
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...