sdk: README for the two example H&E slides
Browse files- sdk/README.md +46 -0
sdk/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MuPaD SDK example slides
|
| 2 |
+
|
| 3 |
+
Two whole-slide H&E images for the end-to-end checks of the [MuPaD SDK](https://github.com/jinxixiang/mupad-sdk). Both slides were held out from training.
|
| 4 |
+
|
| 5 |
+
| file | slide | scale | used by |
|
| 6 |
+
|---|---|---|---|
|
| 7 |
+
| `crc11/CRC11_HE_registered.ome.tif` (~0.6 GB) | ORION-CRC case CRC11, H&E registered to the Orion mIF; held-out test case of the HE2mIF split | 0.325 µm/px, stored in the OME-XML | `scripts/e2e_mif_orion.py` |
|
| 8 |
+
| `ncbi920/NCBI920.tif` (~6.3 GB) | HEST-1k Xenium slide NCBI920 (breast); held-out validation slide of the HE2ST split | 0.087024114237679 µm/px, **not** stored in the file (`pixel_size_um_estimated` in HEST-1k's `HEST_v1_3_1.csv`); pass `mpp=0.087024114237679` | `scripts/e2e_expression_ncbi920.py` |
|
| 9 |
+
|
| 10 |
+
Only the H&E is hosted here. The ground truth stays with the original releases:
|
| 11 |
+
|
| 12 |
+
- **CRC11 mIF**: the public ORION-CRC release (Lin et al., *Nature Cancer* 2023), case CRC11: the 19-channel uint16 Orion image `P37_S43_Full_A24_C59mX_E15_20220128_171510_544056-zlib.ome.tiff` and, if available, its `markers.csv` (one channel name per line; without it the OME channel names are used). The MuPaD HE2mIF training tiles are on Zenodo, record [15340874](https://zenodo.org/records/15340874).
|
| 13 |
+
- **NCBI920 cells**: HEST-1k, `xenium_seg/NCBI920_xenium_cell_seg.parquet` (Xenium cell polygons, WKB `geometry`, required) and `cells/NCBI920_cells.h5ad` (per-cell Xenium counts, `obs_names` = cell id, needed for scoring).
|
| 14 |
+
|
| 15 |
+
## Reproduce the two end-to-end numbers
|
| 16 |
+
|
| 17 |
+
Needs a CUDA GPU; the weights (~13 GB) download on first use.
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
pip install git+https://github.com/jinxixiang/mupad-sdk
|
| 21 |
+
pip install anndata # for the expression scoring
|
| 22 |
+
git clone https://github.com/jinxixiang/mupad-sdk && cd mupad-sdk
|
| 23 |
+
|
| 24 |
+
# H&E -> mIF, CRC11: downloads crc11/CRC11_HE_registered.ome.tif, ~70 min on one L40S plus a few minutes of scoring
|
| 25 |
+
python scripts/e2e_mif_orion.py --out /tmp/mupad_e2e \
|
| 26 |
+
--mif /path/to/orion-CRC/CRC11/P37_S43_Full_A24_C59mX_E15_20220128_171510_544056-zlib.ome.tiff \
|
| 27 |
+
--markers /path/to/orion-CRC/CRC11/markers.csv
|
| 28 |
+
# expected: mean patch PCC 0.381, slide PCC 0.486 over 400 tiles
|
| 29 |
+
|
| 30 |
+
# H&E -> single-cell expression, NCBI920: downloads ncbi920/NCBI920.tif, ~66 min on one L40S
|
| 31 |
+
python scripts/e2e_expression_ncbi920.py --out /tmp/mupad_e2e \
|
| 32 |
+
--segmentation /path/to/hest1k/xenium_seg/NCBI920_xenium_cell_seg.parquet \
|
| 33 |
+
--cells-h5ad /path/to/hest1k/cells/NCBI920_cells.h5ad
|
| 34 |
+
# expected: mean cell PCC 0.449 over 50 genes (187 577 cells)
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
Without the ground-truth files, `e2e_mif_orion.py` and `e2e_expression_ncbi920.py` (without `--cells-h5ad`) predict only. To fetch a slide alone:
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from huggingface_hub import hf_hub_download
|
| 41 |
+
he = hf_hub_download("xiangjx/MuPaD-examples", "sdk/crc11/CRC11_HE_registered.ome.tif", repo_type="dataset")
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## Licence
|
| 45 |
+
|
| 46 |
+
The slides are redistributed under the original datasets' terms: ORION-CRC (Lin et al.) is released under CC BY 4.0 on Zenodo; for NCBI920 see the HEST-1k terms of use. Cite the original datasets when you use them.
|