Skip to content

mecfs_bio.build_system.task.mixer.mixer_utils

Utilities for interacting with the MiXeR docker images Based on documentation here: https://github.com/precimed/mixer

Functions:

Attributes:

MIXER_VERSION module-attribute

MIXER_VERSION = '2.2.1'

SETUP_MIXER_DOCKER module-attribute

SETUP_MIXER_DOCKER = [
    "export",
    f'MIXER_PY="$DOCKER_RUN ghcr.io/precimed/gsa-mixer:{MIXER_VERSION} python /tools/mixer/precimed/mixer.py";',
]

SETUP_MIXER_FIGURES_DOCKER module-attribute

SETUP_MIXER_FIGURES_DOCKER = [
    "export",
    f'MIXER_FIGURES_PY="$DOCKER_RUN ghcr.io/precimed/gsa-mixer:{MIXER_VERSION} python /tools/mixer/precimed/mixer_figures.py";',
]

invoke_mixer

invoke_mixer(
    args: Sequence[str] | str,
    extra_mounts: Mapping[Path, Path],
)
Source code in mecfs_bio/build_system/task/mixer/mixer_utils.py
def invoke_mixer(
    args: Sequence[str] | str,
    extra_mounts: Mapping[Path, Path],
):
    if isinstance(args, str):
        args = [args]
    execute_command(
        _get_docker_command(extra_mounts=extra_mounts)
        + SETUP_MIXER_DOCKER
        + ["${MIXER_PY}"]
        + list(args)
    )

invoke_mixer_figures

invoke_mixer_figures(
    args: Sequence[str] | str,
    extra_mounts: Mapping[Path, Path],
)
Source code in mecfs_bio/build_system/task/mixer/mixer_utils.py
def invoke_mixer_figures(
    args: Sequence[str] | str,
    extra_mounts: Mapping[Path, Path],
):
    if isinstance(args, str):
        args = [args]
    execute_command(
        _get_docker_command(extra_mounts=extra_mounts)
        + SETUP_MIXER_FIGURES_DOCKER
        + ["${MIXER_FIGURES_PY}"]
        + list(args)
    )