Spatial analysis of targeted DESI-MRM imaging integrated with histology ROIs, cell annotations and targeted spatial transcriptomics, from SpatialData Zarr stores to CSV results and an HTML report.
| Location | Purpose |
|---|---|
corrmsi.bat |
The one entry point (check / processing / stats_report / tests). |
corrmsi/ |
Python package: desi_spatial_helpers.py (algorithms), run_desi_from_config.py (processing), publication_utils.py (masks, permutations, provenance), biological_summary.py (donor/animal contrasts), study_workbook.py (study .xlsx), run_corrmsi.py (launcher). |
report/ |
R Markdown stats report: spatial_report.Rmd, spatial_structure.R, spatial_reading_guide.R, render_report.R, environment check. |
templates/ |
Starting YAMLs: processing_example.yaml, processing_focused_lisa.yaml, stats_report_template.yaml. |
tests/ |
Regression, tiny-processing and report smoke checks (corrmsi.bat tests). |
docs/ |
Settings guide, method notes, change history, collaborator handover. |
_local/ |
Local working files (figures, old notebooks/outputs); not part of the package, not tracked. |
Study-specific YAMLs, the study workbook and bats live in each study, not here:
<study>/scripts/spatial_stats/. Results go to <study>/results/spatial_stats/.
corrmsi.bat check <study>\scripts\spatial_stats\<dataset>_processing.yaml
corrmsi.bat processing <study>\scripts\spatial_stats\<dataset>_processing.yaml
corrmsi.bat stats_report <study>\scripts\spatial_stats\<dataset>_stats_report.yamlA study folder can wrap these in one bat per run (e.g. <dataset>_processing.bat,
<dataset>_stats_report.bat, check.bat). The older words pipeline / report and
the key pipeline_config still work.
- processing:
io.out_diris the dataset results folder; every run creates<io.out_dir>/<YYYYMMDD-HHMMSS>/analysis/with all CSVs and LISA maps, plus the frozen config, log and manifest. Nothing is overwritten. - stats_report: uses the newest complete run (or
--input-dir <run>), writes donor/animal contrasts to<run>/analysis/biological/, and the HTML toresults/spatial_stats/reports/as<output stem>_<run>.html.p_values: true(the default) shows p-values, stars and intervals;falsekeeps the report descriptive. - study workbook (
<study>_study.xlsx,study_workbook:in both YAMLs): sheetssamples,features,cellsandpairs. Inpairs,mapchooses the LISA maps that processing computes andshowthe maps the report always shows. Each run keeps a copy of what it used. - tests:
corrmsi.bat testswrites to.test-output/(not tracked).
Environment: the spatial_analysis mamba environment and R 4.6.2 (override with
CORRMSI_PYTHON / CORRMSI_RSCRIPT). Permutation p-values are validated for esda 2.8.1 only.
Developers can still run python -m corrmsi.run_desi_from_config config.yaml from the repo root.
- Raw x/y are native lattice coordinates, not micrometres; declare the pitch per acquisition.
- p-values are shown or hidden with
p_valuesin the stats-report YAML, not by a tissue mask. An optional independent mask (analysis.mask_path) still restricts which pixels are analysed. - In bivariate local Moran maps, significance depends only on the second map's neighbourhood; the first map sets the quadrant colour.
- See settings, spatial-structure method,
notebook notes and change history.
docs/ALL_CHANGES,HANDOVER_FOR_COLLABORATORandVALIDATION_AND_ROLLBACKdescribe the 24 Nov 2026 revision as handed over, i.e. before the package restructure.
