Skip to content

Commit

Permalink
Merge pull request #182 from BodenmillerGroup/ome-preprocessing-hotfix
Browse files Browse the repository at this point in the history
OME preprocessing hotfix
  • Loading branch information
Milad4849 authored May 8, 2023
2 parents 66e9717 + 542f0d2 commit bc10207
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.16.1] - 2023-05-07

### Fixed

- Broken external preprocessing for files with OME-suffix [#181](https://github.com/BodenmillerGroup/steinbock/issues/181)

## [0.16.0] - 2023-02-03

### Added
Expand Down Expand Up @@ -365,6 +371,7 @@ Added:
Initial release for beta testing


[0.16.1]: https://github.com/BodenmillerGroup/steinbock/compare/v0.16.0...v0.16.1
[0.16.0]: https://github.com/BodenmillerGroup/steinbock/compare/v0.15.0...v0.16.0
[0.15.0]: https://github.com/BodenmillerGroup/steinbock/compare/v0.14.2...v0.15.0
[0.14.2]: https://github.com/BodenmillerGroup/steinbock/compare/v0.14.1...v0.14.2
Expand Down
26 changes: 13 additions & 13 deletions docs/install-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ In principle, the *steinbock* Docker container can be run on any Docker-enabled

For reproducibility, it is recommended to always pull a specific release, e.g.:

docker run ghcr.io/bodenmillergroup/steinbock:0.16.0
docker run ghcr.io/bodenmillergroup/steinbock:0.16.1

To run the *steinbock* Docker container with NVIDIA GPU support (Linux only):

docker run --gpus all ghcr.io/bodenmillergroup/steinbock:0.16.0-gpu
docker run --gpus all ghcr.io/bodenmillergroup/steinbock:0.16.1-gpu

[Bind mounts](https://docs.docker.com/storage/bind-mounts/) can be used to make data from the host system available to the Docker container (see below). Commands that launch a graphical user interface may require further system configuration and additional arguments to `docker run` as outlined in the following.

### Windows

On the command line, use the following command to run the *steinbock* Docker container:

docker run -v "C:\Data":/data -p 8888:8888 -e DISPLAY=host.docker.internal:0 ghcr.io/bodenmillergroup/steinbock:0.16.0
docker run -v "C:\Data":/data -p 8888:8888 -e DISPLAY=host.docker.internal:0 ghcr.io/bodenmillergroup/steinbock:0.16.1

In the command above, adapt the bind mount path to your data/working directory (`C:\Data`; no trailing backslash) and the *steinbock* Docker container version (`0.16.0`) as needed. Specifying the `DISPLAY` environment variable is required only when running graphical user interfaces using X forwarding.
In the command above, adapt the bind mount path to your data/working directory (`C:\Data`; no trailing backslash) and the *steinbock* Docker container version (`0.16.1`) as needed. Specifying the `DISPLAY` environment variable is required only when running graphical user interfaces using X forwarding.

To simplify the use of the *steinbock* command-line interface, it is recommended to set up a `steinbock` macro:

doskey steinbock=docker run -p 8888:8888 -v "C:\Data":/data ghcr.io/bodenmillergroup/steinbock:0.16.0 $*
doskey steinbock=docker run -p 8888:8888 -v "C:\Data":/data ghcr.io/bodenmillergroup/steinbock:0.16.1 $*

The created macro is retained for the current session and enables running `steinbock` from the current command line without typing the full Docker command, for example:

Expand All @@ -85,13 +85,13 @@ The created macro is retained for the current session and enables running `stein

On the terminal, use the following command to run the *steinbock* Docker container (Docker must be running):

docker run -v /path/to/data:/data --platform linux/amd64 -u $(id -u):$(id -g) -p 8888:8888 -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/home/steinbock/.Xauthority:ro -e DISPLAY=host.docker.internal:0 ghcr.io/bodenmillergroup/steinbock:0.16.0
docker run -v /path/to/data:/data --platform linux/amd64 -u $(id -u):$(id -g) -p 8888:8888 -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/home/steinbock/.Xauthority:ro -e DISPLAY=host.docker.internal:0 ghcr.io/bodenmillergroup/steinbock:0.16.1

In the command above, adapt the bind mount path to your data/working directory (`/path/to/data`) and the *steinbock* Docker container version (`0.16.0`) as needed. Specifying the `/tmp/.X11-unix` bind mount, the `~/.Xauthority` bind mount and the `DISPLAY` environment variable are required only when running graphical user interfaces using X forwarding.
In the command above, adapt the bind mount path to your data/working directory (`/path/to/data`) and the *steinbock* Docker container version (`0.16.1`) as needed. Specifying the `/tmp/.X11-unix` bind mount, the `~/.Xauthority` bind mount and the `DISPLAY` environment variable are required only when running graphical user interfaces using X forwarding.

To simplify the use of the *steinbock* command-line interface, it is recommended to set up a `steinbock` command alias:

alias steinbock="docker run -v /path/to/data:/data --platform linux/amd64 -u $(id -u):$(id -g) -p 8888:8888 -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/home/steinbock/.Xauthority:ro -e DISPLAY=host.docker.internal:0 ghcr.io/bodenmillergroup/steinbock:0.16.0"
alias steinbock="docker run -v /path/to/data:/data --platform linux/amd64 -u $(id -u):$(id -g) -p 8888:8888 -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/home/steinbock/.Xauthority:ro -e DISPLAY=host.docker.internal:0 ghcr.io/bodenmillergroup/steinbock:0.16.1"

The created command alias is retained for the current session and enables running `steinbock` from the current terminal without typing the full Docker command, for example:

Expand All @@ -106,21 +106,21 @@ The created command alias is retained for the current session and enables runnin

On the terminal, use the following command to run the *steinbock* Docker container:

docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY ghcr.io/bodenmillergroup/steinbock:0.16.0
docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY ghcr.io/bodenmillergroup/steinbock:0.16.1

To run the *steinbock* Docker container with NVIDIA GPU support, use `-gpu` Docker image instead:

docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --gpus all ghcr.io/bodenmillergroup/steinbock:0.16.0-gpu
docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --gpus all ghcr.io/bodenmillergroup/steinbock:0.16.1-gpu

In the commands above, adapt the bind mount path to your data/working directory (`/path/to/data`) and the *steinbock* Docker container version (`0.16.0`) as needed. Specifying the `host` network mode, the `/tmp/.X11-unix` bind mount and the `DISPLAY` environment variable are required only when running graphical user interfaces using X forwarding.
In the commands above, adapt the bind mount path to your data/working directory (`/path/to/data`) and the *steinbock* Docker container version (`0.16.1`) as needed. Specifying the `host` network mode, the `/tmp/.X11-unix` bind mount and the `DISPLAY` environment variable are required only when running graphical user interfaces using X forwarding.

To simplify the use of the *steinbock* command-line interface, it is recommended to set up a `steinbock` command alias:

alias steinbock="docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY ghcr.io/bodenmillergroup/steinbock:0.16.0"
alias steinbock="docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY ghcr.io/bodenmillergroup/steinbock:0.16.1"

To run the *steinbock* Docker container with NVIDIA GPU support, use `-gpu` Docker image instead:

alias steinbock="docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --gpus all ghcr.io/bodenmillergroup/steinbock:0.16.0-gpu"
alias steinbock="docker run -v /path/to/data:/data -u $(id -u):$(id -g) --network host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --gpus all ghcr.io/bodenmillergroup/steinbock:0.16.1-gpu"

The created command alias is retained for the current session and enables running `steinbock` from the current terminal without typing the full Docker command, for example:

Expand Down
11 changes: 5 additions & 6 deletions steinbock/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ class SteinbockIOException(SteinbockException):
def _as_path_with_suffix(path: Union[str, PathLike], suffix: str) -> Path:
path = Path(path)
if re.fullmatch(r".+\.ome\.[^.]+", path.name, flags=re.IGNORECASE):
stem, ome_suffix, suffix = path.name.rpartition(".ome.")
if ome_suffix:
path = path.with_name(f"{stem}.{suffix}")
stem, ome_suffix, suffix = path.name.rpartition(".OME.")
if ome_suffix:
path = path.with_name(f"{stem}.{suffix}")
stem, ome_sep, orig_suffix_without_dot = path.name.rpartition(".ome.")
if not ome_sep: # lower case OME separator not found, try upper case
stem, ome_sep, orig_suffix_without_dot = path.name.rpartition(".OME.")
if ome_sep and orig_suffix_without_dot: # found OME separator, remove it
path = path.with_name(f"{stem}.{orig_suffix_without_dot}")
return path.with_suffix(suffix)


Expand Down

0 comments on commit bc10207

Please sign in to comment.