From ccd0c70681f55aa897505cac18cd5cb20f70c50d Mon Sep 17 00:00:00 2001 From: jonasscheid Date: Sun, 12 May 2024 21:01:00 +0000 Subject: [PATCH 1/3] adding ms2pip model cache dir option --- CHANGELOG.md | 1 + bin/ms2rescore_cli.py | 2 ++ conf/modules.config | 1 + nextflow.config | 1 + nextflow_schema.json | 7 +++++++ 5 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea443d4d..fbbf4818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` - Added MS²Rescore module with the underlying python CLI [#293](https://github.com/nf-core/mhcquant/pull/293) +- Added new flag `ms2pip_model_dir`, which allows specifying a cache directory for ms2pip models [#322](https://github.com/nf-core/mhcquant/pull/322) ### `Fixed` diff --git a/bin/ms2rescore_cli.py b/bin/ms2rescore_cli.py index 07ab397e..ec06fd08 100755 --- a/bin/ms2rescore_cli.py +++ b/bin/ms2rescore_cli.py @@ -37,6 +37,7 @@ def parse_cli_arguments_to_config(**kwargs): config["ms2rescore"]["feature_generators"]["ms2pip"] = { "model": kwargs["ms2pip_model"], "ms2_tolerance": kwargs["ms2_tolerance"], + "model_dir": kwargs["ms2pip_model_dir"], } if "deeplc" in feature_generators: config["ms2rescore"]["feature_generators"]["deeplc"] = { @@ -144,6 +145,7 @@ def filter_out_artifact_psms( default="", ) @click.option("-pipm", "--ms2pip_model", help="MS²PIP model (default: `Immuno-HCD`)", type=str, default="Immuno-HCD") +@click.option("-pipmdir", "--ms2pip_model_dir", help="Path to directory, which holds pre-downloaded MS²PIP models", type=str, default=None) @click.option( "-ms2tol", "--ms2_tolerance", help="Fragment mass tolerance [Da](default: `0.02`)", type=float, default=0.02 ) diff --git a/conf/modules.config b/conf/modules.config index 44b08b64..210e009f 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -254,6 +254,7 @@ process { ext.args = [ "--ms2_tolerance ${2 * params.fragment_mass_tolerance}", "--ms2pip_model ${params.ms2pip_model}", + "--ms2pip_model_dir ${params.ms2pip_model_dir}", "--rescoring_engine ${params.rescoring_engine}", params.feature_generators.trim() ? "--feature_generators ${params.feature_generators}" : '' ].join(' ').trim() diff --git a/nextflow.config b/nextflow.config index 48a28039..4f6c2bc4 100644 --- a/nextflow.config +++ b/nextflow.config @@ -73,6 +73,7 @@ params { rescoring_engine = 'percolator' feature_generators = 'deeplc,ms2pip' ms2pip_model = 'Immuno-HCD' + ms2pip_model_dir = null deeplc_calibration_set_size = 0.15 // MultiQC options diff --git a/nextflow_schema.json b/nextflow_schema.json index c92162df..de58c1b0 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -295,6 +295,13 @@ "default": "Immuno-HCD", "description": "Specify the ms2pip model that should be used for rescoring. Checkout the ms2pip documentation for available models." }, + "ms2pip_model_dir": { + "type": "string", + "format": "directory-path", + "fa_icon": "fas fa-file-code", + "hidden": true, + "description": "Specify the ms2pip model that should be used for rescoring. Checkout the ms2pip documentation for available models." + }, "deeplc_calibration_set_size": { "type": "number", "fa_icon": "fas fa-file-code", From 465c9030d843c719bef388f81ea6a54d75a4e750 Mon Sep 17 00:00:00 2001 From: jonasscheid Date: Sun, 12 May 2024 21:11:31 +0000 Subject: [PATCH 2/3] adjust param description --- nextflow_schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index de58c1b0..bd2ee9c4 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -293,20 +293,20 @@ "type": "string", "fa_icon": "fas fa-file-code", "default": "Immuno-HCD", - "description": "Specify the ms2pip model that should be used for rescoring. Checkout the ms2pip documentation for available models." + "description": "Specify the MS²PIP model that should be used for rescoring. Checkout the MS²PIP documentation for available models." }, "ms2pip_model_dir": { "type": "string", "format": "directory-path", "fa_icon": "fas fa-file-code", "hidden": true, - "description": "Specify the ms2pip model that should be used for rescoring. Checkout the ms2pip documentation for available models." + "description": "Specify a local directory holding at least the MS²PIP models specified in `ms2pip_model`." }, "deeplc_calibration_set_size": { "type": "number", "fa_icon": "fas fa-file-code", "default": 0.15, - "description": "Specify the number or percentage of PSMs that should be used for calibration of the deeplc model." + "description": "Specify the number or percentage of PSMs that should be used for calibration of the DeepLC model." }, "refine_fdr_on_predicted_subset": { "type": "boolean", From 3dd15c0c504e49d35425ae4b7c0a586d2cb6bd2a Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Mon, 13 May 2024 12:04:35 +0000 Subject: [PATCH 3/3] fix lint --- nextflow_schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index be96b26f..ec8eafb5 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -275,7 +275,7 @@ "enum": [ "Immuno-HCD", "timsTOF", - "timsTOF2023" + "timsTOF2023", "CID", "CIDch2", "CID-TMT",