haneulpark
commited on
Commit
•
4e48d81
1
Parent(s):
93efe01
Update README.md
Browse files
README.md
CHANGED
@@ -118,7 +118,7 @@ then load, featurize, split, fit, and evaluate the a catboost model
|
|
118 |
from molflux.modelzoo import load_from_dict as load_model_from_dict
|
119 |
from molflux.metrics import load_suite
|
120 |
|
121 |
-
To sanitize
|
122 |
|
123 |
import pandas as pd
|
124 |
import numpy as np
|
@@ -127,16 +127,17 @@ To sanitize compounds, import some modules
|
|
127 |
from rdkit import Chem
|
128 |
import molvs
|
129 |
|
130 |
-
Some
|
|
|
131 |
|
132 |
# failed to parse smiles, looked it up in ChemSpider and found Octahydro-1H-purine-6-thiol
|
133 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
134 |
# https://www.chemspider.com/Chemical-Structure.114454999.html?rid=8f8bdf21-6482-44e5-adc9-71c5aef41627
|
135 |
-
Long2023.loc[Long2023['SMILES'] == 'Sc1[nH]cnc-2[n+H]cnc1-2', 'SMILES'] = "SC1NCNC2NCNC21"
|
136 |
|
137 |
# failed to parse smiles, looked it up in Pubchem and found 2-Amino-3,7-dihydropurin-1-ium-6-thione
|
138 |
# https://pubchem.ncbi.nlm.nih.gov/compound/117071895
|
139 |
-
Long2023.loc[Long2023['SMILES'] == 'Sc1nc(N)nc2[n+H]c[nH]c12', 'SMILES'] = "C1=NC2=C(N1)C(=S)[NH+]=C(N2)N"
|
140 |
|
141 |
# failed to parse smiles, looked it up in ChemSpider and found gentamicin
|
142 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
@@ -144,50 +145,50 @@ Long2023.loc[Long2023['SMILES'] == 'Sc1nc(N)nc2[n+H]c[nH]c12', 'SMILES'] = "C1=N
|
|
144 |
# It's unclear from the smiles, if they used just one of the forms or the mixture of all three
|
145 |
# Clinically, there appears to be a wide range of compositions of C1, C1a, C2 forms (!)
|
146 |
# Here, we'll just use the C1 form (https://www.ebi.ac.uk/chebi/searchId.do;D579C431E9548A30AFBD88A2D05CA777?chebiId=CHEBI:27412)
|
147 |
-
Long2023.loc[Long2023['SMILES'] == 'O(C1C(O)C(OC2C(O)C([N+H2]C)[C@](O)(C)CO2)C(N)CC1N)C1C([N+H3])CCC(C([N+H2]C)C)O1', 'SMILES'] = \
|
148 |
"CNC(C)[C@@H]1CC[C@@H](N)[C@H](O1)O[C@@H]1[C@@H](N)C[C@@H](N)[C@H](O[C@H]2OC[C@](C)(O)[C@H](NC)[C@H]2O)[C@H]1O"
|
149 |
|
150 |
# failed to parse smiles, looked it up in ChemSpider and found (2S)-2-Hydroxy-N-isopropyl-3-(1-naphthyloxy)-1-propanaminium
|
151 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
152 |
# https://www.chemspider.com/Chemical-Structure.5296478.html?rid=129380a1-888e-48d0-b240-43646b288842
|
153 |
-
Long2023.loc[Long2023['SMILES'] == 'O(C[C@@H](O)C[N+H2]C(C)C)c1c2c(ccc1)cccc2', 'SMILES'] = \
|
154 |
"O[C@@H](C[NH2+]C(C)C)COc2cccc1ccccc12"
|
155 |
|
156 |
# failed to parse smiles, looked it up in ChemSpider, removing charge and H from nitrogens
|
157 |
# matches Periciazine, which I think is what this compound is
|
158 |
# https://www.chemspider.com/Chemical-Structure.4585.html?rid=0694332f-3886-4df1-85d4-8cdb11554c3d
|
159 |
-
Long2023.loc[Long2023['SMILES'] == 'OC1CC[N+H](CCC[N+@H]2c3c(Sc4c2cccc4)ccc(C#N)c3)CC1', 'SMILES'] = \
|
160 |
"c1ccc2c(c1)N(c3cc(ccc3S2)C#N)CCCN4CCC(CC4)O"
|
161 |
|
162 |
# failed to parse smiles, looked it up in ChemSpider and found idarubicin
|
163 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
164 |
# Idarubicin, or 4-demethoxydaunorubicin is an anthracycline antileukemic drug.
|
165 |
# https://www.chemspider.com/Chemical-Structure.39117.html?rid=a418032b-d8ab-4200-9226-bcb194221cf0&page_num=0
|
166 |
-
Long2023.loc[Long2023['SMILES'] == 'O=C(C)[C@@]1(O)CC(OC2OC(C)C(O)C([N+H3])C2)c2c(O)c3C(=O)c4c(C(=O)c3c(O)c2C1)cccc4', 'SMILES'] = \
|
167 |
"C[C@H]1[C@H]([C@H](C[C@@H](O1)O[C@H]2C[C@@](Cc3c2c(c4c(c3O)C(=O)c5ccccc5C4=O)O)(C(=O)C)O)N)O"
|
168 |
|
169 |
# failed to parse smiles, looked it up in ChemSpider and found (2S)-5-[(6-Methoxy-8-quinolinyl)amino]-2-pentanaminium
|
170 |
# (Found by conversion of search term to chemical structure (full match))
|
171 |
# https://www.chemspider.com/Chemical-Structure.1291555.html?rid=b22e2c45-078e-48d9-8907-22deb37bed0c
|
172 |
-
Long2023.loc[Long2023['SMILES'] == 'O(C)c1cc(NCCC[C@@H]([N+H3])C)c2ncccc2c1', 'SMILES'] = "C[C@@H](CCCNc1cc(cc2c1nccc2)OC)[NH3+]"
|
173 |
|
174 |
# failed to parse smiles, looked it up in PUbchem
|
175 |
# found diethyl-[2-[[5-[(Z)-(5-fluoro-2-oxo-1H-indol-3-ylidene)methyl]-2,4-dimethyl-1H-pyrrole-3-carbonyl]amino]ethyl]azanium
|
176 |
# https://pubchem.ncbi.nlm.nih.gov/compound/40469377
|
177 |
-
Long2023.loc[Long2023['SMILES'] == 'Fc1cc2/C(=C/c3c(C)c(C(=O)NCC[N+H](CC)CC)c(C)[nH]3)/C(=O)Nc2cc1', 'SMILES'] = \
|
178 |
"CC[NH+](CC)CCNC(=O)C1=C(NC(=C1C)C=C2C3=C(C=CC(=C3)F)NC2=O)C"
|
179 |
|
180 |
# failed to parse smiles, looked it up in ChemSpider
|
181 |
# found 1-Methyl-4-{4-[(4-methyl-3-{[4-(3-pyridinyl)-2-pyrimidinyl]amino}phenyl)carbamoyl]benzyl}piperazin-1-ium
|
182 |
# (Found by conversion of search term to chemical structure (full match))
|
183 |
# https://www.chemspider.com/Chemical-Structure.13082883.html?rid=8baa4568-3947-473e-9fdc-8872f411694c#synonymsTab
|
184 |
-
Long2023.loc[Long2023['SMILES'] == 'O=C([N+H2]c1cc(Nc2nc(-c3cnccc3)ccn2)c(C)cc1)c1ccc(CN2CCN(C)CC2)cc1', 'SMILES'] = \
|
185 |
"Cc1ccc(cc1Nc2nccc(n2)c3cccnc3)NC(=O)c4ccc(cc4)CN5CC[NH+](CC5)C"
|
186 |
|
187 |
# failed to parse smiles, looked it up in ChemSpider and found 6-Chloro-9-{[(2S)-5-(diethylammonio)-2-pentanyl]amino}-2-methoxyacridinium
|
188 |
# (Found by conversion of search term to chemical structure (full match))
|
189 |
# https://www.chemspider.com/Chemical-Structure.5408834.html?rid=c1cdd9c2-d48b-4cd4-945d-606bf2bff1ee
|
190 |
-
Long2023.loc[Long2023['SMILES'] == 'Clc1cc2[n+H]c3c(c(N[C@H](CCC[N+H](CC)CC)C)c2cc1)cc(OC)cc3', 'SMILES'] = \
|
191 |
"Clc3ccc2c(c1cc(OC)ccc1[nH+]c2c3)N[C@@H](C)CCC[NH+](CC)CC"
|
192 |
|
193 |
# failed to parse smiles, looked it up in ChemSpider, removing charge
|
@@ -195,34 +196,86 @@ Long2023.loc[Long2023['SMILES'] == 'Clc1cc2[n+H]c3c(c(N[C@H](CCC[N+H](CC)CC)C)c2
|
|
195 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
196 |
# Carvedilol is a beta-blocker medication, that may be prescribed for treating high blood pressure and chronic heart failure with reduced ejection fraction.
|
197 |
# https://www.chemspider.com/Chemical-Structure.2487.html?rid=f8358443-8c32-4e5f-b1d8-47ad13ea8a16&page_num=0
|
198 |
-
Long2023.loc[Long2023['SMILES'] == 'O(CC[N+H2]C[C@H](O)COc1c-2c([N+H2]c3c-2cccc3)ccc1)c1c(OC)cccc1', 'SMILES'] = \
|
199 |
"COc1ccccc1OCCNCC(COc2cccc3c2c4ccccc4[nH]3)O"
|
200 |
|
201 |
# failed to parse smiles, looked it up in ChemSpider, found (2S)-1-(2,6-Dimethylphenoxy)-2-propanaminium
|
202 |
# (Found by conversion of search term to chemical structure (full match))
|
203 |
# https://www.chemspider.com/Chemical-Structure.5296573.html?rid=c8c0121e-fad3-4458-8c64-a0baa3e18358
|
204 |
-
Long2023.loc[Long2023['SMILES'] == 'O(C[C@@H]([N+H3])C)c1c(C)cccc1C', 'SMILES'] = \
|
205 |
"O(c1c(cccc1C)C)C[C@@H]([NH3+])C"
|
206 |
|
207 |
# failed to parse smiles, looked it up in ChemSpider and found 4-{2-[(5-Cyano-5,5-diphenylpentyl)(methyl)amino]ethyl}-4-methylmorpholin-4-ium
|
208 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
209 |
# https://www.chemspider.com/Chemical-Structure.2310136.html?rid=ce2b48f6-04d6-4df3-ad71-b6507906c7cb
|
210 |
-
Long2023.loc[Long2023['SMILES'] == '[N+@H](CCCCC(C#N)(c1ccccc1)c1ccccc1)(CC[N+]1(C)CCOCC1)C', 'SMILES'] = \
|
211 |
"CN(CCCCC(C#N)(c1ccccc1)c2ccccc2)CC[N+]3(CCOCC3)C"
|
212 |
|
213 |
# failed to parse smiles, looked it up in ChemSpider
|
214 |
# found (5E)-3-[(2R,6S)-2,6-Dimethyl-1-piperidinyl]-5-[(4-methoxybenzoyl)imino]-4,5-dihydro-1,2,3-oxadiazol-3-ium-4-ide
|
215 |
# (Found by conversion of search term to chemical structure (full match))
|
216 |
# https://www.chemspider.com/Chemical-Structure.28530638.html?rid=b44dbe3c-24f1-4303-8deb-82b879b7f0e0
|
217 |
-
Long2023.loc[Long2023['SMILES'] == 'O=C(/N=C1/ON=[N+](N2[C@@H](C)CCC[C@H]2C)[C-H]/1)c1ccc(OC)cc1', 'SMILES'] = \
|
218 |
"C[C@@H]1CCC[C@@H](N1[n+]2[cH-]/c(=N\C(=O)c3ccc(cc3)OC)/on2)C"
|
219 |
|
220 |
# failed to parse smiles, looked it up in Pubchem
|
221 |
# found ((R)-[(2S)-7-ethenyl-1-azabicyclo[2.2.1]heptan-2-yl]-(6-methoxyquinolin-4-yl)methanol
|
222 |
# https://pubchem.ncbi.nlm.nih.gov/compound/139247817
|
223 |
-
Long2023.loc[Long2023['SMILES'] == 'O(C)c1cc2c([C@@H](O)[C@@H]3[N+@H]4[C@@H](C=C)[C@H](C3)CC4)ccnc2cc1', 'SMILES'] = \
|
224 |
"COC1=CC2=C(C=CN=C2C=C1)C(C3CC4CCN3C4C=C)O"
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
split_dataset = load_dataset('maomlab/HematoxLong2022', name = 'HematoxLong2022')
|
228 |
|
@@ -234,8 +287,8 @@ Long2023.loc[Long2023['SMILES'] == 'O(C)c1cc2c([C@@H](O)[C@@H]3[N+@H]4[C@@H](C=C
|
|
234 |
model = load_model_from_dict({
|
235 |
"name": "cat_boost_classifier",
|
236 |
"config": {
|
237 |
-
"x_features": ['
|
238 |
-
"y_features": ['
|
239 |
|
240 |
model.train(split_featurised_dataset["train"])
|
241 |
preds = model.predict(split_featurised_dataset["test"])
|
@@ -243,8 +296,8 @@ Long2023.loc[Long2023['SMILES'] == 'O(C)c1cc2c([C@@H](O)[C@@H]3[N+@H]4[C@@H](C=C
|
|
243 |
classification_suite = load_suite("classification")
|
244 |
|
245 |
scores = classification_suite.compute(
|
246 |
-
references=split_featurised_dataset["test"]['
|
247 |
-
predictions=preds["cat_boost_classifier::
|
248 |
|
249 |
## Citation
|
250 |
Cite this:
|
|
|
118 |
from molflux.modelzoo import load_from_dict as load_model_from_dict
|
119 |
from molflux.metrics import load_suite
|
120 |
|
121 |
+
To sanitize molecules, import some modules
|
122 |
|
123 |
import pandas as pd
|
124 |
import numpy as np
|
|
|
127 |
from rdkit import Chem
|
128 |
import molvs
|
129 |
|
130 |
+
Some molecules cause SMILES parse error, which could be resolved by the code below
|
131 |
+
Long2023 = HematoxLong2023.to_pd()
|
132 |
|
133 |
# failed to parse smiles, looked it up in ChemSpider and found Octahydro-1H-purine-6-thiol
|
134 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
135 |
# https://www.chemspider.com/Chemical-Structure.114454999.html?rid=8f8bdf21-6482-44e5-adc9-71c5aef41627
|
136 |
+
Long2023.loc[Long2023['SMILES'] == 'Sc1[nH]cnc-2[n+H]cnc1-2', 'SMILES'] = "SC1NCNC2NCNC21"
|
137 |
|
138 |
# failed to parse smiles, looked it up in Pubchem and found 2-Amino-3,7-dihydropurin-1-ium-6-thione
|
139 |
# https://pubchem.ncbi.nlm.nih.gov/compound/117071895
|
140 |
+
Long2023.loc[Long2023['SMILES'] == 'Sc1nc(N)nc2[n+H]c[nH]c12', 'SMILES'] = "C1=NC2=C(N1)C(=S)[NH+]=C(N2)N"
|
141 |
|
142 |
# failed to parse smiles, looked it up in ChemSpider and found gentamicin
|
143 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
|
|
145 |
# It's unclear from the smiles, if they used just one of the forms or the mixture of all three
|
146 |
# Clinically, there appears to be a wide range of compositions of C1, C1a, C2 forms (!)
|
147 |
# Here, we'll just use the C1 form (https://www.ebi.ac.uk/chebi/searchId.do;D579C431E9548A30AFBD88A2D05CA777?chebiId=CHEBI:27412)
|
148 |
+
Long2023.loc[Long2023['SMILES'] == 'O(C1C(O)C(OC2C(O)C([N+H2]C)[C@](O)(C)CO2)C(N)CC1N)C1C([N+H3])CCC(C([N+H2]C)C)O1', 'SMILES'] = \
|
149 |
"CNC(C)[C@@H]1CC[C@@H](N)[C@H](O1)O[C@@H]1[C@@H](N)C[C@@H](N)[C@H](O[C@H]2OC[C@](C)(O)[C@H](NC)[C@H]2O)[C@H]1O"
|
150 |
|
151 |
# failed to parse smiles, looked it up in ChemSpider and found (2S)-2-Hydroxy-N-isopropyl-3-(1-naphthyloxy)-1-propanaminium
|
152 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
153 |
# https://www.chemspider.com/Chemical-Structure.5296478.html?rid=129380a1-888e-48d0-b240-43646b288842
|
154 |
+
Long2023.loc[Long2023['SMILES'] == 'O(C[C@@H](O)C[N+H2]C(C)C)c1c2c(ccc1)cccc2', 'SMILES'] = \
|
155 |
"O[C@@H](C[NH2+]C(C)C)COc2cccc1ccccc12"
|
156 |
|
157 |
# failed to parse smiles, looked it up in ChemSpider, removing charge and H from nitrogens
|
158 |
# matches Periciazine, which I think is what this compound is
|
159 |
# https://www.chemspider.com/Chemical-Structure.4585.html?rid=0694332f-3886-4df1-85d4-8cdb11554c3d
|
160 |
+
Long2023.loc[Long2023['SMILES'] == 'OC1CC[N+H](CCC[N+@H]2c3c(Sc4c2cccc4)ccc(C#N)c3)CC1', 'SMILES'] = \
|
161 |
"c1ccc2c(c1)N(c3cc(ccc3S2)C#N)CCCN4CCC(CC4)O"
|
162 |
|
163 |
# failed to parse smiles, looked it up in ChemSpider and found idarubicin
|
164 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
165 |
# Idarubicin, or 4-demethoxydaunorubicin is an anthracycline antileukemic drug.
|
166 |
# https://www.chemspider.com/Chemical-Structure.39117.html?rid=a418032b-d8ab-4200-9226-bcb194221cf0&page_num=0
|
167 |
+
Long2023.loc[Long2023['SMILES'] == 'O=C(C)[C@@]1(O)CC(OC2OC(C)C(O)C([N+H3])C2)c2c(O)c3C(=O)c4c(C(=O)c3c(O)c2C1)cccc4', 'SMILES'] = \
|
168 |
"C[C@H]1[C@H]([C@H](C[C@@H](O1)O[C@H]2C[C@@](Cc3c2c(c4c(c3O)C(=O)c5ccccc5C4=O)O)(C(=O)C)O)N)O"
|
169 |
|
170 |
# failed to parse smiles, looked it up in ChemSpider and found (2S)-5-[(6-Methoxy-8-quinolinyl)amino]-2-pentanaminium
|
171 |
# (Found by conversion of search term to chemical structure (full match))
|
172 |
# https://www.chemspider.com/Chemical-Structure.1291555.html?rid=b22e2c45-078e-48d9-8907-22deb37bed0c
|
173 |
+
Long2023.loc[Long2023['SMILES'] == 'O(C)c1cc(NCCC[C@@H]([N+H3])C)c2ncccc2c1', 'SMILES'] = "C[C@@H](CCCNc1cc(cc2c1nccc2)OC)[NH3+]"
|
174 |
|
175 |
# failed to parse smiles, looked it up in PUbchem
|
176 |
# found diethyl-[2-[[5-[(Z)-(5-fluoro-2-oxo-1H-indol-3-ylidene)methyl]-2,4-dimethyl-1H-pyrrole-3-carbonyl]amino]ethyl]azanium
|
177 |
# https://pubchem.ncbi.nlm.nih.gov/compound/40469377
|
178 |
+
Long2023.loc[Long2023['SMILES'] == 'Fc1cc2/C(=C/c3c(C)c(C(=O)NCC[N+H](CC)CC)c(C)[nH]3)/C(=O)Nc2cc1', 'SMILES'] = \
|
179 |
"CC[NH+](CC)CCNC(=O)C1=C(NC(=C1C)C=C2C3=C(C=CC(=C3)F)NC2=O)C"
|
180 |
|
181 |
# failed to parse smiles, looked it up in ChemSpider
|
182 |
# found 1-Methyl-4-{4-[(4-methyl-3-{[4-(3-pyridinyl)-2-pyrimidinyl]amino}phenyl)carbamoyl]benzyl}piperazin-1-ium
|
183 |
# (Found by conversion of search term to chemical structure (full match))
|
184 |
# https://www.chemspider.com/Chemical-Structure.13082883.html?rid=8baa4568-3947-473e-9fdc-8872f411694c#synonymsTab
|
185 |
+
Long2023.loc[Long2023['SMILES'] == 'O=C([N+H2]c1cc(Nc2nc(-c3cnccc3)ccn2)c(C)cc1)c1ccc(CN2CCN(C)CC2)cc1', 'SMILES'] = \
|
186 |
"Cc1ccc(cc1Nc2nccc(n2)c3cccnc3)NC(=O)c4ccc(cc4)CN5CC[NH+](CC5)C"
|
187 |
|
188 |
# failed to parse smiles, looked it up in ChemSpider and found 6-Chloro-9-{[(2S)-5-(diethylammonio)-2-pentanyl]amino}-2-methoxyacridinium
|
189 |
# (Found by conversion of search term to chemical structure (full match))
|
190 |
# https://www.chemspider.com/Chemical-Structure.5408834.html?rid=c1cdd9c2-d48b-4cd4-945d-606bf2bff1ee
|
191 |
+
Long2023.loc[Long2023['SMILES'] == 'Clc1cc2[n+H]c3c(c(N[C@H](CCC[N+H](CC)CC)C)c2cc1)cc(OC)cc3', 'SMILES'] = \
|
192 |
"Clc3ccc2c(c1cc(OC)ccc1[nH+]c2c3)N[C@@H](C)CCC[NH+](CC)CC"
|
193 |
|
194 |
# failed to parse smiles, looked it up in ChemSpider, removing charge
|
|
|
196 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
197 |
# Carvedilol is a beta-blocker medication, that may be prescribed for treating high blood pressure and chronic heart failure with reduced ejection fraction.
|
198 |
# https://www.chemspider.com/Chemical-Structure.2487.html?rid=f8358443-8c32-4e5f-b1d8-47ad13ea8a16&page_num=0
|
199 |
+
Long2023.loc[Long2023['SMILES'] == 'O(CC[N+H2]C[C@H](O)COc1c-2c([N+H2]c3c-2cccc3)ccc1)c1c(OC)cccc1', 'SMILES'] = \
|
200 |
"COc1ccccc1OCCNCC(COc2cccc3c2c4ccccc4[nH]3)O"
|
201 |
|
202 |
# failed to parse smiles, looked it up in ChemSpider, found (2S)-1-(2,6-Dimethylphenoxy)-2-propanaminium
|
203 |
# (Found by conversion of search term to chemical structure (full match))
|
204 |
# https://www.chemspider.com/Chemical-Structure.5296573.html?rid=c8c0121e-fad3-4458-8c64-a0baa3e18358
|
205 |
+
Long2023.loc[Long2023['SMILES'] == 'O(C[C@@H]([N+H3])C)c1c(C)cccc1C', 'SMILES'] = \
|
206 |
"O(c1c(cccc1C)C)C[C@@H]([NH3+])C"
|
207 |
|
208 |
# failed to parse smiles, looked it up in ChemSpider and found 4-{2-[(5-Cyano-5,5-diphenylpentyl)(methyl)amino]ethyl}-4-methylmorpholin-4-ium
|
209 |
# (Found by conversion of search term to chemical structure (connectivity match))
|
210 |
# https://www.chemspider.com/Chemical-Structure.2310136.html?rid=ce2b48f6-04d6-4df3-ad71-b6507906c7cb
|
211 |
+
Long2023.loc[Long2023['SMILES'] == '[N+@H](CCCCC(C#N)(c1ccccc1)c1ccccc1)(CC[N+]1(C)CCOCC1)C', 'SMILES'] = \
|
212 |
"CN(CCCCC(C#N)(c1ccccc1)c2ccccc2)CC[N+]3(CCOCC3)C"
|
213 |
|
214 |
# failed to parse smiles, looked it up in ChemSpider
|
215 |
# found (5E)-3-[(2R,6S)-2,6-Dimethyl-1-piperidinyl]-5-[(4-methoxybenzoyl)imino]-4,5-dihydro-1,2,3-oxadiazol-3-ium-4-ide
|
216 |
# (Found by conversion of search term to chemical structure (full match))
|
217 |
# https://www.chemspider.com/Chemical-Structure.28530638.html?rid=b44dbe3c-24f1-4303-8deb-82b879b7f0e0
|
218 |
+
Long2023.loc[Long2023['SMILES'] == 'O=C(/N=C1/ON=[N+](N2[C@@H](C)CCC[C@H]2C)[C-H]/1)c1ccc(OC)cc1', 'SMILES'] = \
|
219 |
"C[C@@H]1CCC[C@@H](N1[n+]2[cH-]/c(=N\C(=O)c3ccc(cc3)OC)/on2)C"
|
220 |
|
221 |
# failed to parse smiles, looked it up in Pubchem
|
222 |
# found ((R)-[(2S)-7-ethenyl-1-azabicyclo[2.2.1]heptan-2-yl]-(6-methoxyquinolin-4-yl)methanol
|
223 |
# https://pubchem.ncbi.nlm.nih.gov/compound/139247817
|
224 |
+
Long2023.loc[Long2023['SMILES'] == 'O(C)c1cc2c([C@@H](O)[C@@H]3[N+@H]4[C@@H](C=C)[C@H](C3)CC4)ccnc2cc1', 'SMILES'] = \
|
225 |
"COC1=CC2=C(C=CN=C2C=C1)C(C3CC4CCN3C4C=C)O"
|
226 |
|
227 |
+
Sanitize molecule with MolVS
|
228 |
+
|
229 |
+
standardizer = molvs.Standardizer()
|
230 |
+
fragment_remover = molvs.fragment.FragmentRemover()
|
231 |
+
|
232 |
+
Long2023['ID'] = [f"Long2023_{i}" for i in range(len(Long2023.index))]
|
233 |
+
Long2023['X'] = [ \
|
234 |
+
rdkit.Chem.MolToSmiles(
|
235 |
+
fragment_remover.remove(
|
236 |
+
standardizer.standardize(
|
237 |
+
rdkit.Chem.MolFromSmiles(
|
238 |
+
smiles))))
|
239 |
+
for smiles in Long2023['SMILES']]
|
240 |
+
|
241 |
+
most are because it includes the salt form and/or it is not neutralized
|
242 |
+
for id, alert in problems:
|
243 |
+
print(f"ID: {id}, problem: {alert[0]}")
|
244 |
+
|
245 |
+
indices = [
|
246 |
+
41, 54, 98, 142, 148, 151, 177, 300, 314, 334, 354, 363,
|
247 |
+
416, 501, 662, 780, 881, 933, 1149, 1154, 1229, 1249,
|
248 |
+
1256, 1265, 1289, 1352, 2266, 2321
|
249 |
+
]
|
250 |
+
|
251 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)C2=C3C(=CC=CC3=CC=C2)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=CC=CC3=CC=CC(=C23)C1=O'
|
252 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)NCCCl)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NCCCl)=CC3=CC=C2)C1=O'
|
253 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC=O)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC=O)=CC3=CC=C2)C1=O'
|
254 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)CCCCl)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)CCCCl)=CC3=CC=C2)C1=O'
|
255 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)C(Cl)(Cl)Cl)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)C(Cl)(Cl)Cl)=CC3=CC=C2)C1=O'
|
256 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc([N+](=O)[O-])cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC([N+](=O)[O-])=CC3=CC=C2)C1=O'
|
257 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(N)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(N)=CC3=CC=C2)C1=O'
|
258 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)Nc4ccc(Cl)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NC4=CC=C(Cl)C=C4)=CC3=CC=C2)C1=O'
|
259 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)Nc4ccc(C#N)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NC4=CC=C(C#N)C=C4)=CC3=CC=C2)C1=O'
|
260 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=S)Nc4ccc(Cl)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=S)NC4=CC=C(Cl)C=C4)=CC3=CC=C2)C1=O'
|
261 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(/N=C/c4ccc(C#N)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(/N=C/C4=CC=C(C#N)C=C4)=CC3=CC=C2)C1=O'
|
262 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=S)Nc4ccc(C#N)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=S)NC4=CC=C(C#N)C=C4)=CC3=CC=C2)C1=O'
|
263 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NCc4ccc5c(c4)OCO5)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NCC4=CC=C5OCOC5=C4)=CC3=CC=C2)C1=O'
|
264 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)NC(=O)c4ccccc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NC(=O)C4=CC=CC=C4)=CC3=CC=C2)C1=O'
|
265 |
+
Long2023.loc[Long2023['X'] == 'C[C@H]1Oc2cc(cnc2N)-c2c(nn(C)c2C#N)CN(C)C(=O)c2ccc(F)cc21', 'X'] = 'C[C@H]1OC2=C(N)N=CC(=C2)C2=C(C#N)N(C)N=C2CN(C)C(=O)C2=CC=C(F)C=C21'
|
266 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)Nc4cc5c6c(cccc6c4)C(=O)N(CCN(C)C)C5=O)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NC4=CC5=C6C(=CC=CC6=C4)C(=O)N(CCN(C)C)C5=O)=CC3=CC=C2)C1=O'
|
267 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NCc4ccc5c(c4)OCCO5)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NCC4=CC=C5OCCOC5=C4)=CC3=CC=C2)C1=O'
|
268 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)c4ccccc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)C4=CC=CC=C4)=CC3=CC=C2)C1=O'
|
269 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)NC(=O)CCl)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NC(=O)CCl)=CC3=CC=C2)C1=O'
|
270 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)C(F)(F)F)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)C(F)(F)F)=CC3=CC=C2)C1=O'
|
271 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)Nc4ccc(OC(F)(F)F)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NC4=CC=C(OC(F)(F)F)C=C4)=CC3=CC=C2)C1=O'
|
272 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(/N=C/c4cc(O)ccc4O)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(/N=C/C4=CC(O)=CC=C4O)=CC3=CC=C2)C1=O'
|
273 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=S)Nc4ccc(OC(F)(F)F)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=S)NC4=CC=C(OC(F)(F)F)C=C4)=CC3=CC=C2)C1=O'
|
274 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NCc4cc5c(cc4[N+](=O)[O-])OCO5)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NCC4=CC5=C(C=C4[N+](=O)[O-])OCO5)=CC3=CC=C2)C1=O'
|
275 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)Cc4ccc(Cl)cc4)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)CC4=CC=C(Cl)C=C4)=CC3=CC=C2)C1=O'
|
276 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(/N=C/c4cc5c(cc4[N+](=O)[O-])OCO5)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(/N=C/C4=CC5=C(C=C4[N+](=O)[O-])OCO5)=CC3=CC=C2)C1=O'
|
277 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(/N=C/c4ccc5c(c4)OCO5)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(/N=C/C4=CC=C5OCOC5=C4)=CC3=CC=C2)C1=O'
|
278 |
+
Long2023.loc[Long2023['X'] == 'CN(C)CCN1C(=O)c2cccc3cc(NC(=O)Nc4ccc5c(c4)OCO5)cc(c23)C1=O', 'X'] = 'CN(C)CCN1C(=O)C2=C3C(=CC(NC(=O)NC4=CC=C5OCOC5=C4)=CC3=CC=C2)C1=O'
|
279 |
|
280 |
split_dataset = load_dataset('maomlab/HematoxLong2022', name = 'HematoxLong2022')
|
281 |
|
|
|
287 |
model = load_model_from_dict({
|
288 |
"name": "cat_boost_classifier",
|
289 |
"config": {
|
290 |
+
"x_features": ['canonical SMILES::morgan', 'canonical SMILES::maccs_rdkit'],
|
291 |
+
"y_features": ['Label']}})
|
292 |
|
293 |
model.train(split_featurised_dataset["train"])
|
294 |
preds = model.predict(split_featurised_dataset["test"])
|
|
|
296 |
classification_suite = load_suite("classification")
|
297 |
|
298 |
scores = classification_suite.compute(
|
299 |
+
references=split_featurised_dataset["test"]['Label'],
|
300 |
+
predictions=preds["cat_boost_classifier::Label"])
|
301 |
|
302 |
## Citation
|
303 |
Cite this:
|