-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAminoAcid.cpp
More file actions
37 lines (34 loc) · 763 Bytes
/
AminoAcid.cpp
File metadata and controls
37 lines (34 loc) · 763 Bytes
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
#include "AminoAcid.h"
AminoAcid::AminoAcid(std::vector<std::string>&& aaInfo) {
if (aaInfo.size() == 0) {
return;
}
resIdx = std::stoi(aaInfo.front().substr(22, 4));
threeAA = aaInfo.front().substr(17, 3);
oneAA = threeToOneAA[threeAA];
for (auto&& line : aaInfo) {
atoms.emplace_back(std::move(line));
}
}
std::unordered_map<std::string, char> AminoAcid::threeToOneAA{
{ "ALA", 'A' },
{ "CYS", 'C' },
{ "ASP", 'D' },
{ "GLU", 'E' },
{ "PHE", 'F' },
{ "GLY", 'G' },
{ "HIS", 'H' },
{ "ILE", 'I' },
{ "LYS", 'K' },
{ "LEU", 'L' },
{ "MET", 'M' },
{ "ASN", 'N' },
{ "PRO", 'P' },
{ "GLN", 'Q' },
{ "ARG", 'R' },
{ "SER", 'S' },
{ "THR", 'T' },
{ "VAL", 'V' },
{ "TRP", 'W' },
{ "TYR", 'Y' },
};