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
2from pyopenms import *
3
4gh = gh = "https://raw.githubusercontent.com/OpenMS/pyopenms-docs/master"
5urlretrieve(gh + "/src/data/IdXMLFile_whole.idXML", "test.idXML")
6protein_ids = []
7peptide_ids = []
8IdXMLFile().load("test.idXML", protein_ids, peptide_ids)
9IdXMLFile().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 = []
7MzIdentMLFile().load("test.mzid", protein_ids, peptide_ids)
8MzIdentMLFile().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 = []
7PepXMLFile().load("test.pepxml", protein_ids, peptide_ids)
8PepXMLFile().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 = ProteinIdentification()
6peptide_ids = PeptideIdentification()
7ProtXMLFile().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 = FeatureMap()
9FeatureXMLFile().load("test.featureXML", features)
10FeatureXMLFile().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 = ConsensusMap()
8ConsensusXMLFile().load("test.consensusXML", consensus_features)
9ConsensusXMLFile().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 = TargetedExperiment()
6TraMLFile().load("test.TraML", targeted_exp)
7TraMLFile().store("test.out.TraML", targeted_exp)