Skip to content

Commit 805def8

Browse files
authored
Add cosmx liver dataset (#66)
1 parent f3fcadf commit 805def8

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

scripts/create_resources/spatial/process_bruker_cosmx.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ param_list:
2323
dataset_organism: "mus_musculus"
2424
segmentation_id: ["cell"]
2525
26+
- id: "bruker_cosmx/bruker_human_liver_cosmx"
27+
input_raw: "https://smi-public.objects.liquidweb.services/NormalLiverFiles.zip"
28+
input_flat_files: "https://syncandshare.desy.de/index.php/s/zYT4fM28y86cZeW/download/NormalLiver.zip"
29+
dataset_name: "Bruker CosMx Human Liver"
30+
dataset_url: "https://nanostring.com/products/cosmx-spatial-molecular-imager/ffpe-dataset/human-liver-rna-ffpe-dataset/"
31+
dataset_summary: "Bruker CosMx Human Liver dataset on FFPE."
32+
dataset_description: "Bruker CosMx Human Liver dataset on FFPE."
33+
dataset_organism: "homo_sapiens"
34+
segmentation_id: ["cell"]
35+
2636
2737
output_dataset: "\$id/dataset.zarr"
2838
output_state: "\$id/state.yaml"

src/datasets/loaders/bruker_cosmx/script.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@
142142
else:
143143
print(datetime.now() - t0, "Download and extract flat files", flush=True)
144144
os.system(f"wget {par['input_flat_files']} -O '{FILE_NAME_FLAT}'")
145-
145+
146146
with zipfile.ZipFile(FILE_NAME_FLAT, 'r') as zip_ref:
147147
zip_ref.extractall(TMP_DIR)
148-
148+
149149
print(datetime.now() - t0, f"Move flat files to {DATA_DIR}", flush=True)
150150
source_dir = FILE_NAME_FLAT.parent / FILE_NAME_FLAT.stem
151-
151+
152152
file_names = os.listdir(source_dir)
153153
for file_name in file_names:
154154
if not (DATA_DIR / file_name).exists():
@@ -164,9 +164,9 @@
164164
print(datetime.now() - t0, "Create CellLabels folder with CellLabels tif", flush=True)
165165
# Create CellLabels folder with CellLabels tif (somehow this folder name is expected and this is not always present)
166166
# see e.g. late discussion in https://github.com/gustaveroussy/sopa/issues/285
167-
167+
168168
labels_dir.mkdir(parents=True, exist_ok=True)
169-
169+
170170
# Get all folders in data_dir that start with "FOV" and move the CellLabels_FXXX.tif file to the CellLabels folder
171171
print(datetime.now() - t0, "Move CellLabels_FXXX.tif files to CellLabels folder", flush=True)
172172
for fov_dir in DATA_DIR.glob("FOV*"):

0 commit comments

Comments
 (0)