Skip to content

Commit

Permalink
Merge pull request #297 from jonasscheid/add_ms2rescore
Browse files Browse the repository at this point in the history
Expose deeplc calibration set size param
  • Loading branch information
jonasscheid authored Jan 4, 2024
2 parents 1fc7268 + 90409ac commit 992ac4f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/ms2rescore_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def parse_cli_arguments_to_config(**kwargs):

for key, value in kwargs.items():
# Skip these arguments since they need to set in a nested dict of feature_generators
if key in ["ms2pip_model", "ms2_tolerance", "rng"]:
if key in ["ms2pip_model", "ms2_tolerance", "rng", "calibration_set_size"]:
continue

elif key == "feature_generators":
Expand All @@ -39,7 +39,10 @@ def parse_cli_arguments_to_config(**kwargs):
"ms2_tolerance": kwargs["ms2_tolerance"],
}
if "deeplc" in feature_generators:
config["ms2rescore"]["feature_generators"]["deeplc"] = {"deeplc_retrain": False}
config["ms2rescore"]["feature_generators"]["deeplc"] = {
"deeplc_retrain": False,
"calibration_set_size": kwargs["calibration_set_size"],
}
if "maxquant" in feature_generators:
config["ms2rescore"]["feature_generators"]["maxquant"] = {}
if "ionmob" in feature_generators:
Expand Down Expand Up @@ -144,6 +147,12 @@ def filter_out_artifact_psms(
@click.option(
"-ms2tol", "--ms2_tolerance", help="Fragment mass tolerance [Da](default: `0.02`)", type=float, default=0.02
)
@click.option(
"-cs",
"--calibration_set_size",
help="Percentage of number of calibration set for DeepLC (default: `0.15`)",
default=0.15,
)
@click.option("-re", "--rescoring_engine", help="Either mokapot or percolator (default: `mokapot`)", default="mokapot")
@click.option(
"-rng", "--rng", help="Seed for mokapot's random number generator (default: `4711`)", type=int, default=4711
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ params {
rescoring_engine = 'percolator'
feature_generators = 'deeplc,ms2pip'
ms2pip_model = 'Immuno-HCD'
deeplc_calibration_set_size = 0.15

// MultiQC options
skip_multiqc = false
Expand Down
6 changes: 6 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@
"default": "Immuno-HCD",
"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",
"default": 0.15,
"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",
"fa_icon": "fas fa-arrows-repeat",
Expand Down

0 comments on commit 992ac4f

Please sign in to comment.