-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from aeisenbarth/spacem
Add SpaceM datasets
- Loading branch information
Showing
6 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
### Data | ||
|
||
This is a metabolomics dataset from experiments on Hepa and NIH3T3 cells using the [SpaceM](https://doi.org/10.1038/s41592-021-01198-0) method, by [Alexandrov group, EMBL](https://www.embl.org/groups/alexandrov/). | ||
|
||
The data consist of the following items: | ||
|
||
- coordinate systems: | ||
Each set of processed images/labels is registered in a corresponding coordinate system with matching prefix. | ||
(This is because "global" is the default coordinate system of incoming unregistered data and is treated unmutable). | ||
- images: | ||
- `….pre_maldi`: Microscopy, with `Trans` and `GFP` channels | ||
- `….post_maldi`: Microscopy after MALDI measurements, with `Trans` and `Dapi` channels | ||
- labels: | ||
- `….cells`: Segmentation of pre-MALDI images | ||
- `….ablation_marks`: Segmentation of post-MALDI images | ||
- shapes: | ||
- `….layout`: Bounding boxes of wells on a slide | ||
- `….maldi_regions`: Bounding boxes for the MALDI measurements | ||
- tables: | ||
- `table`: | ||
- for all annotated elements: `project_id`, `slide_id`, `well_id`, `maldi_region_id` | ||
- for segmentations: | ||
- `object_type`, `replicate`, `treatment` | ||
- scikit-image region properties | ||
- `X`: MALDI ion intensities | ||
|
||
### Download | ||
|
||
The dataset is already natively in SpatialData 0.1.2 format. | ||
|
||
Download the data with `download.py`, (`to_zarr.py` exists solely for consistency). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import subprocess | ||
|
||
URL = "https://s3.embl.de/spatialdata/raw_data/20221014_HeLaNIH3T3.small.zip" | ||
|
||
os.chdir(os.path.dirname(__file__)) | ||
command = f"curl {URL} --output 'data.zip'" | ||
subprocess.run(command, shell=True, check=True) | ||
subprocess.run("unzip -o data.zip", shell=True, check=True) | ||
subprocess.run("mv spatialdata.zarr data.zarr", shell=True, check=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from pathlib import Path | ||
import spatialdata as sd | ||
|
||
# Dataset is already in SpatialData format. | ||
path_read = Path(__file__).parent / "data.zarr" | ||
assert path_read.exists() | ||
|
||
print(f'view with "python -m napari_spatialdata view data.zarr"') | ||
|
||
# Test reading | ||
sdata = sd.SpatialData.read("./data.zarr") | ||
print(sdata) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
### Data | ||
|
||
This is a metabolomics dataset from single-cell Seahorse experiments on T-cells using the [SpaceM](https://doi.org/10.1038/s41592-021-01198-0) method, by [Alexandrov group, EMBL](https://www.embl.org/groups/alexandrov/). | ||
|
||
The data consist of the following items: | ||
|
||
- coordinate systems: | ||
Each set of processed images/labels is registered in a corresponding coordinate system with matching prefix. | ||
(This is because "global" is the default coordinate system of incoming unregistered data and is treated unmutable). | ||
- images: | ||
- `….pre_maldi`: Microscopy, with `Trans` and `GFP` channels | ||
- `….post_maldi`: Microscopy after MALDI measurements, with `Trans` and `Dapi` channels | ||
- labels: | ||
- `….cells`: Segmentation of pre-MALDI images | ||
- `….ablation_marks`: Segmentation of post-MALDI images | ||
- shapes: | ||
- `….layout`: Bounding boxes of wells on a slide | ||
- `….maldi_regions`: Bounding boxes for the MALDI measurements | ||
- tables: | ||
- `table`: | ||
- for all annotated elements: `project_id`, `slide_id`, `well_id`, `maldi_region_id` | ||
- for segmentations: | ||
- `object_type`, `replicate`, `treatment` | ||
- scikit-image region properties | ||
- `X`: MALDI ion intensities | ||
|
||
### Download | ||
|
||
The dataset is already natively in SpatialData 0.1.2 format. | ||
|
||
Download the data with `download.py`, (`to_zarr.py` exists solely for consistency). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import subprocess | ||
|
||
URL = "https://s3.embl.de/spatialdata/raw_data/20220121_ScSeahorse1.small.zip" | ||
|
||
os.chdir(os.path.dirname(__file__)) | ||
command = f"curl {URL} --output 'data.zip'" | ||
subprocess.run(command, shell=True, check=True) | ||
subprocess.run("unzip -o data.zip", shell=True, check=True) | ||
subprocess.run("mv spatialdata.zarr data.zarr", shell=True, check=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from pathlib import Path | ||
import spatialdata as sd | ||
|
||
# Dataset is already in SpatialData format. | ||
path_read = Path(__file__).parent / "data.zarr" | ||
assert path_read.exists() | ||
|
||
print(f'view with "python -m napari_spatialdata view data.zarr"') | ||
|
||
# Test reading | ||
sdata = sd.SpatialData.read("./data.zarr") | ||
print(sdata) |