{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "MS²Rescore configuration", "type": "object", "required": ["ms2rescore"], "properties": { "ms2rescore": { "description": "General MS²Rescore settings.", "type": "object", "required": ["psm_file"], "additionalProperties": false, "properties": { "feature_generators": { "description": "Feature generators and their configurations.", "type": "object", "patternProperties": { ".*": { "$ref": "#/definitions/feature_generator" }, "basic": { "$ref": "#/definitions/basic" }, "ms2pip": { "$ref": "#/definitions/ms2pip" }, "deeplc": { "$ref": "#/definitions/deeplc" }, "im2deep": { "$ref": "#/definitions/im2deep" }, "ms2": { "$ref": "#/definitions/ms2" } }, "default": { "basic": {}, "ms2pip": { "model": "HCD" }, "ms2": {}, "deeplc": {} } }, "rescoring": { "description": "Ristretto rescoring configuration. Set to {} to use the defaults below.", "allOf": [{ "$ref": "#/definitions/rescoring" }], "default": { "train_fdr": 0.01, "model": "svm" } }, "psm_generator": { "description": "PSM generator and their configuration.", "type": "object", "minProperties": 0, "maxProperties": 1, "patternProperties": { ".*": { "$ref": "#/definitions/psm_generator" }, "mumble": { "$ref": "#/definitions/mumble" } } }, "config_file": { "description": "Path to configuration file", "oneOf": [{ "type": "string" }, { "type": "null" }] }, "psm_file": { "description": "Path to file with peptide-spectrum matches.", "oneOf": [ { "type": "string" }, { "type": "null" }, { "type": "array", "items": { "type": "string" } } ] }, "psm_file_type": { "description": "PSM file type. By default inferred from file extension.", "type": "string", "default": "infer" }, "psm_reader_kwargs": { "description": "Keyword arguments passed to the PSM reader.", "type": "object", "default": {} }, "spectrum_path": { "description": "Path to spectrum file or directory with spectrum files", "oneOf": [{ "type": "string" }, { "type": "null" }] }, "output_path": { "description": "Path and root name for output files", "oneOf": [{ "type": "string" }, { "type": "null" }] }, "log_level": { "description": "Logging level", "type": "string", "enum": ["debug", "info", "warning", "error", "critical"] }, "id_decoy_pattern": { "description": "Regex pattern used to identify the decoy PSMs in identification file.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": null }, "spectrum_id_pattern": { "description": "Regex pattern to extract index or scan number from spectrum file. Requires at least one capturing group.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": "(.*)", "format": "regex" }, "psm_id_pattern": { "description": "Regex pattern to extract index or scan number from PSM file. Requires at least one capturing group.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": "(.*)", "format": "regex" }, "psm_id_rt_pattern": { "description": "Regex pattern to extract retention time from PSM identifier. Requires at least one capturing group.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": null, "format": "regex" }, "psm_id_im_pattern": { "description": "Regex pattern to extract ion mobility from PSM identifier. Requires at least one capturing group.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": null, "format": "regex" }, "max_psm_rank_input": { "description": "Maximum rank of PSMs to use as input for rescoring", "type": "number", "default": 10, "minimum": 1 }, "max_psm_rank_output": { "description": "Maximum rank of PSMs to return after rescoring, before final FDR calculation", "type": "number", "default": 1, "minimum": 1 }, "modification_mapping": { "description": "Mapping of modification labels to each replacement label.", "type": "object", "default": {} }, "fixed_modifications": { "description": "Mapping of amino acids with fixed modifications to the modification name.", "type": "object", "default": {}, "additionalProperties": true }, "processes": { "description": "Number of parallel processes to use; -1 for all available", "type": "number", "multipleOf": 1, "minimum": -1, "default": -1 }, "rename_to_usi": { "description": "Convert spectrum IDs to their universal spectrum identifier", "type": "boolean" }, "write_flashlfq": { "description": "Write results to a FlashLFQ-compatible file", "oneOf": [{ "type": "boolean" }, { "type": "null" }], "default": false }, "write_report": { "description": "Write an HTML report with various QC metrics and charts", "oneOf": [{ "type": "boolean" }, { "type": "null" }], "default": true }, "report_fdr": { "description": "FDR threshold used for reporting: console log identification counts, the HTML report's identification stats/charts, and FlashLFQ output filtering. Independent of rescoring.train_fdr, which controls ristretto's training instead.", "type": "number", "minimum": 0, "maximum": 1, "default": 0.01 }, "disable_update_check": { "description": "Disable the automatic update check", "oneOf": [{ "type": "boolean" }, { "type": "null" }], "default": false }, "profile": { "description": "Write a txt report using cProfile for profiling", "oneOf": [{ "type": "boolean" }, { "type": "null" }], "default": false }, "fragmentation_model": { "description": "Fragmentation model for spectrum annotation: cidhcd (a/b/y), etd (c/y/z), ethcd (a/b/c/y/z), or all (a/b/c/x/y/z)", "type": "string", "enum": ["cidhcd", "etd", "ethcd", "all"], "default": "cidhcd" }, "tolerance_value": { "description": "Fragment mass tolerance value for spectrum annotation", "type": "number", "minimum": 0, "default": 0.02 }, "tolerance_mode": { "description": "Fragment mass tolerance mode for spectrum annotation", "type": "string", "enum": ["ppm", "Da"], "default": "Da" } } } }, "definitions": { "feature_generator": { "description": "Feature generator configuration", "type": "object", "additionalProperties": true }, "rescoring": { "description": "Ristretto rescoring configuration.", "type": "object", "additionalProperties": false, "properties": { "train_fdr": { "description": "FDR threshold used during ristretto's semi-supervised training", "type": "number", "minimum": 0, "maximum": 1, "default": 0.01 }, "model": { "description": "Model used for ristretto's semi-supervised rescoring: 'svm' (iterative Percolator-style SVM, default) or 'lda' (single-pass Fisher LDA, faster but less powerful on hard datasets)", "type": "string", "enum": ["svm", "lda"], "default": "svm" } } }, "psm_generator": { "description": "Additional PSM feature generator configuration", "type": "object", "additionalProperties": true }, "basic": { "$ref": "#/definitions/feature_generator", "description": "Basic feature generator configuration", "type": "object", "additionalProperties": true }, "ms2pip": { "$ref": "#/definitions/feature_generator", "description": "MS²PIP feature generator configuration", "type": "object", "additionalProperties": true, "properties": { "model": { "description": "MS²PIP model to use (see MS²PIP documentation)", "type": "string", "default": "HCD" }, "model_dir": { "description": "Directory containing MS²PIP models", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": null } } }, "deeplc": { "$ref": "#/definitions/feature_generator", "description": "DeepLC feature generator configuration", "type": "object", "additionalProperties": true, "properties": { "calibration_set_size": { "description": "Calibration set size", "oneOf": [{ "type": "integer" }, { "type": "number" }], "default": 0.15 } } }, "ms2": { "$ref": "#/definitions/feature_generator", "description": "MS2 spectrum-based feature generator configuration", "type": "object", "additionalProperties": true, "properties": { "add_mod_info": { "description": "Add modification-aware features: modification-specific neutral loss and diagnostic ion intensities, the hyperscore gain of each modification over its removal, and the hyperscore difference to the best competing PSM for the same spectrum. Requires modification names that rustyms can resolve (Unimod names or accessions). Recommended together with the mumble PSM generator.", "type": "boolean", "default": false } } }, "im2deep": { "$ref": "#/definitions/feature_generator", "description": "Ion mobility feature generator configuration using IM2Deep", "type": "object", "additionalProperties": true, "properties": { "reference_dataset": { "description": "Path to IM2Deep reference dataset file. Defaults to IM2Deep's own bundled reference dataset if not set.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": null } } }, "mumble": { "$ref": "#/definitions/psm_generator", "description": "Mumble PSM generator configuration. Mumble proposes candidate Unimod modifications that explain each PSM's precursor mass shift (open-modification-search style). Requires the optional `mumble` dependency (`pip install ms2rescore[mumble]`). Mumble is still under active development (beta): review results and expect occasional errors, especially on unusual input.", "type": "object", "additionalProperties": true, "properties": { "aa_combinations": { "description": "Number of amino acid combinations to consider as an additional mass-shift explanation, on top of Unimod modifications. Requires `fasta_file`. Increases runtime combinatorially; keep low.", "type": "integer", "default": 0 }, "combination_length": { "description": "Maximum number of modifications to combine per mass shift. Lower combination lengths are always included as well.", "type": "integer", "default": 1 }, "exclude_mutations": { "description": "Exclude candidate modifications classified as amino acid substitutions.", "type": "boolean", "default": false }, "fasta_file": { "description": "Path to a FASTA file with protein sequences, used to validate amino acid combination candidates. Required if `aa_combinations` is greater than 0.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": null }, "mass_error": { "description": "Mass error tolerance in Da used to match a PSM's mass shift to a candidate modification.", "type": "number", "default": 0.02 }, "modification_file": { "description": "Path to a restriction list of Unimod modifications to consider (TSV with `unimod_id`/`name`, and optionally `residue`, columns). Defaults to a curated subset bundled with Mumble. Ignored if `all_unimod_modifications` is true.", "oneOf": [{ "type": "string" }, { "type": "null" }], "default": null }, "all_unimod_modifications": { "description": "Consider all Unimod modifications instead of the restricted default/`modification_file` list. Substantially increases runtime and the risk of false-positive candidate modifications.", "type": "boolean", "default": false } } } } }