![]() |
OpenMS
|
Utility class for score type handling in identification and quantification workflows. More...
#include <OpenMS/ANALYSIS/ID/Scores.h>
Classes | |
| struct | Maps_ |
| Holds the static score type lookup maps (thread-safe via C++11 function-local static) More... | |
Public Types | |
| enum class | IDType { RAW , RAW_EVAL , PP , PEP , FDR , QVAL } |
| Hierarchy of possible score types in MS identification. More... | |
Static Public Member Functions | |
| static bool | isScoreType (const String &score_name, IDType type) |
| Checks if the given score name corresponds to a specific ID score type. | |
| static IDType | parseIDType (const String &score_type) |
| Converts a string representation of an ID score type to an IDType enum. | |
| static bool | isHigherBetter (IDType type) |
| Determines whether a higher score is better for the given ID score type. | |
| static std::vector< String > | getAllIDScoreNames () |
| Gets a vector of all ID score names that are used in OpenMS. | |
| static const std::set< String > & | getIDNamesForType (IDType type) |
| Gets the set of known names for a specific ID score type. | |
| static bool | findIDTypeByName (const String &name, IDType &type) |
| Finds the ID score type for a given score name. | |
| static String | normalizeScoreName (const String &score_name) |
| Normalizes a score name by removing the "_score" suffix if present. | |
| static bool | isKnownScoreType (const String &score_name) |
| Checks if a score name is a known score type (after normalization). | |
Static Private Member Functions | |
| static const Maps_ & | getMaps_ () |
| Returns the singleton Maps_ instance (thread-safe initialization guaranteed by C++11) | |
Utility class for score type handling in identification and quantification workflows.
This class provides centralized handling of score types used in peptide/protein identification, quantification, and PTM localization. It defines the hierarchy of score types and provides utility methods for score type conversion, comparison, and lookup.
The identification score type hierarchy is:
| struct OpenMS::Scores::Maps_ |
|
strong |
Hierarchy of possible score types in MS identification.
In an ideal case, this should be reimplemented to follow ontology hierarchies as soon as e.g. MS-OBO is complete and we switched the Metavalues to CV terms.
Finds the ID score type for a given score name.
Searches through all known score names to find a matching type.
| [in] | name | The score name to look up. |
| [out] | type | Output parameter for the found score type. |
|
static |
Gets a vector of all ID score names that are used in OpenMS.
Gets the set of known names for a specific ID score type.
| [in] | type | The ID score type. |
|
staticprivate |
Returns the singleton Maps_ instance (thread-safe initialization guaranteed by C++11)
|
static |
Determines whether a higher score is better for the given ID score type.
| [in] | type | The ID score type to check. |
|
static |
Checks if a score name is a known score type (after normalization).
This method normalizes the score name and checks if it matches any known score type in the registry. Unlike isScoreType(), this doesn't require specifying which IDType to check - it checks all of them.
| [in] | score_name | The score name to check. |
Checks if the given score name corresponds to a specific ID score type.
This method determines if a given score name, typically derived from an identification object or meta value, matches a specified IDType. It performs a case-insensitive comparison and optionally removes the "_score" suffix if present.
| [in] | score_name | The name of the score to check. |
| [in] | type | The IDType to compare against. |
Normalizes a score name by removing the "_score" suffix if present.
This is useful when checking if a score name matches a known score type, as OpenMS conventions allow both "q-value" and "q-value_score" forms.
| [in] | score_name | The score name to normalize. |
Converts a string representation of an ID score type to an IDType enum.
This method attempts to map a given string, representing a score type, to the corresponding IDType enum value. It handles various common representations of score types, including those with or without the "_score" suffix, and ignores case and special characters like '-', '_', and ' '.
| [in] | score_type | The string representation of the score type. |
| Exception::MissingInformation | If the provided score_type string does not match any known score type. |