OpenMS
Loading...
Searching...
No Matches
UniProtXMLFile.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13#include <functional>
14#include <string>
15#include <vector>
16
17namespace OpenMS
18{
28 {
29 std::string type;
30 std::string id;
31 std::string description;
32 std::string location_sequence;
33 bool has_position{false};
34 bool has_range{false};
35 int position{0};
36 int begin{0};
37 int end{0};
38 std::string original;
39 std::string variation;
40 };
41
53 {
54 std::string id;
55 std::string name;
56 std::string sequence_type;
57 std::string sequence_ref;
58 };
59
69 {
70 std::string dataset;
71 std::string accession;
72 std::vector<std::string> alt_accessions;
73 std::string name;
74 std::string full_name;
75 std::string primary_gene;
76 std::string ncbi_tax_id;
77 std::string tax_name;
78 std::string protein_existence;
79 std::string sequence_version;
80 std::string entry_version;
81 std::string sequence;
82 std::vector<UniProtFeature> features;
83 std::vector<UniProtIsoform> isoforms;
84 };
85
100 {
101 public:
104
106 ~UniProtXMLFile() override;
107
117 void load(const std::string& filename, std::vector<UniProtEntry>& entries);
118
132 void loadStreaming(const std::string& filename, const std::function<void(UniProtEntry&&)>& callback);
133
134 private:
137 };
138
139} // namespace OpenMS
Base class for loading and storing XML files via Xerces, with optional schema validation and transpar...
Definition XMLFile.h:40
Reads UniProtKB XML protein databases (.xml or transparently .xml.gz).
Definition UniProtXMLFile.h:100
UniProtXMLFile()
Default constructor.
void loadStreaming(const std::string &filename, const std::function< void(UniProtEntry &&)> &callback)
Stream entries one at a time via a user-supplied callback.
Definition UniProtXMLFile.cpp:24
UniProtXMLFile(const UniProtXMLFile &)=delete
UniProtXMLFile & operator=(const UniProtXMLFile &)=delete
void load(const std::string &filename, std::vector< UniProtEntry > &entries)
Load all entries from a UniProtKB XML file into memory.
Definition UniProtXMLFile.cpp:18
~UniProtXMLFile() override
Destructor.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::string protein_existence
<proteinExistence type="..."> (raw type string, e.g. "evidence at protein level")
Definition UniProtXMLFile.h:78
std::string variation
<variation> text (sequence or splice variant; first occurrence only)
Definition UniProtXMLFile.h:39
std::vector< UniProtIsoform > isoforms
isoform definitions from <comment type="alternative products">
Definition UniProtXMLFile.h:83
bool has_position
a single <position> element was present
Definition UniProtXMLFile.h:33
std::string sequence_type
<sequence type="...">: "displayed", "described", "external" or "not described"
Definition UniProtXMLFile.h:56
std::string entry_version
<entry version="...">
Definition UniProtXMLFile.h:80
std::string description
feature/@description (raw, before any cleanup)
Definition UniProtXMLFile.h:31
int position
1-based position (0 = unknown / absent)
Definition UniProtXMLFile.h:35
std::string tax_name
<organism>/<name type="scientific">
Definition UniProtXMLFile.h:77
std::string location_sequence
<location sequence="...">: accession of the isoform the coordinates refer to; empty = the entry's can...
Definition UniProtXMLFile.h:32
std::string primary_gene
<gene>/<name type="primary"> (first occurrence)
Definition UniProtXMLFile.h:75
std::vector< std::string > alt_accessions
second and subsequent <accession> entries
Definition UniProtXMLFile.h:72
std::string type
feature/@type, e.g. "modified residue", "disulfide bond", "sequence variant"
Definition UniProtXMLFile.h:29
std::string sequence_ref
<sequence ref="...">: space-separated <feature type="splice variant"> ids
Definition UniProtXMLFile.h:57
std::string dataset
entry/@dataset, e.g. "Swiss-Prot" or "TrEMBL"
Definition UniProtXMLFile.h:70
std::string ncbi_tax_id
<organism>/<dbReference type="NCBI Taxonomy" id="...">
Definition UniProtXMLFile.h:76
bool has_range
a <begin> / <end> pair was present
Definition UniProtXMLFile.h:34
int begin
1-based range start (0 = unknown / absent)
Definition UniProtXMLFile.h:36
std::string sequence
canonical <sequence> text (whitespace stripped); isoform sequences are not stored in the XML
Definition UniProtXMLFile.h:81
std::string name
first <name> (e.g. "2" or "VEGF121"); later <name> elements are synonyms
Definition UniProtXMLFile.h:55
std::string original
<original> text (sequence or splice variant)
Definition UniProtXMLFile.h:38
int end
1-based range end (0 = unknown / absent)
Definition UniProtXMLFile.h:37
std::string sequence_version
<sequence version="...">
Definition UniProtXMLFile.h:79
std::string full_name
<protein>/<recommendedName>/<fullName> (first occurrence)
Definition UniProtXMLFile.h:74
std::string accession
first <accession> (primary id)
Definition UniProtXMLFile.h:71
std::vector< UniProtFeature > features
<feature> elements in document order
Definition UniProtXMLFile.h:82
std::string id
feature/@id, e.g. "VSP_021275" (referenced by isoform definitions)
Definition UniProtXMLFile.h:30
A single <entry> from a UniProtKB XML file, in a parser-neutral form.
Definition UniProtXMLFile.h:69
A single <feature> element from a UniProtKB XML entry.
Definition UniProtXMLFile.h:28
One <isoform> definition from <comment type="alternative products">.
Definition UniProtXMLFile.h:53