diff --git a/src/data_processors/process_dataset/script.py b/src/data_processors/process_dataset/script.py index be2c97054..5976079de 100644 --- a/src/data_processors/process_dataset/script.py +++ b/src/data_processors/process_dataset/script.py @@ -213,6 +213,7 @@ def subsample_adata_group_balanced(adata, group_key, n_samples, seed=0): if "metadata" not in sdata.tables: if "table" in sdata.tables: sdata["metadata"] = sdata["table"] + del sdata["table"] else: sdata["metadata"] = ad.AnnData(uns={}) diff --git a/src/datasets/loaders/allen_brain_cell_atlas_merfish/config.vsh.yaml b/src/datasets/loaders/allen_brain_cell_atlas_merfish/config.vsh.yaml index 8c7a249ac..700616235 100644 --- a/src/datasets/loaders/allen_brain_cell_atlas_merfish/config.vsh.yaml +++ b/src/datasets/loaders/allen_brain_cell_atlas_merfish/config.vsh.yaml @@ -91,4 +91,4 @@ runners: - type: executable - type: nextflow directives: - label: [midmem, midcpu, hightime] + label: [highmem, midcpu, hightime] diff --git a/src/datasets/loaders/allen_brain_cell_atlas_merfish/script.py b/src/datasets/loaders/allen_brain_cell_atlas_merfish/script.py index 1469e2c40..01afc3838 100644 --- a/src/datasets/loaders/allen_brain_cell_atlas_merfish/script.py +++ b/src/datasets/loaders/allen_brain_cell_atlas_merfish/script.py @@ -344,7 +344,9 @@ def um_to_px_y(y): fov_img = fov_img[:, OVERLAP_SIZE:, :] xp += OVERLAP_SIZE - complete_img[:, xp:xp + fov_img.shape[1], yp:yp + fov_img.shape[2]] = fov_img + h = min(fov_img.shape[1], complete_img.shape[1] - xp) + w = min(fov_img.shape[2], complete_img.shape[2] - yp) + complete_img[:, xp:xp + h, yp:yp + w] = fov_img[:, :h, :w] if fov % 10 == 0: delete_dax_files() diff --git a/src/datasets/loaders/bruker_cosmx/config.vsh.yaml b/src/datasets/loaders/bruker_cosmx/config.vsh.yaml index 5fd748dfb..2fee3340b 100644 --- a/src/datasets/loaders/bruker_cosmx/config.vsh.yaml +++ b/src/datasets/loaders/bruker_cosmx/config.vsh.yaml @@ -76,4 +76,4 @@ runners: - type: executable - type: nextflow directives: - label: [midmem, midcpu, hightime] + label: [highmem, midcpu, hightime] diff --git a/src/methods_segmentation/binning/script.py b/src/methods_segmentation/binning/script.py index 2afc747cf..44df8d73a 100644 --- a/src/methods_segmentation/binning/script.py +++ b/src/methods_segmentation/binning/script.py @@ -49,8 +49,8 @@ def convert_to_lower_dtype(arr): parsed_data = Labels2DModel.parse(data_array, transformations=transformation) sd_output.labels['segmentation'] = parsed_data sd_output.tables['table'] = ad.AnnData( - obs=sdata.tables["table"].obs[["cell_id", "region"]], - var=sdata.tables["table"].var[[]] + obs=sdata.tables["metadata"].obs[["cell_id", "region"]], + var=sdata.tables["metadata"].var[[]] ) print("Writing output", flush=True) diff --git a/src/methods_segmentation/cellpose/config.vsh.yaml b/src/methods_segmentation/cellpose/config.vsh.yaml index f43d741b4..1187c12a9 100644 --- a/src/methods_segmentation/cellpose/config.vsh.yaml +++ b/src/methods_segmentation/cellpose/config.vsh.yaml @@ -79,8 +79,8 @@ resources: engines: - type: docker - #image: openproblems/base_pytorch_nvidia:1 # TODO: ideally get gpu image to work - image: openproblems/base_python:1 + image: openproblems/base_pytorch_nvidia:1 # TODO: ideally get gpu image to work + #image: openproblems/base_python:1 setup: - type: python pypi: cellpose<4.0.0 @@ -93,4 +93,4 @@ runners: - type: executable - type: nextflow directives: - label: [ midtime, midcpu, veryhighmem, gpu ] + label: [ midtime, midcpu, highmem, gpu ] diff --git a/src/methods_segmentation/cellpose/script.py b/src/methods_segmentation/cellpose/script.py index 9a4745cdf..190f80da3 100644 --- a/src/methods_segmentation/cellpose/script.py +++ b/src/methods_segmentation/cellpose/script.py @@ -48,8 +48,8 @@ def convert_to_lower_dtype(arr): sd_output.labels['segmentation'] = parsed_data sd_output.tables['table'] = ad.AnnData( - obs=sdata.tables["table"].obs[["cell_id", "region"]], - var=sdata.tables["table"].var[[]] + obs=sdata.tables["metadata"].obs[["cell_id", "region"]], + var=sdata.tables["metadata"].var[[]] ) print("Writing output", flush=True) diff --git a/src/methods_segmentation/custom_segmentation/script.py b/src/methods_segmentation/custom_segmentation/script.py index 8f6cb9724..c108117ff 100644 --- a/src/methods_segmentation/custom_segmentation/script.py +++ b/src/methods_segmentation/custom_segmentation/script.py @@ -26,8 +26,8 @@ }, tables={ "table": ad.AnnData( - obs=sdata.tables["table"].obs[["cell_id", "region"]], - var=sdata.tables["table"].var[[]] + obs=sdata.tables["metadata"].obs[["cell_id", "region"]], + var=sdata.tables["metadata"].var[[]] ) } ) diff --git a/src/methods_segmentation/stardist/config.vsh.yaml b/src/methods_segmentation/stardist/config.vsh.yaml index 9c17fcf6d..5b5207c0a 100644 --- a/src/methods_segmentation/stardist/config.vsh.yaml +++ b/src/methods_segmentation/stardist/config.vsh.yaml @@ -24,21 +24,20 @@ engines: # NOTE: On mac the tensorflow install leads to an error. Develop the method in a conda env instead (and test docker via gh-actions). # Installations can be done with pip (except tensorflow: use conda install -c conda-forge tensorflow) - type: docker - #image: openproblems/base_tensorflow_nvidia:1 # TODO: ideally get gpu image to work - image: openproblems/base_python:1 + image: openproblems/base_tensorflow_nvidia:1 # TODO: ideally get gpu image to work + #image: openproblems/base_python:1 __merge__: - /src/base/setup_spatialdata_partial.yaml setup: - type: python - pypi: stardist - - type: python - pypi: numpy<2.0.0 - - type: python - pypi: tensorflow + pypi: + - stardist + - tensorflow==2.17.0 + - numpy<2.0.0 - type: native runners: - type: executable - type: nextflow directives: - label: [ midtime, midcpu, highmem, gpu ] + label: [ hightime, midcpu, highmem, gpu ] diff --git a/src/methods_segmentation/stardist/script.py b/src/methods_segmentation/stardist/script.py index 968e5bbf8..0bb0a1795 100644 --- a/src/methods_segmentation/stardist/script.py +++ b/src/methods_segmentation/stardist/script.py @@ -78,8 +78,8 @@ def do_after(self): sd_output.labels['segmentation'] = parsed_labels sd_output.tables['table'] = ad.AnnData( - obs=sdata.tables["table"].obs[["cell_id", "region"]], - var=sdata.tables["table"].var[[]] + obs=sdata.tables["metadata"].obs[["cell_id", "region"]], + var=sdata.tables["metadata"].var[[]] ) print("Writing output", flush=True) diff --git a/src/methods_segmentation/watershed/script.py b/src/methods_segmentation/watershed/script.py index 30045ba6e..9b6aca07a 100644 --- a/src/methods_segmentation/watershed/script.py +++ b/src/methods_segmentation/watershed/script.py @@ -49,8 +49,8 @@ def convert_to_lower_dtype(arr): sd_output.labels['segmentation'] = parsed_data sd_output.tables['table'] = ad.AnnData( - obs=sdata.tables["table"].obs[["cell_id", "region"]], - var=sdata.tables["table"].var[[]] + obs=sdata.tables["metadata"].obs[["cell_id", "region"]], + var=sdata.tables["metadata"].var[[]] ) print("Writing output", flush=True) diff --git a/src/methods_transcript_assignment/baysor/script_no_sopa.py b/src/methods_transcript_assignment/baysor/script_no_sopa.py index f105fdb2d..35544ef62 100644 --- a/src/methods_transcript_assignment/baysor/script_no_sopa.py +++ b/src/methods_transcript_assignment/baysor/script_no_sopa.py @@ -177,7 +177,7 @@ def convert_str_ids_to_ints(df, file_path_for_error_messages=None): tables={ "table": ad.AnnData( obs=pd.DataFrame(cell_id_col), - var=sdata.tables["table"].var[[]] + var=sdata.tables["metadata"].var[[]] ) } ) diff --git a/src/methods_transcript_assignment/proseg/script_no_sopa.py b/src/methods_transcript_assignment/proseg/script_no_sopa.py index b9008fb38..80dac0315 100644 --- a/src/methods_transcript_assignment/proseg/script_no_sopa.py +++ b/src/methods_transcript_assignment/proseg/script_no_sopa.py @@ -132,7 +132,7 @@ tables={ "table": ad.AnnData( obs=pd.DataFrame(cell_id_col), - var=sdata.tables["table"].var[[]] + var=sdata.tables["metadata"].var[[]] ) } )