IdentifierMSRunMapper#

class pyopenms.IdentifierMSRunMapper#

Bases: object

Maps protein identification identifiers to MS run file paths.

This class encapsulates the mapping between ProteinIdentification identifiers and their associated MS run paths. It is useful for resolving the correct source file for peptide identifications, especially in merged identification results.

Example usage:

# Create mapping from protein identifications
mapper = oms.IdentifierMSRunMapper(protein_ids)

# Get MS run paths for a peptide's identifier
paths = mapper.getMSRunPaths(pep_id.getIdentifier())

# Build a USI using the mapping
usi = pep_id.buildUSI(mapper, "PXD000561", False)
__init__() → None#
__init__(arg: collections.abc.Sequence[pyopenms.ProteinIdentification], /) → None

Methods

__init__()

create(prot_ids)

Create/update mapping from a list of ProteinIdentifications.

empty()

Check if the mapping is empty.

getMSRunPaths(identifier)

Get the MS run paths associated with the given identifier.

hasIdentifier(identifier)

Check if the mapping contains an entry for the given identifier.

size()

Get the number of identifier mappings.

create(prot_ids: collections.abc.Sequence[pyopenms.ProteinIdentification]) → None#

Create/update mapping from a list of ProteinIdentifications.

Parameters:

prot_ids – List of ProteinIdentification objects

empty() → bool#

Check if the mapping is empty.

Returns:

True if no mappings exist

getMSRunPaths(identifier: str) → list[str]#

Get the MS run paths associated with the given identifier.

Parameters:

identifier – ProteinIdentification identifier

Returns:

List of MS run file paths associated with this identifier

hasIdentifier(identifier: str) → bool#

Check if the mapping contains an entry for the given identifier.

Parameters:

identifier – ProteinIdentification identifier

Returns:

True if identifier exists in mapping

size() → int#

Get the number of identifier mappings.

Returns:

Number of identifiers in the mapping