File: 11stereo.py

package info (click to toggle)
pymol 2.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 42,288 kB
  • sloc: cpp: 476,472; python: 76,538; ansic: 29,510; javascript: 6,792; sh: 47; makefile: 24
file content (179 lines) | stat: -rw-r--r-- 2,816 bytes parent folder | download | duplicates (12)
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
from chempy.champ import Champ

ch = Champ()

# basic validation of stereochemistry handling on the simplest system

IS = [ # implicit patterns (S) 
   "[C@H](C)(N)O",
   "[C@H](N)(O)C",
   "[C@H](O)(C)N",

   "C[C@H](N)O",
   "N[C@H](O)C",
   "O[C@H](C)N",

   "[C@@H](C)(O)N",
   "[C@@H](N)(C)O",
   "[C@@H](O)(N)C",

   "C[C@@H](O)N",
   "N[C@@H](C)O",
   "O[C@@H](N)C",

   ]

IR = [ # implicit patterns (R) 
   "[C@@H](C)(N)O",
   "[C@@H](N)(O)C",
   "[C@@H](O)(C)N",

   "C[C@@H](N)O",
   "N[C@@H](O)C",
   "O[C@@H](C)N",

   "[C@H](C)(O)N",
   "[C@H](N)(C)O",
   "[C@H](O)(N)C",

   "C[C@H](O)N",
   "N[C@H](C)O",
   "O[C@H](N)C",

   ]

XS = [ # explicit patterns (S) 

   "H[C@](C)(N)O",
   "H[C@](N)(O)C",
   "H[C@](O)(C)N",

   "C[C@](H)(O)N",
   "N[C@](H)(C)O",
   "O[C@](H)(N)C",

   "O[C@](N)(C)H",
   "C[C@](O)(N)H",
   "N[C@](C)(O)H",

   "N[C@](O)(H)C",
   "O[C@](C)(H)N",
   "C[C@](N)(H)O",

   "H[C@@](C)(O)N",
   "H[C@@](N)(C)O",
   "H[C@@](O)(N)C",

   "C[C@@](H)(N)O",
   "N[C@@](H)(O)C",
   "O[C@@](H)(C)N",

   "O[C@@](N)(H)C",
   "C[C@@](O)(H)N",
   "N[C@@](C)(H)O",

   "N[C@@](O)(C)H",
   "O[C@@](C)(N)H",
   "C[C@@](N)(O)H",

   ]

XR = [ # explicit patterns (R) 

   "H[C@@](C)(N)O",
   "H[C@@](N)(O)C",
   "H[C@@](O)(C)N",

   "C[C@@](H)(O)N",
   "N[C@@](H)(C)O",
   "O[C@@](H)(N)C",

   "O[C@@](N)(C)H",
   "C[C@@](O)(N)H",
   "N[C@@](C)(O)H",

   "N[C@@](O)(H)C",
   "O[C@@](C)(H)N",
   "C[C@@](N)(H)O",

   "H[C@](C)(O)N",
   "H[C@](N)(C)O",
   "H[C@](O)(N)C",

   "C[C@](H)(N)O",
   "N[C@](H)(O)C",
   "O[C@](H)(C)N",

   "O[C@](N)(H)C",
   "C[C@](O)(H)N",
   "N[C@](C)(H)O",

   "N[C@](O)(C)H",
   "O[C@](C)(N)H",
   "C[C@](N)(O)H",

   ]

I = [ # implicit patterns (achiral)

   "[CH](C)(N)O",
   "[CH](N)(O)C",
   "[CH](O)(C)N",

   "C[CH](N)O",
   "N[CH](O)C",
   "O[CH](C)N",

   ]

X = [ # explicit patterns (achiral)

   "HC(C)(N)O",
   "HC(N)(O)C",
   "HC(O)(C)N",

   "CC(H)(O)N",
   "NC(H)(C)O",
   "OC(H)(N)C",

   "OC(N)(C)H",
   "CC(O)(N)H",
   "NC(C)(O)H",

   "NC(O)(H)C",
   "OC(C)(H)N",
   "CC(N)(H)O",

   ]

# print 

PIS = map(lambda x:ch.insert_pattern_string(x),IS)
PXS = map(lambda x:ch.insert_pattern_string(x),XS)

for a in range(0,len(PIS)):
   print IS[a],ch.pattern_get_string(PIS[a])

for a in range(0,len(PXS)):
   print XS[a],ch.pattern_get_string(PXS[a])

PIR = map(lambda x:ch.insert_pattern_string(x),IR)
PXR = map(lambda x:ch.insert_pattern_string(x),XR)

for a in range(0,len(PIR)):
   print IR[a],ch.pattern_get_string(PIR[a])

for a in range(0,len(PXR)):
   print XR[a],ch.pattern_get_string(PXR[a])


PI = map(lambda x:ch.insert_pattern_string(x),I)
PX = map(lambda x:ch.insert_pattern_string(x),X)

for a in range(0,len(PI)):
   print I[a],ch.pattern_get_string(PI[a])

for a in range(0,len(PX)):
   print X[a],ch.pattern_get_string(PX[a])