Percolator#
- class pyopenms.Percolator#
Bases:
objectIn-process Percolator: semi-supervised target/decoy rescoring with q-values + PEPs.
Two entry points:
rescore(peptide_ids, feature_names=[]): PSM-specific sugar that stamps percolator_score / _q_value / _pep as meta values on each PeptideHit.
rescore(rescore_input): domain-agnostic. Accepts any (feature matrix, target/decoy labels, optional CV grouping keys) triple. Returns a RescoreOutput with per-row scores, q-values, PEPs.
Instances are NOT concurrent-safe; construct one per worker.
- __init__() None#
Methods
__init__()Returns a copy of the default parameters
getName()Returns the name
Returns a copy of the parameters
markRescoredRuns(runs, tool, settings[, version])Mark search runs as post-processed by Percolator and return them: search engine "Percolator" with the given version, the meta value 'percolator' = tool, and the search parameters' meta values 'Percolator:<name>' of settings, a list of (name, value) in this order.
rescore(peptide_ids[, feature_names])Overloaded function.
rescorePSMs(peptide_ids, feature_set, ...[, ...])Rescore PSMs in place on the standard Percolator (.pin) feature set.
setName(name)Sets the name
setParameters(param)Sets the parameters
storeWeights(filename)Write the models of the last rescore() as the percolator executable writes them with -w: three comment lines, then per cross-validation fold the feature names and "m0" (the bias), the weights of the normalized features and those of the raw features (tab-separated).
- getDefaults() pyopenms.Param#
Returns a copy of the default parameters
- getName() str#
Returns the name
- getParameters() pyopenms.Param#
Returns a copy of the parameters
- getSubsections() list[str]#
- static markRescoredRuns(runs: collections.abc.Sequence[pyopenms.ProteinIdentification], tool: str, settings: collections.abc.Sequence[tuple[str, None | int | float | str | bytes | list[str] | list[int] | list[float]]], version: str = '3.08-vendored') list[pyopenms.ProteinIdentification]#
Mark search runs as post-processed by Percolator and return them: search engine “Percolator” with the given version, the meta value ‘percolator’ = tool, and the search parameters’ meta values ‘Percolator:<name>’ of settings, a list of (name, value) in this order. A value None removes that meta value.
- rescore(peptide_ids: collections.abc.Sequence[pyopenms.PeptideIdentification], feature_names: list[str] = []) None#
- rescore(input: pyopenms.RescoreInput) pyopenms.RescoreOutput
Overloaded function.
rescore(peptide_ids: collections.abc.Sequence[pyopenms.PeptideIdentification], feature_names: list[str] = []) -> None
Rescore PSMs in place; appends percolator_* meta values.
rescore(input: pyopenms.RescoreInput) -> pyopenms.RescoreOutput
Domain-agnostic rescoring on a feature matrix.
- rescorePSMs(peptide_ids: pyopenms.PeptideIdentificationList, feature_set: list[str], enzyme: str, min_charge: int, max_charge: int, score_type: str = 'q-value') int#
Rescore PSMs in place on the standard Percolator (.pin) feature set.
Stamps the PIN features, trains, and writes SVM score (MS:1001492), q-value (MS:1001491) and PEP (MS:1001493) onto each hit. The main score becomes the one selected by score_type (“q-value”, “pep” or “svm”), and the original score is kept as a meta value named after the old score type. Hits that cannot be rescored (no peptide evidence, no target/decoy annotation or a missing feature) get q-value = PEP = 1 and SVM score = -100. The stamped features are removed again. Returns the number of rescored hits.
feature_set: e.g. PercolatorInfile.getStandardFeatureSet(min_charge, max_charge) plus extra features plus “Peptide” and “Proteins”.
- setName(name: str) None#
Sets the name
- setParameters(param: pyopenms.Param) None#
Sets the parameters
- storeWeights(filename: str) None#
Write the models of the last rescore() as the percolator executable writes them with -w: three comment lines, then per cross-validation fold the feature names and “m0” (the bias), the weights of the normalized features and those of the raw features (tab-separated). Raises an exception if nothing has been trained yet, or after rescorePSMs() with RESET.