Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/data_processors/process_dataset/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [midmem, midcpu, hightime]
label: [highmem, midcpu, hightime]
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/datasets/loaders/bruker_cosmx/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [midmem, midcpu, hightime]
label: [highmem, midcpu, hightime]
4 changes: 2 additions & 2 deletions src/methods_segmentation/binning/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/methods_segmentation/cellpose/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -93,4 +93,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [ midtime, midcpu, veryhighmem, gpu ]
label: [ midtime, midcpu, highmem, gpu ]
4 changes: 2 additions & 2 deletions src/methods_segmentation/cellpose/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/methods_segmentation/custom_segmentation/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[[]]
)
}
)
Expand Down
15 changes: 7 additions & 8 deletions src/methods_segmentation/stardist/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
4 changes: 2 additions & 2 deletions src/methods_segmentation/stardist/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/methods_segmentation/watershed/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/methods_transcript_assignment/baysor/script_no_sopa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[[]]
)
}
)
Expand Down
2 changes: 1 addition & 1 deletion src/methods_transcript_assignment/proseg/script_no_sopa.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
tables={
"table": ad.AnnData(
obs=pd.DataFrame(cell_id_col),
var=sdata.tables["table"].var[[]]
var=sdata.tables["metadata"].var[[]]
)
}
)
Expand Down
Loading