Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose deeplc calibration set size param #297

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading