Skip to content

Commit c525b69

Browse files
JBeckwithclaude
andcommitted
Restructure and consolidate notebooks for new-user clarity
- Rename example_notebooks with Step-prefixed ordering (Step1–Step4a/b) - Move calibration notebooks (AreaCalibration, CellMask) to Optional_ prefix since they only need re-running when changing microscope/objective - Create 00_START_HERE.ipynb explaining workflow, step order, and optional branches - Consolidate 3 ASAP BoxPlots notebooks (Neurons/Microglia/Astrocytes) into one parameterised ASAP_Cell_Plots_BoxPlots.ipynb with cell_type + table_name params - Consolidate 2 ASAP HC visualisation notebooks into one ASAP_Cell_Plots_HC_Visualisation.ipynb with cell_type + path params - Fix NameError bug in Optional_CellMask_SizeThresholding (image_size was unassigned) - Add path-edit warning to Optional_TwoColourCoincidencePlot Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ef56ffa commit c525b69

10 files changed

Lines changed: 2227 additions & 11 deletions
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"nbformat": 4,
3+
"nbformat_minor": 5,
4+
"metadata": {
5+
"kernelspec": {
6+
"display_name": "Python 3 (ipykernel)",
7+
"language": "python",
8+
"name": "python3"
9+
},
10+
"language_info": {
11+
"name": "python",
12+
"version": "3.10.0"
13+
}
14+
},
15+
"cells": [
16+
{
17+
"cell_type": "markdown",
18+
"metadata": {},
19+
"source": "# pyRASP — Start Here\n\nWelcome to **pyRASP**, a toolkit for single-molecule imaging analysis of 3D z-stacks.\n\nThis folder (`example_notebooks/`) contains step-by-step notebooks for a new user. Work through the numbered notebooks in order, then add Optional notebooks as needed.\n\n---\n\n## Installation check"
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"metadata": {},
25+
"outputs": [],
26+
"source": "# Run this cell to verify pyRASP is importable before proceeding\nimport sys\nsys.path.append('..')\n\nfrom src import RASPRoutines, AnalysisFunctions, IOFunctions, PlottingFunctions\nprint(\"pyRASP imported successfully.\")"
27+
},
28+
{
29+
"cell_type": "markdown",
30+
"metadata": {},
31+
"source": "---\n\n## Core pipeline\n\n| Notebook | What it does |\n|---|---|\n| `Step1_RadialityCalibration.ipynb` | **Run first.** Calibrates the radiality threshold from negative-control images. Saves parameters to disk. Required for any spot detection. |\n| `Step2_SingleImageAnalysis.ipynb` | Visual QC on one image: plots detected spots before committing to the full folder run. |\n| `Step3_ImageFolderAnalysis.ipynb` | Runs `analyse_images()` on an entire folder. Produces `spot_analysis.csv` and `largeobject_analysis.csv`. |\n| `Step4a_LargeObject_CellColocalisation.ipynb` | Re-runs LO-to-cell colocalisation on existing CSVs (uses `lo_colocalise_wrapper()`). Needs Step 3 output. |\n| `Step4b_CountPunctaInCells.ipynb` | Counts spots per individual cell (uses `count_puncta_in_individual_cells_threshold_3D()`). Needs Step 3 output. |\n\n---\n\n## Optional — calibration (once per microscope setup)\n\nThese only need to be run when changing microscope or objective. If you have already calibrated these values, skip them.\n\n| Notebook | What it does |\n|---|---|\n| `Optional_AreaCalibration.ipynb` | Calibrates the area threshold that distinguishes diffraction-limited puncta from large aggregates. |\n| `Optional_CellMask_SizeThresholding.ipynb` | Visual tool for choosing cell-size thresholds. |\n\n---\n\n## Optional — spatial statistics (needs Step 3 output)\n\nThese can be run in any order after Step 3:\n\n| Notebook | What it does |\n|---|---|\n| `Optional_SpotToSpot_RDF.ipynb` | Auto-correlation RDF: do spots cluster with themselves? |\n| `Optional_SpotToMask_RDF.ipynb` | Spot-to-mask RDF: do spots avoid or seek the cell boundary? |\n| `Optional_TwoPunctaSets_RDF.ipynb` | Cross-channel RDF: do channel-1 and channel-2 spots co-cluster? |\n| `Optional_SpotToSpotCoincidence.ipynb` | Coincidence fraction: what fraction of C1 spots co-localise with C2? |\n| `Optional_TwoColourCoincidencePlot.ipynb` | Two-colour coincidence visualisation. **Edit paths before running.** |\n| `Optional_CellPunctumPlot.ipynb` | Per-cell punctum analysis plot. |\n\n---\n\n## Real-data worked examples\n\nFor end-to-end worked examples on real ASAP data, see `../testing_notebooks/worked_examples/`:\n\n- `FullPipeline_LargeAggregates_20260326.ipynb` — calibrate → analyse → LO-in-cell → plots\n- `FullPipeline_Oligomers_20260326.ipynb` — calibrate → analyse → count per cell → box plots\n- `FullPipeline_Puncta_20260529.ipynb` — collaborator dataset (note: incomplete)"
32+
}
33+
]
34+
}
File renamed without changes.

example_notebooks/Step2b_CellMask_SizeThresholding.ipynb renamed to example_notebooks/Optional_CellMask_SizeThresholding.ipynb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,7 @@
9999
]
100100
}
101101
],
102-
"source": [
103-
"image_size = \n",
104-
"for k in np.arange(len(areas)):\n",
105-
" coords = pil[k]\n",
106-
" xm = coords[:, 0]\n",
107-
" ym = coords[:, 1]\n",
108-
" if (np.any(xm > image_size[0])) or (np.any(ym > image_size[1])):\n",
109-
" print(k)"
110-
]
102+
"source": "image_size = cell_mask_old.shape # (height, width) of the 2D projected mask\nfor k in np.arange(len(areas)):\n coords = pil[k]\n xm = coords[:, 0]\n ym = coords[:, 1]\n if (np.any(xm > image_size[0])) or (np.any(ym > image_size[1])):\n print(k)"
111103
},
112104
{
113105
"cell_type": "code",
@@ -139,4 +131,4 @@
139131
},
140132
"nbformat": 4,
141133
"nbformat_minor": 5
142-
}
134+
}

‎example_notebooks/Optional_TwoColourCoincidencePlot.ipynb‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@
6969
"z_plane = 10 # middle of stacks"
7070
]
7171
},
72+
{
73+
"cell_type": "markdown",
74+
"metadata": {},
75+
"source": "> **Edit before running:** The cell below contains hardcoded file paths. Replace `analysis_file_c1`, `analysis_file_c2`, and the image filename with paths to your own data before running."
76+
},
7277
{
7378
"cell_type": "code",
7479
"execution_count": null,
@@ -233,4 +238,4 @@
233238
},
234239
"nbformat": 4,
235240
"nbformat_minor": 5
236-
}
241+
}
File renamed without changes.
File renamed without changes.

example_notebooks/Step5a_LargeObject_CellColocalisation.ipynb renamed to example_notebooks/Step4a_LargeObject_CellColocalisation.ipynb

File renamed without changes.
File renamed without changes.

‎testing_notebooks/ASAP_Cell_Plots_BoxPlots.ipynb‎

Lines changed: 50 additions & 0 deletions
Large diffs are not rendered by default.

‎testing_notebooks/ASAP_Cell_Plots_HC_Visualisation.ipynb‎

Lines changed: 2135 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)