-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProFormaParser.h
38 lines (27 loc) · 1.24 KB
/
ProFormaParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef PROFORMA_PARSER_H
#define PROFORMA_PARSER_H
#include <string>
#include <vector>
#include <unordered_map>
#include <stdexcept>
#include "ProFormaTerm.h" // You would need to include the header for ProFormaTerm
namespace TopDownProteomics::ProForma {
class ProFormaParser {
public:
ProFormaParser() = default;
ProFormaTerm ParseString(const std::string& proFormaString);
private:
void HandleGlobalModification(
std::unordered_map<std::string, ProFormaTagGroup>*& tagGroups,
std::vector<ProFormaGlobalModification>*& globalModifications,
std::string& sequence, int startRange, int endRange,
const std::string& tagText);
void ProcessTag(std::string tag, int startIndex, int index, bool inSequenceAmbiguity,
std::vector<ProFormaTag>*& tags, std::unordered_map<std::string, ProFormaTagGroup>*& tagGroups);
std::vector<ProFormaDescriptor>* ProcessTag(std::string tag, int startIndex, int index,
std::unordered_map<std::string, ProFormaTagGroup>*& tagGroups);
std::tuple<ProFormaKey, ProFormaEvidenceType, std::string, std::string, double>
ParseDescriptor(const std::string& text);
};
}
#endif // PROFORMA_PARSER_H