IDScoreSwitcherAlgorithm#
- class pyopenms.IDScoreSwitcherAlgorithm#
Bases:
DefaultParamHandlerAlgorithm to switch identification scores within identification or consensus feature maps
This class provides functionality to switch the main scoring type used in peptide or protein identification data. It supports switching between different score types, such as raw scores, E-values, posterior probabilities, posterior error probabilities, FDR, and q-values.
- __init__() None#
Methods
__init__()findScoreType(id, score_type)Search for a score type in a PeptideIdentification
Returns the default parameters
getName()Returns the name
Returns the parameters
Gets a vector of all score names that are used in OpenMS
isScoreType(score_name, type)Checks if the given score name corresponds to a specific score type
isScoreTypeHigherBetter(score_type)Determines whether a higher score type is better given an IDType enum
setName(name)Sets the name
setParameters(param)Sets the parameters
switchBackScoreType(pep_ids, isr)Overloaded function.
switchScores(cmap, counter[, ...])Overloaded function.
switchToGeneralScoreType(pep_ids, type, counter)Overloaded function.
switchToScoreType(pep_ids, ...)Overloaded function.
toScoreTypeEnum(score_type)Converts a string representation of a score type to an IDType enum
- findScoreType(id: pyopenms.PeptideIdentification, score_type: pyopenms.Scores.IDType) pyopenms.ScoreSearchResult#
Search for a score type in a PeptideIdentification
- getDefaults() pyopenms.Param#
Returns the default parameters
- getName() str#
Returns the name
- getParameters() pyopenms.Param#
Returns the parameters
- getScoreNames() list[str]#
Gets a vector of all score names that are used in OpenMS
- Returns:
A vector of all score names (e.g., “q-value”, “ln(hyperscore)”)
- getSubsections() list[str]#
- isScoreType(score_name: str, type: pyopenms.Scores.IDType) bool#
Checks if the given score name corresponds to a specific score type
- Parameters:
score_name – The name of the score to check
type – The IDType to compare against
- Returns:
True if the score name matches the given IDType
- isScoreTypeHigherBetter(score_type: pyopenms.Scores.IDType) bool#
Determines whether a higher score type is better given an IDType enum
- Parameters:
score_type – The score type to check
- Returns:
True if a higher score type is better
- setName(name: str) None#
Sets the name
- setParameters(param: pyopenms.Param) None#
Sets the parameters
- static switchBackScoreType(pep_ids: pyopenms.PeptideIdentificationList, isr: pyopenms.IDSwitchResult) None#
- static switchBackScoreType(cmap: pyopenms.ConsensusMap, isr: pyopenms.IDSwitchResult, include_unassigned: bool = True) None
Overloaded function.
switchBackScoreType(pep_ids: pyopenms.PeptideIdentificationList, isr: pyopenms.IDSwitchResult) -> None
Revert scores to original type
switchBackScoreType(cmap: pyopenms.ConsensusMap, isr: pyopenms.IDSwitchResult, include_unassigned: bool = True) -> None
Revert scores of a ConsensusMap to original type
- switchScores(cmap: pyopenms.ConsensusMap, counter: int, unassigned_peptides_too: bool = True) int#
- switchScores(pep_ids: pyopenms.PeptideIdentificationList, counter: int) int
Overloaded function.
switchScores(cmap: pyopenms.ConsensusMap, counter: int, unassigned_peptides_too: bool = True) -> int
Switches the scores of peptide identifications in a ConsensusMap
- Parameters:
cmap – The ConsensusMap containing peptide identifications whose scores need to be switched
counter – A reference to a counter that will be incremented for each peptide identification processed
unassigned_peptides_too – Whether to include unassigned peptides in the score switching process
switchScores(pep_ids: pyopenms.PeptideIdentificationList, counter: int) -> int
Switches the scores of peptide identifications
- Parameters:
pep_ids – The peptide identifications whose scores need to be switched
counter – A reference to a counter that will be incremented for each peptide identification processed
- switchToGeneralScoreType(pep_ids: pyopenms.PeptideIdentificationList, type: pyopenms.Scores.IDType, counter: int) int#
- switchToGeneralScoreType(cmap: pyopenms.ConsensusMap, type: pyopenms.Scores.IDType, counter: int, unassigned_peptides_too: bool = True) int
Overloaded function.
switchToGeneralScoreType(pep_ids: pyopenms.PeptideIdentificationList, type: pyopenms.Scores.IDType, counter: int) -> int
Switches the score type of a PeptideIdentificationList to a general score type
- Parameters:
pep_ids – The PeptideIdentificationList whose scores need to be switched
type – The desired general score type to switch to
counter – A reference to a counter that will be incremented for each peptide identification processed
switchToGeneralScoreType(cmap: pyopenms.ConsensusMap, type: pyopenms.Scores.IDType, counter: int, unassigned_peptides_too: bool = True) -> int
Switches the score type of a ConsensusMap to a general score type
- Parameters:
cmap – The ConsensusMap containing peptide identifications whose scores need to be switched
type – The desired general score type to switch to
counter – A reference to a counter that will be incremented for each peptide identification processed
unassigned_peptides_too – Whether to include unassigned peptides in the score switching process
- static switchToScoreType(pep_ids: pyopenms.PeptideIdentificationList, requested_score_type_as_string: str) pyopenms.IDSwitchResult#
- static switchToScoreType(cmap: pyopenms.ConsensusMap, requested_score_type_as_string: str, include_unassigned: bool = True) pyopenms.IDSwitchResult
Overloaded function.
switchToScoreType(pep_ids: pyopenms.PeptideIdentificationList, requested_score_type_as_string: str) -> pyopenms.IDSwitchResult
Switch the score type of peptide identifications
switchToScoreType(cmap: pyopenms.ConsensusMap, requested_score_type_as_string: str, include_unassigned: bool = True) -> pyopenms.IDSwitchResult
Switch the score type of a ConsensusMap
- static toScoreTypeEnum(score_type: str) pyopenms.Scores.IDType#
Converts a string representation of a score type to an IDType enum
- Parameters:
score_type – The string representation of the score type
- Returns:
The corresponding IDType enum value
- Raises:
Exception::MissingInformation if the score_type string is not recognized