chython 2.4__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. chython/__init__.py +31 -0
  2. chython/_functions.py +69 -0
  3. chython/algorithms/__init__.py +18 -0
  4. chython/algorithms/_isomorphism.cp312-win_amd64.pyd +0 -0
  5. chython/algorithms/_isomorphism.pyx +189 -0
  6. chython/algorithms/aromatics/__init__.py +27 -0
  7. chython/algorithms/aromatics/_rules.py +124 -0
  8. chython/algorithms/aromatics/kekule.py +530 -0
  9. chython/algorithms/aromatics/test/__init__.py +18 -0
  10. chython/algorithms/aromatics/test/test_kekule.py +160 -0
  11. chython/algorithms/aromatics/test/test_thiele.py +263 -0
  12. chython/algorithms/aromatics/thiele.py +226 -0
  13. chython/algorithms/calculate2d/__init__.py +23 -0
  14. chython/algorithms/calculate2d/clean2d.js +1 -0
  15. chython/algorithms/calculate2d/molecule.py +149 -0
  16. chython/algorithms/calculate2d/reaction.py +80 -0
  17. chython/algorithms/depict.py +523 -0
  18. chython/algorithms/fingerprints/__init__.py +48 -0
  19. chython/algorithms/fingerprints/linear.py +208 -0
  20. chython/algorithms/fingerprints/morgan.py +137 -0
  21. chython/algorithms/fingerprints/test/__init__.py +18 -0
  22. chython/algorithms/fingerprints/test/test_linear.py +127 -0
  23. chython/algorithms/fingerprints/test/test_morgan.py +79 -0
  24. chython/algorithms/isomorphism.py +667 -0
  25. chython/algorithms/mapping/__init__.py +28 -0
  26. chython/algorithms/mapping/_groups.py +94 -0
  27. chython/algorithms/mapping/_reactions.py +72 -0
  28. chython/algorithms/mapping/attention.py +216 -0
  29. chython/algorithms/mapping/fixmapper.py +84 -0
  30. chython/algorithms/mapping/groups.py +137 -0
  31. chython/algorithms/mcs.py +202 -0
  32. chython/algorithms/morgan.py +82 -0
  33. chython/algorithms/rings.py +551 -0
  34. chython/algorithms/smiles.py +556 -0
  35. chython/algorithms/standardize/__init__.py +30 -0
  36. chython/algorithms/standardize/_charged.py +115 -0
  37. chython/algorithms/standardize/_groups.py +926 -0
  38. chython/algorithms/standardize/_metal_organics.py +189 -0
  39. chython/algorithms/standardize/_reagents.py +44 -0
  40. chython/algorithms/standardize/_salts.py +68 -0
  41. chython/algorithms/standardize/molecule.py +479 -0
  42. chython/algorithms/standardize/reaction.py +429 -0
  43. chython/algorithms/standardize/resonance.py +196 -0
  44. chython/algorithms/standardize/salts.py +128 -0
  45. chython/algorithms/standardize/saturation.py +378 -0
  46. chython/algorithms/standardize/test/__init__.py +18 -0
  47. chython/algorithms/standardize/test/test_groups.py +118 -0
  48. chython/algorithms/stereo.py +1222 -0
  49. chython/algorithms/tautomers/__init__.py +171 -0
  50. chython/algorithms/tautomers/_acid.py +59 -0
  51. chython/algorithms/tautomers/_base.py +116 -0
  52. chython/algorithms/tautomers/_keto_enol.py +107 -0
  53. chython/algorithms/tautomers/acid_base.py +214 -0
  54. chython/algorithms/tautomers/heteroarenes.py +108 -0
  55. chython/algorithms/tautomers/keto_enol.py +148 -0
  56. chython/algorithms/tautomers/test/__init__.py +18 -0
  57. chython/algorithms/tautomers/test/test_tautomers.py +80 -0
  58. chython/algorithms/test/__init__.py +18 -0
  59. chython/algorithms/test/test_isomorphism.py +58 -0
  60. chython/algorithms/test/test_smiles.py +76 -0
  61. chython/algorithms/x3dom.py +355 -0
  62. chython/containers/__init__.py +43 -0
  63. chython/containers/_pack_v2.cp312-win_amd64.pyd +0 -0
  64. chython/containers/_pack_v2.pyx +271 -0
  65. chython/containers/_unpack_v0v2.cp312-win_amd64.pyd +0 -0
  66. chython/containers/_unpack_v0v2.pyx +300 -0
  67. chython/containers/bonds.py +255 -0
  68. chython/containers/cgr.py +115 -0
  69. chython/containers/graph.py +200 -0
  70. chython/containers/molecule.py +695 -0
  71. chython/containers/query.py +66 -0
  72. chython/containers/reaction.py +324 -0
  73. chython/exceptions.py +114 -0
  74. chython/files/MRVrw.py +523 -0
  75. chython/files/PDBrw.py +257 -0
  76. chython/files/RDFrw.py +298 -0
  77. chython/files/SDFrw.py +221 -0
  78. chython/files/__init__.py +29 -0
  79. chython/files/_convert.py +207 -0
  80. chython/files/_mapping.py +117 -0
  81. chython/files/_xyz.cp312-win_amd64.pyd +0 -0
  82. chython/files/_xyz.pyx +74 -0
  83. chython/files/daylight/__init__.py +24 -0
  84. chython/files/daylight/parser.py +157 -0
  85. chython/files/daylight/smarts.py +107 -0
  86. chython/files/daylight/smiles.py +245 -0
  87. chython/files/daylight/test/__init__.py +18 -0
  88. chython/files/daylight/test/test_daylight_smarts.py +289 -0
  89. chython/files/daylight/test/test_daylight_smiles.py +101 -0
  90. chython/files/daylight/test/test_parser.py +118 -0
  91. chython/files/daylight/test/test_tokenize.py +77 -0
  92. chython/files/daylight/tokenize.py +376 -0
  93. chython/files/libinchi/__init__.py +22 -0
  94. chython/files/libinchi/libinchi.dll +0 -0
  95. chython/files/libinchi/wrapper.py +555 -0
  96. chython/files/mdl/__init__.py +25 -0
  97. chython/files/mdl/emol.py +209 -0
  98. chython/files/mdl/erxn.py +67 -0
  99. chython/files/mdl/mol.py +144 -0
  100. chython/files/mdl/read.py +225 -0
  101. chython/files/mdl/rxn.py +67 -0
  102. chython/files/mdl/stereo.py +63 -0
  103. chython/files/mdl/write.py +165 -0
  104. chython/files/xyz.py +78 -0
  105. chython/periodictable/__init__.py +69 -0
  106. chython/periodictable/base/__init__.py +25 -0
  107. chython/periodictable/base/dynamic.py +149 -0
  108. chython/periodictable/base/element.py +452 -0
  109. chython/periodictable/base/groups.py +90 -0
  110. chython/periodictable/base/periods.py +46 -0
  111. chython/periodictable/base/query.py +473 -0
  112. chython/periodictable/base/vector.py +119 -0
  113. chython/periodictable/groupI.py +252 -0
  114. chython/periodictable/groupII.py +223 -0
  115. chython/periodictable/groupIII.py +1154 -0
  116. chython/periodictable/groupIV.py +210 -0
  117. chython/periodictable/groupIX.py +196 -0
  118. chython/periodictable/groupV.py +192 -0
  119. chython/periodictable/groupVI.py +183 -0
  120. chython/periodictable/groupVII.py +162 -0
  121. chython/periodictable/groupVIII.py +161 -0
  122. chython/periodictable/groupX.py +166 -0
  123. chython/periodictable/groupXI.py +164 -0
  124. chython/periodictable/groupXII.py +158 -0
  125. chython/periodictable/groupXIII.py +239 -0
  126. chython/periodictable/groupXIV.py +262 -0
  127. chython/periodictable/groupXV.py +276 -0
  128. chython/periodictable/groupXVI.py +457 -0
  129. chython/periodictable/groupXVII.py +324 -0
  130. chython/periodictable/groupXVIII.py +260 -0
  131. chython/reactor/__init__.py +24 -0
  132. chython/reactor/base.py +212 -0
  133. chython/reactor/deprotection.py +565 -0
  134. chython/reactor/groups.py +128 -0
  135. chython/reactor/reactions/__init__.py +157 -0
  136. chython/reactor/reactions/_amidation.py +58 -0
  137. chython/reactor/reactions/_amine_isocyanate.py +52 -0
  138. chython/reactor/reactions/_buchwald_hartwig.py +50 -0
  139. chython/reactor/reactions/_esterification.py +49 -0
  140. chython/reactor/reactions/_macmillan.py +43 -0
  141. chython/reactor/reactions/_reductive_amination.py +50 -0
  142. chython/reactor/reactions/_sonogashira.py +49 -0
  143. chython/reactor/reactions/_sulfonamidation.py +52 -0
  144. chython/reactor/reactions/_suzuki_miyaura.py +88 -0
  145. chython/reactor/reactions/ufe.py +99 -0
  146. chython/reactor/reactor.py +170 -0
  147. chython/reactor/retro/__init__.py +77 -0
  148. chython/reactor/retro/_amidation.py +39 -0
  149. chython/reactor/retro/_aryl_amination.py +32 -0
  150. chython/reactor/retro/_mitsunobu.py +49 -0
  151. chython/reactor/retro/_sonogashira.py +49 -0
  152. chython/reactor/retro/_suzuki_miyaura.py +54 -0
  153. chython/reactor/scaffold.py +122 -0
  154. chython/reactor/test/__init__.py +18 -0
  155. chython/reactor/test/test_deprotection.py +57 -0
  156. chython/reactor/test/test_reactor.py +40 -0
  157. chython/reactor/test/test_scaffold.py +57 -0
  158. chython/reactor/test/test_transformer.py +40 -0
  159. chython/reactor/transformer.py +62 -0
  160. chython/utils/__init__.py +57 -0
  161. chython/utils/free_wilson.py +114 -0
  162. chython/utils/grid.py +130 -0
  163. chython/utils/rdkit.py +165 -0
  164. chython/utils/retro.py +139 -0
  165. chython/utils/svg.py +57 -0
  166. chython/utils/test/__init__.py +18 -0
  167. chython/utils/test/test_rdkit.py +71 -0
  168. chython-2.4.dist-info/LICENSE +165 -0
  169. chython-2.4.dist-info/METADATA +101 -0
  170. chython-2.4.dist-info/RECORD +171 -0
  171. chython-2.4.dist-info/WHEEL +4 -0
@@ -0,0 +1,115 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright 2021-2023 Ramil Nugmanov <nougmanoff@protonmail.com>
4
+ # This file is part of chython.
5
+ #
6
+ # chython is free software; you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as published by
8
+ # the Free Software Foundation; either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with this program; if not, see <https://www.gnu.org/licenses/>.
18
+ #
19
+ from lazy_object_proxy import Proxy
20
+
21
+
22
+ def _fixed_rules():
23
+ """
24
+ Rules working without Morgan.
25
+ These rules are used for charge canonization for heterocycles
26
+ """
27
+ from ... import smarts
28
+
29
+ rules = []
30
+
31
+ # N1C=CN2[NH+]=CC=C12>>N1C=CC2=[NH+]C=CN12
32
+ # first and second atoms are ryrrole-like
33
+ # second atom will be charged
34
+ # if fix is True, third atom will be uncharged else first
35
+ q = smarts('[N;a;r5;+:1]:1:[N;r5:3]:2:[C;r5](:[N;r5:2]:[C;r5]:[C;r5]:2):[C;r5]:[C;r5]:1')
36
+ rules.append((q, False))
37
+
38
+ # N1C=C[N+]2=C1C=CN2>>N1C=CC2=[NH+]C=CN12
39
+ q = smarts('[N;a;r5;+:3]:1:2:[N;r5:1]:[C;r5]:[C;r5]:[C;r5]:1:[N;r5:2]:[C;r5]:[C;r5]:2')
40
+ rules.append((q, True))
41
+
42
+ # N1C=C2C=CN[N+]2=C1>>N1C=CC2=C[NH+]=CN12
43
+ q = smarts('[N;a;r5;+:3]:1:2:[N;r5:1]:[C;r5]:[C;r5]:[C;r5]:1:[C;r5]:[N;r5:2]:[C;r5]:2')
44
+ rules.append((q, True))
45
+
46
+ # N1C=C2NC=C[N+]2=C1>>N1C=CN2C=[NH+]C=C12
47
+ q = smarts('[N;a;r5;+:3]:1:2:[C;r5](:[N;r5:1]:[C;r5]:[C;r5]:1):[C;r5]:[N;r5:2]:[C;r5]:2')
48
+ rules.append((q, True))
49
+
50
+ # N1C2=[NH+]C=CC2=CC=C1>>N1C=CC2=CC=C[NH+]=C12
51
+ q = smarts('[N;a;r5;+:1]:1:[C;r6]:2:[N;r6:2]:[C;r6]:[C;r6]:[C;r6]:[C;r5]:2:[C;r5]:[C;r5]:1')
52
+ rules.append((q, False))
53
+
54
+ # N1C=C2C(=CC=[NH+]2)C=C1>>N1C=CC2=CC=[NH+]C=C12
55
+ q = smarts('[N;a;r5;+:1]:1:[C;r6]:2:[C;r6]:[N;r6:2]:[C;r6]:[C;r6]:[C;r5]:2:[C;r5]:[C;r5]:1')
56
+ rules.append((q, False))
57
+
58
+ # C1=CC=2C(=[NH+]1)C=CNC=2>>N1C=CC2=C[NH+]=CC=C12
59
+ q = smarts('[N;a;r5;+:1]:1:[C;r6]:2:[C;r6]:[C;r6]:[N;r6:2]:[C;r6]:[C;r5]:2:[C;r5]:[C;r5]:1')
60
+ rules.append((q, False))
61
+
62
+ # C=1C=[NH+]C=2C=1NC=CC=2>>N1C=CC2=[NH+]C=CC=C12
63
+ q = smarts('[N;a;r5;+:1]:1:[C;r6]:2:[C;r6]:[C;r6]:[C;r6]:[N;r6:2]:[C;r5]:2:[C;r5]:[C;r5]:1')
64
+ rules.append((q, False))
65
+
66
+ # C1=2C=[NH+]C=C1NC=CC=2>>N1C=C2C=CC=[NH+]C2=C1
67
+ q = smarts('[N;a;r5;+:1]:1:[C;r5]:[C;r6]:2:[N;r6:2]:[C;r6]:[C;r6]:[C;r6]:[C;r5]:2:[C;r5]:1')
68
+ rules.append((q, False))
69
+
70
+ # C1=2C=CNC=C1C=[NH+]C=2>>N1C=C2C=C[NH+]=CC2=C1
71
+ q = smarts('[N;a;r5;+:1]:1:[C;r5]:[C;r6]:2:[C;r6]:[N;r6:2]:[C;r6]:[C;r6]:[C;r5]:2:[C;r5]:1')
72
+ rules.append((q, False))
73
+ return rules
74
+
75
+
76
+ def _morgan_rules():
77
+ """
78
+ Rules working with Morgan.
79
+ These rules are for charge canonization
80
+ """
81
+ from ... import smarts
82
+
83
+ rules = []
84
+
85
+ # N1C=CC2=CC=[NH+]N12
86
+ q = smarts('[N;a;r5;+:1]:1:[N;D3]:2:[N;r5:2]:[C;r5]:[C;r5]:[C;D3]:2:[C;r5]:[C;r5]:1')
87
+ rules.append((q, False))
88
+
89
+ # N1C=CC2=[N+]1NC=C2
90
+ q = smarts('[N;a;D3;r5;+:3]:1:2:[N;r5:1]:[C;r5]:[C;r5]:[C;D3]:1:[C;r5]:[C;r5]:[N;r5:2]:2')
91
+ rules.append((q, True))
92
+
93
+ # N1C=CN2C=C[NH+]=C12
94
+ q = smarts('[N;a;r5;+:1]:1:[C;D3]:2:[N;r5:2]:[C;r5]:[C;r5]:[N;D3]:2:[C;r5]:[C;r5]:1')
95
+ rules.append((q, False))
96
+
97
+ # N1C=C[N+]2=C1NC=C2
98
+ q = smarts('[N;a;D3;r5;+:3]:1:2:[C;D3](:[N;r5:1]:[C;r5]:[C;r5]:1):[N;r5:2]:[C;r5]:[C;r5]:2')
99
+ rules.append((q, True))
100
+
101
+ # imidazole
102
+ q = smarts('[N;a;r5;+:1]:1:[C;r5]:[N;r5:2]:[C;r5]:[C;r5]:1')
103
+ rules.append((q, False))
104
+
105
+ # pyrazole+
106
+ q = smarts('[N;a;r5;+:1]:1:[N;r5:2]:[C;r5]:[C;r5]:[C;r5]:1')
107
+ rules.append((q, False))
108
+ return rules
109
+
110
+
111
+ fixed_rules = Proxy(_fixed_rules)
112
+ morgan_rules = Proxy(_morgan_rules)
113
+
114
+
115
+ __all__ = ['fixed_rules', 'morgan_rules']