-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNAD_Result.py
More file actions
4022 lines (3121 loc) · 170 KB
/
Copy pathNAD_Result.py
File metadata and controls
4022 lines (3121 loc) · 170 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/python
# Import modules for CGI handling
import cgi, cgitb
import webbrowser
import urllib
import urllib2
import re
import sys, os
from itertools import izip
import requests
from bs4 import BeautifulSoup
import numpy as np
import pandas as pd
from collections import Counter
import matplotlib
import matplotlib.pyplot as plt
import uuid
from Bio.Seq import Seq
from Bio import motifs
from Bio.Alphabet import IUPAC
from zipfile import ZipFile
from collections import OrderedDict
matplotlib.use('Agg')
pd.set_option('display.max_colwidth', -1)
# Create instance of FieldStorage
form = cgi.FieldStorage()
print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>"
print "<style>"
print """
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.grid {
background: white;
margin: 0 0 20px 0;
}
.grid:after {
/* Or @extend clearfix */
content: "";
display: table;
clear: both;
}
[class*='col-'] {
float: left;
padding-right: 20px;
}
.grid [class*='col-']:last-of-type {
padding-right: 0;
}
.col-2-3 {
width: 33.33%;
overflow: scroll;
}
.col-1-3 {
width: 33.33%;
overflow: scroll;
}
.module {
padding: 20px;
background: #eee;
}
body {
padding: 10px 50px 200px;
background-size: 300px 300px;
}
h1 {
color: white;
}
h1 em {
color: #666;
font-size: 16px;
}
"""
#############
#style for printing image side by side
print """
.weblogo_column {
float: left;
width: 33.33%;
padding: 2px;
}
/* Clearfix (clear floats) */
.weblogo_row::after {
content: "";
clear: both;
display: table;
}
"""
############
######style for collapsible content###
print """
.collapsible {
background-color: #777;
color: white;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
}
.active, .collapsible:hover {
background-color: #555;
}
.contentsection {
padding: 0 18px;
display: none;
overflow: scroll;
background-color: #f1f1f1;
}
"""
############End of style for collapsible content###
#style for divindg into 2 columns
print "* {box-sizing: border-box;}"
print ".column {float: left;width: 50%;padding: 10px;}"
print ".row:after {content: "";display: table;clear: both;}"
#END of style for divindg into 2 columns
print "</style>"
print "<body>"
# Substructure Atom Information for PCHILIDE ligand
l=['N7N','C7N','O7N','C3N','C4N','C5N','C6N','N1N','C2N','O2D','C2D','C1D','O4D','C4D','C3D','O3D','C5D','O5D','PN','O2N','O1N','O3','P1','O1A','O2A','O5B','C5D','C4B','O4B','C1B','C2B','O2B','C3B','O3B','N9A','C8A','N7A','C5A','C4A','N3A','C2A','N1A','C6A','N6A']
Nicot=sorted(['N7N','C7N','O7N','C3N','C4N','C5N','C6N','N1N','C2N'])
Ribitol=sorted(['O2D','C2D','C1D','O4D','C4D','C3D','O3D','C5D']) #Ribose_Nicot
phosphate=sorted(['O5D','PN','O2N','O1N','O3','P1','O1A','O2A','O5B'])
Ribose=sorted(['C5B','C4B','O4B','C1B','C2B','O2B','C3B','O3B'])#Ribose_adeno
Adenin=sorted(['N9A','C8A','N7A','C5A','C4A','N3A','C2A','N1A','C6A','N6A'])
#SUbstructure section ends here
# Information of the selected ligands and PDB ids from LigPage.py
variable = ""
value = ""
r = ""
value_dict={}
lig_sel=[]
for key in form.keys():
variable = str(key)
# print "The selected Ligand for PDBID:%s" %variable
value = str(form.getvalue(variable))
# print "is", value
value_dict.setdefault('%s'%variable,[]).append(value)
r += "<p>"+ variable +", "+ value +"</p>\n"
print "<p style='font-size:20px; text-align:center; color:blue'> Results for the following selected PDBID's and Ligands: ",'\n'.join("{}:{}".format(k,v) for k,v in value_dict.items()),"</p>","<br/>"
pdbsum_URL="http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/GetPage.pl?pdbcode="
pdbsum_URL2="&template=links.html"
#DIctionary and List
pdbsum_dict={}
PDBID_LIST=[]
#Title for Page
Title="The Results are for the following selected PDBID's and Ligands:"
#print Title.center(100,' '),"<br/>"
#Preparing PdbSum Url with selected PDB ids
for ids,lig in value_dict.iteritems():
pdbsumurl=pdbsum_URL+ids+pdbsum_URL2
lig_sel.append(lig)
pdbsum_dict.setdefault('%s'%ids,[]).append(pdbsumurl)
#print "PDBSUMDICT", pdbsum_dict,"<br/>","<br/>"
#creating a list for PDB ids
for id,url in pdbsum_dict.iteritems():
PDBID_LIST.append(id)
#print "PDBID LIST", PDBID_LIST, "<br/>"
#Extracting the Href links from PDBSum home page for the selected PDB ids and Ligands using BeautifulSoup
litems=[]
new=[]
items2=[]
new1=[]
lig_link=[]
finalLIG_link=[]
liginte_set=set()
ligintelist=[]
link_set=set()
for id,url in pdbsum_dict.iteritems():
#print id, url, "<br/>"
for link in url:
html_page=requests.get(link)
soup = BeautifulSoup(html_page.text,'html.parser')
ligand_name_items=soup.find_all('a')
for items in ligand_name_items:
name=items.contents[0]
links='www.ebi.ac.uk' + items.get('href')
text=str(name)+ " " + str(links)
litems.append(text)
#Looping over the extracted URLs from PDBSum and appending into a lIst called New
for x in litems:
x=x.strip()
new.append(x)
#print new
#Looping over Ligand and PDBSum Urls (from above step) to extract the PDBSUm URL for the seleted Ligand Page in PDBSUm. The Ligand Page URL is now as a SET data type
ligand_urlLIST=[]
for lig in lig_sel:
#print "LIGAND", lig, "<br/>"
for y in new:
lig= ''.join(lig)
if y.startswith(lig):#y=y.split()
y=y.split()
link=y[1]
link1="http://"+link
#print link1
ligand_urlLIST.append(link1)
link_set.add(link1)
link_setlist=list(link_set)
#print ligand_urlLIST
#print "SET",link_setlist, "<br/>"
#Using Beautifulsoup to extract all the links from PDBSUM Ligand interaction Page for each of the PDB ids.
#print PDBID_LIST
PDBID_URL_dict=zip(PDBID_LIST,ligand_urlLIST)
LiginteractPage=dict(PDBID_URL_dict)
#print "what1", LiginteractPage, "<br/>"
#print "what2", PDBID_URL_dict
for pdbid,pdbsumlink in LiginteractPage.iteritems():
links=list(LiginteractPage.viewvalues())
for y in links:
html_page2=requests.get(y)
soup2 = BeautifulSoup(html_page2.text,'html.parser')
ligand_name_items1=soup2.find_all('a')
#Looping over all the href links from PDBSUM ligand intercation page to extract
#URL(Final page for extracting atom details) for the atom based interaction for PDB ids with ligands
for items in ligand_name_items1:
name=items.contents[0]
links='www.ebi.ac.uk' + items.get('href')
text=str(links)
items2.append(text)
for i in items2:
# print i
final=i.split()
final=''.join(final)
#print final, "<br/>"
if 'thornton-srv/databases/cgi-bin/pdbsum/GetLigInt.pl?pdb=' in final:
finalLIG_link.append(final)
lastitem=finalLIG_link[-1]
lastitem="http://"+lastitem
# print lastitem,"<br/>"
if lastitem not in ligintelist:
ligintelist.append(lastitem)
liginte_set.add(lastitem)
liginte_list=list(liginte_set)
#print "LIST", (ligintelist),"<br/>"
PDBID_INTURL_dict=zip(PDBID_LIST,ligintelist)
pdbsum_dict1=dict(PDBID_INTURL_dict)
for id,link in pdbsum_dict1.iteritems():
links=list(pdbsum_dict1.viewvalues())
PDBID=list(pdbsum_dict1.viewkeys())
#print "HI LINKS CHECK for SPACE", links,"<br/>"
#print "PDBIDs", PDBID,"<br/>"
Number_of_Ids=len(PDBID)
#FInal DIctionary with PDBID and Ligplot URL for extracting intercation details
mydictcheck={}
for ids,links in zip(PDBID,ligintelist):
mydictcheck.setdefault('%s'%ids,[]).append(links)
###############################################################################
#SECTION OF FIDING COMMON LIGAND ATOMS
###############################################################################
#selecting common ligand atoms that are hydrogen bonded in selected PDB structures
H_printing = False
H_atoms_commoncomp={}
for H_pdbids,H_pdbidlinks in mydictcheck.iteritems():
for H_links_sel in H_pdbidlinks:
H_links_sel1=str(H_links_sel)
weblink=requests.get(H_links_sel1, stream=True)
for H_atomlines in weblink.iter_lines():
H_atomlines1=H_atomlines.strip()
if H_atomlines1.startswith('Hydrogen bonds'):
H_printing = True
elif H_atomlines1.startswith('Non-bonded contacts'):
H_printing = False
if H_printing:
#print H_atomlines
if H_atomlines1.startswith(('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')):
H_atomlines2=H_atomlines1.split()
H_atm_sel=H_atomlines2[8]
H_atoms_commoncomp.setdefault('%s'%H_pdbids,[]).append(H_atm_sel)
H_atomsvalues_dict1=H_atoms_commoncomp.values()
H_common_intersectionfinal=sorted(list(set.intersection(*map(set,H_atomsvalues_dict1))))
#END of selecting common ligand atoms that are hydrogen bonded in selected PDB structures
#selecting common ligand atoms that are non-hydrogen bonded in selected PDB structures
NONH_printing = False
NONHatoms_commoncomp={}
for NONHpdbids,NONHpdbidlinks in mydictcheck.iteritems():
for NONHlinks_sel in NONHpdbidlinks:
NONHlinks_sel1=str(NONHlinks_sel)
weblink=requests.get(NONHlinks_sel1, stream=True)
for NONHatomlines in weblink.iter_lines():
NONHatomlines1=NONHatomlines.strip()
if NONHatomlines1.startswith('Non-bonded contacts'):
NONH_printing = True
elif NONHatomlines1.startswith('Hydrogen bonds'):
NONH_printing = False
if NONH_printing:
#print atomlines1
if NONHatomlines1.startswith(('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')):
NONHatomlines2=NONHatomlines1.split()
NONHatm_sel=NONHatomlines2[8]
NONHatoms_commoncomp.setdefault('%s'%NONHpdbids,[]).append(NONHatm_sel)
NONHatomsvalues_dict1=NONHatoms_commoncomp.values()
NONHcommon_intersectionfinal=sorted(list(set.intersection(*map(set,NONHatomsvalues_dict1))))
###############################################################################
#END OF SECTION OF FIDING COMMON LIGAND ATOMS
###############################################################################
###############################################################################
#START OF SECTION OF LIGAND ATOMS IN EACH SUBGROUPS:
###############################################################################
###############################################################################
# 1.START OF SECTION OF NAD SUBGROUPS:
###############################################################################
#Nicot
Nicot_graphdicH={}
Nicot_common_graphdicH={}
Nicot_graphdicNH={}
Nicot_common_graphdicNH={}
Nicot_All_combine_Lig_Res_H={}
Nicot_allH_Lig_Resdict={}
Nicot_Common_combine_Lig_Res_H={}
Nicot_CommonH_Lig_Resdict={}
Nicot_All_combine_Lig_Res_NH={}
Nicot_allNH_Lig_Resdict={}
Nicot_Common_combine_Lig_Res_NH={}
Nicot_CommonNH_Lig_Resdict={}
Nicot_All_combine_Lig_Res_H_distance={}
Nicot_allH_Lig_Resdict_distance={}
Nicot_Common_combine_Lig_Res_H_distance={}
Nicot_CommonH_Lig_Resdict_distance={}
Nicot_All_combine_Lig_Res_NH_distance={}
Nicot_allNH_Lig_Resdict_distance={}
Nicot_Common_combine_Lig_Res_NH_distance={}
Nicot_CommonNH_Lig_Resdict_distance={}
Nicot_listdata_H=[]
Nicot_listdata_NH=[]
Nicot_lresidueH=[]
Nicot_latomH=[]
Nicot_lresidueNH=[]
Nicot_latomNH=[]
Nicot_common_listdata_H=[]
Nicot_common_listdata_NH=[]
Nicot_H_appended_lig_tabledic={}
Nicot_H_Common_appended_lig_tabledic={}
Nicot_NH_appended_lig_tabledic={}
Nicot_NH_Common_appended_lig_tabledic={}
Nicot_finalsetH=set()
Nicot_finalsetNH=set()
#End of Nicot
#Ribitol
Ribitol_graphdicH={}
Ribitol_common_graphdicH={}
Ribitol_graphdicNH={}
Ribitol_common_graphdicNH={}
Ribitol_All_combine_Lig_Res_H={}
Ribitol_allH_Lig_Resdict={}
Ribitol_Common_combine_Lig_Res_H={}
Ribitol_CommonH_Lig_Resdict={}
Ribitol_All_combine_Lig_Res_NH={}
Ribitol_allNH_Lig_Resdict={}
Ribitol_Common_combine_Lig_Res_NH={}
Ribitol_CommonNH_Lig_Resdict={}
Ribitol_All_combine_Lig_Res_H_distance={}
Ribitol_allH_Lig_Resdict_distance={}
Ribitol_Common_combine_Lig_Res_H_distance={}
Ribitol_CommonH_Lig_Resdict_distance={}
Ribitol_All_combine_Lig_Res_NH_distance={}
Ribitol_allNH_Lig_Resdict_distance={}
Ribitol_Common_combine_Lig_Res_NH_distance={}
Ribitol_CommonNH_Lig_Resdict_distance={}
Ribitol_listdata_H=[]
Ribitol_listdata_NH=[]
Ribitol_lresidueH=[]
Ribitol_latomH=[]
Ribitol_lresidueNH=[]
Ribitol_latomNH=[]
Ribitol_common_listdata_H=[]
Ribitol_common_listdata_NH=[]
Ribitol_H_appended_lig_tabledic={}
Ribitol_H_Common_appended_lig_tabledic={}
Ribitol_NH_appended_lig_tabledic={}
Ribitol_NH_Common_appended_lig_tabledic={}
#End of Ribitol
#phosphate
phosphate_graphdicH={}
phosphate_common_graphdicH={}
phosphate_graphdicNH={}
phosphate_common_graphdicNH={}
phosphate_All_combine_Lig_Res_H={}
phosphate_allH_Lig_Resdict={}
phosphate_Common_combine_Lig_Res_H={}
phosphate_CommonH_Lig_Resdict={}
phosphate_All_combine_Lig_Res_NH={}
phosphate_allNH_Lig_Resdict={}
phosphate_Common_combine_Lig_Res_NH={}
phosphate_CommonNH_Lig_Resdict={}
phosphate_All_combine_Lig_Res_H_distance={}
phosphate_allH_Lig_Resdict_distance={}
phosphate_Common_combine_Lig_Res_H_distance={}
phosphate_CommonH_Lig_Resdict_distance={}
phosphate_All_combine_Lig_Res_NH_distance={}
phosphate_allNH_Lig_Resdict_distance={}
phosphate_Common_combine_Lig_Res_NH_distance={}
phosphate_CommonNH_Lig_Resdict_distance={}
phosphate_listdata_H=[]
phosphate_listdata_NH=[]
phosphate_lresidueH=[]
phosphate_latomH=[]
phosphate_lresidueNH=[]
phosphate_latomNH=[]
phosphate_common_listdata_H=[]
phosphate_common_listdata_NH=[]
phosphate_H_appended_lig_tabledic={}
phosphate_H_Common_appended_lig_tabledic={}
phosphate_NH_appended_lig_tabledic={}
phosphate_NH_Common_appended_lig_tabledic={}
phosphate_finalsetH=set()
phosphate_finalsetNH=set()
#End of phosphate
#Ribose
Ribose_graphdicH={}
Ribose_common_graphdicH={}
Ribose_graphdicNH={}
Ribose_common_graphdicNH={}
Ribose_All_combine_Lig_Res_H={}
Ribose_allH_Lig_Resdict={}
Ribose_Common_combine_Lig_Res_H={}
Ribose_CommonH_Lig_Resdict={}
Ribose_All_combine_Lig_Res_NH={}
Ribose_allNH_Lig_Resdict={}
Ribose_Common_combine_Lig_Res_NH={}
Ribose_CommonNH_Lig_Resdict={}
Ribose_All_combine_Lig_Res_H_distance={}
Ribose_allH_Lig_Resdict_distance={}
Ribose_Common_combine_Lig_Res_H_distance={}
Ribose_CommonH_Lig_Resdict_distance={}
Ribose_All_combine_Lig_Res_NH_distance={}
Ribose_allNH_Lig_Resdict_distance={}
Ribose_Common_combine_Lig_Res_NH_distance={}
Ribose_CommonNH_Lig_Resdict_distance={}
Ribose_listdata_H=[]
Ribose_listdata_NH=[]
Ribose_common_listdata_H=[]
Ribose_common_listdata_NH=[]
Ribose_H_appended_lig_tabledic={}
Ribose_H_Common_appended_lig_tabledic={}
Ribose_NH_appended_lig_tabledic={}
Ribose_NH_Common_appended_lig_tabledic={}
#End ofRibose
#Adenin
Adenin_graphdicH={}
Adenin_common_graphdicH={}
Adenin_graphdicNH={}
Adenin_common_graphdicNH={}
Adenin_All_combine_Lig_Res_H={}
Adenin_allH_Lig_Resdict={}
Adenin_Common_combine_Lig_Res_H={}
Adenin_CommonH_Lig_Resdict={}
Adenin_All_combine_Lig_Res_NH={}
Adenin_allNH_Lig_Resdict={}
Adenin_Common_combine_Lig_Res_NH={}
Adenin_CommonNH_Lig_Resdict={}
Adenin_All_combine_Lig_Res_H_distance={}
Adenin_allH_Lig_Resdict_distance={}
Adenin_Common_combine_Lig_Res_H_distance={}
Adenin_CommonH_Lig_Resdict_distance={}
Adenin_All_combine_Lig_Res_NH_distance={}
Adenin_allNH_Lig_Resdict_distance={}
Adenin_Common_combine_Lig_Res_NH_distance={}
Adenin_CommonNH_Lig_Resdict_distance={}
Adenin_listdata_H=[]
Adenin_listdata_NH=[]
Adenin_lresidueH=[]
Adenin_latomH=[]
Adenin_lresidueNH=[]
Adenin_latomNH=[]
Adenin_common_listdata_H=[]
Adenin_common_listdata_NH=[]
Adenin_H_appended_lig_tabledic={}
Adenin_H_Common_appended_lig_tabledic={}
Adenin_NH_appended_lig_tabledic={}
Adenin_NH_Common_appended_lig_tabledic={}
#End ofAdenin
lresidueH=[]
latomH=[]
ldistanceH=[]
residueH={}
atmnameH={}
dicresidue_unique={}
residue_seenH=set()
atom_seenH=set()
lresidueNH=[]
latomNH=[]
ldistanceNH=[]
residueNH={}
atmnameNH={}
dicresidue_unique={}
residue_seenNH=set()
atom_seenNH=set()
Ribitol_finalsetH=set()
Ribitol_finalsetNH=set()
Adenin_finalsetH=set()
Adenin_finalsetNH=set()
finalsetH=set()
finalsetNH=set()
combines_listdata=[]
#print "<table style=width:50%>"
#print "<tr>"
#print "<th colspan='%d'>Interaction List</th>"% Number_of_Ids
#print "</tr>"
#print "</div>"
H_appended_lig_tabledic={}
H_Common_appended_lig_tabledic={}
NH_Common_appended_lig_tabledic={}
NH_appended_lig_tabledic={}
graphdicH={}
graphdicNH={}
common_graphdicH={}
common_graphdicNH={}
printing = False
for id,link in mydictcheck.iteritems():
#print link, id
links_sel=link[0]
link1= ''.join(str(links_sel))
res2=urllib.urlopen(str(link1))
html=res2.read()
#print html
for l in link:
ll=str(l)
r = requests.get(ll, stream=True)
for line in r.iter_lines():
line=line.strip()
if line.startswith('Hydrogen bonds'):
printing = True
elif line.startswith('Non-bonded contacts'):
printing = False
if printing:
if line.startswith(('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')):
#print "HB", line
lineH=line.split()
lignameH=lineH[9]
atmH=lineH[8]
resH=lineH[3]
residuenumH=lineH[4]
distanceH=lineH[12]
resnumH=resH+residuenumH
# #appending each residue and its position to list called lresidue
lresidueH.append(resnumH)
#appending each ligand atom to list called latom
latomH.append(atmH)
#appending distance of each interaction to ldistance
ldistanceH.append(distanceH)
#creating a set for residue with position
residue_seenH.add(resnumH)
#creating a set for each ligand atom
atom_seenH.add(atmH)
#making a dictionary with list comtaining residue name and position
residueH.setdefault('%s'%id,[]).append(resnumH)
#making a dictionary with list comataing ligand atoms
atmnameH.setdefault('%s'%id,[]).append(atmH)
if atmH in Nicot:
Nicot_lresidueH.append(resnumH)
Nicot_latomH.append(atmH)
Nicot_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for physio and weblogo
Nicot_All_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for table
Nicot_All_combine_Lig_Res_H_uniquify= {k:list(set(j)) for k,j in Nicot_All_combine_Lig_Res_H.items()}
Nicot_allH_Lig_Resdict['%s'%id]=Nicot_All_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for all group
Nicot_All_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Nicot_All_combine_Lig_Res_H_distance_uniquify= {k:list(set(j)) for k,j in Nicot_All_combine_Lig_Res_H_distance.items()}
Nicot_allH_Lig_Resdict_distance['%s'%id]=Nicot_All_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in H_common_intersectionfinal:
Nicot_common_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)
Nicot_Common_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with common lig atom and residues for table
Nicot_Common_combine_Lig_Res_H_uniquify={k:list(set(j)) for k,j in Nicot_Common_combine_Lig_Res_H.items()}
Nicot_CommonH_Lig_Resdict['%s'%id]=Nicot_Common_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for common group
Nicot_Common_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Nicot_Common_combine_Lig_Res_H_distance_uniquify={k:list(set(j)) for k,j in Nicot_Common_combine_Lig_Res_H_distance.items()}
Nicot_CommonH_Lig_Resdict_distance['%s'%id]=Nicot_Common_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in Ribitol:
Ribitol_lresidueH.append(resnumH)
Ribitol_latomH.append(atmH)
Ribitol_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for physio and weblogo
Ribitol_All_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for table
Ribitol_All_combine_Lig_Res_H_uniquify= {k:list(set(j)) for k,j in Ribitol_All_combine_Lig_Res_H.items()}
Ribitol_allH_Lig_Resdict['%s'%id]=Ribitol_All_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for all group
Ribitol_All_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Ribitol_All_combine_Lig_Res_H_distance_uniquify= {k:list(set(j)) for k,j in Ribitol_All_combine_Lig_Res_H_distance.items()}
Ribitol_allH_Lig_Resdict_distance['%s'%id]=Ribitol_All_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in H_common_intersectionfinal:
Ribitol_common_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)
Ribitol_Common_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with common lig atom and residues for table
Ribitol_Common_combine_Lig_Res_H_uniquify={k:list(set(j)) for k,j in Ribitol_Common_combine_Lig_Res_H.items()}
Ribitol_CommonH_Lig_Resdict['%s'%id]=Ribitol_Common_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for common group
Ribitol_Common_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Ribitol_Common_combine_Lig_Res_H_distance_uniquify={k:list(set(j)) for k,j in Ribitol_Common_combine_Lig_Res_H_distance.items()}
Ribitol_CommonH_Lig_Resdict_distance['%s'%id]=Ribitol_Common_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in phosphate:
phosphate_lresidueH.append(resnumH)
phosphate_latomH.append(atmH)
phosphate_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for physio and weblogo
phosphate_All_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for table
phosphate_All_combine_Lig_Res_H_uniquify= {k:list(set(j)) for k,j in phosphate_All_combine_Lig_Res_H.items()}
phosphate_allH_Lig_Resdict['%s'%id]=phosphate_All_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for all group
phosphate_All_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
phosphate_All_combine_Lig_Res_H_distance_uniquify= {k:list(set(j)) for k,j in phosphate_All_combine_Lig_Res_H_distance.items()}
phosphate_allH_Lig_Resdict_distance['%s'%id]=phosphate_All_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in H_common_intersectionfinal:
phosphate_common_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)
phosphate_Common_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with common lig atom and residues for table
phosphate_Common_combine_Lig_Res_H_uniquify={k:list(set(j)) for k,j in phosphate_Common_combine_Lig_Res_H.items()}
phosphate_CommonH_Lig_Resdict['%s'%id]=phosphate_Common_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for common group
phosphate_Common_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
phosphate_Common_combine_Lig_Res_H_distance_uniquify={k:list(set(j)) for k,j in phosphate_Common_combine_Lig_Res_H_distance.items()}
phosphate_CommonH_Lig_Resdict_distance['%s'%id]=phosphate_Common_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in Ribose:
Ribose_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)
Ribose_All_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for table
Ribose_All_combine_Lig_Res_H_uniquify={k:list(set(j)) for k,j in Ribose_All_combine_Lig_Res_H.items()}
Ribose_allH_Lig_Resdict['%s'%id]=Ribose_All_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for all group
Ribose_All_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Ribose_All_combine_Lig_Res_H_distance_uniquify= {k:list(set(j)) for k,j in Ribose_All_combine_Lig_Res_H_distance.items()}
Ribose_allH_Lig_Resdict_distance['%s'%id]=Ribose_All_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in H_common_intersectionfinal:
Ribose_common_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)
Ribose_Common_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with common lig atom and residues for table
Ribose_Common_combine_Lig_Res_H_uniquify={k:list(set(j)) for k,j in Ribose_Common_combine_Lig_Res_H.items()}
Ribose_CommonH_Lig_Resdict['%s'%id]=Ribose_Common_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for common group
Ribose_Common_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Ribose_Common_combine_Lig_Res_H_distance_uniquify={k:list(set(j)) for k,j in Ribose_Common_combine_Lig_Res_H_distance.items()}
Ribose_CommonH_Lig_Resdict_distance['%s'%id]=Ribose_Common_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in Adenin:
Adenin_lresidueH.append(resnumH)
Adenin_latomH.append(atmH)
Adenin_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)
Adenin_All_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with all lig atom and residues for table
Adenin_All_combine_Lig_Res_H_uniquify={k:list(set(j)) for k,j in Adenin_All_combine_Lig_Res_H.items()}
Adenin_allH_Lig_Resdict['%s'%id]=Adenin_All_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for all group
Adenin_All_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Adenin_All_combine_Lig_Res_H_distance_uniquify= {k:list(set(j)) for k,j in Adenin_All_combine_Lig_Res_H_distance.items()}
Adenin_allH_Lig_Resdict_distance['%s'%id]=Adenin_All_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
if atmH in H_common_intersectionfinal:
Adenin_common_graphdicH.setdefault('%s'%atmH,[]).append(resnumH)
Adenin_Common_combine_Lig_Res_H.setdefault('%s'%atmH,[]).append(resnumH)#creating dictionary with common lig atom and residues for table
Adenin_Common_combine_Lig_Res_H_uniquify={k:list(set(j)) for k,j in Adenin_Common_combine_Lig_Res_H.items()}
Adenin_CommonH_Lig_Resdict['%s'%id]=Adenin_Common_combine_Lig_Res_H_uniquify#final dic for table with pdb id , lig atom and residues for common group
Adenin_Common_combine_Lig_Res_H_distance.setdefault('%s'%atmH,[]).append(distanceH)#creating dictionary with all lig atom and distance for table
Adenin_Common_combine_Lig_Res_H_distance_uniquify={k:list(set(j)) for k,j in Adenin_Common_combine_Lig_Res_H_distance.items()}
Adenin_CommonH_Lig_Resdict_distance['%s'%id]=Adenin_Common_combine_Lig_Res_H_distance_uniquify#final dic for table with pdb id , lig atom and distance for all group
else:
if line.startswith(('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')):
#print "NHB", line
lineNH=line.split()
lignameNH=lineNH[9]
atmNH=lineNH[8]
resNH=lineNH[3]
residuenumNH=lineNH[4]
distanceNH=lineNH[12]
resnumNH=resNH+residuenumNH
# #appending each residue and its position to list called lresidue
lresidueNH.append(resnumNH)
#appending each ligand atom to list called latom
latomNH.append(atmNH)
#appending distance of each interaction to ldistance
ldistanceNH.append(distanceNH)
#creating a set for residue with position
residue_seenNH.add(resnumNH)
#creating a set for each ligand atom
atom_seenNH.add(atmNH)
#making a dictionary with list comtaining residue name and position
residueNH.setdefault('%s'%id,[]).append(resnumNH)
#making a dictionary with list comataing ligand atoms
atmnameNH.setdefault('%s'%id,[]).append(atmNH)
if atmNH in Nicot:
Nicot_lresidueNH.append(resnumNH)
Nicot_latomNH.append(atmNH)
Nicot_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Nicot_All_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with all lig atom and residues for table
Nicot_All_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Nicot_All_combine_Lig_Res_NH.items()}
Nicot_allNH_Lig_Resdict['%s'%id]=Nicot_All_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for all group
Nicot_All_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with all lig atom and residues for table
Nicot_All_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Nicot_All_combine_Lig_Res_NH_distance.items()}
Nicot_allNH_Lig_Resdict_distance['%s'%id]=Nicot_All_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for all group
if atmNH in NONHcommon_intersectionfinal:
Nicot_common_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Nicot_Common_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with common lig atom and residues for table
Nicot_Common_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Nicot_Common_combine_Lig_Res_NH.items()}
Nicot_CommonNH_Lig_Resdict['%s'%id]=Nicot_Common_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for common group
Nicot_Common_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with common lig atom and residues for table
Nicot_Common_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Nicot_Common_combine_Lig_Res_NH_distance.items()}
Nicot_CommonNH_Lig_Resdict_distance['%s'%id]=Nicot_Common_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for common group
if atmNH in Ribitol:
Ribitol_lresidueNH.append(resnumNH)
Ribitol_latomNH.append(atmNH)
Ribitol_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Ribitol_All_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with all lig atom and residues for table
Ribitol_All_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Ribitol_All_combine_Lig_Res_NH.items()}
Ribitol_allNH_Lig_Resdict['%s'%id]=Ribitol_All_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for all group
Ribitol_All_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with all lig atom and residues for table
Ribitol_All_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Ribitol_All_combine_Lig_Res_NH_distance.items()}
Ribitol_allNH_Lig_Resdict_distance['%s'%id]=Ribitol_All_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for all group
if atmNH in NONHcommon_intersectionfinal:
Ribitol_common_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Ribitol_Common_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with common lig atom and residues for table
Ribitol_Common_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Ribitol_Common_combine_Lig_Res_NH.items()}
Ribitol_CommonNH_Lig_Resdict['%s'%id]=Ribitol_Common_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for common group
Ribitol_Common_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with common lig atom and residues for table
Ribitol_Common_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Ribitol_Common_combine_Lig_Res_NH_distance.items()}
Ribitol_CommonNH_Lig_Resdict_distance['%s'%id]=Ribitol_Common_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for common group
if atmNH in phosphate:
phosphate_lresidueNH.append(resnumNH)
phosphate_latomNH.append(atmNH)
phosphate_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
phosphate_All_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with all lig atom and residues for table
phosphate_All_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in phosphate_All_combine_Lig_Res_NH.items()}
phosphate_allNH_Lig_Resdict['%s'%id]=phosphate_All_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for all group
phosphate_All_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with all lig atom and residues for table
phosphate_All_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in phosphate_All_combine_Lig_Res_NH_distance.items()}
phosphate_allNH_Lig_Resdict_distance['%s'%id]=phosphate_All_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for all group
if atmNH in NONHcommon_intersectionfinal:
phosphate_common_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
phosphate_Common_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with common lig atom and residues for table
phosphate_Common_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in phosphate_Common_combine_Lig_Res_NH.items()}
phosphate_CommonNH_Lig_Resdict['%s'%id]=phosphate_Common_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for common group
phosphate_Common_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with common lig atom and residues for table
phosphate_Common_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in phosphate_Common_combine_Lig_Res_NH_distance.items()}
phosphate_CommonNH_Lig_Resdict_distance['%s'%id]=phosphate_Common_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for common group
if atmNH in Ribose:
Ribose_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Ribose_All_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with all lig atom and residues for table
Ribose_All_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Ribose_All_combine_Lig_Res_NH.items()}
Ribose_allNH_Lig_Resdict['%s'%id]=Ribose_All_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for all group
Ribose_All_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with all lig atom and residues for table
Ribose_All_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Ribose_All_combine_Lig_Res_NH_distance.items()}
Ribose_allNH_Lig_Resdict_distance['%s'%id]=Ribose_All_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for all group
if atmNH in NONHcommon_intersectionfinal:
Ribose_common_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Ribose_Common_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with common lig atom and residues for table
Ribose_Common_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Ribose_Common_combine_Lig_Res_NH.items()}
Ribose_CommonNH_Lig_Resdict['%s'%id]=Ribose_Common_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for common group
Ribose_Common_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with common lig atom and residues for table
Ribose_Common_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Ribose_Common_combine_Lig_Res_NH_distance.items()}
Ribose_CommonNH_Lig_Resdict_distance['%s'%id]=Ribose_Common_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for common group
if atmNH in Adenin:
Adenin_lresidueNH.append(resnumNH)
Adenin_latomNH.append(atmNH)
Adenin_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Adenin_All_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with all lig atom and residues for table
Adenin_All_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Adenin_All_combine_Lig_Res_NH.items()}
Adenin_allNH_Lig_Resdict['%s'%id]=Adenin_All_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for all group
Adenin_All_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with all lig atom and residues for table
Adenin_All_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Adenin_All_combine_Lig_Res_NH_distance.items()}
Adenin_allNH_Lig_Resdict_distance['%s'%id]=Adenin_All_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for all group
if atmNH in NONHcommon_intersectionfinal:
Adenin_common_graphdicNH.setdefault('%s'%atmNH,[]).append(resnumNH)
Adenin_Common_combine_Lig_Res_NH.setdefault('%s'%atmNH,[]).append(resnumNH)#creating dictionary with common lig atom and residues for table
Adenin_Common_combine_Lig_Res_NH_uniquify= {k:list(set(j)) for k,j in Adenin_Common_combine_Lig_Res_NH.items()}
Adenin_CommonNH_Lig_Resdict['%s'%id]=Adenin_Common_combine_Lig_Res_NH_uniquify#final dic for table with pdb id , lig atom and residues for common group
Adenin_Common_combine_Lig_Res_NH_distance.setdefault('%s'%atmNH,[]).append(distanceNH)#creating dictionary with common lig atom and residues for table
Adenin_Common_combine_Lig_Res_NH_distance_uniquify= {k:list(set(j)) for k,j in Adenin_Common_combine_Lig_Res_NH_distance.items()}
Adenin_CommonNH_Lig_Resdict_distance['%s'%id]=Adenin_Common_combine_Lig_Res_NH_distance_uniquify#final dic for table with pdb id , lig atom and residues for common group
Nicot_listdata_H=[]
Nicot_listdata_NH=[]
Nicot_lresidueH=[]
Nicot_latomH=[]
Nicot_lresidueNH=[]
Nicot_latomNH=[]
Nicot_All_combine_Lig_Res_H={}
Nicot_Common_combine_Lig_Res_H={}
Nicot_All_combine_Lig_Res_NH={}
Nicot_Common_combine_Lig_Res_NH={}
Nicot_All_combine_Lig_Res_H_distance={}
Nicot_Common_combine_Lig_Res_H_distance={}
Nicot_All_combine_Lig_Res_NH_distance={}
Nicot_Common_combine_Lig_Res_NH_distance={}
Nicot_common_listdata_H=[]
Nicot_common_listdata_NH=[]
Nicot_finalsetH.clear()
Nicot_finalsetNH.clear()
Ribitol_listdata_H=[]
Ribitol_listdata_NH=[]
Ribitol_lresidueH=[]
Ribitol_latomH=[]
Ribitol_lresidueNH=[]
Ribitol_latomNH=[]
Ribitol_All_combine_Lig_Res_H={}
Ribitol_Common_combine_Lig_Res_H={}
Ribitol_All_combine_Lig_Res_NH={}
Ribitol_Common_combine_Lig_Res_NH={}
Ribitol_All_combine_Lig_Res_H_distance={}
Ribitol_Common_combine_Lig_Res_H_distance={}
Ribitol_All_combine_Lig_Res_NH_distance={}
Ribitol_Common_combine_Lig_Res_NH_distance={}
phosphate_listdata_H=[]
phosphate_listdata_NH=[]
phosphate_lresidueH=[]
phosphate_latomH=[]
phosphate_lresidueNH=[]
phosphate_latomNH=[]
phosphate_All_combine_Lig_Res_H={}
phosphate_Common_combine_Lig_Res_H={}
phosphate_All_combine_Lig_Res_NH={}
phosphate_Common_combine_Lig_Res_NH={}
phosphate_All_combine_Lig_Res_H_distance={}
phosphate_Common_combine_Lig_Res_H_distance={}
phosphate_All_combine_Lig_Res_NH_distance={}
phosphate_Common_combine_Lig_Res_NH_distance={}
phosphate_common_listdata_H=[]
phosphate_common_listdata_NH=[]
phosphate_finalsetH.clear()
phosphate_finalsetNH.clear()