usi - Universal Spectrum Identifier (USI) parser and minimal PROXI client¶
Summary¶
USI is a standardized method of referencing a specific
spectrum in a dataset, possibly attached to an interpretation. This module includes a
USI
type which can represent these constructs, parse()
them and
reconstruct them.
One use-case for USI is to request spectrum information from a PROXI service host. PROXI services are available from several of the major national proteomics data hosts, including MassIVE, PeptideAtlas, PRIDE, and jPOST.
See also
LeDuc, Richard D., Eric W. Deutsch, Pierre-Alain Binz, Ryan T. Fellers, Anthony J. Cesnik, Joshua A. Klein, Tim Van Den Bossche, et al. “Proteomics Standards Initiative’s ProForma 2.0: Unifying the Encoding of Proteoforms and Peptidoforms.” ArXiv:2109.11352 [q-Bio], September 23, 2021. http://arxiv.org/abs/2109.11352.
Data access¶
USI
for representing Universal Spectrum Identifiers. CallUSI.parse()
to parse a USI string.
proxi()
to request a USI from a remote service. Provides access to the PeptideAtlas, MassIVE, PRIDE and jPOST hosts.
- class pyteomics.usi.PROXIAggregator(backends=None, n_threads=None, timeout=15, merge=True, ephemeral_pool=True, **kwargs)[source]¶
Bases:
object
Aggregate across requests across multiple PROXI servers.
Will attempt to coalesce responses from responding servers into a single spectrum representation.
- backends¶
The backend servers to query. Defaults to the set of all available backends.
- n_threads¶
The number of threads to run concurrently to while making requests. Defaults to the number of servers to query.
- Type:
- __init__(backends=None, n_threads=None, timeout=15, merge=True, ephemeral_pool=True, **kwargs)[source]¶
- coalesce(responses, method='first')[source]¶
Merge responses from disparate servers into a single spectrum representation.
The merging process will use the first of every array encountered, and all unique attributes.
- class pyteomics.usi.USI(protocol, dataset, datafile, scan_identifier_type, scan_identifier, interpretation)[source]¶
Bases:
USI
Represent a Universal Spectrum Identifier (USI).
Note
This implementation will capture the interpretation component but will not interpret it at this time.
- scan_identifier_type¶
The format of the scan identifier, one of (scan, index, nativeId, trace)
- Type:
- scan_identifier¶
A usually numerical but potentially comma separated value encoded as a string to uniquely identify the spectrum to be recovered from
datafile
indataset
.- Type:
- interpretation¶
The trailing material of the USI, such as the ProForma peptide sequence and charge
- Type:
- __init__()¶
- count(value, /)¶
Return number of occurrences of value.
- datafile¶
Alias for field number 2
- dataset¶
Alias for field number 1
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- interpretation¶
Alias for field number 5
- protocol¶
Alias for field number 0
- scan_identifier¶
Alias for field number 4
- scan_identifier_type¶
Alias for field number 3
- pyteomics.usi.proxi(usi, backend='peptide_atlas', **kwargs)[source]¶
Retrieve a
USI
from a PROXI <http://www.psidev.info/proxi>.- Parameters:
usi (str or
USI
) – The universal spectrum identifier to request.backend (str or
Callable
) – Either the name of a PROXI host (peptide_atlas, massive, pride, jpost, or aggregator), or a callable object (which_PROXIBackend
instances are) which will be used to resolve the USI. The “aggregator” backend will use aPROXIAggregator
instance which will request the same USI from all the registered servers and attempt to merge their responses into a single whole. SeePROXIAggregator.coalesce()
for more details on the merging process.**kwargs – extra arguments passed when constructing the backend by name.
- Returns:
The spectrum as represented by the requested PROXI host.
- Return type: