Skip to content

Commit f7ccd18

Browse files
author
Lukas Schrangl
committed
Update Analysis and Plots notebooks
1 parent 35a0536 commit f7ccd18

File tree

2 files changed

+39
-75
lines changed

2 files changed

+39
-75
lines changed

notebooks/02. Analysis.ipynb

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"outputs": [],
1212
"source": [
1313
"%matplotlib widget\n",
14-
"import sys\n",
15-
"import os\n",
14+
"\n",
1615
"import matplotlib.pyplot as plt\n",
1716
"plt.ioff()\n",
1817
"import numpy as np\n",
@@ -30,9 +29,9 @@
3029
"output_type": "stream",
3130
"text": [
3231
"smFRET analysis software version 2.1\n",
33-
"(git revision 2.1-76-gd791ef7)\n",
34-
"Output version 12\n",
35-
"Using sdt-python version 14.4\n"
32+
"(git revision 2.1-87-ga66b93a)\n",
33+
"Output version 13\n",
34+
"Using sdt-python version 15.2\n"
3635
]
3736
}
3837
],
@@ -47,10 +46,7 @@
4746
"outputs": [],
4847
"source": [
4948
"# Create an Analyzer instance. This will load the tracking data.\n",
50-
"ana = Analyzer()\n",
51-
"# Add a (\"fret\", \"exc_type\") column declaring the excitation type (donor or\n",
52-
"# acceptor) for each localization.\n",
53-
"ana.flag_excitation_type()"
49+
"ana = Analyzer(\"tracking-split\")"
5450
]
5551
},
5652
{
@@ -100,12 +96,12 @@
10096
{
10197
"data": {
10298
"application/vnd.jupyter.widget-view+json": {
103-
"model_id": "b78aa53144a04e399b3a05cb841a045e",
99+
"model_id": "828de3b2d9ae4638881111479aec9652",
104100
"version_major": 2,
105101
"version_minor": 0
106102
},
107103
"text/plain": [
108-
"VBox(children=(Dropdown(description='channel', options=('acceptor', 'donor'), value='acceptor'), BoundedIntTex…"
104+
"VBox(children=(Dropdown(description='channel', options=('donor', 'acceptor'), value='donor'), BoundedIntText(v…"
109105
]
110106
},
111107
"metadata": {},
@@ -180,7 +176,7 @@
180176
{
181177
"data": {
182178
"application/vnd.jupyter.widget-view+json": {
183-
"model_id": "b5b3f0148c874113b3b7bb73e0cf6e03",
179+
"model_id": "1c97a41d7f64490faf769dd842633e81",
184180
"version_major": 2,
185181
"version_minor": 0
186182
},
@@ -237,7 +233,7 @@
237233
{
238234
"data": {
239235
"application/vnd.jupyter.widget-view+json": {
240-
"model_id": "e57740ca6ea34ab4a2ce00f7bac026e8",
236+
"model_id": "f8540c53327d4b64996de2dc5159a7c0",
241237
"version_major": 2,
242238
"version_minor": 0
243239
},
@@ -336,12 +332,12 @@
336332
{
337333
"data": {
338334
"application/vnd.jupyter.widget-view+json": {
339-
"model_id": "485d7207aba54ca8aab6982fc5e7ed4c",
335+
"model_id": "7a57bc95af7447e78a31a8df4af93dcc",
340336
"version_major": 2,
341337
"version_minor": 0
342338
},
343339
"text/plain": [
344-
"Thresholder(children=(Dropdown(description='image', options=('DPPC_ctrl-J4/cells-01_000_.tif', 'DPPC_ctrl-J4/c…"
340+
"Thresholder(children=(ImageSelector(children=(Dropdown(description='image', options=(('DPPC_ctrl-J4/cells-01_0…"
345341
]
346342
},
347343
"metadata": {},
@@ -355,22 +351,35 @@
355351
},
356352
{
357353
"cell_type": "code",
358-
"execution_count": 19,
354+
"execution_count": 20,
359355
"metadata": {},
360356
"outputs": [],
361357
"source": [
362358
"# Threshold cell images and select only data within cell-occupied areas\n",
363-
"ana.apply_cell_masks(\"adaptive\", block_size=65, c=-2, smooth=3, method=\"mean\")\n",
359+
"ana.apply_cell_masks([k for k in ana.analyzers if not k.endswith(\"no-cells\")],\n",
360+
" \"adaptive\", block_size=65, c=-2, smooth=3, method=\"mean\")\n",
364361
"\n",
365362
"if plot_keys:\n",
366363
" dp.dscatter(\"Underneath cells\")"
367364
]
368365
},
369366
{
370367
"cell_type": "code",
371-
"execution_count": 20,
368+
"execution_count": 21,
372369
"metadata": {},
373-
"outputs": [],
370+
"outputs": [
371+
{
372+
"name": "stderr",
373+
"output_type": "stream",
374+
"text": [
375+
"/home/lukas/Software/fret-analysis/smfret_analysis/analyzer.py:860: PerformanceWarning: \n",
376+
"your performance may suffer as PyTables will pickle object types that it cannot\n",
377+
"map directly to c-types [inferred_type->mixed,key->axis1_level0] [items->None]\n",
378+
"\n",
379+
" {(\"fret\", \"exc_type\"): str}))\n"
380+
]
381+
}
382+
],
374383
"source": [
375384
"# Save results to disk (typically \"filtered-v???.h5\")\n",
376385
"ana.save()"
@@ -401,7 +410,7 @@
401410
"name": "python",
402411
"nbconvert_exporter": "python",
403412
"pygments_lexer": "ipython3",
404-
"version": "3.7.6"
413+
"version": "3.7.8"
405414
},
406415
"nbpresent": {
407416
"slides": {

0 commit comments

Comments
 (0)