In [1]:
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
from sys import stdout
import pandas as pd

In [2]:
# real test case

In [ ]:
def compute_dis(pos1, pos2):
    dis = pos1 - pos2
    dis = dis.value_in_unit(nanometer)
    r = (dis[0]**2 + dis[1]**2 + dis[2]**2)**0.5
    return r

In [71]:
# AWSEM_xml = "/Users/weilu/openmmawsem/awsem_heme.xml"

pre = "/Users/weilu/Research/server/jun_week1_2020/debug_xun_heme/ligand_xml_l/"
AWSEM_xml = f"{pre}/awsem.xml"
AWSEM_xml = f"{pre}/awsem_test.xml"
fileLocation = f"{pre}/crystal_structure-openmmawsem.pdb"
pdb = PDBFile(fileLocation)
# pdb = PDBFile("/Users/weilu/Research/server/jan_2020/include_small_molecular/my_ABCDE_with_ligand/my_ABCDE_with_ligand-openmmawsem.pdb")

In [29]:


In [43]:
res_list = list(pdb.topology.residues())
atom_list = list(pdb.topology.atoms())
protein_resNames = ["NGP", "IGL", "IPR", "NTER", "CTER"]
DNA_resNames = ["DA", "DC", "DT", "DG"]
protein_res_list = []
DNA_res_list = []
ligand_res_list = []
for res in res_list:
    if res.name in protein_resNames:
        protein_res_list.append(res)
    elif res.name in DNA_resNames:
        DNA_res_list.append(res)
    else:
        ligand_res_list.append(res)

protein_atom_list = []
DNA_atom_list = []
ligand_atom_list = []
for atom in atom_list:
    if atom.residue.name in protein_resNames:
        protein_atom_list.append(atom)
    elif atom.residue.name in DNA_resNames:
        DNA_atom_list.append(atom)
    else:
        ligand_atom_list.append(atom)


forcefield = ForceField(AWSEM_xml)
[templates, names] = forcefield.generateTemplatesForUnmatchedResidues(pdb.topology)
for a in templates:
    for a1 in a.atoms:
        if a1.element.symbol == "C":
            a1.type = "CA"
        else:
            a1.type = a1.element.symbol
        # a1.type = a1.element.symbol
    forcefield.registerResidueTemplate(a)
system = forcefield.createSystem(pdb.topology)

info = []
for ligand_atom in ligand_atom_list:
    pos1 = pdb.positions[ligand_atom.index]
    for protein_atom in protein_atom_list:
        if protein_atom.name != "CB":
            continue
        protein_chain = protein_atom.residue.chain.id
        pos2 = pdb.positions[protein_atom.index]
        r = compute_dis(pos1, pos2)
        if r < 0.65:
            # print(ligand_atom, protein_atom, "in contact", r)
            info.append([ligand_atom.index, protein_atom.index, r, protein_chain, ligand_atom.name, protein_atom.name])


---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-43-3f1460dc24c2> in <module>()
     36         # a1.type = a1.element.symbol
     37     forcefield.registerResidueTemplate(a)
---> 38 system = forcefield.createSystem(pdb.topology)
     39 
     40 info = []

~/anaconda/lib/python3.6/site-packages/simtk/openmm/app/forcefield.py in createSystem(self, topology, nonbondedMethod, nonbondedCutoff, constraints, rigidWater, removeCMMotion, hydrogenMass, residueTemplates, ignoreExternalBonds, switchDistance, flexibleConstraints, **args)
   1160                 msg  = "Could not find typename '%s' for atom '%s' in list of known atom types.\n" % (typename, str(atom))
   1161                 msg += "Known atom types are: %s" % str(self._atomTypes.keys())
-> 1162                 raise Exception(msg)
   1163 
   1164             # Add the particle to the OpenMM system.

Exception: Could not find typename 'Fe' for atom '<Atom 807 (FE) of chain 1 residue 131 (HEM)>' in list of known atom types.
Known atom types are: dict_keys(['N', 'H', 'CA', 'C', 'O', 'CB', 'Ni', 'CAA', 'CAB', 'CAC', 'CAD', 'NA', 'CBA', 'CBB', 'CBC', 'CBD', 'NB', 'CGA', 'CGD', 'ND', 'CHA', 'CHB', 'CHC', 'CHD', 'CMA', 'CMB', 'CMC', 'CMD', 'C1A', 'C1B', 'C1C', 'C1D', 'O1A', 'O1D', 'C2A', 'C2B', 'C2C', 'C2D', 'O2A', 'O2D', 'C3A', 'C3B', 'C3C', 'C3D', 'C4A', 'C4B', 'C4C', 'C4D', 'NC'])

In [31]:
data = pd.DataFrame(info, columns=["Ligand_atom_index", "Protein_atom_index", "r", "Protein_chain", "Ligand_atom_name", "Protein_atom_name"])

In [72]:
forcefield = ForceField(AWSEM_xml)
[templates, names] = forcefield.generateTemplatesForUnmatchedResidues(pdb.topology)

In [73]:
for a in templates:
    for a1 in a.atoms:
        a1.type = a1.name
        print(a1.type, a1.element)
        # a1.type = a1.element.symbol
    forcefield.registerResidueTemplate(a)


CAA <Element carbon>
CAB <Element carbon>
CAC <Element carbon>
CAD <Element carbon>
NA <Element nitrogen>
CBA <Element carbon>
CBB <Element carbon>
CBC <Element carbon>
CBD <Element carbon>
NB <Element nitrogen>
CGA <Element carbon>
CGD <Element carbon>
ND <Element nitrogen>
CHA <Element carbon>
CHB <Element carbon>
CHC <Element carbon>
CHD <Element carbon>
CMA <Element carbon>
CMB <Element carbon>
CMC <Element carbon>
CMD <Element carbon>
C1A <Element carbon>
C1B <Element carbon>
C1C <Element carbon>
C1D <Element carbon>
O1A <Element oxygen>
O1D <Element oxygen>
C2A <Element carbon>
C2B <Element carbon>
C2C <Element carbon>
C2D <Element carbon>
O2A <Element oxygen>
O2D <Element oxygen>
C3A <Element carbon>
C3B <Element carbon>
C3C <Element carbon>
C3D <Element carbon>
C4A <Element carbon>
C4B <Element carbon>
C4C <Element carbon>
C4D <Element carbon>
NC <Element nitrogen>
FE <Element iron>

In [74]:
system = forcefield.createSystem(pdb.topology)

In [75]:
a1.name


Out[75]:
'FE'

In [76]:
b =a1.element

In [77]:
b.mass


Out[77]:
Quantity(value=55.8452, unit=dalton)

In [78]:
b.name


Out[78]:
'iron'

In [41]:
b.mass


Out[41]:
Quantity(value=55.8452, unit=dalton)

In [36]:
a1.parameters


Out[36]:
{}

In [37]:
a1.type


Out[37]:
'Fe'

In [ ]:
a1.

In [33]:
templates


Out[33]:
[<simtk.openmm.app.forcefield.ForceField._TemplateData at 0x115a8ff98>]

In [79]:
for i in range(810):
    a = system.getParticleMass(i)
    print(i, a)


0 12.0 Da
1 0.0 Da
2 16.0 Da
3 12.0 Da
4 0.0 Da
5 0.0 Da
6 12.0 Da
7 0.0 Da
8 16.0 Da
9 0.0 Da
10 0.0 Da
11 12.0 Da
12 0.0 Da
13 16.0 Da
14 12.0 Da
15 0.0 Da
16 0.0 Da
17 12.0 Da
18 0.0 Da
19 16.0 Da
20 12.0 Da
21 0.0 Da
22 12.0 Da
23 0.0 Da
24 16.0 Da
25 12.0 Da
26 0.0 Da
27 0.0 Da
28 12.0 Da
29 0.0 Da
30 16.0 Da
31 12.0 Da
32 0.0 Da
33 0.0 Da
34 12.0 Da
35 0.0 Da
36 16.0 Da
37 12.0 Da
38 0.0 Da
39 0.0 Da
40 12.0 Da
41 0.0 Da
42 16.0 Da
43 12.0 Da
44 0.0 Da
45 0.0 Da
46 12.0 Da
47 0.0 Da
48 16.0 Da
49 12.0 Da
50 0.0 Da
51 0.0 Da
52 12.0 Da
53 0.0 Da
54 16.0 Da
55 12.0 Da
56 0.0 Da
57 0.0 Da
58 12.0 Da
59 0.0 Da
60 16.0 Da
61 12.0 Da
62 0.0 Da
63 0.0 Da
64 12.0 Da
65 0.0 Da
66 16.0 Da
67 12.0 Da
68 0.0 Da
69 0.0 Da
70 12.0 Da
71 0.0 Da
72 16.0 Da
73 12.0 Da
74 0.0 Da
75 0.0 Da
76 12.0 Da
77 0.0 Da
78 16.0 Da
79 12.0 Da
80 0.0 Da
81 0.0 Da
82 12.0 Da
83 0.0 Da
84 16.0 Da
85 0.0 Da
86 0.0 Da
87 12.0 Da
88 0.0 Da
89 16.0 Da
90 12.0 Da
91 0.0 Da
92 0.0 Da
93 12.0 Da
94 0.0 Da
95 16.0 Da
96 12.0 Da
97 0.0 Da
98 0.0 Da
99 12.0 Da
100 0.0 Da
101 16.0 Da
102 12.0 Da
103 0.0 Da
104 0.0 Da
105 12.0 Da
106 0.0 Da
107 16.0 Da
108 12.0 Da
109 0.0 Da
110 0.0 Da
111 12.0 Da
112 0.0 Da
113 16.0 Da
114 0.0 Da
115 0.0 Da
116 12.0 Da
117 0.0 Da
118 16.0 Da
119 12.0 Da
120 0.0 Da
121 0.0 Da
122 12.0 Da
123 0.0 Da
124 16.0 Da
125 12.0 Da
126 0.0 Da
127 0.0 Da
128 12.0 Da
129 0.0 Da
130 16.0 Da
131 12.0 Da
132 0.0 Da
133 0.0 Da
134 12.0 Da
135 0.0 Da
136 16.0 Da
137 0.0 Da
138 0.0 Da
139 12.0 Da
140 0.0 Da
141 16.0 Da
142 12.0 Da
143 0.0 Da
144 0.0 Da
145 12.0 Da
146 0.0 Da
147 16.0 Da
148 12.0 Da
149 0.0 Da
150 0.0 Da
151 12.0 Da
152 0.0 Da
153 16.0 Da
154 12.0 Da
155 0.0 Da
156 0.0 Da
157 12.0 Da
158 0.0 Da
159 16.0 Da
160 12.0 Da
161 0.0 Da
162 0.0 Da
163 12.0 Da
164 0.0 Da
165 16.0 Da
166 12.0 Da
167 0.0 Da
168 0.0 Da
169 12.0 Da
170 0.0 Da
171 16.0 Da
172 12.0 Da
173 0.0 Da
174 0.0 Da
175 12.0 Da
176 0.0 Da
177 16.0 Da
178 12.0 Da
179 0.0 Da
180 0.0 Da
181 12.0 Da
182 0.0 Da
183 16.0 Da
184 0.0 Da
185 0.0 Da
186 12.0 Da
187 0.0 Da
188 16.0 Da
189 12.0 Da
190 0.0 Da
191 0.0 Da
192 12.0 Da
193 0.0 Da
194 16.0 Da
195 12.0 Da
196 0.0 Da
197 0.0 Da
198 12.0 Da
199 0.0 Da
200 16.0 Da
201 12.0 Da
202 0.0 Da
203 0.0 Da
204 12.0 Da
205 0.0 Da
206 16.0 Da
207 12.0 Da
208 0.0 Da
209 0.0 Da
210 12.0 Da
211 0.0 Da
212 16.0 Da
213 12.0 Da
214 0.0 Da
215 0.0 Da
216 12.0 Da
217 0.0 Da
218 16.0 Da
219 12.0 Da
220 0.0 Da
221 0.0 Da
222 12.0 Da
223 0.0 Da
224 16.0 Da
225 12.0 Da
226 0.0 Da
227 0.0 Da
228 12.0 Da
229 0.0 Da
230 16.0 Da
231 12.0 Da
232 0.0 Da
233 0.0 Da
234 12.0 Da
235 0.0 Da
236 16.0 Da
237 12.0 Da
238 0.0 Da
239 0.0 Da
240 12.0 Da
241 0.0 Da
242 16.0 Da
243 12.0 Da
244 0.0 Da
245 0.0 Da
246 12.0 Da
247 0.0 Da
248 16.0 Da
249 12.0 Da
250 0.0 Da
251 0.0 Da
252 12.0 Da
253 0.0 Da
254 16.0 Da
255 12.0 Da
256 0.0 Da
257 0.0 Da
258 12.0 Da
259 0.0 Da
260 16.0 Da
261 12.0 Da
262 0.0 Da
263 0.0 Da
264 12.0 Da
265 0.0 Da
266 16.0 Da
267 12.0 Da
268 0.0 Da
269 0.0 Da
270 12.0 Da
271 0.0 Da
272 16.0 Da
273 12.0 Da
274 0.0 Da
275 0.0 Da
276 12.0 Da
277 0.0 Da
278 16.0 Da
279 12.0 Da
280 0.0 Da
281 0.0 Da
282 12.0 Da
283 0.0 Da
284 16.0 Da
285 12.0 Da
286 0.0 Da
287 0.0 Da
288 12.0 Da
289 0.0 Da
290 16.0 Da
291 12.0 Da
292 0.0 Da
293 0.0 Da
294 12.0 Da
295 0.0 Da
296 16.0 Da
297 12.0 Da
298 0.0 Da
299 0.0 Da
300 12.0 Da
301 0.0 Da
302 16.0 Da
303 12.0 Da
304 0.0 Da
305 0.0 Da
306 12.0 Da
307 0.0 Da
308 16.0 Da
309 0.0 Da
310 0.0 Da
311 12.0 Da
312 0.0 Da
313 16.0 Da
314 12.0 Da
315 0.0 Da
316 0.0 Da
317 12.0 Da
318 0.0 Da
319 16.0 Da
320 0.0 Da
321 0.0 Da
322 12.0 Da
323 0.0 Da
324 16.0 Da
325 12.0 Da
326 0.0 Da
327 0.0 Da
328 12.0 Da
329 0.0 Da
330 16.0 Da
331 12.0 Da
332 0.0 Da
333 0.0 Da
334 12.0 Da
335 0.0 Da
336 16.0 Da
337 12.0 Da
338 0.0 Da
339 0.0 Da
340 12.0 Da
341 0.0 Da
342 16.0 Da
343 0.0 Da
344 12.0 Da
345 0.0 Da
346 16.0 Da
347 12.0 Da
348 0.0 Da
349 0.0 Da
350 12.0 Da
351 0.0 Da
352 16.0 Da
353 0.0 Da
354 0.0 Da
355 12.0 Da
356 0.0 Da
357 16.0 Da
358 12.0 Da
359 0.0 Da
360 0.0 Da
361 12.0 Da
362 0.0 Da
363 16.0 Da
364 12.0 Da
365 0.0 Da
366 0.0 Da
367 12.0 Da
368 0.0 Da
369 16.0 Da
370 12.0 Da
371 0.0 Da
372 0.0 Da
373 12.0 Da
374 0.0 Da
375 16.0 Da
376 12.0 Da
377 0.0 Da
378 0.0 Da
379 12.0 Da
380 0.0 Da
381 16.0 Da
382 12.0 Da
383 0.0 Da
384 0.0 Da
385 12.0 Da
386 0.0 Da
387 16.0 Da
388 0.0 Da
389 0.0 Da
390 12.0 Da
391 0.0 Da
392 16.0 Da
393 12.0 Da
394 0.0 Da
395 0.0 Da
396 12.0 Da
397 0.0 Da
398 16.0 Da
399 12.0 Da
400 0.0 Da
401 0.0 Da
402 12.0 Da
403 0.0 Da
404 16.0 Da
405 12.0 Da
406 0.0 Da
407 0.0 Da
408 12.0 Da
409 0.0 Da
410 16.0 Da
411 12.0 Da
412 0.0 Da
413 0.0 Da
414 12.0 Da
415 0.0 Da
416 16.0 Da
417 12.0 Da
418 0.0 Da
419 0.0 Da
420 12.0 Da
421 0.0 Da
422 16.0 Da
423 12.0 Da
424 0.0 Da
425 0.0 Da
426 12.0 Da
427 0.0 Da
428 16.0 Da
429 12.0 Da
430 0.0 Da
431 12.0 Da
432 0.0 Da
433 16.0 Da
434 12.0 Da
435 0.0 Da
436 0.0 Da
437 12.0 Da
438 0.0 Da
439 16.0 Da
440 12.0 Da
441 0.0 Da
442 0.0 Da
443 12.0 Da
444 0.0 Da
445 16.0 Da
446 12.0 Da
447 0.0 Da
448 0.0 Da
449 12.0 Da
450 0.0 Da
451 16.0 Da
452 12.0 Da
453 0.0 Da
454 0.0 Da
455 12.0 Da
456 0.0 Da
457 16.0 Da
458 12.0 Da
459 0.0 Da
460 0.0 Da
461 12.0 Da
462 0.0 Da
463 16.0 Da
464 12.0 Da
465 0.0 Da
466 0.0 Da
467 12.0 Da
468 0.0 Da
469 16.0 Da
470 12.0 Da
471 0.0 Da
472 0.0 Da
473 12.0 Da
474 0.0 Da
475 16.0 Da
476 12.0 Da
477 0.0 Da
478 0.0 Da
479 12.0 Da
480 0.0 Da
481 16.0 Da
482 12.0 Da
483 0.0 Da
484 0.0 Da
485 12.0 Da
486 0.0 Da
487 16.0 Da
488 12.0 Da
489 0.0 Da
490 0.0 Da
491 12.0 Da
492 0.0 Da
493 16.0 Da
494 0.0 Da
495 0.0 Da
496 12.0 Da
497 0.0 Da
498 16.0 Da
499 12.0 Da
500 0.0 Da
501 0.0 Da
502 12.0 Da
503 0.0 Da
504 16.0 Da
505 12.0 Da
506 0.0 Da
507 0.0 Da
508 12.0 Da
509 0.0 Da
510 16.0 Da
511 12.0 Da
512 0.0 Da
513 0.0 Da
514 12.0 Da
515 0.0 Da
516 16.0 Da
517 12.0 Da
518 0.0 Da
519 0.0 Da
520 12.0 Da
521 0.0 Da
522 16.0 Da
523 12.0 Da
524 0.0 Da
525 0.0 Da
526 12.0 Da
527 0.0 Da
528 16.0 Da
529 12.0 Da
530 0.0 Da
531 0.0 Da
532 12.0 Da
533 0.0 Da
534 16.0 Da
535 12.0 Da
536 0.0 Da
537 0.0 Da
538 12.0 Da
539 0.0 Da
540 16.0 Da
541 0.0 Da
542 0.0 Da
543 12.0 Da
544 0.0 Da
545 16.0 Da
546 12.0 Da
547 0.0 Da
548 0.0 Da
549 12.0 Da
550 0.0 Da
551 16.0 Da
552 12.0 Da
553 0.0 Da
554 0.0 Da
555 12.0 Da
556 0.0 Da
557 16.0 Da
558 12.0 Da
559 0.0 Da
560 0.0 Da
561 12.0 Da
562 0.0 Da
563 16.0 Da
564 12.0 Da
565 0.0 Da
566 0.0 Da
567 12.0 Da
568 0.0 Da
569 16.0 Da
570 12.0 Da
571 0.0 Da
572 0.0 Da
573 12.0 Da
574 0.0 Da
575 16.0 Da
576 12.0 Da
577 0.0 Da
578 0.0 Da
579 12.0 Da
580 0.0 Da
581 16.0 Da
582 12.0 Da
583 0.0 Da
584 0.0 Da
585 12.0 Da
586 0.0 Da
587 16.0 Da
588 12.0 Da
589 0.0 Da
590 0.0 Da
591 12.0 Da
592 0.0 Da
593 16.0 Da
594 12.0 Da
595 0.0 Da
596 0.0 Da
597 12.0 Da
598 0.0 Da
599 16.0 Da
600 12.0 Da
601 0.0 Da
602 0.0 Da
603 12.0 Da
604 0.0 Da
605 16.0 Da
606 12.0 Da
607 0.0 Da
608 0.0 Da
609 12.0 Da
610 0.0 Da
611 16.0 Da
612 0.0 Da
613 0.0 Da
614 12.0 Da
615 0.0 Da
616 16.0 Da
617 12.0 Da
618 0.0 Da
619 0.0 Da
620 12.0 Da
621 0.0 Da
622 16.0 Da
623 12.0 Da
624 0.0 Da
625 0.0 Da
626 12.0 Da
627 0.0 Da
628 16.0 Da
629 12.0 Da
630 0.0 Da
631 0.0 Da
632 12.0 Da
633 0.0 Da
634 16.0 Da
635 12.0 Da
636 0.0 Da
637 0.0 Da
638 12.0 Da
639 0.0 Da
640 16.0 Da
641 12.0 Da
642 0.0 Da
643 0.0 Da
644 12.0 Da
645 0.0 Da
646 16.0 Da
647 12.0 Da
648 0.0 Da
649 0.0 Da
650 12.0 Da
651 0.0 Da
652 16.0 Da
653 12.0 Da
654 0.0 Da
655 0.0 Da
656 12.0 Da
657 0.0 Da
658 16.0 Da
659 12.0 Da
660 0.0 Da
661 0.0 Da
662 12.0 Da
663 0.0 Da
664 16.0 Da
665 12.0 Da
666 0.0 Da
667 0.0 Da
668 12.0 Da
669 0.0 Da
670 16.0 Da
671 0.0 Da
672 0.0 Da
673 12.0 Da
674 0.0 Da
675 16.0 Da
676 12.0 Da
677 0.0 Da
678 0.0 Da
679 12.0 Da
680 0.0 Da
681 16.0 Da
682 12.0 Da
683 0.0 Da
684 0.0 Da
685 12.0 Da
686 0.0 Da
687 16.0 Da
688 0.0 Da
689 0.0 Da
690 12.0 Da
691 0.0 Da
692 16.0 Da
693 12.0 Da
694 0.0 Da
695 0.0 Da
696 12.0 Da
697 0.0 Da
698 16.0 Da
699 12.0 Da
700 0.0 Da
701 0.0 Da
702 12.0 Da
703 0.0 Da
704 16.0 Da
705 12.0 Da
706 0.0 Da
707 0.0 Da
708 12.0 Da
709 0.0 Da
710 16.0 Da
711 12.0 Da
712 0.0 Da
713 0.0 Da
714 12.0 Da
715 0.0 Da
716 16.0 Da
717 12.0 Da
718 0.0 Da
719 0.0 Da
720 12.0 Da
721 0.0 Da
722 16.0 Da
723 12.0 Da
724 0.0 Da
725 0.0 Da
726 12.0 Da
727 0.0 Da
728 16.0 Da
729 12.0 Da
730 0.0 Da
731 0.0 Da
732 12.0 Da
733 0.0 Da
734 16.0 Da
735 12.0 Da
736 0.0 Da
737 0.0 Da
738 12.0 Da
739 0.0 Da
740 16.0 Da
741 12.0 Da
742 0.0 Da
743 0.0 Da
744 12.0 Da
745 0.0 Da
746 16.0 Da
747 12.0 Da
748 0.0 Da
749 0.0 Da
750 12.0 Da
751 0.0 Da
752 16.0 Da
753 12.0 Da
754 0.0 Da
755 0.0 Da
756 12.0 Da
757 0.0 Da
758 16.0 Da
759 12.0 Da
760 0.0 Da
761 0.0 Da
762 12.0 Da
763 16.0 Da
764 12.0 Da
765 12.0 Da
766 12.0 Da
767 12.0 Da
768 12.0 Da
769 14.0 Da
770 12.0 Da
771 12.0 Da
772 12.0 Da
773 12.0 Da
774 14.0 Da
775 12.0 Da
776 12.0 Da
777 14.0 Da
778 12.0 Da
779 12.0 Da
780 12.0 Da
781 12.0 Da
782 12.0 Da
783 12.0 Da
784 12.0 Da
785 12.0 Da
786 12.0 Da
787 12.0 Da
788 12.0 Da
789 12.0 Da
790 16.0 Da
791 16.0 Da
792 12.0 Da
793 12.0 Da
794 12.0 Da
795 12.0 Da
796 16.0 Da
797 16.0 Da
798 12.0 Da
799 12.0 Da
800 12.0 Da
801 12.0 Da
802 12.0 Da
803 12.0 Da
804 12.0 Da
805 12.0 Da
806 14.0 Da
807 15.845 Da
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-79-fe8a681587ce> in <module>()
      1 for i in range(810):
----> 2     a = system.getParticleMass(i)
      3     print(i, a)

~/anaconda/lib/python3.6/site-packages/simtk/openmm/openmm.py in getParticleMass(self, index)
  19708             the index of the particle for which to get the mass
  19709         """
> 19710         val = _openmm.System_getParticleMass(self, index)
  19711 
  19712         val=unit.Quantity(val, unit.amu)

Exception: Assertion failure at System.cpp:55.  Index out of range

In [20]:
data


Out[20]:
Ligand_atom_index Protein_atom_index r Protein_chain Ligand_atom_name Protein_atom_name
0 765 73 0.560354 A CAA CB
1 765 90 0.453520 A CAA CB
2 765 96 0.559185 A CAA CB
3 766 108 0.516014 A CAB CB
4 766 682 0.610380 A CAB CB
... ... ... ... ... ... ...
165 807 90 0.435179 A FE CB
166 807 705 0.557864 A FE CB
167 807 723 0.617690 A FE CB
168 807 729 0.558187 A FE CB
169 807 753 0.634061 A FE CB

170 rows × 6 columns


In [26]:
AWSEM_xml = "/Users/weilu/openmmawsem/awsem_heme.xml"
pre = "/Users/weilu/Research/server/may_week3_2020/hemoglobin/setups/debug_displacement_of_N/"
fileLocation = "/Users/weilu/Research/server/may_week3_2020/hemoglobin/setups/four_chains/5x2r-openmmawsem.pdb"
fileLocation = "/Users/weilu/Research/server/may_week3_2020/hemoglobin/setups/debug_displacement_of_N/5x2r-openmmawsem.pdb"
pdb = PDBFile(fileLocation)
# pdb = PDBFile("/Users/weilu/Research/server/jan_2020/include_small_molecular/my_ABCDE_with_ligand/my_ABCDE_with_ligand-openmmawsem.pdb")

In [27]:


In [28]:
res_list = list(pdb.topology.residues())
atom_list = list(pdb.topology.atoms())
protein_resNames = ["NGP", "IGL", "IPR", "NTER", "CTER"]
DNA_resNames = ["DA", "DC", "DT", "DG"]
protein_res_list = []
DNA_res_list = []
ligand_res_list = []
for res in res_list:
    if res.name in protein_resNames:
        protein_res_list.append(res)
    elif res.name in DNA_resNames:
        DNA_res_list.append(res)
    else:
        ligand_res_list.append(res)

protein_atom_list = []
DNA_atom_list = []
ligand_atom_list = []
for atom in atom_list:
    if atom.residue.name in protein_resNames:
        protein_atom_list.append(atom)
    elif atom.residue.name in DNA_resNames:
        DNA_atom_list.append(atom)
    else:
        ligand_atom_list.append(atom)

In [29]:


In [30]:


In [31]:
data = pd.DataFrame(info, columns=["Ligand_atom_index", "Protein_atom_index", "r", "Protein_chain"])

In [32]:
data.to_csv(f"{pre}/het_protein_bonds.csv", index=False)

In [33]:
data


Out[33]:
Ligand_atom_index Protein_atom_index r Protein_chain
0 3340 353 0.567563 A
1 3340 502 0.562452 A
2 3341 330 0.646263 A
3 3341 347 0.600552 A
4 3341 496 0.586840 A
... ... ... ... ...
548 3508 2724 0.628420 D
549 3508 3046 0.585422 D
550 3509 3046 0.563507 D
551 3510 3046 0.524599 D
552 3511 3046 0.630991 D

553 rows × 4 columns


In [34]:
# data = pd.read_csv(f"{pre}/het_protein_bonds.csv")

In [35]:
res_list = list(pdb.topology.residues())
atom_list = list(pdb.topology.atoms())
protein_resNames = ["NGP", "IGL", "IPR", "NTER", "CTER"]
DNA_resNames = ["DA", "DC", "DT", "DG"]
protein_res_list = []
DNA_res_list = []
ligand_res_list = []
for res in res_list:
    if res.name in protein_resNames:
        protein_res_list.append(res)
    elif res.name in DNA_resNames:
        DNA_res_list.append(res)
    else:
        ligand_res_list.append(res)

protein_atom_list = []
DNA_atom_list = []
ligand_atom_list = []
for atom in atom_list:
    if atom.residue.name in protein_resNames:
        protein_atom_list.append(atom)
    elif atom.residue.name in DNA_resNames:
        DNA_atom_list.append(atom)
    else:
        ligand_atom_list.append(atom)
ligand_res_list


Out[35]:
[<Residue 570 (HNI) of chain 4>,
 <Residue 571 (HEM) of chain 5>,
 <Residue 572 (HEM) of chain 6>,
 <Residue 573 (HNI) of chain 7>]

In [36]:
info = []
for res in ligand_res_list:
    atoms = list(res.atoms())
    n_atoms = len(atoms)
    for i in range(n_atoms):
        atom1 = atoms[i]
        pos1 = pdb.positions[atom1.index]
        for j in range(i+1, n_atoms):
            atom2 = atoms[j]
            pos2 = pdb.positions[atom2.index]
            dis = pos1 - pos2
            dis = dis.value_in_unit(nanometer)
            r = (dis[0]**2 + dis[1]**2 + dis[2]**2)**0.5
            # print(atom1.index, atom2.index, round(r, 3))
            info.append([res.name, atom1.index, atom2.index, atom1.name, atom2.name, atom1.element.symbol, atom2.element.symbol, round(r, 3)])

data = pd.DataFrame(info, columns=["Name", "Atom1", "Atom2", "Name1", "Name2", "Symbol1", "Symbol2", "r"])
data


Out[36]:
Name Atom1 Atom2 Name1 Name2 Symbol1 Symbol2 r
0 HNI 3340 3341 NI CHA Ni C 0.336
1 HNI 3340 3342 NI CHB Ni C 0.336
2 HNI 3340 3343 NI CHC Ni C 0.335
3 HNI 3340 3344 NI CHD Ni C 0.337
4 HNI 3340 3345 NI NA Ni N 0.193
... ... ... ... ... ... ... ... ...
3607 HNI 3508 3510 CBD O1D C O 0.240
3608 HNI 3508 3511 CBD O2D C O 0.250
3609 HNI 3509 3510 CGD O1D C O 0.122
3610 HNI 3509 3511 CGD O2D C O 0.135
3611 HNI 3510 3511 O1D O2D O O 0.221

3612 rows × 8 columns


In [37]:
data.to_csv(f"{pre}/het_frag.csv", index=False)

In [ ]:


In [ ]:


In [ ]:


In [ ]:
info = []
for res in ligand_res_list:
    atoms = list(res.atoms())
    n_atoms = len(atoms)
    for i in range(n_atoms):
        atom1 = atoms[i]
        pos1 = pdb.positions[atom1.index]
        for j in range(i+1, n_atoms):
            atom2 = atoms[j]
            pos2 = pdb.positions[atom2.index]
            r = compute_dis(pos1, pos2)
            # print(atom1.index, atom2.index, round(r, 3))
            info.append([res.name, atom1.index, atom2.index, atom1.name, atom2.name, atom1.element.symbol, atom2.element.symbol, round(r, 3)])
            
            

data = pd.DataFrame(info, columns=["Name", "Atom1", "Atom2", "Name1", "Name2", "Symbol1", "Symbol2", "r"])

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [33]:
data.dtypes


Out[33]:
Ligand_atom_index       int64
Protein_atom_index      int64
r                     float64
Protein_chain          object
dtype: object

In [34]:
protein_atom_list[0]


Out[34]:
<Atom 0 (CA) of chain 0 residue 0 (NGP)>

In [23]:
res.


Out[23]:
'CLR'

In [123]:
atom.name


Out[123]:
'C18'

In [114]:
d = pdb.positions[atom.index]

In [121]:
atom = ligand_atom_list[0]

In [ ]:
atom.index

In [91]:
a = list(pdb.getTopology().bonds())

In [100]:
a = ligand_atom_list[0]

In [103]:
ligand_atoms_index_list = [atom.index for atom in ligand_atom_list]
protein_atoms_index_list = [atom.index for atom in protein_atom_list]

In [106]:
a = protein_atom_list[0]

In [108]:



Out[108]:
0

In [96]:
atom1 = a[0].atom1

In [97]:
atom1.index


Out[97]:
3548

In [98]:
atom1.id


Out[98]:
'31351'

In [128]:
pdb.getTopology()


Out[128]:
<Topology; 13 chains, 612 residues, 3760 atoms, 220 bonds>

In [4]:
forcefield = ForceField(AWSEM_xml)

In [5]:
[templates, names] = forcefield.generateTemplatesForUnmatchedResidues(pdb.topology)

In [6]:
for a in templates:
    for a1 in a.atoms:
        if a1.element.symbol == "C":
            a1.type = "CA"
        else:
            a1.type = a1.element.symbol
        # a1.type = a1.element.symbol
    forcefield.registerResidueTemplate(a)

In [7]:
system = forcefield.createSystem(pdb.topology)

In [8]:
a = templates[0]

In [61]:
names


Out[61]:
[<Residue 604 (OLC) of chain 5>, <Residue 606 (CLR) of chain 7>]

In [35]:


In [36]:



Out[36]:
[<Residue 570 (HNI) of chain 4>,
 <Residue 571 (HEM) of chain 5>,
 <Residue 572 (HEM) of chain 6>,
 <Residue 573 (HNI) of chain 7>]

In [ ]:


In [ ]:


In [15]:
positions = pdb.positions

In [46]:
atoms = list(res.atoms())

In [48]:
atom = atoms[0]

In [49]:
atom.index


Out[49]:
3548

In [68]:
atom1.name


Out[68]:
'O1'

In [69]:
atom.element.symbol


Out[69]:
'C'

In [37]:


In [82]:


In [38]:


In [39]:
data


Out[39]:
Name Atom1 Atom2 Name1 Name2 Symbol1 Symbol2 r
0 HNI 3340 3341 NI CHA Ni C 0.336
1 HNI 3340 3342 NI CHB Ni C 0.336
2 HNI 3340 3343 NI CHC Ni C 0.335
3 HNI 3340 3344 NI CHD Ni C 0.337
4 HNI 3340 3345 NI NA Ni N 0.193
... ... ... ... ... ... ... ... ...
3607 HNI 3508 3510 CBD O1D C O 0.240
3608 HNI 3508 3511 CBD O2D C O 0.250
3609 HNI 3509 3510 CGD O1D C O 0.122
3610 HNI 3509 3511 CGD O2D C O 0.135
3611 HNI 3510 3511 O1D O2D O O 0.221

3612 rows × 8 columns


In [40]:
data.to_csv(f"{pre}/het_frag.csv", index=False)

In [ ]:
for i, line in data.iterrows():
    atom1 = line["Atom1"]
    atom2 = line["Atom2"]
    r = float(line["r"])
    print(atom1, atom2, r)

In [16]:
len(positions)


Out[16]:
3760

In [52]:
pos1 = positions[3548]

In [53]:
pos2 = positions[3551]

In [54]:
(pos1[0]**2 + pos1[1]**2 + pos1[2]**2)**0.5


Out[54]:
Quantity(value=1.7304134910477322, unit=nanometer)

In [55]:
dis = pos1 - pos2
dis = dis.value_in_unit(nanometer)
r = (dis[0]**2 + dis[1]**2 + dis[2]**2)**0.5

In [56]:
r


Out[56]:
0.15375965010366024

In [17]:
res = ligand_res_list[0]

In [18]:
b = list(res.bonds())[0]

In [19]:
b.atom1


Out[19]:
<Atom 3548 (C18) of chain 5 residue 604 (OLC)>

In [20]:
list(res.bonds())


Out[20]:
[Bond(<Atom 3548 (C18) of chain 5 residue 604 (OLC)>, <Atom 3551 (C17) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3549 (C10) of chain 5 residue 604 (OLC)>, <Atom 3550 (C9) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3549 (C10) of chain 5 residue 604 (OLC)>, <Atom 3552 (C11) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3550 (C9) of chain 5 residue 604 (OLC)>, <Atom 3553 (C8) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3551 (C17) of chain 5 residue 604 (OLC)>, <Atom 3555 (C16) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3552 (C11) of chain 5 residue 604 (OLC)>, <Atom 3556 (C12) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3553 (C8) of chain 5 residue 604 (OLC)>, <Atom 3557 (C7) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3554 (C24) of chain 5 residue 604 (OLC)>, <Atom 3568 (C22) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3554 (C24) of chain 5 residue 604 (OLC)>, <Atom 3570 (O25) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3555 (C16) of chain 5 residue 604 (OLC)>, <Atom 3558 (C15) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3556 (C12) of chain 5 residue 604 (OLC)>, <Atom 3559 (C13) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3557 (C7) of chain 5 residue 604 (OLC)>, <Atom 3560 (C6) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3558 (C15) of chain 5 residue 604 (OLC)>, <Atom 3561 (C14) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3559 (C13) of chain 5 residue 604 (OLC)>, <Atom 3561 (C14) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3560 (C6) of chain 5 residue 604 (OLC)>, <Atom 3562 (C5) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3562 (C5) of chain 5 residue 604 (OLC)>, <Atom 3563 (C4) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3563 (C4) of chain 5 residue 604 (OLC)>, <Atom 3564 (C3) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3564 (C3) of chain 5 residue 604 (OLC)>, <Atom 3565 (C2) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3565 (C2) of chain 5 residue 604 (OLC)>, <Atom 3567 (C1) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3566 (C21) of chain 5 residue 604 (OLC)>, <Atom 3568 (C22) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3566 (C21) of chain 5 residue 604 (OLC)>, <Atom 3572 (O20) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3567 (C1) of chain 5 residue 604 (OLC)>, <Atom 3569 (O19) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3567 (C1) of chain 5 residue 604 (OLC)>, <Atom 3572 (O20) of chain 5 residue 604 (OLC)>),
 Bond(<Atom 3568 (C22) of chain 5 residue 604 (OLC)>, <Atom 3571 (O23) of chain 5 residue 604 (OLC)>)]

In [160]:
b.type

In [161]:
atom1 = b.atom1

In [162]:
atom1.id


Out[162]:
'31351'

In [163]:
atom1.index


Out[163]:
3548

In [168]:
atom1.element.symbol


Out[168]:
'C'

In [ ]:
# initial testing.

In [5]:
origin_pdb = PDBFile("/Users/weilu/Research/server/jan_2020/include_small_molecular/6ud8_F_complete/6ud8_F_complete-openmmawsem.pdb")

In [6]:
origin_pdb.getTopology()


Out[6]:
<Topology; 1 chains, 174 residues, 1028 atoms, 0 bonds>

In [64]:
pdb = PDBFile("/Users/weilu/Research/server/jan_2020/include_small_molecular/6ud8_F_complete-openmmawsem.pdb")

In [65]:
pdb.getTopology()


Out[65]:
<Topology; 2 chains, 175 residues, 1093 atoms, 64 bonds>

In [66]:
forcefield = ForceField("/Users/weilu/openmmawsem/awsem.xml")

In [67]:
forcefield.generateTemplatesForUnmatchedResidues(pdb.topology)


Out[67]:
[[<simtk.openmm.app.forcefield.ForceField._TemplateData at 0x1a20bc71d0>],
 [<Residue 174 (OLC) of chain 1>]]

In [68]:
[template, ffxml] = forcefield.generateTemplatesForUnmatchedResidues(pdb.topology)

In [69]:
a = template[0]

In [70]:
a.name


Out[70]:
'OLC'

In [71]:
a.bonds


Out[71]:
[(0, 3),
 (0, 25),
 (0, 26),
 (0, 27),
 (1, 2),
 (1, 4),
 (1, 28),
 (2, 5),
 (2, 29),
 (3, 7),
 (3, 30),
 (3, 31),
 (4, 8),
 (4, 32),
 (4, 33),
 (5, 9),
 (5, 34),
 (5, 35),
 (6, 20),
 (6, 22),
 (6, 36),
 (6, 37),
 (7, 10),
 (7, 38),
 (7, 39),
 (8, 11),
 (8, 40),
 (8, 41),
 (9, 12),
 (9, 42),
 (9, 43),
 (10, 13),
 (10, 44),
 (10, 45),
 (11, 13),
 (11, 46),
 (11, 47),
 (12, 14),
 (12, 48),
 (12, 49),
 (13, 50),
 (13, 51),
 (14, 15),
 (14, 52),
 (14, 53),
 (15, 16),
 (15, 54),
 (15, 55),
 (16, 17),
 (16, 56),
 (16, 57),
 (17, 19),
 (17, 58),
 (17, 59),
 (18, 20),
 (18, 24),
 (18, 60),
 (18, 61),
 (19, 21),
 (19, 24),
 (20, 23),
 (20, 62),
 (22, 63),
 (23, 64)]

In [56]:
a


Out[56]:
<simtk.openmm.app.forcefield.ForceField._TemplateData at 0x1a206219b0>

In [86]:
for a1 in a.atoms:
    a1.type = a1.element.symbol

In [72]:
a1 = a.atoms[0]

In [73]:
a1.element.symbol


Out[73]:
'C'

In [74]:
a1.name


Out[74]:
'C18'

In [75]:
a1.parameters


Out[75]:
{}

In [76]:
a1.type

In [77]:
a1.externalBonds


Out[77]:
0

In [78]:
a.externalBonds


Out[78]:
[]

In [80]:
a1.bondedTo


Out[80]:
[3, 25, 26, 27]

In [82]:
a.atoms[3].name


Out[82]:
'C17'

In [21]:
olc = a[1]

In [40]:
forcefield.getGenerators()


Out[40]:
[]

In [84]:
forcefield.registerResidueTemplate(a)

In [89]:
system = forcefield.createSystem(pdb.topology)

In [90]:
system.getNumParticles()


Out[90]:
1093

In [126]:
system.


Out[126]:
<Swig Object of type 'OpenMM::System *' at 0x1a21f8a600>

In [95]:
b = list(pdb.topology.atoms())

In [96]:
b[-1]


Out[96]:
<Atom 1092 (HO23) of chain 1 residue 174 (OLC)>

In [97]:
b[0]


Out[97]:
<Atom 0 (CA) of chain 0 residue 0 (NGP)>

In [103]:
b0 = b[-1]

In [104]:
b0.id


Out[104]:
'31415'

In [105]:
b0.index


Out[105]:
1092

In [106]:
b0.element


Out[106]:
<Element hydrogen>

In [107]:
pdb.topology.getNumResidues()


Out[107]:
175

In [111]:
res_list = list(pdb.topology.residues())
protein_resNames = ["NGP", "IGL", "IPR", "NTER", "CTER"]
DNA_resNames = ["DA", "DC", "DT", "DG"]
protein_res_list = []
DNA_res_list = []
ligand_res_list = []
for res in res_list:
    if res.name in protein_resNames:
        protein_res_list.append(res)
    elif res.name in DNA_resNames:
        DNA_res_list.append(res)
    else:
        ligand_res_list.append(res)

In [112]:
res = res_list[0]

In [114]:


In [ ]:
nres = len(protein_res_list)
residues = protein_res_list
natoms

In [117]:
atom_list = list(pdb.topology.atoms())

In [124]:
protein_atom_list = []
DNA_atom_list = []
ligand_atom_list = []
for atom in atom_list:
    if atom.residue.name in protein_resNames:
        protein_atom_list.append(atom)
    elif atom.residue.name in DNA_resNames:
        DNA_atom_list.append(atom)
    else:
        ligand_atom_list.append(atom)

In [119]:
atom = atom_list[0]

In [125]:
ligand_atom_list


Out[125]:
[<Atom 1028 (C18) of chain 1 residue 174 (OLC)>,
 <Atom 1029 (C10) of chain 1 residue 174 (OLC)>,
 <Atom 1030 (C9) of chain 1 residue 174 (OLC)>,
 <Atom 1031 (C17) of chain 1 residue 174 (OLC)>,
 <Atom 1032 (C11) of chain 1 residue 174 (OLC)>,
 <Atom 1033 (C8) of chain 1 residue 174 (OLC)>,
 <Atom 1034 (C24) of chain 1 residue 174 (OLC)>,
 <Atom 1035 (C16) of chain 1 residue 174 (OLC)>,
 <Atom 1036 (C12) of chain 1 residue 174 (OLC)>,
 <Atom 1037 (C7) of chain 1 residue 174 (OLC)>,
 <Atom 1038 (C15) of chain 1 residue 174 (OLC)>,
 <Atom 1039 (C13) of chain 1 residue 174 (OLC)>,
 <Atom 1040 (C6) of chain 1 residue 174 (OLC)>,
 <Atom 1041 (C14) of chain 1 residue 174 (OLC)>,
 <Atom 1042 (C5) of chain 1 residue 174 (OLC)>,
 <Atom 1043 (C4) of chain 1 residue 174 (OLC)>,
 <Atom 1044 (C3) of chain 1 residue 174 (OLC)>,
 <Atom 1045 (C2) of chain 1 residue 174 (OLC)>,
 <Atom 1046 (C21) of chain 1 residue 174 (OLC)>,
 <Atom 1047 (C1) of chain 1 residue 174 (OLC)>,
 <Atom 1048 (C22) of chain 1 residue 174 (OLC)>,
 <Atom 1049 (O19) of chain 1 residue 174 (OLC)>,
 <Atom 1050 (O25) of chain 1 residue 174 (OLC)>,
 <Atom 1051 (O23) of chain 1 residue 174 (OLC)>,
 <Atom 1052 (O20) of chain 1 residue 174 (OLC)>,
 <Atom 1053 (H18) of chain 1 residue 174 (OLC)>,
 <Atom 1054 (H18A) of chain 1 residue 174 (OLC)>,
 <Atom 1055 (H18B) of chain 1 residue 174 (OLC)>,
 <Atom 1056 (H10) of chain 1 residue 174 (OLC)>,
 <Atom 1057 (H9) of chain 1 residue 174 (OLC)>,
 <Atom 1058 (H17) of chain 1 residue 174 (OLC)>,
 <Atom 1059 (H17A) of chain 1 residue 174 (OLC)>,
 <Atom 1060 (H11) of chain 1 residue 174 (OLC)>,
 <Atom 1061 (H11A) of chain 1 residue 174 (OLC)>,
 <Atom 1062 (H8) of chain 1 residue 174 (OLC)>,
 <Atom 1063 (H8A) of chain 1 residue 174 (OLC)>,
 <Atom 1064 (H24) of chain 1 residue 174 (OLC)>,
 <Atom 1065 (H24A) of chain 1 residue 174 (OLC)>,
 <Atom 1066 (H16) of chain 1 residue 174 (OLC)>,
 <Atom 1067 (H16A) of chain 1 residue 174 (OLC)>,
 <Atom 1068 (H12) of chain 1 residue 174 (OLC)>,
 <Atom 1069 (H12A) of chain 1 residue 174 (OLC)>,
 <Atom 1070 (H7) of chain 1 residue 174 (OLC)>,
 <Atom 1071 (H7A) of chain 1 residue 174 (OLC)>,
 <Atom 1072 (H15) of chain 1 residue 174 (OLC)>,
 <Atom 1073 (H15A) of chain 1 residue 174 (OLC)>,
 <Atom 1074 (H13) of chain 1 residue 174 (OLC)>,
 <Atom 1075 (H13A) of chain 1 residue 174 (OLC)>,
 <Atom 1076 (H6) of chain 1 residue 174 (OLC)>,
 <Atom 1077 (H6A) of chain 1 residue 174 (OLC)>,
 <Atom 1078 (H14) of chain 1 residue 174 (OLC)>,
 <Atom 1079 (H14A) of chain 1 residue 174 (OLC)>,
 <Atom 1080 (H5) of chain 1 residue 174 (OLC)>,
 <Atom 1081 (H5A) of chain 1 residue 174 (OLC)>,
 <Atom 1082 (H4) of chain 1 residue 174 (OLC)>,
 <Atom 1083 (H4A) of chain 1 residue 174 (OLC)>,
 <Atom 1084 (H3) of chain 1 residue 174 (OLC)>,
 <Atom 1085 (H3A) of chain 1 residue 174 (OLC)>,
 <Atom 1086 (H2) of chain 1 residue 174 (OLC)>,
 <Atom 1087 (H2A) of chain 1 residue 174 (OLC)>,
 <Atom 1088 (H21) of chain 1 residue 174 (OLC)>,
 <Atom 1089 (H21A) of chain 1 residue 174 (OLC)>,
 <Atom 1090 (H22) of chain 1 residue 174 (OLC)>,
 <Atom 1091 (HO25) of chain 1 residue 174 (OLC)>,
 <Atom 1092 (HO23) of chain 1 residue 174 (OLC)>]

In [120]:
atom.index


Out[120]:
0

In [121]:
atom.name


Out[121]:
'CA'

In [123]:
atom.residue.name


Out[123]:
'NGP'

In [116]:
DNA_res_list


Out[116]:
[]

In [115]:
ligand_res_list


Out[115]:
[<Residue 174 (OLC) of chain 1>]

In [ ]:
for res in res_list:
    if