From ea0f805719b1aa475c6b8b2ddd18cab89e4e6ee9 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:35:48 +0100 Subject: [PATCH 01/32] get rid of ws-windows conversion --- alphadia/cli.py | 69 ++++++------------------------ alphadia/utils.py | 76 ---------------------------------- tests/unit_tests/test_utils.py | 15 ------- 3 files changed, 13 insertions(+), 147 deletions(-) diff --git a/alphadia/cli.py b/alphadia/cli.py index 4702d555..96f49df0 100644 --- a/alphadia/cli.py +++ b/alphadia/cli.py @@ -156,20 +156,7 @@ def parse_output_directory(args: argparse.Namespace, config: dict) -> str: Output directory. """ - output_directory = None - if "output_directory" in config: - output_directory = ( - utils.windows_to_wsl(config["output_directory"]) - if args.wsl - else config["output_directory"] - ) - - if args.output is not None: - output_directory = ( - utils.windows_to_wsl(args.output) if args.wsl else args.output - ) - - return output_directory + return args.output if args.output is not None else config.get("output_directory") def parse_quant_dir(args: argparse.Namespace, config: dict) -> str: @@ -193,18 +180,7 @@ def parse_quant_dir(args: argparse.Namespace, config: dict) -> str: path to quant directory. """ - quant_dir = None - if "quant_dir" in config: - quant_dir = ( - utils.windows_to_wsl(config["quant_dir"]) - if args.wsl - else config["quant_dir"] - ) - - if args.quant_dir is not None: - quant_dir = utils.windows_to_wsl(args.quant_dir) if args.wsl else args.quant_dir - - return quant_dir + return args.quant_dir if args.quant_dir is not None else config.get("quant_dir") def parse_raw_path_list(args: argparse.Namespace, config: dict) -> list: @@ -227,21 +203,17 @@ def parse_raw_path_list(args: argparse.Namespace, config: dict) -> list: raw_path_list : list List of raw files. """ - config_raw_path_list = config.get("raw_path_list", []) - raw_path_list = ( - utils.windows_to_wsl(config_raw_path_list) if args.wsl else config_raw_path_list - ) - raw_path_list += utils.windows_to_wsl(args.file) if args.wsl else args.file + raw_path_list = config.get("raw_path_list", []) + raw_path_list += args.file config_directory = config.get("directory") - directory = utils.windows_to_wsl(config_directory) if args.wsl else config_directory - if directory is not None: - raw_path_list += [os.path.join(directory, f) for f in os.listdir(directory)] - directory_list = ( - utils.windows_to_wsl(args.directory) if args.wsl else args.directory - ) - for directory in directory_list: + if config_directory is not None: + raw_path_list += [ + os.path.join(config_directory, f) for f in os.listdir(config_directory) + ] + + for directory in args.directory: raw_path_list += [os.path.join(directory, f) for f in os.listdir(directory)] # filter raw files by regex @@ -277,17 +249,7 @@ def parse_library(args: argparse.Namespace, config: dict) -> str: library : str Spectral library. """ - - library = None - if "library" in config: - library = ( - utils.windows_to_wsl(config["library"]) if args.wsl else config["library"] - ) - - if args.library is not None: - library = utils.windows_to_wsl(args.library) if args.wsl else args.library - - return library + return args.library if args.quant_dir is not None else config.get("library") def parse_fasta(args: argparse.Namespace, config: dict) -> list: @@ -311,13 +273,8 @@ def parse_fasta(args: argparse.Namespace, config: dict) -> list: List of fasta files. """ - config_fasta_path_list = config.get("fasta_list", []) - fasta_path_list = ( - utils.windows_to_wsl(config_fasta_path_list) - if args.wsl - else config_fasta_path_list - ) - fasta_path_list += utils.windows_to_wsl(args.fasta) if args.wsl else args.fasta + fasta_path_list = config.get("fasta_list", []) + fasta_path_list += args.fasta return fasta_path_list diff --git a/alphadia/utils.py b/alphadia/utils.py index 888bf077..8de0e8ae 100644 --- a/alphadia/utils.py +++ b/alphadia/utils.py @@ -1,7 +1,6 @@ import logging import math import platform -import re from ctypes import Structure, c_double import numba as nb @@ -74,81 +73,6 @@ def extended_ion_hash(precursor_idx, rank, number, type, charge): return precursor_idx + (rank << 32) + (number << 40) + (type << 48) + (charge << 56) -def wsl_to_windows( - path: str | list | tuple, -) -> str | list | tuple: - """Converts a WSL path to a Windows path. - - Parameters - ---------- - path : str, list, tuple - WSL path. - - Returns - ------- - str, list, tuple - Windows path. - - """ - - if path is None: - return None - - if isinstance(path, str): - disk_match = re.search(r"^/mnt/[a-z]", path) - - if len(disk_match.group()) == 0: - raise ValueError( - "Could not find disk in path during wsl to windows conversion" - ) - - disk_letter = disk_match.group()[5].upper() - - return re.sub(r"^/mnt/[a-z]", f"{disk_letter}:", path).replace("/", "\\") - - elif isinstance(path, list | tuple): - return [wsl_to_windows(p) for p in path] - else: - raise ValueError(f"Unsupported type {type(path)}") - - -def windows_to_wsl( - path: str | list | tuple, -) -> str | list | tuple: - """Converts a Windows path to a WSL path. - - Parameters - ---------- - path : str, list, tuple - Windows path. - - Returns - ------- - str, list, tuple - WSL path. - - """ - if path is None: - return None - - if isinstance(path, str): - disk_match = re.search(r"^[A-Z]:", path) - - if len(disk_match.group()) == 0: - raise ValueError( - "Could not find disk in path during windows to wsl conversion" - ) - - disk_letter = disk_match.group()[0].lower() - - return re.sub(r"^[A-Z]:", f"/mnt/{disk_letter}", path.replace("\\", "/")) - - elif isinstance(path, list | tuple): - return [windows_to_wsl(p) for p in path] - else: - raise ValueError(f"Unsupported type {type(path)}") - - def recursive_update(full_dict: dict, update_dict: dict): """recursively update a dict with a second dict. The dict is updated inplace. diff --git a/tests/unit_tests/test_utils.py b/tests/unit_tests/test_utils.py index bc10da03..9f5263d9 100644 --- a/tests/unit_tests/test_utils.py +++ b/tests/unit_tests/test_utils.py @@ -15,8 +15,6 @@ calculate_score_groups, get_torch_device, merge_missing_columns, - windows_to_wsl, - wsl_to_windows, ) @@ -108,19 +106,6 @@ def test_score_groups(): ) -def test_wsl_conversion(): - test_path = "/mnt/c/Users/username/Documents/test.txt" - expected_path = "C:\\Users\\username\\Documents\\test.txt" - - assert wsl_to_windows(test_path) == expected_path - assert windows_to_wsl(expected_path) == test_path - - test_path = "/mnt/d/Users/us__.sdername/D ocuments/test.txt" - expected_path = "D:\\Users\\us__.sdername\\D ocuments\\test.txt" - - assert wsl_to_windows(test_path) == expected_path - assert windows_to_wsl(expected_path) == test_path - @pytest.fixture() def left_and_right_df(): From 598d2f195e5328347d669258d324bd5b51aedb47 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:38:11 +0100 Subject: [PATCH 02/32] get rid of --wsl parameter --- alphadia/cli.py | 10 +--------- docs/methods/command-line.md | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/alphadia/cli.py b/alphadia/cli.py index 96f49df0..59935c55 100644 --- a/alphadia/cli.py +++ b/alphadia/cli.py @@ -82,12 +82,6 @@ nargs="?", default=None, ) -parser.add_argument( - "--wsl", - "-w", - action="store_true", - help="Set if running on Windows Subsystem for Linux.", -) parser.add_argument( "--config-dict", type=str, @@ -206,9 +200,7 @@ def parse_raw_path_list(args: argparse.Namespace, config: dict) -> list: raw_path_list = config.get("raw_path_list", []) raw_path_list += args.file - config_directory = config.get("directory") - - if config_directory is not None: + if (config_directory := config.get("directory")) is not None: raw_path_list += [ os.path.join(config_directory, f) for f in os.listdir(config_directory) ] diff --git a/docs/methods/command-line.md b/docs/methods/command-line.md index 20267ed6..c3ccdc2e 100644 --- a/docs/methods/command-line.md +++ b/docs/methods/command-line.md @@ -19,7 +19,7 @@ Which should return usage: alphadia [-h] [--version] [--output [OUTPUT]] [--file FILE] [--directory DIRECTORY] [--regex [REGEX]] [--library [LIBRARY]] [--fasta FASTA] [--config [CONFIG]] - [--wsl] [--config-dict [CONFIG_DICT]] + [--config-dict [CONFIG_DICT]] Search DIA experiments with alphaDIA @@ -40,7 +40,6 @@ options: --config [CONFIG], -c [CONFIG] Config yaml which will be used to update the default config. - --wsl, -w Set if running on Windows Subsystem for Linux. --config-dict [CONFIG_DICT] Python Dict which will be used to update the default config. From 8ef4da65a4dc5cebac48be3986311433a6d979d6 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:39:19 +0100 Subject: [PATCH 03/32] remove wsl from backend --- alphadia/constants/default.yaml | 1 - alphadia/workflow/managers/raw_file_manager.py | 14 -------------- tests/unit_tests/test_config_updater.py | 3 --- 3 files changed, 18 deletions(-) diff --git a/alphadia/constants/default.yaml b/alphadia/constants/default.yaml index f2edafd1..e4033d61 100644 --- a/alphadia/constants/default.yaml +++ b/alphadia/constants/default.yaml @@ -8,7 +8,6 @@ general: reuse_quant: false astral_ms1: false log_level: 'INFO' - wsl: false mmap_detector_events: false use_gpu: true # whether to save the libraries to the output directory diff --git a/alphadia/workflow/managers/raw_file_manager.py b/alphadia/workflow/managers/raw_file_manager.py index bada5b69..2bde1805 100644 --- a/alphadia/workflow/managers/raw_file_manager.py +++ b/alphadia/workflow/managers/raw_file_manager.py @@ -51,16 +51,6 @@ def get_dia_data_object( """ file_extension = os.path.splitext(dia_data_path)[1] - is_wsl = self._config["general"]["wsl"] - if is_wsl: - # copy file to /tmp # TODO check if WSL support can be dropped - import shutil - - tmp_path = "/tmp" - tmp_dia_data_path = os.path.join(tmp_path, os.path.basename(dia_data_path)) - shutil.copyfile(dia_data_path, tmp_dia_data_path) - dia_data_path = tmp_dia_data_path - if file_extension.lower() == ".d": raw_data_type = "bruker" dia_data = bruker.TimsTOFTranspose( @@ -110,10 +100,6 @@ def get_dia_data_object( self.reporter.log_metric("raw_data_type", raw_data_type) - # remove tmp file if wsl - if is_wsl: - os.remove(tmp_dia_data_path) - self._calc_stats(dia_data) self._log_stats() diff --git a/tests/unit_tests/test_config_updater.py b/tests/unit_tests/test_config_updater.py index 61696e0a..44b1816f 100644 --- a/tests/unit_tests/test_config_updater.py +++ b/tests/unit_tests/test_config_updater.py @@ -15,7 +15,6 @@ reuse_quant: false astral_ms1: false log_level: 'INFO' - wsl: false mmap_detector_events: false use_gpu: true @@ -90,7 +89,6 @@ reuse_quant: true astral_ms1: false log_level: INFO - wsl: false mmap_detector_events: false use_gpu: true library_loading: @@ -116,7 +114,6 @@ general.reuse_quant False True - general.astral_ms1 False - - general.log_level INFO - - -general.wsl False - - general.mmap_detector_events False - - general.use_gpu True - - library_loading.rt_heuristic 180 - - From c35a7ae7fb786447ec886a0310739fbe34ee519a Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:41:16 +0100 Subject: [PATCH 04/32] remove is-wl dependency --- gui/package-lock.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/gui/package-lock.json b/gui/package-lock.json index 3d72e34f..45bad2c7 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -8312,7 +8312,6 @@ ], "dependencies": { "@malept/cross-spawn-promise": "^1.1.0", - "is-wsl": "^2.2.0", "which": "^2.0.2" }, "engines": { @@ -13188,17 +13187,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -16940,7 +16928,6 @@ "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" }, "engines": { "node": ">=12" From 65134d7dea9fccb8507b1a0cca1055b4d5235d97 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:46:24 +0100 Subject: [PATCH 05/32] remove wsl form frontend --- gui/src/main/modules/engine.js | 174 +------------------------------- gui/src/main/modules/profile.js | 4 - 2 files changed, 2 insertions(+), 176 deletions(-) diff --git a/gui/src/main/modules/engine.js b/gui/src/main/modules/engine.js index 4034e8cc..fdf3c5aa 100644 --- a/gui/src/main/modules/engine.js +++ b/gui/src/main/modules/engine.js @@ -154,7 +154,7 @@ function hasPython(envName, condaPath){ return new Promise((resolve, reject) => { try { execPATH("conda run -n " + envName + " python -c \"print(__import__('sys').version)\"" , condaPath, (err, stdout, stderr) => { - if (err) {console.log(err); reject("Conda environment " + envName + " not found within WSL"); return;} + if (err) {console.log(err); reject("Python not found in conda environment " + envName); return;} resolve(stdout.trim().split(" ")[0]) }) } catch (err) { @@ -168,7 +168,7 @@ function hasAlphaDIA(envName, condaPath){ return new Promise((resolve, reject) => { try { execPATH(`conda run -n ${envName} alphadia --version` , condaPath, (err, stdout, stderr) => { - if (err) {console.log(err); reject("alphaDIA not found within WSL"); return;} + if (err) {console.log(err); reject("AlphaDIA not found in conda environment " + envName); return;} resolve(stdout.trim()) } )} catch (err) { @@ -470,175 +470,6 @@ class BundledExecutionEngine extends BaseExecutionEngine { } -function hasWSL(){ - return new Promise((resolve, reject) => { - exec("wsl --list", () => {}).on("exit", (code) => { - if (code == 0){ - resolve() - } else { - reject("WSL not found") - } - }) - }) -} - -function hasWSLConda(){ - return new Promise((resolve, reject) => { - exec("wsl bash -ic \"conda info --json\"", (err, stdout, stderr) => { - if (err) {console.log(err); reject("Conda not found within WSL"); return;} - const info = JSON.parse(stdout); - resolve(info['conda_version']) - }) - }) -} - -function hasWSLCondaEnv(envName){ - return new Promise((resolve, reject) => { - exec("wsl bash -ic \"conda activate " + envName + "\"", (err, stdout, stderr) => { - if (err) {console.log(err); reject("Conda environment " + envName + " not found within WSL"); return;} - resolve() - }) - }) -} - -function hasWSLAlphaPython(envName){ - return new Promise((resolve, reject) => { - exec("wsl bash -ic \"conda activate " + envName + " && python -c \\\"print(__import__('sys').version)\\\"\"", (err, stdout, stderr) => { - if (err) {console.log(err); reject("Python not found in environment " + envName + " within WSL"); return;} - resolve(stdout.trim().split(" ")[0]) - }) - }) -} - -function hasWSLAlphaDIA(envName){ - return new Promise((resolve, reject) => { - exec("wsl bash -ic \"conda activate " + envName + " && alphadia --version\"", (err, stdout, stderr) => { - if (err) {console.log(err); reject("alphaDIA not found within WSL"); return;} - resolve(stdout.trim()) - }) - }) -} - -class WSLExecutionEngine extends BaseExecutionEngine { - - name = "WSLExecutionEngine" - description = "Windows subsystem for Linux (WSL) is being used to run alphaDIA. Recommended execution engine for Windows users." - valid_plattforms = [ - "win32" - ] - - checkAvailability(){ - return new Promise((resolve, reject) => { - - if (this.valid_plattforms.indexOf(process.platform) == -1){ - this.available = false - this.error = "Plattform " + process.platform + " is not supported when using " + this.constructor.name - resolve(this) - } - - // check the status code of the command "wsl --list" - - return hasWSL().then( - hasWSLConda - ).then((conda_version) => { - this.versions.push({"name": "conda", "version": conda_version}) - }).then(() => { - return hasWSLCondaEnv(this.config.envName) - }).then(() => { - return hasWSLAlphaPython(this.config.envName) - }).then((python_version) => { - this.versions.push({"name": "python", "version": python_version}) - }).then(() => { - return hasWSLAlphaDIA(this.config.envName) - }).then((alphadia_version) => { - this.versions.push({"name": "alphadia", "version": alphadia_version}) - }).then(() => { - this.available = true - }).catch((err) => { - this.available = false - this.error = err - }).finally(() => { - console.log(this.constructor.name + " status") - console.log(this) - resolve(this) - }) - }) - } - - saveWorkflow(workflow){ - return new Promise((resolve, reject) => { - const workflowFolder = workflow.output_directory.path - const config = workflowToConfig(workflow) - if (!fs.existsSync(workflowFolder)) { - reject("Output folder " + workflowFolder + " does not exist.") - } - const configPath = path.join(workflowFolder, "config.yaml") - // save config.yaml in workflow folder - writeYamlFile.sync(configPath, config, {lineWidth: -1}) - resolve() - }) - } - - startWorkflow(workflow){ - return this.saveWorkflow(workflow).then(() => { - - let run = { - engine: this.constructor.name, - name: workflow.name, - path: workflow.output_directory.path, - std: [], - pid: null, - code: -1, - process : null, - activePromise: null, - } - - const winOutputPath = path.join(workflow.output_directory.path, "config.yaml") - const wslOutputPath = "/mnt/" + winOutputPath.replace(/\\/g, "/").replace(":", "").toLowerCase() - - run.process = spawn("wsl", ["bash", - "-ic", - "\"conda run -n " + this.config.envName + " --no-capture-output alphadia -w --config " + wslOutputPath + "\""], { shell: true }); - run.pid = run.process.pid - - const stdoutTransform = lineBreakTransform(); - run.process.stdout.pipe(stdoutTransform).on('data', (data) => { - run.std.push(data.toString()) - }); - - const stderrTransform = lineBreakTransform(); - run.process.stderr.pipe(stderrTransform).on('data', (data) => { - run.std.push(data.toString()) - }); - - run.activePromise = new Promise((resolve, reject) => { - run.process.on('close', (code) => { - run.process = null - run.code = code - resolve(code); - }); - }) - - console.log(run) - - return run - }).catch((err) => { - console.log(err) - dialog.showMessageBox( - BrowserWindow.getFocusedWindow(), - { - type: 'error', - title: 'Error while starting workflow', - message: `Could not start workflow. ${err}`, - }).catch((err) => { - console.log(err) - }) - }) - } - - - -} class ExecutionManager { @@ -654,7 +485,6 @@ class ExecutionManager { this.executionEngines = [ new CMDExecutionEngine(profile.config.CMDExecutionEngine || {}), new BundledExecutionEngine(profile.config.BundledExecutionEngine || {}), - new WSLExecutionEngine(profile.config.WSLExecutionEngine || {}), ] // invoke checkAvailability() for all execution engines diff --git a/gui/src/main/modules/profile.js b/gui/src/main/modules/profile.js index bcd47d0a..9f831dec 100644 --- a/gui/src/main/modules/profile.js +++ b/gui/src/main/modules/profile.js @@ -14,10 +14,6 @@ const Profile = class { "path": "" }, "clippy": false, - "WSLExecutionEngine": { - "envName": "alphadia", - - }, "CMDExecutionEngine": { "envName": "alphadia", "condaPath": "" From a46ddf858b6be955a5859054323f5b17aa0aa5de Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:50:56 +0100 Subject: [PATCH 06/32] fix typo --- alphadia/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alphadia/cli.py b/alphadia/cli.py index 59935c55..a4970f10 100644 --- a/alphadia/cli.py +++ b/alphadia/cli.py @@ -241,7 +241,7 @@ def parse_library(args: argparse.Namespace, config: dict) -> str: library : str Spectral library. """ - return args.library if args.quant_dir is not None else config.get("library") + return args.library if args.library is not None else config.get("library") def parse_fasta(args: argparse.Namespace, config: dict) -> list: From 59b6ba63670ecf6b4ce1d991c9fceaec839d5fcb Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:03:56 +0100 Subject: [PATCH 07/32] refactor CLI --- alphadia/cli.py | 172 +++++++++++------------------------------------- 1 file changed, 40 insertions(+), 132 deletions(-) diff --git a/alphadia/cli.py b/alphadia/cli.py index a4970f10..62f0ae5b 100644 --- a/alphadia/cli.py +++ b/alphadia/cli.py @@ -98,23 +98,8 @@ ) -def parse_config(args: argparse.Namespace) -> dict: - """Parse config file and config update JSON string. - 1. Load config file if specified. - 2. Update config with config update JSON string. - - Parameters - ---------- - - args : argparse.Namespace - Command line arguments. - - Returns - ------- - - config : dict - Updated config dictionary. - """ +def _get_config_from_args(args: argparse.Namespace) -> dict: + """Parse config file from `args.config` if given and update with optional JSON string `args.config_dict`.""" config = {} if args.config is not None: @@ -129,74 +114,34 @@ def parse_config(args: argparse.Namespace) -> dict: return config -def parse_output_directory(args: argparse.Namespace, config: dict) -> str: - """Parse output directory. - 1. Use output directory from config file if specified. - 2. Use output directory from command line if specified. +def _get_from_args_or_config( + args: argparse.Namespace, config: dict, *, args_key: str, config_key: str +) -> str: + """Get a value from command line arguments (key: `args_key`) or config file (key: `config_key`), the former taking precedence.""" + value_from_args = args.__dict__.get(args_key) + return value_from_args if value_from_args is not None else config.get(config_key) - Parameters - ---------- - args : argparse.Namespace - Command line arguments. - - config : dict - Config dictionary. - - Returns - ------- - - output_directory : str - Output directory. +def _get_raw_path_list_from_args_and_config( + args: argparse.Namespace, config: dict +) -> list: """ + Generate a list of raw file paths based on command-line arguments and configuration. - return args.output if args.output is not None else config.get("output_directory") - - -def parse_quant_dir(args: argparse.Namespace, config: dict) -> str: - """Parse custom quant path. - 1. Use custom quant path from config file if specified. - 2. Use custom quant path from command line if specified. + This function combines file paths specified in the configuration and command-line + arguments, including files from specified directories. It filters the resulting + list of file paths using a regular expression provided in the arguments. - Parameters - ---------- + Args: + args (argparse.Namespace): Command-line arguments containing file and directory + paths, as well as a regex pattern for filtering. + config (dict): Configuration dictionary that may include a list of raw paths + and a directory to search for files. - args : argparse.Namespace - Command line arguments. - - config : dict - Config dictionary. - - Returns - ------- - - quant_dir : str - path to quant directory. + Returns: + list: A list of file paths that match the specified regex pattern. """ - return args.quant_dir if args.quant_dir is not None else config.get("quant_dir") - - -def parse_raw_path_list(args: argparse.Namespace, config: dict) -> list: - """Parse raw file list. - 1. Use raw file list from config file if specified. - 2. Use raw file list from command line if specified. - - Parameters - ---------- - - args : argparse.Namespace - Command line arguments. - - config : dict - Config dictionary. - - Returns - ------- - - raw_path_list : list - List of raw files. - """ raw_path_list = config.get("raw_path_list", []) raw_path_list += args.file @@ -221,49 +166,10 @@ def parse_raw_path_list(args: argparse.Namespace, config: dict) -> list: return raw_path_list -def parse_library(args: argparse.Namespace, config: dict) -> str: - """Parse spectral library. - 1. Use spectral library from config file if specified. - 2. Use spectral library from command line if specified. - - Parameters - ---------- - - args : argparse.Namespace - Command line arguments. - - config : dict - Config dictionary. - - Returns - ------- - - library : str - Spectral library. - """ - return args.library if args.library is not None else config.get("library") - - -def parse_fasta(args: argparse.Namespace, config: dict) -> list: - """Parse fasta file list. - 1. Use fasta file list from config file if specified. - 2. Use fasta file list from command line if specified. - - Parameters - ---------- - - args : argparse.Namespace - Command line arguments. - - config : dict - Config dictionary. - - Returns - ------- - - fasta_path_list : list - List of fasta files. - """ +def _get_fasta_list_from_args_and_config( + args: argparse.Namespace, config: dict +) -> list: + """Parse fasta file list from command line arguments and config file, merging them if both are given.""" fasta_path_list = config.get("fasta_list", []) fasta_path_list += args.fasta @@ -284,36 +190,38 @@ def run(*args, **kwargs): print(f"{alphadia.__version__}") return - config = parse_config(args) + user_config = _get_config_from_args(args) - output_directory = parse_output_directory(args, config) + output_directory = _get_from_args_or_config( + args, user_config, args_key="output", config_key="output_directory" + ) if output_directory is None: - # print help message if no output directory specified parser.print_help() - print("No output directory specified.") return - quant_dir = parse_quant_dir(args, config) - reporting.init_logging(output_directory) - raw_path_list = parse_raw_path_list(args, config) - - library_path = parse_library(args, config) - fasta_path_list = parse_fasta(args, config) + logger.progress(f"Saving output to: {output_directory}") + raw_path_list = _get_raw_path_list_from_args_and_config(args, user_config) logger.progress(f"Searching {len(raw_path_list)} files:") for f in raw_path_list: logger.progress(f" {os.path.basename(f)}") + library_path = _get_from_args_or_config( + args, user_config, args_key="library", config_key="library" + ) logger.progress(f"Using library: {library_path}") + fasta_path_list = _get_fasta_list_from_args_and_config(args, user_config) logger.progress(f"Using {len(fasta_path_list)} fasta files:") for f in fasta_path_list: logger.progress(f" {f}") # TODO rename all output_directory, output_folder => output_path, quant_dir->quant_path (except cli parameter) - logger.progress(f"Saving output to: {output_directory}") + quant_dir = _get_from_args_or_config( + args, user_config, args_key="quant_dir", config_key="quant_dir" + ) if quant_dir is not None: logger.progress(f"Saving quantification output to {quant_dir=}") @@ -330,7 +238,7 @@ def run(*args, **kwargs): raw_path_list=raw_path_list, library_path=library_path, fasta_path_list=fasta_path_list, - config=config, + config=user_config, quant_path=quant_dir, ) From 04dbe43da6a562b2728bfb55742778c417d0f0fd Mon Sep 17 00:00:00 2001 From: mschwoer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:31:17 +0100 Subject: [PATCH 08/32] Update alphadia/planning.py Co-authored-by: Charlotte Gerhaher --- alphadia/planning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alphadia/planning.py b/alphadia/planning.py index c3c7bd9f..38f384af 100644 --- a/alphadia/planning.py +++ b/alphadia/planning.py @@ -121,7 +121,7 @@ def _init_config( user_config: dict | Config, output_folder: str, config_base_path: str | None, - ): + ) -> Config: """Initialize the config with default values and update with user defined values.""" # default config path is not defined in the function definition to account for different path separators on different OS From e0d5d8ff7c2fdcab65bd48c3f7720d172b0153d9 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:09:38 +0100 Subject: [PATCH 09/32] fix images and download links --- README.md | 5 ++++- docs/guides/libfree-gui.md | 2 +- docs/quickstart.md | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c3f52cc8..e9c27aed 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,10 @@ Make sure you have installed the GUI using the one-click installer. To verify yo ### 2. Test data -For the first search we will be using a spectral library to search 60SPD bulk HeLa samples on the Orbitrap Astral. Download the test samples and save them: [HeLa library](https://datashare.biochem.mpg.de/s/Uw2yfNSbApfPpTk), [RAW files].(https://datashare.biochem.mpg.de/s/339jg5HtGrwLwDN) +For the first search we will be using a spectral library to search 60SPD bulk HeLa samples on the Orbitrap Astral. +Download the test samples and save them: +[HeLa library](https://datashare.biochem.mpg.de/s/Uw2yfNSbApfPpTk), +[RAW files](https://datashare.biochem.mpg.de/s/339jg5HtGrwLwDN) ### 3. Search settings diff --git a/docs/guides/libfree-gui.md b/docs/guides/libfree-gui.md index cc15419c..5824c8db 100644 --- a/docs/guides/libfree-gui.md +++ b/docs/guides/libfree-gui.md @@ -10,7 +10,7 @@ Also ensure the right execution engine has been selected and your version is up ## 2. Project Structure We will be performing two DIA searches: a first search for library generation and a second search for joined quantification. To accommodate this, we prepare the project directory to have a `first_pass` and a `second_pass` folder. You can change the project path in the `Output Files` tab - + ## 3. First search To set up the first search: diff --git a/docs/quickstart.md b/docs/quickstart.md index 6502e055..4c1ff681 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -9,7 +9,10 @@ Make sure you have installed the GUI using the one-click installer. To verify yo ## 2. Test data -For the first search we will be using a spectral library to search 60SPD bulk HeLa samples on the Orbitrap Astral. Download the test samples and save them: [HeLa library](https://datashare.biochem.mpg.de/s/Uw2yfNSbApfPpTk), [RAW files].(https://datashare.biochem.mpg.de/s/339jg5HtGrwLwDN) +For the first search we will be using a spectral library to search 60SPD bulk HeLa samples on the Orbitrap Astral. +Download the test samples and save them: +[HeLa library](https://datashare.biochem.mpg.de/s/Uw2yfNSbApfPpTk), +[RAW files](https://datashare.biochem.mpg.de/s/339jg5HtGrwLwDN) ## 3. Search settings From 570f6aa0611e7b826e3f6fc17d5c4dc66f1f6191 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:09:48 +0100 Subject: [PATCH 10/32] add secion on CLI quickstart --- docs/quickstart.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/quickstart.md b/docs/quickstart.md index 4c1ff681..f9baf14a 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -30,3 +30,9 @@ Select an output folder where the search progress and the final results should b ## 4. Run the search Click *Run Workflow* to start the search and see the progress. + +# Quickstart using CLI +1. Clone the repository from GitHub +2. Create a conda environment called `alphadia` and install AlphaDIA (either from `pip` or local, cf. [Installation](installation.md)) +3. `cd` into the root folder of the repository, then `cd test` +4. `./run_e2e_tests.sh basic alphadia` will run a basic test after downloading the test data From 3e6a198f8337ae839221dec341824183ab63b3ed Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:10:02 +0100 Subject: [PATCH 11/32] dump the full config object to disk --- alphadia/planning.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alphadia/planning.py b/alphadia/planning.py index 38f384af..0b18124f 100644 --- a/alphadia/planning.py +++ b/alphadia/planning.py @@ -149,6 +149,8 @@ def _init_config( if "output" not in config: config["output"] = output_folder + config.to_yaml(os.path.join(output_folder, "full_config.yaml")) + return config @property From df308189bcc77d8b65cd2250671eb7ff1e803f1c Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:12:05 +0100 Subject: [PATCH 12/32] add citation --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9c27aed..63a32e9a 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,10 @@ In case of issues, check out the following: --- ## Citations -A manuscript has been submitted to bioRxiv. +A manuscript has been submitted to bioRxiv: +> **AlphaDIA enables End-to-End Transfer Learning for Feature-Free Proteomics** +> Georg Wallmann, Patricia Skowronek, Vincenth Brennsteiner, Mikhail Lebedev, Marvin Thielert, Sophia Steigerwald, Mohamed Kotb, Tim Heymann, Xie-Xuan Zhou, Magnus Schwörer, Maximilian T. Strauss, Constantin Ammar, Sander Willems, Wen-Feng Zeng, Matthias Mann +> bioRxiv 2024.05.28.596182; doi: https://doi.org/10.1101/2024.05.28.596182 --- ## How to contribute From 9456bb6122a3e4729503f2a902263e1e4dc93a0c Mon Sep 17 00:00:00 2001 From: Mohamed Sameh Date: Sun, 15 Dec 2024 20:56:59 +0100 Subject: [PATCH 13/32] fix: zero predictions for ms2 --- alphadia/transferlearning/train.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alphadia/transferlearning/train.py b/alphadia/transferlearning/train.py index 9704d557..b26e7899 100644 --- a/alphadia/transferlearning/train.py +++ b/alphadia/transferlearning/train.py @@ -5,6 +5,7 @@ import torch from alphabase.peptide.fragment import remove_unused_fragments from alphabase.peptide.mobility import ccs_to_mobility_for_df, mobility_to_ccs_for_df +from alphabase.peptide.precursor import refine_precursor_df from peptdeep.model.charge import ChargeModelForModAASeq from peptdeep.model.model_interface import CallbackHandler, LR_SchedulerInterface from peptdeep.pretrained_models import ModelManager @@ -564,13 +565,14 @@ def finetune_ms2( test_intensity_df = test_intensity_df[0] # Prepare order for peptdeep prediction - + val_psm_df = refine_precursor_df(val_psm_df) reordered_val_psm_df = self._reset_frag_idx(val_psm_df) reordered_val_intensity_df = self._order_intensities( reordered_precursor_df=reordered_val_psm_df, unordered_precursor_df=val_psm_df, unordered_frag_df=val_intensity_df, ) + test_psm_df = refine_precursor_df(test_psm_df) reordered_test_psm_df = self._reset_frag_idx(test_psm_df) reordered_test_intensity_df = self._order_intensities( reordered_precursor_df=reordered_test_psm_df, From fb728d2c090c92ca149053110c6d816d22b8dcfe Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:47:38 +0100 Subject: [PATCH 14/32] update install instructions --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 63a32e9a..8415246a 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,13 @@ AlphaDIA can be installed on Windows, macOS and Linux. Please choose the preferr Currently available for **MacOS** and **Windows**. You can download the latest release of alphaDIA [here](https://github.com/Mannlabs/alphadia/releases/latest). -* **Windows:** Download the latest `win-x64` build. Save it and double click it to install. If you receive a warning during installation click *Run anyway*. -* **MacOS:** Download the latest `darwin-arm64` build. Please note that alphaDIA currently requires an ARM based M1/2/3 processor for the one-click installer. Save the installer and open the parent folder in Finder. Right-click and select *open*. If you receive a warning during installation click *Open*. If you want to use `.raw` files on Thermo instruments alphaRaw is required, which depends on Mono. A detailed guide to installing alphaRaw with mono can be found [here](https://github.com/MannLabs/alpharaw#installation). +* **Windows:** Download the latest `alphadia-X.Y.Z-windows-amd64.exe` build and double click it to install. If you receive a warning during installation click *Run anyway*. +* **MacOS:** Download the latest build suitable for your chip architecture +(can be looked up by clicking on the Apple Symbol > *About this Mac* > *Chip* ("M1", "M2", "M3" -> `arm64`, "Intel" -> `x64`), +`alphadia-X.Y.Z-macos-darwin-arm64.pkg` or `alphadia-X.Y.Z-macos-darwin-x64.pkg`. Open the parent folder of the downloaded file in Finder, +right-click and select *open*. If you receive a warning during installation click *Open*. If you want to use `.raw` files on Thermo instruments alphaRaw is required, which depends on Mono. A detailed guide to installing alphaRaw with mono can be found [here](https://github.com/MannLabs/alpharaw#installation). +* **Linux:** Download the latest `alphadia-X.Y.Z-linux-x64.deb` build and install it via `dpkg -i alphadia-X.Y.Z-linux-x64.deb`. + As of now, **Linux** users need follow the steps for the [developer installation](docs/installation.md#developer-installation) in order to use the GUI. From 82566e461f25342ad27a8e0057b3f4b6ddb066b2 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:31:32 +0100 Subject: [PATCH 15/32] renaming --- alphadia/constants/keys.py | 4 ++-- alphadia/outputtransform.py | 26 ++++++++++++++++---------- alphadia/search_plan.py | 6 +++--- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/alphadia/constants/keys.py b/alphadia/constants/keys.py index d2556d87..1f786966 100644 --- a/alphadia/constants/keys.py +++ b/alphadia/constants/keys.py @@ -13,8 +13,8 @@ def get_values(cls): ] -class OutputKeys(metaclass=ConstantsClass): - """String constants for reading and writing output columns.""" +class StatOutputKeys(metaclass=ConstantsClass): + """String constants for reading and writing output columns for the `stat` file.""" # optimization OPTIMIZATION_PREFIX = "optimization." diff --git a/alphadia/outputtransform.py b/alphadia/outputtransform.py index fc532b29..365134ee 100644 --- a/alphadia/outputtransform.py +++ b/alphadia/outputtransform.py @@ -19,7 +19,7 @@ from alphadia import fdr, grouping, libtransform, utils from alphadia.consensus.utils import read_df, write_df -from alphadia.constants.keys import OutputKeys +from alphadia.constants.keys import StatOutputKeys from alphadia.exceptions import NoPsmFoundError from alphadia.outputaccumulator import ( AccumulationBroadcaster, @@ -977,22 +977,28 @@ def _build_run_stat_df( optimization_manager = manager.OptimizationManager( path=optimization_manager_path ) - optimization_stats[OutputKeys.MS2_ERROR] = optimization_manager.ms2_error - optimization_stats[OutputKeys.MS1_ERROR] = optimization_manager.ms1_error - optimization_stats[OutputKeys.RT_ERROR] = optimization_manager.rt_error - optimization_stats[OutputKeys.MOBILITY_ERROR] = ( + optimization_stats[StatOutputKeys.MS2_ERROR] = ( + optimization_manager.ms2_error + ) + optimization_stats[StatOutputKeys.MS1_ERROR] = ( + optimization_manager.ms1_error + ) + optimization_stats[StatOutputKeys.RT_ERROR] = optimization_manager.rt_error + optimization_stats[StatOutputKeys.MOBILITY_ERROR] = ( optimization_manager.mobility_error ) else: logger.warning(f"Error reading optimization manager for {raw_name}") for key in [ - OutputKeys.MS2_ERROR, - OutputKeys.MS1_ERROR, - OutputKeys.RT_ERROR, - OutputKeys.MOBILITY_ERROR, + StatOutputKeys.MS2_ERROR, + StatOutputKeys.MS1_ERROR, + StatOutputKeys.RT_ERROR, + StatOutputKeys.MOBILITY_ERROR, ]: - stats[f"{OutputKeys.OPTIMIZATION_PREFIX}{key}"] = optimization_stats[key] + stats[f"{StatOutputKeys.OPTIMIZATION_PREFIX}{key}"] = optimization_stats[ + key + ] # collect calibration stats calibration_stats = defaultdict(lambda: np.nan) diff --git a/alphadia/search_plan.py b/alphadia/search_plan.py index 16a8b276..19f7b5f7 100644 --- a/alphadia/search_plan.py +++ b/alphadia/search_plan.py @@ -7,7 +7,7 @@ import pandas as pd import yaml -from alphadia.constants.keys import OutputKeys +from alphadia.constants.keys import StatOutputKeys from alphadia.outputtransform import ( SearchPlanOutput, ) @@ -218,10 +218,10 @@ def _get_optimized_values_config(output_folder: Path) -> dict: output_folder / f"{SearchPlanOutput.STAT_OUTPUT}.tsv", sep="\t" ) target_ms1_tolerance = np.nanmedian( - df[f"{OutputKeys.OPTIMIZATION_PREFIX}{OutputKeys.MS1_ERROR}"] + df[f"{StatOutputKeys.OPTIMIZATION_PREFIX}{StatOutputKeys.MS1_ERROR}"] ) target_ms2_tolerance = np.nanmedian( - df[f"{OutputKeys.OPTIMIZATION_PREFIX}{OutputKeys.MS2_ERROR}"] + df[f"{StatOutputKeys.OPTIMIZATION_PREFIX}{StatOutputKeys.MS2_ERROR}"] ) if np.isnan(target_ms1_tolerance) and np.isnan(target_ms2_tolerance): From 918d331e4f2dd3719ea8f3778fa183a815d300a5 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:32:42 +0100 Subject: [PATCH 16/32] more use of LIBRARY_OUTPUT constant --- alphadia/outputtransform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/alphadia/outputtransform.py b/alphadia/outputtransform.py index 365134ee..b4a9ecd2 100644 --- a/alphadia/outputtransform.py +++ b/alphadia/outputtransform.py @@ -909,7 +909,11 @@ def build_library( if self.config["general"]["save_mbr_library"]: logger.info("Writing MBR spectral library to disk") - mbr_spec_lib.save_hdf(os.path.join(self.output_folder, "speclib.mbr.hdf")) + mbr_spec_lib.save_hdf( + os.path.join( + self.output_folder, f"{SearchPlanOutput.LIBRARY_OUTPUT}.hdf" + ) + ) return mbr_spec_lib From c5b3a0693fe199e8219ab8b5176868a39cdb5a3e Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:35:41 +0100 Subject: [PATCH 17/32] less warning --- alphadia/workflow/manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/alphadia/workflow/manager.py b/alphadia/workflow/manager.py index b7248fdc..9ca4beca 100644 --- a/alphadia/workflow/manager.py +++ b/alphadia/workflow/manager.py @@ -101,7 +101,12 @@ def save(self): def load(self): """Load the state from pickle file.""" - if self.path is None or not os.path.exists(self.path): + if self.path is None: + self.reporter.log_string( + f"{self.__class__.__name__} not loaded from disk.", + ) + return + elif not os.path.exists(self.path): self.reporter.log_string( f"{self.__class__.__name__} not found at: {self.path}", verbosity="warning", From b0445610dff0ab20f73e0b5c1e6ac291b4201b13 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:25:30 +0100 Subject: [PATCH 18/32] use a more season-appropriate name for the dumped config --- alphadia/planning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alphadia/planning.py b/alphadia/planning.py index 0b18124f..b9dec072 100644 --- a/alphadia/planning.py +++ b/alphadia/planning.py @@ -149,7 +149,7 @@ def _init_config( if "output" not in config: config["output"] = output_folder - config.to_yaml(os.path.join(output_folder, "full_config.yaml")) + config.to_yaml(os.path.join(output_folder, "frozen_config.yaml")) return config From 30aae3668151c1f54794bd8c5902a20f6c4c9976 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:34:07 +0100 Subject: [PATCH 19/32] remove config dumping --- alphadia/planning.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/alphadia/planning.py b/alphadia/planning.py index b9dec072..38f384af 100644 --- a/alphadia/planning.py +++ b/alphadia/planning.py @@ -149,8 +149,6 @@ def _init_config( if "output" not in config: config["output"] = output_folder - config.to_yaml(os.path.join(output_folder, "frozen_config.yaml")) - return config @property From b0cf870b7491450735c4cb214bdf19888d1782c4 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:21:41 +0100 Subject: [PATCH 20/32] =?UTF-8?q?Bump=20version:=201.9.1=20=E2=86=92=201.9?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alphadia/__init__.py | 2 +- gui/package.json | 2 +- gui/src/main/modules/profile.js | 2 +- misc/.bumpversion.cfg | 2 +- release/linux/build_installer_linux.sh | 2 +- release/linux/control | 2 +- release/macos/build_installer_macos.sh | 2 +- release/macos/build_package_macos.sh | 4 ++-- release/macos/distribution.xml | 2 +- release/macos/info.plist | 4 ++-- release/windows/alphadia_innoinstaller.iss | 4 ++-- release/windows/build_installer_windows.ps1 | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/alphadia/__init__.py b/alphadia/__init__.py index bd2ea95b..e16450ce 100644 --- a/alphadia/__init__.py +++ b/alphadia/__init__.py @@ -1,3 +1,3 @@ #!python -__version__ = "1.9.1" +__version__ = "1.9.2" diff --git a/gui/package.json b/gui/package.json index def7516f..0c003da7 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,7 +1,7 @@ { "name": "alphadia", "productName": "alphadia-gui", - "version": "1.9.1", + "version": "1.9.2", "description": "Graphical user interface for DIA data analysis", "main": "dist/electron.js", "homepage": "./", diff --git a/gui/src/main/modules/profile.js b/gui/src/main/modules/profile.js index bcd47d0a..787e9a5c 100644 --- a/gui/src/main/modules/profile.js +++ b/gui/src/main/modules/profile.js @@ -3,7 +3,7 @@ const path = require("path") const { app, shell, BrowserWindow} = require("electron") const { dialog } = require('electron') -const VERSION = "1.9.1" +const VERSION = "1.9.2" const Profile = class { diff --git a/misc/.bumpversion.cfg b/misc/.bumpversion.cfg index 97037493..1aa88e0f 100644 --- a/misc/.bumpversion.cfg +++ b/misc/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.9.1 +current_version = 1.9.2 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/release/linux/build_installer_linux.sh b/release/linux/build_installer_linux.sh index cfcbb9bb..35703bad 100755 --- a/release/linux/build_installer_linux.sh +++ b/release/linux/build_installer_linux.sh @@ -10,7 +10,7 @@ rm -rf dist build *.egg-info rm -rf dist_pyinstaller build_pyinstaller python -m build -pip install "dist/alphadia-1.9.1-py3-none-any.whl[stable]" +pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" if [ "${CPU_OR_GPU}" != "GPU" ]; then pip install torch -U --extra-index-url https://download.pytorch.org/whl/cpu diff --git a/release/linux/control b/release/linux/control index 1568815e..90fed30a 100644 --- a/release/linux/control +++ b/release/linux/control @@ -1,5 +1,5 @@ Package: alphadia -Version: 1.9.1 +Version: 1.9.2 Architecture: all Maintainer: Mann Labs Description: alphadia diff --git a/release/macos/build_installer_macos.sh b/release/macos/build_installer_macos.sh index 7df4cf99..0fd02708 100755 --- a/release/macos/build_installer_macos.sh +++ b/release/macos/build_installer_macos.sh @@ -10,7 +10,7 @@ rm -rf dist_pyinstaller build_pyinstaller export EAGER_IMPORT=true # TODO check if this can be removed with newset peptdeep version w/out transformer dependenc python -m build -pip install "dist/alphadia-1.9.1-py3-none-any.whl[stable]" +pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" # Creating the stand-alone pyinstaller folder pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y diff --git a/release/macos/build_package_macos.sh b/release/macos/build_package_macos.sh index 6838c237..2ae26c65 100755 --- a/release/macos/build_package_macos.sh +++ b/release/macos/build_package_macos.sh @@ -7,10 +7,10 @@ set -e -u # Set up package name and version PACKAGE_NAME="alphadia" APP_NAME="alphadia" -PACKAGE_VERSION="1.9.1" +PACKAGE_VERSION="1.9.2" PKG_FOLDER="dist/$APP_NAME.app" -# BUILD_NAME is taken from environment variables, e.g. alphadia-1.9.1-macos-darwin-arm64 or alphadia-1.9.1-macos-darwin-x64 +# BUILD_NAME is taken from environment variables, e.g. alphadia-1.9.2-macos-darwin-arm64 or alphadia-1.9.2-macos-darwin-x64 rm -rf ${BUILD_NAME}.pkg # Cleanup the package folder diff --git a/release/macos/distribution.xml b/release/macos/distribution.xml index d5d7dea8..bac68251 100644 --- a/release/macos/distribution.xml +++ b/release/macos/distribution.xml @@ -1,6 +1,6 @@ - AlphaDIA 1.9.1 + AlphaDIA 1.9.2 diff --git a/release/macos/info.plist b/release/macos/info.plist index 3809c893..02a16ba3 100644 --- a/release/macos/info.plist +++ b/release/macos/info.plist @@ -9,9 +9,9 @@ CFBundleIconFile alphadia.icns CFBundleIdentifier - alphadia.1.9.1 + alphadia.1.9.2 CFBundleShortVersionString - 1.9.1 + 1.9.2 CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/release/windows/alphadia_innoinstaller.iss b/release/windows/alphadia_innoinstaller.iss index 4f332647..a19ba8e4 100644 --- a/release/windows/alphadia_innoinstaller.iss +++ b/release/windows/alphadia_innoinstaller.iss @@ -5,7 +5,7 @@ ; so all paths are given relative to the location of this .iss file. #define MyAppName "AlphaDIA" -#define MyAppVersion "1.9.1" +#define MyAppVersion "1.9.2" #define MyAppPublisher "Max Planck Institute of Biochemistry, Mann Labs" #define MyAppURL "https://github.com/MannLabs/alphadia" #define MyAppExeName "alphadia-gui.exe" @@ -29,7 +29,7 @@ PrivilegesRequired=lowest PrivilegesRequiredOverridesAllowed=dialog ; release workflow expects artifact at root of repository OutputDir=..\..\ -; example for BUILD_NAME: alphadia-1.9.1-win-x64 +; example for BUILD_NAME: alphadia-1.9.2-win-x64 OutputBaseFilename={#GetEnv('BUILD_NAME')} SetupIconFile=..\logos\alphadia.ico Compression=lzma diff --git a/release/windows/build_installer_windows.ps1 b/release/windows/build_installer_windows.ps1 index 974e2682..1123d75f 100644 --- a/release/windows/build_installer_windows.ps1 +++ b/release/windows/build_installer_windows.ps1 @@ -5,7 +5,7 @@ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist python -m build -pip install "dist/alphadia-1.9.1-py3-none-any.whl[stable]" +pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" # Creating the stand-alone pyinstaller folder pip install tbb==2021.13.1 From 9421198c0f33e635630c5428ecf67cf2b55dfc4a Mon Sep 17 00:00:00 2001 From: GeorgWa Date: Fri, 20 Dec 2024 11:48:08 +0100 Subject: [PATCH 21/32] fix dask version --- requirements/requirements.txt | 1 + requirements/requirements_loose.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index c421c4e8..6a165d05 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -17,6 +17,7 @@ transformers==4.40.2 directlfq==0.2.19 pythonnet==3.0.3 zstandard==0.22.0 +dask==2024.11.2 # not direct dependencies but we have to restrict the versions numpy<2 # test: tolerate_version avoid the breaking change in numpy >= 2 scipy==1.12.0 diff --git a/requirements/requirements_loose.txt b/requirements/requirements_loose.txt index 68aa94bf..d373a565 100644 --- a/requirements/requirements_loose.txt +++ b/requirements/requirements_loose.txt @@ -6,6 +6,7 @@ alpharaw>=0.3.1 # test: tolerate_version alphatims alphabase>=1.4.0 # test: tolerate_version peptdeep>=1.3.0 # test: tolerate_version +dask==2024.11.2 # test: tolerate_version progressbar neptune seaborn From 2c9beba03ad551c4f9739790dd1d456ab10534de Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:55:54 +0100 Subject: [PATCH 22/32] install mono in CI install mono in CI --- .github/workflows/_run_tests.yml | 5 +++++ misc/pip_install.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index e5032c14..92436ac9 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -34,6 +34,11 @@ jobs: - name: Conda info shell: bash -l {0} run: conda info + - name: Install mono + shell: bash -l {0} + run: | + conda install mono + - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | diff --git a/misc/pip_install.sh b/misc/pip_install.sh index bbfd5352..2ca0b8b8 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -4,7 +4,7 @@ INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} -conda create -n $ENV_NAME python=$PYTHON_VERSION -y +conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From 7511152dfc5d6977deb01a99db6b66f87d7b630b Mon Sep 17 00:00:00 2001 From: Mohamed Sameh Date: Fri, 20 Dec 2024 19:02:36 +0100 Subject: [PATCH 23/32] fix the nan bug --- alphadia/outputaccumulator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alphadia/outputaccumulator.py b/alphadia/outputaccumulator.py index 9f1e8547..76c14cd2 100644 --- a/alphadia/outputaccumulator.py +++ b/alphadia/outputaccumulator.py @@ -585,8 +585,8 @@ def ms2_quality_control( # use the precursor for MS2 learning if the median correlation is above the cutoff use_for_ms2[i] = median_correlation > precursor_correlation_cutoff - # Fix: Use loc to modify the original DataFrame instead of the view - spec_lib_base.fragment_intensity_df.loc[start_idx:stop_idx] = ( + # Fix: Use iloc to modify the original DataFrame instead of the view + spec_lib_base.fragment_intensity_df.iloc[start_idx:stop_idx] = ( fragment_intensity_view.values * ( fragment_correlation_view From b7572b2c8e9586a5d862d06db02535dfbc7ff37f Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:55:54 +0100 Subject: [PATCH 24/32] install mono in CI install mono in CI --- .github/workflows/_run_tests.yml | 5 +++++ misc/pip_install.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index e5032c14..92436ac9 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -34,6 +34,11 @@ jobs: - name: Conda info shell: bash -l {0} run: conda info + - name: Install mono + shell: bash -l {0} + run: | + conda install mono + - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | diff --git a/misc/pip_install.sh b/misc/pip_install.sh index bbfd5352..2ca0b8b8 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -4,7 +4,7 @@ INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} -conda create -n $ENV_NAME python=$PYTHON_VERSION -y +conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From e25b2f94ba42cf2e4a5a29331942a83883efcbfe Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:55:54 +0100 Subject: [PATCH 25/32] install mono in CI install mono in CI --- .github/workflows/_run_tests.yml | 5 +++++ misc/pip_install.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index e5032c14..92436ac9 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -34,6 +34,11 @@ jobs: - name: Conda info shell: bash -l {0} run: conda info + - name: Install mono + shell: bash -l {0} + run: | + conda install mono + - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | diff --git a/misc/pip_install.sh b/misc/pip_install.sh index bbfd5352..2ca0b8b8 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -4,7 +4,7 @@ INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} -conda create -n $ENV_NAME python=$PYTHON_VERSION -y +conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From 8cb6e1b9d69cdeb59294e67c8de152183dedc346 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:55:54 +0100 Subject: [PATCH 26/32] install mono in CI install mono in CI --- .github/workflows/_run_tests.yml | 5 +++++ misc/pip_install.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index e5032c14..92436ac9 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -34,6 +34,11 @@ jobs: - name: Conda info shell: bash -l {0} run: conda info + - name: Install mono + shell: bash -l {0} + run: | + conda install mono + - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | diff --git a/misc/pip_install.sh b/misc/pip_install.sh index bbfd5352..2ca0b8b8 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -4,7 +4,7 @@ INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} -conda create -n $ENV_NAME python=$PYTHON_VERSION -y +conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From a55a9e12f2d664fad5d2eaaa96c19da2213114c2 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:37:24 +0100 Subject: [PATCH 27/32] fix formatting --- tests/unit_tests/test_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit_tests/test_utils.py b/tests/unit_tests/test_utils.py index 9f5263d9..cd2bc2e0 100644 --- a/tests/unit_tests/test_utils.py +++ b/tests/unit_tests/test_utils.py @@ -106,7 +106,6 @@ def test_score_groups(): ) - @pytest.fixture() def left_and_right_df(): left_df = pd.DataFrame([{"idx": 1, "col_1": 0, "col_2": 0}]) From b00c6de6214426a597d1e6ac89b9542b10d265f5 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:14:02 +0100 Subject: [PATCH 28/32] no mono for windows --- .github/workflows/_run_tests.yml | 6 +++--- misc/pip_install.sh | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 92436ac9..7689ecf3 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -35,17 +35,17 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono + if: ${{ runner.os != 'windows-latest' }} shell: bash -l {0} run: | conda install mono - - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} diff --git a/misc/pip_install.sh b/misc/pip_install.sh index 2ca0b8b8..b48ee03e 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -3,8 +3,13 @@ set -e -u INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} +INSTALL_MONO=${4:-false} -conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y +if [ "$INSTALL_MONO" = "true" ]; then + conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y +else + conda create -n $ENV_NAME python=$PYTHON_VERSION -y +fi if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From 7d72682102a0fad90eb1b80cbe7cd8c7b166dfb3 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:38:08 +0100 Subject: [PATCH 29/32] fix no mono for windows --- .github/workflows/_run_tests.yml | 11 ++++++----- .github/workflows/branch-checks.yaml | 3 ++- .github/workflows/pip_installation.yml | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 7689ecf3..0333c79e 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -1,5 +1,5 @@ # reusable workflow to run tests on different installation types and OS -name: run-tests +name: Run unit tests on ${{ inputs.os }} on: workflow_call: @@ -17,7 +17,8 @@ on: required: true type: string jobs: - run-unit-tests-stable-ubuntu: + run-unit-tests: + name: Unit tests [${{ inputs.os }}] runs-on: ${{ inputs.os }} steps: - uses: actions/checkout@v4 @@ -35,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ runner.os != 'windows-latest' }} + if: ${{ inputs.os != 'windows-latest' }} shell: bash -l {0} run: | conda install mono @@ -43,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} diff --git a/.github/workflows/branch-checks.yaml b/.github/workflows/branch-checks.yaml index 5fa58954..90677094 100644 --- a/.github/workflows/branch-checks.yaml +++ b/.github/workflows/branch-checks.yaml @@ -15,8 +15,9 @@ jobs: # For feature branches, we don't test the full matrix (os x [stable, loose]) in order to save time & resources. run-tests-stable: - name: Test stable pip installation on ubuntu-latest + name: Test 'stable' on ubuntu-latest strategy: + fail-fast: false matrix: os: [ubuntu-latest] python-version: ["3.10", "3.11", "3.12"] diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index 172f3b5a..92e6721b 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -21,7 +21,7 @@ concurrency: jobs: run-unit-tests-stable: - name: Test stable pip installation on 3 OS + name: Test 'stable' on ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-13, windows-latest] @@ -34,7 +34,7 @@ jobs: test-script: ./run_unit_tests.sh run-unit-tests-loose: - name: Test loose pip installation on 3 OS + name: Test 'loose' on ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, macos-13, windows-latest ] From c064a8f10051272342de49403d25d9caa16f38c6 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:42:18 +0100 Subject: [PATCH 30/32] add support for Windows 95 (TM) --- .github/workflows/_run_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 0333c79e..2e528439 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ inputs.os != 'windows-latest' }} + if: ${{ contains(inputs.os, 'windows') == 'false' }} shell: bash -l {0} run: | conda install mono @@ -44,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} From 99081d7706bcba30c44984d23bfde69ffb2dfe7d Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:50:30 +0100 Subject: [PATCH 31/32] fix --- .github/workflows/_run_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 2e528439..59a8698e 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -1,5 +1,5 @@ # reusable workflow to run tests on different installation types and OS -name: Run unit tests on ${{ inputs.os }} +name: Run unit tests on: workflow_call: From afea9730ffae0867cd0456b90cc75e1a9a8514ae Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:49:33 +0100 Subject: [PATCH 32/32] fix --- .github/workflows/_run_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 59a8698e..1cc32945 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ contains(inputs.os, 'windows') == 'false' }} + if: ${{ !contains(inputs.os, 'windows') }} shell: bash -l {0} run: | conda install mono @@ -44,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }}