Other MS Data Formats#

Identification Data (idXML, mzIdentML, pepXML, protXML)#

You can store and load identification data from an idXML file as follows:

1from urllib.request import urlretrieve
2import pyopenms as oms
3
4gh = gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-docs/master"
5urlretrieve(gh + "/src/data/IdXMLFile_whole.idXML", "test.idXML")
6protein_ids = []
7peptide_ids = []
8oms.IdXMLFile().load("test.idXML", protein_ids, peptide_ids)
9oms.IdXMLFile().store("test.out.idXML", protein_ids, peptide_ids)

You can store and load identification data from an mzIdentML file as follows:

1from urllib.request import urlretrieve
2
3gh = gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-docs/master"
4urlretrieve(gh + "/src/data/MzIdentML_3runs.mzid", "test.mzid")
5protein_ids = []
6peptide_ids = []
7oms.MzIdentMLFile().load("test.mzid", protein_ids, peptide_ids)
8oms.MzIdentMLFile().store("test.out.mzid", protein_ids, peptide_ids)

You can store and load identification data from a TPP pepXML file as follows:

1from urllib.request import urlretrieve
2
3gh = gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-docs/master"
4urlretrieve(gh + "/src/data/PepXMLFile_test.pepxml", "test.pepxml")
5protein_ids = []
6peptide_ids = []
7oms.PepXMLFile().load("test.pepxml", protein_ids, peptide_ids)
8oms.PepXMLFile().store("test.out.pepxml", protein_ids, peptide_ids)

You can load (storing is not supported) identification data from a TPP protXML file as follows:

1from urllib.request import urlretrieve
2
3gh = gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-docs/master"
4urlretrieve(gh + "/src/data/ProtXMLFile_input_1.protXML", "test.protXML")
5protein_ids = oms.ProteinIdentification()
6peptide_ids = oms.PeptideIdentification()
7oms.ProtXMLFile().load("test.protXML", protein_ids, peptide_ids)
8# storing protein XML file is not yet supported

Note how each data file produces two vectors of type ProteinIdentification and PeptideIdentification which also means that conversion between two data types is trivial: load data from one data file and use the storage function of the other file.

Quantiative Data (featureXML, consensusXML)#

OpenMS stores quantitative information in the internal featureXML and consensusXML attributes. The featureXML format is used to store quantitative data from a single LC-MS/MS run while the consensusXML is used to store quantitative data from multiple LC-MS/MS runs. These can be accessed as follows:

 1from urllib.request import urlretrieve
 2
 3gh = gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-docs/master"
 4urlretrieve(
 5    gh + "/src/data/FeatureFinderCentroided_1_output.featureXML",
 6    "test.featureXML",
 7)
 8features = oms.FeatureMap()
 9oms.FeatureXMLFile().load("test.featureXML", features)
10oms.FeatureXMLFile().store("test.out.featureXML", features)

and for consensusXML

1from urllib.request import urlretrieve
2
3gh = gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-docs/master"
4urlretrieve(
5    gh + "/src/data/ConsensusXMLFile_1.consensusXML", "test.consensusXML"
6)
7consensus_features = oms.ConsensusMap()
8oms.ConsensusXMLFile().load("test.consensusXML", consensus_features)
9oms.ConsensusXMLFile().store("test.out.consensusXML", consensus_features)

Transition data (TraML)#

The TraML data format allows you to store transition information for targeted experiments (SRM / MRM / PRM / DIA).

1from urllib.request import urlretrieve
2
3gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-extra/master"
4urlretrieve(gh + "/src/data/ConvertTSVToTraML_output.TraML", "test.TraML")
5targeted_exp = oms.TargetedExperiment()
6oms.TraMLFile().load("test.TraML", targeted_exp)
7oms.TraMLFile().store("test.out.TraML", targeted_exp)