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 59a325fe..70ef957b 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -215,6 +215,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 12736cd5..ebee2150 100644 --- a/nextflow.config +++ b/nextflow.config @@ -50,6 +50,7 @@ params { rescoring_engine = 'percolator' feature_generators = 'deeplc,ms2pip' ms2pip_model = 'Immuno-HCD' + ms2pip_model_dir = null deeplc_calibration_set_size = 0.15 // Percolator settings diff --git a/nextflow_schema.json b/nextflow_schema.json index c81e02b3..ec8eafb5 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -275,6 +275,7 @@ "enum": [ "Immuno-HCD", "timsTOF", + "timsTOF2023", "CID", "CIDch2", "CID-TMT", @@ -285,14 +286,21 @@ "iTRAQ", "iTRAQphospho" ], - "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 a local directory holding at least the MS²PIP models specified in `ms2pip_model`." }, "deeplc_calibration_set_size": { "type": "number", "fa_icon": "fas fa-head-side-gear", "hidden": true, "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." }, "fdr_level": { "type": "string",