Skip to content

Commit

Permalink
Merge pull request #322 from jonasscheid/ms2pip_cachedir
Browse files Browse the repository at this point in the history
Add option to specify MS2PIP model directory
  • Loading branch information
jonasscheid authored May 28, 2024
2 parents 4a4f835 + 3dd15c0 commit 2b22ec7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 2 additions & 0 deletions bin/ms2rescore_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = {
Expand Down Expand Up @@ -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
)
Expand Down
1 change: 1 addition & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
"enum": [
"Immuno-HCD",
"timsTOF",
"timsTOF2023",
"CID",
"CIDch2",
"CID-TMT",
Expand All @@ -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",
Expand Down

0 comments on commit 2b22ec7

Please sign in to comment.