Line data Source code
1 : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 : Copyright (c) 2013-2019 The plumed team
3 : (see the PEOPLE file at the root of the distribution for a list of names)
4 :
5 : See http://www.plumed.org for more information.
6 :
7 : This file is part of plumed, version 2.
8 :
9 : plumed is free software: you can redistribute it and/or modify
10 : it under the terms of the GNU Lesser General Public License as published by
11 : the Free Software Foundation, either version 3 of the License, or
12 : (at your option) any later version.
13 :
14 : plumed is distributed in the hope that it will be useful,
15 : but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : GNU Lesser General Public License for more details.
18 :
19 : You should have received a copy of the GNU Lesser General Public License
20 : along with plumed. If not, see <http://www.gnu.org/licenses/>.
21 : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
22 : #include "MolDataClass.h"
23 : #include "Exception.h"
24 : #include "Tools.h"
25 : #include "PDB.h"
26 :
27 : namespace PLMD {
28 :
29 25 : unsigned MolDataClass::numberOfAtomsPerResidueInBackbone( const std::string& type ) {
30 25 : if( type=="protein" ) return 5;
31 0 : else if( type=="dna" ) return 6;
32 0 : else if( type=="rna" ) return 6;
33 0 : else return 0;
34 : }
35 :
36 6285 : bool MolDataClass::allowedResidue( const std::string& type, const std::string& residuename ) {
37 6285 : if( type=="protein" ) {
38 5806 : if(residuename=="ALA") return true;
39 5670 : else if(residuename=="ARG") return true;
40 5670 : else if(residuename=="ASN") return true;
41 5670 : else if(residuename=="ASP") return true;
42 5670 : else if(residuename=="CYS") return true;
43 5670 : else if(residuename=="GLN") return true;
44 5670 : else if(residuename=="GLU") return true;
45 5670 : else if(residuename=="GLY") return true;
46 5666 : else if(residuename=="HIS") return true;
47 5666 : else if(residuename=="ILE") return true;
48 5666 : else if(residuename=="LEU") return true;
49 5666 : else if(residuename=="LYS") return true;
50 5666 : else if(residuename=="MET") return true;
51 5666 : else if(residuename=="PHE") return true;
52 5666 : else if(residuename=="PRO") return true;
53 5665 : else if(residuename=="SER") return true;
54 5661 : else if(residuename=="THR") return true;
55 5661 : else if(residuename=="TRP") return true;
56 5657 : else if(residuename=="TYR") return true;
57 5657 : else if(residuename=="VAL") return true;
58 : // Terminal groups
59 473 : else if(residuename=="ACE") return true;
60 473 : else if(residuename=="NME") return true;
61 473 : else if(residuename=="NH2") return true;
62 : // Alternative residue names in common force fiels
63 473 : else if(residuename=="GLH") return true; // neutral GLU
64 473 : else if(residuename=="ASH") return true; // neutral ASP
65 473 : else if(residuename=="HID") return true; // HIS-D amber
66 473 : else if(residuename=="HSD") return true; // HIS-D charmm
67 473 : else if(residuename=="HIE") return true; // HIS-E amber
68 473 : else if(residuename=="HSE") return true; // HIS-E charmm
69 473 : else if(residuename=="HIP") return true; // HIS-P amber
70 473 : else if(residuename=="HSP") return true; // HIS-P charmm
71 473 : else return false;
72 479 : } else if( type=="dna" ) {
73 6 : if(residuename=="A") return true;
74 6 : else if(residuename=="A5") return true;
75 6 : else if(residuename=="A3") return true;
76 6 : else if(residuename=="AN") return true;
77 6 : else if(residuename=="G") return true;
78 6 : else if(residuename=="G5") return true;
79 6 : else if(residuename=="G3") return true;
80 6 : else if(residuename=="GN") return true;
81 6 : else if(residuename=="T") return true;
82 2 : else if(residuename=="T5") return true;
83 2 : else if(residuename=="T3") return true;
84 2 : else if(residuename=="TN") return true;
85 2 : else if(residuename=="C") return true;
86 2 : else if(residuename=="C5") return true;
87 2 : else if(residuename=="C3") return true;
88 2 : else if(residuename=="CN") return true;
89 2 : else if(residuename=="DA") return true;
90 2 : else if(residuename=="DA5") return true;
91 2 : else if(residuename=="DA3") return true;
92 2 : else if(residuename=="DAN") return true;
93 2 : else if(residuename=="DG") return true;
94 1 : else if(residuename=="DG5") return true;
95 1 : else if(residuename=="DG3") return true;
96 1 : else if(residuename=="DGN") return true;
97 1 : else if(residuename=="DT") return true;
98 1 : else if(residuename=="DT5") return true;
99 1 : else if(residuename=="DT3") return true;
100 1 : else if(residuename=="DTN") return true;
101 1 : else if(residuename=="DC") return true;
102 0 : else if(residuename=="DC5") return true;
103 0 : else if(residuename=="DC3") return true;
104 0 : else if(residuename=="DCN") return true;
105 0 : else return false;
106 473 : } else if( type=="rna" ) {
107 473 : if(residuename=="A") return true;
108 416 : else if(residuename=="A5") return true;
109 416 : else if(residuename=="A3") return true;
110 416 : else if(residuename=="AN") return true;
111 416 : else if(residuename=="G") return true;
112 394 : else if(residuename=="G5") return true;
113 390 : else if(residuename=="G3") return true;
114 390 : else if(residuename=="GN") return true;
115 390 : else if(residuename=="U") return true;
116 368 : else if(residuename=="U5") return true;
117 368 : else if(residuename=="U3") return true;
118 368 : else if(residuename=="UN") return true;
119 368 : else if(residuename=="C") return true;
120 353 : else if(residuename=="C5") return true;
121 353 : else if(residuename=="C3") return true;
122 349 : else if(residuename=="CN") return true;
123 349 : else if(residuename=="RA") return true;
124 241 : else if(residuename=="RA5") return true;
125 241 : else if(residuename=="RA3") return true;
126 241 : else if(residuename=="RAN") return true;
127 241 : else if(residuename=="RG") return true;
128 189 : else if(residuename=="RG5") return true;
129 189 : else if(residuename=="RG3") return true;
130 185 : else if(residuename=="RGN") return true;
131 185 : else if(residuename=="RU") return true;
132 85 : else if(residuename=="RU5") return true;
133 85 : else if(residuename=="RU3") return true;
134 85 : else if(residuename=="RUN") return true;
135 85 : else if(residuename=="RC") return true;
136 13 : else if(residuename=="RC5") return true;
137 9 : else if(residuename=="RC3") return true;
138 9 : else if(residuename=="RCN") return true;
139 6 : else return false;
140 : }
141 : return false;
142 : }
143 :
144 2652 : void MolDataClass::getBackboneForResidue( const std::string& type, const unsigned& residuenum, const PDB& mypdb, std::vector<AtomNumber>& atoms ) {
145 2652 : std::string residuename=mypdb.getResidueName( residuenum );
146 2652 : plumed_massert( MolDataClass::allowedResidue( type, residuename ), "residue " + residuename + " unrecognized for molecule type " + type );
147 2652 : if( type=="protein" ) {
148 2652 : if( residuename=="GLY") {
149 0 : atoms.resize(5);
150 0 : atoms[0]=mypdb.getNamedAtomFromResidue("N",residuenum);
151 0 : atoms[1]=mypdb.getNamedAtomFromResidue("CA",residuenum);
152 0 : atoms[2]=mypdb.getNamedAtomFromResidue("HA1",residuenum);
153 0 : atoms[3]=mypdb.getNamedAtomFromResidue("C",residuenum);
154 0 : atoms[4]=mypdb.getNamedAtomFromResidue("O",residuenum);
155 2652 : } else if( residuename=="ACE") {
156 0 : atoms.resize(1);
157 0 : atoms[0]=mypdb.getNamedAtomFromResidue("C",residuenum);
158 5304 : } else if( residuename=="NME"||residuename=="NH2") {
159 0 : atoms.resize(1);
160 0 : atoms[0]=mypdb.getNamedAtomFromResidue("N",residuenum);
161 : } else {
162 2652 : atoms.resize(5);
163 7956 : atoms[0]=mypdb.getNamedAtomFromResidue("N",residuenum);
164 7956 : atoms[1]=mypdb.getNamedAtomFromResidue("CA",residuenum);
165 7956 : atoms[2]=mypdb.getNamedAtomFromResidue("CB",residuenum);
166 7956 : atoms[3]=mypdb.getNamedAtomFromResidue("C",residuenum);
167 7956 : atoms[4]=mypdb.getNamedAtomFromResidue("O",residuenum);
168 : }
169 0 : } else if( type=="dna" || type=="rna" ) {
170 0 : atoms.resize(6);
171 0 : atoms[0]=mypdb.getNamedAtomFromResidue("P",residuenum);
172 0 : atoms[1]=mypdb.getNamedAtomFromResidue("O5\'",residuenum);
173 0 : atoms[2]=mypdb.getNamedAtomFromResidue("C5\'",residuenum);
174 0 : atoms[3]=mypdb.getNamedAtomFromResidue("C4\'",residuenum);
175 0 : atoms[4]=mypdb.getNamedAtomFromResidue("C3\'",residuenum);
176 0 : atoms[5]=mypdb.getNamedAtomFromResidue("O3\'",residuenum);
177 : }
178 : else {
179 0 : plumed_merror(type + " is not a valid molecule type");
180 : }
181 2652 : }
182 :
183 3335 : bool MolDataClass::isTerminalGroup( const std::string& type, const std::string& residuename ) {
184 3335 : if( type=="protein" ) {
185 3335 : if( residuename=="ACE" ) return true;
186 3008 : else if( residuename=="NME" ) return true;
187 2681 : else if( residuename=="NH2" ) return true;
188 2681 : else return false;
189 : } else {
190 0 : plumed_merror(type + " is not a valid molecule type");
191 : }
192 : return false;
193 : }
194 :
195 502 : void MolDataClass::specialSymbol( const std::string& type, const std::string& symbol, const PDB& mypdb, std::vector<AtomNumber>& numbers ) {
196 724 : if(type=="protein" || type=="rna" || type=="dna") {
197 : // symbol should be something like
198 : // phi-123 i.e. phi torsion of residue 123 of first chain
199 : // psi-A321 i.e. psi torsion of residue 321 of chain A
200 502 : numbers.resize(0);
201 : std::size_t dash=symbol.find_first_of('-');
202 502 : std::size_t firstnum=symbol.find_first_of("0123456789",dash+1);
203 502 : std::string name=symbol.substr(0,dash);
204 : unsigned resnum;
205 : std::string resname;
206 : std::string chainid;
207 502 : if(firstnum==dash+1) {
208 976 : Tools::convert( symbol.substr(dash+1), resnum );
209 : chainid="*"; // this is going to match the first chain
210 : } else {
211 : // if chain id is provided:
212 28 : Tools::convert( symbol.substr(firstnum), resnum );
213 28 : chainid=symbol.substr(dash+1,firstnum-(dash+1)); // this is going to match the proper chain
214 : }
215 1004 : resname= mypdb.getResidueName(resnum,chainid);
216 502 : Tools::stripLeadingAndTrailingBlanks(resname);
217 1004 : if(allowedResidue("protein",resname)) {
218 58 : if( name=="phi" && !isTerminalGroup("protein",resname) ) {
219 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C",resnum-1,chainid));
220 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N",resnum,chainid));
221 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CA",resnum,chainid));
222 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C",resnum,chainid));
223 54 : } else if( name=="psi" && !isTerminalGroup("protein",resname) ) {
224 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N",resnum,chainid));
225 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CA",resnum,chainid));
226 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C",resnum,chainid));
227 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N",resnum+1,chainid));
228 0 : } else if( name=="omega" && !isTerminalGroup("protein",resname) ) {
229 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CA",resnum,chainid));
230 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C",resnum,chainid));
231 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N",resnum+1,chainid));
232 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CA",resnum+1,chainid));
233 0 : } else if( name=="chi1" && !isTerminalGroup("protein",resname) ) {
234 0 : if ( resname=="GLY" || resname=="ALA" ) plumed_merror("chi-1 is not defined for Alanine and Glycine");
235 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N",resnum,chainid));
236 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CA",resnum,chainid));
237 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CB",resnum,chainid));
238 0 : if(resname=="ILE"||resname=="VAL")
239 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CG1",resnum,chainid));
240 0 : else if(resname=="CYS")
241 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("SG",resnum,chainid));
242 0 : else if(resname=="THR")
243 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("OG1",resnum,chainid));
244 0 : else if(resname=="SER")
245 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("OG",resnum,chainid));
246 : else
247 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("CG",resnum,chainid));
248 0 : } else numbers.push_back(mypdb.getNamedAtomFromResidueAndChain(name,resnum,chainid));
249 1419 : } else if( allowedResidue("rna",resname) || allowedResidue("dna",resname)) {
250 : std::string basetype;
251 473 : if(resname.find_first_of("A")!=std::string::npos) basetype+="A";
252 473 : if(resname.find_first_of("U")!=std::string::npos) basetype+="U";
253 473 : if(resname.find_first_of("T")!=std::string::npos) basetype+="T";
254 473 : if(resname.find_first_of("C")!=std::string::npos) basetype+="C";
255 473 : if(resname.find_first_of("G")!=std::string::npos) basetype+="G";
256 473 : plumed_massert(basetype.length()==1,"cannot find type of rna/dna residue "+resname+" "+basetype);
257 473 : if( name=="chi" ) {
258 99 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4\'",resnum,chainid));
259 99 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C1\'",resnum,chainid));
260 97 : if(basetype=="T" || basetype=="U" || basetype=="C") {
261 24 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N1",resnum,chainid));
262 24 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2",resnum,chainid));
263 47 : } else if(basetype=="G" || basetype=="A") {
264 75 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N9",resnum,chainid));
265 75 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
266 0 : } else plumed_error();
267 440 : } else if( name=="alpha" ) {
268 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O3\'",resnum-1,chainid));
269 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("P",resnum,chainid));
270 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O5\'",resnum,chainid));
271 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5\'",resnum,chainid));
272 433 : } else if( name=="beta" ) {
273 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("P",resnum,chainid));
274 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O5\'",resnum,chainid));
275 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5\'",resnum,chainid));
276 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
277 426 : } else if( name=="gamma" ) {
278 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O5\'",resnum,chainid));
279 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5\'",resnum,chainid));
280 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
281 81 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
282 399 : } else if( name=="delta" ) {
283 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5\'",resnum,chainid));
284 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
285 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
286 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O3\'",resnum,chainid));
287 398 : } else if( name=="epsilon" ) {
288 24 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
289 24 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
290 24 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O3\'",resnum,chainid));
291 24 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("P",resnum+1,chainid));
292 390 : } else if( name=="zeta" ) {
293 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
294 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O3\'",resnum,chainid));
295 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("P",resnum+1,chainid));
296 21 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O5\'",resnum+1,chainid));
297 383 : } else if( name=="v0" ) {
298 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
299 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4\'",resnum,chainid));
300 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C1\'",resnum,chainid));
301 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2\'",resnum,chainid));
302 380 : } else if( name=="v1" ) {
303 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4\'",resnum,chainid));
304 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C1\'",resnum,chainid));
305 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2\'",resnum,chainid));
306 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
307 377 : } else if( name=="v2" ) {
308 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C1\'",resnum,chainid));
309 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2\'",resnum,chainid));
310 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
311 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
312 374 : } else if( name=="v3" ) {
313 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2\'",resnum,chainid));
314 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
315 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
316 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4\'",resnum,chainid));
317 371 : } else if( name=="v4" ) {
318 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
319 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
320 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4\'",resnum,chainid));
321 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C1\'",resnum,chainid));
322 368 : } else if( name=="back" ) {
323 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("P",resnum,chainid));
324 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O5\'",resnum,chainid));
325 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5\'",resnum,chainid));
326 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
327 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
328 3 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O3\'",resnum,chainid));
329 367 : } else if( name=="sugar" ) {
330 156 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4\'",resnum,chainid));
331 156 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4\'",resnum,chainid));
332 156 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C1\'",resnum,chainid));
333 156 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2\'",resnum,chainid));
334 156 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C3\'",resnum,chainid));
335 315 : } else if( name=="base" ) {
336 25 : if(basetype=="C") {
337 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N1",resnum,chainid));
338 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2",resnum,chainid));
339 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O2",resnum,chainid));
340 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N3",resnum,chainid));
341 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
342 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N4",resnum,chainid));
343 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5",resnum,chainid));
344 27 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C6",resnum,chainid));
345 16 : } else if(basetype=="U") {
346 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N1",resnum,chainid));
347 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2",resnum,chainid));
348 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O2",resnum,chainid));
349 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N3",resnum,chainid));
350 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
351 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4",resnum,chainid));
352 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5",resnum,chainid));
353 6 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C6",resnum,chainid));
354 14 : } else if(basetype=="T") {
355 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N1",resnum,chainid));
356 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2",resnum,chainid));
357 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O2",resnum,chainid));
358 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N3",resnum,chainid));
359 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
360 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O4",resnum,chainid));
361 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5",resnum,chainid));
362 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C7",resnum,chainid));
363 0 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C6",resnum,chainid));
364 14 : } else if(basetype=="G") {
365 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N9",resnum,chainid));
366 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
367 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N3",resnum,chainid));
368 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2",resnum,chainid));
369 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N2",resnum,chainid));
370 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N1",resnum,chainid));
371 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C6",resnum,chainid));
372 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("O6",resnum,chainid));
373 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5",resnum,chainid));
374 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N7",resnum,chainid));
375 9 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C8",resnum,chainid));
376 11 : } else if(basetype=="A") {
377 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N9",resnum,chainid));
378 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
379 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N1",resnum,chainid));
380 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2",resnum,chainid));
381 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N3",resnum,chainid));
382 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C6",resnum,chainid));
383 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N6",resnum,chainid));
384 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C5",resnum,chainid));
385 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("N7",resnum,chainid));
386 33 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C8",resnum,chainid));
387 0 : } else plumed_error();
388 290 : } else if( name=="lcs" ) {
389 852 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C2",resnum,chainid));
390 752 : if(basetype=="T" || basetype=="U" || basetype=="C") {
391 444 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
392 444 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C6",resnum,chainid));
393 216 : } else if(basetype=="G" || basetype=="A") {
394 408 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C6",resnum,chainid));
395 408 : numbers.push_back(mypdb.getNamedAtomFromResidueAndChain("C4",resnum,chainid));
396 0 : } else plumed_error();
397 12 : } else numbers.push_back(mypdb.getNamedAtomFromResidueAndChain(name,resnum,chainid));
398 : }
399 : }
400 : else {
401 0 : plumed_merror(type + " is not a valid molecule type");
402 : }
403 502 : }
404 :
405 : }
|