Published June 3, 2026
| Version v1.0.0
Software
Open
adiezsanchez/microglia_dna_damage: COSMIC
Authors/Creators
Description
This is the first public release of COSMIC (Counting Of Spots in Marker Indicator Cells): an interactive, notebook-driven workflow to quantify puncta (e.g. DNA damage foci) inside nuclei of cell-marker–positive cells. The reference use case is γH2AX-style foci in Iba1⁺ microglia and GFAP⁺ astrocytes from multichannel Zeiss .lsm stacks, but the same steps apply to other 3-channel marker + nuclei + spot assays.
Highlights
- End-to-end pipeline from multichannel
.lsmstacks → per-image CSV metrics → QC filtering → exploratory plots and batch image review. - Cellpose 2.0 nuclei segmentation with tunable pre and post processing (Gaussian blur, contrast stretch, dilation/erosion).
- Cell marker+ (CM+) nuclei via intensity thresholding or optional APOC semantic segmentation, with erosion to suppress protrusion artifacts on MIPs.
- APOC object segmenters (three pretrained DNA-damage versions) for spot detection, with post-segmentation erosion/dilation to control speck size.
- Quality control that flags suboptimal stainings from mask-area outliers and writes
qc_*.csvfiles for downstream filtering. - Example outputs for microglia and astrocyte parameter sets included under
results/. CITATION.cfffor machine-readable citation metadata (GitHub Cite this repository).
Added
- Core analysis module:
utils.py(analyze_images, parameter extraction, QC, aggregation, Plotly exploration helpers). - Notebooks:
0_data_download.ipynb— download example data via pre-signed URL.00_presigned_url_generator.ipynb— helper for data hosting (maintainers).1_image_analysis.ipynb— batch image analysis and CSV export.2_data_exploration.ipynb— technical-replicate plots, QC, aggregated results.3_qc_passed_image_display.ipynb/3_qc_failed_image_display.ipynb— matplotlib review of QC-passed vs failed images.
- Pretrained classifiers:
object_segmenters/dna_damage_object_segmenter_v{1,2,3}.clsemantic_segmenters/microglia_segmenter_v1.cl
- Reproducible conda environment:
envs/environment.yml(Python 3.9, Cellpose, Napari/devbio stack, APOC, PyTorch CPU, Plotly, Jupyter). - Documentation:
README.mdwith workflow diagram, parameter glossary, and setup instructions. - License: BSD 3-Clause.
Workflow summary
- Segment nuclei (Cellpose) → dilate/erode labels so foci associate with the correct nucleus.
- Define CM+ nuclei (threshold or APOC glia mask + colocalization erosion).
- Detect spots (APOC object segmenter v1–v3) → size filtering via erosion/dilation.
- Export metrics per filename (foci per CM+ nucleus, damage load ratios, mask areas, etc.).
- Explore & QC in notebook 2; visualize passed/failed cases in notebooks 3.
Notes for users
- GPU:
analyze_imagesusesCellpose(gpu=True); a CUDA-capable GPU is recommended for practical batch runs. - Data: Raw
.lsmdata are not bundled; use0_data_download.ipynbafter obtaining a fresh pre-signed link (see README). Place images underraw_data/,microglia_data/, orastrocyte_data/as described in the notebooks. - Channels: Pipeline expects 3 channels (nuclei, spot channel, cell marker); adapt channel indices in code if your acquisition order differs.
- Segmenter choice: v1 is strictest (best on clean stainings); v2/v3 generalize more but can add noise on poor slides (documented in README).
- Training notebooks: README references
0_train_*and4_quality_checks.ipynbfor classifier training and Napari deep-dive QC; those notebooks are not in this repository—training examples are linked to the intestinal organoid brightfield workflow. - Mouse ID pairing:
mouse_ids_Iba1.csvandmouse_ids_GFAP.csvare gitignored; supply your own mapping files for biological replicate pairing. - Zenodo: Add the DOI to
CITATION.cffand the README Zenodo link when the archive record is published.
Notes
Files
adiezsanchez/microglia_dna_damage-v1.0.0.zip
Files
(61.7 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:5bc72b204e716d6370c92fdb16bd4c32
|
61.7 MB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/adiezsanchez/microglia_dna_damage/tree/v1.0.0 (URL)
Software
- Repository URL
- https://github.com/adiezsanchez/microglia_dna_damage