robert.elder commited on
Commit
f9ba676
1 Parent(s): 94bcc13

added hard-coded materials (manganese phthalocyanine, some pigments) to shared databases; added hard-coded coordinates for MnPC image

Browse files
ChemID.py CHANGED
@@ -199,7 +199,11 @@ def ImageFromSmiles(smiles):
199
  image = None
200
  if type(smiles) is str:
201
  try:
202
- image = Draw.MolToImage(Chem.MolFromSmiles(smiles), size=(350, 350))
 
 
 
 
203
  except ValueError:
204
  pass
205
  return image
 
199
  image = None
200
  if type(smiles) is str:
201
  try:
202
+ if smiles == 'C1=CC=C2C(=C1)C3=NC4=NC(=NC5=C6C=CC=CC6=C([N-]5)N=C7C8=CC=CC=C8C(=N7)N=C2[N-]3)C9=CC=CC=C94.[Mn+2]':
203
+ mol = next(Chem.SDMolSupplier('MnPC.sdf', removeHs=False))
204
+ image = Draw.MolToImage(mol, size=(350, 350))
205
+ else:
206
+ image = Draw.MolToImage(Chem.MolFromSmiles(smiles), size=(350, 350))
207
  except ValueError:
208
  pass
209
  return image
MnPC.sdf ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 250132349
2
+ -OEChem-01222411282D
3
+
4
+ 41 48 0 0 0 0 0 0 0999 V2000
5
+ 0.10000 1.60000 0.0000 Mn 0 0 0 0 0 0 0 0 0 0 0 0
6
+ -3.30000 5.00000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
7
+ -2.90000 1.60000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
8
+ 0.10000 4.50000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
9
+ 3.60000 5.00000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
10
+ -3.30000 -2.00000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
11
+ 3.20000 1.60000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
12
+ 0.10000 -1.60000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
13
+ 3.60000 -1.90000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
14
+ -4.00000 3.10000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
15
+ -1.50000 5.70000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
16
+ -4.00000 -0.10000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
17
+ 1.60000 5.70000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
18
+ 4.30000 3.10000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
19
+ -1.50000 -2.70000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
20
+ 4.30000 -0.10000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
21
+ -6.00000 2.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
22
+ 1.60000 -2.70000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
23
+ -0.90000 7.70000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
24
+ -6.00000 0.60000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
25
+ 1.00000 7.70000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
26
+ 6.20000 2.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
27
+ 6.20000 0.60000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
28
+ -0.90000 -4.60000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
29
+ 1.00000 -4.60000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
30
+ -7.80000 3.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
31
+ -1.90000 9.40000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
32
+ -7.80000 -0.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
33
+ 2.00000 9.40000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
34
+ 8.00000 3.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
35
+ 8.00000 -0.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
36
+ -1.90000 -6.40000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
37
+ 2.00000 -6.40000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
38
+ -9.60000 2.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
39
+ -9.60000 0.60000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
40
+ -0.90000 11.20000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
41
+ 1.00000 11.20000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
42
+ 9.70000 2.50000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
43
+ 9.70000 0.60000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
44
+ -0.90000 -8.20000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
45
+ 1.00000 -8.20000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
46
+ 2 10 1 0 0 0 0
47
+ 2 11 2 0 0 0 0
48
+ 3 10 2 0 0 0 0
49
+ 3 12 1 0 0 0 0
50
+ 4 11 1 0 0 0 0
51
+ 4 13 1 0 0 0 0
52
+ 5 13 2 0 0 0 0
53
+ 5 14 1 0 0 0 0
54
+ 6 12 2 0 0 0 0
55
+ 6 15 1 0 0 0 0
56
+ 7 14 2 0 0 0 0
57
+ 7 16 1 0 0 0 0
58
+ 8 15 1 0 0 0 0
59
+ 8 18 1 0 0 0 0
60
+ 9 16 2 0 0 0 0
61
+ 9 18 1 0 0 0 0
62
+ 10 17 1 0 0 0 0
63
+ 11 19 1 0 0 0 0
64
+ 12 20 1 0 0 0 0
65
+ 13 21 1 0 0 0 0
66
+ 14 22 1 0 0 0 0
67
+ 15 24 2 0 0 0 0
68
+ 16 23 1 0 0 0 0
69
+ 17 20 2 0 0 0 0
70
+ 17 26 1 0 0 0 0
71
+ 18 25 2 0 0 0 0
72
+ 19 21 2 0 0 0 0
73
+ 19 27 1 0 0 0 0
74
+ 20 28 1 0 0 0 0
75
+ 21 29 1 0 0 0 0
76
+ 22 23 1 0 0 0 0
77
+ 22 30 2 0 0 0 0
78
+ 23 31 2 0 0 0 0
79
+ 24 25 1 0 0 0 0
80
+ 24 32 1 0 0 0 0
81
+ 25 33 1 0 0 0 0
82
+ 26 34 2 0 0 0 0
83
+ 27 36 2 0 0 0 0
84
+ 28 35 2 0 0 0 0
85
+ 29 37 2 0 0 0 0
86
+ 30 38 1 0 0 0 0
87
+ 31 39 1 0 0 0 0
88
+ 32 40 2 0 0 0 0
89
+ 33 41 2 0 0 0 0
90
+ 34 35 1 0 0 0 0
91
+ 36 37 1 0 0 0 0
92
+ 38 39 2 0 0 0 0
93
+ 40 41 1 0 0 0 0
94
+ M END
95
+ > <PUBCHEM_COMPOUND_ID_TYPE>
96
+ 0
97
+
98
+ > <PUBCHEM_TOTAL_CHARGE>
99
+ 0
100
+
101
+ > <PUBCHEM_SUBSTANCE_ID>
102
+ 250132349
103
+
104
+ > <PUBCHEM_SUBSTANCE_VERSION>
105
+ 1
106
+
107
+ > <PUBCHEM_EXT_DATASOURCE_NAME>
108
+ NIST
109
+
110
+ > <PUBCHEM_EXT_DATASOURCE_REGID>
111
+ FBVMGXXZRKLOMC-MXKBGJTJSA-N
112
+
113
+ > <PUBCHEM_SUBSTANCE_SYNONYM>
114
+ FBVMGXXZRKLOMC-MXKBGJTJSA-N
115
+ Manganese phthalocyanine
116
+ Manganese(II) phthalocyanine
117
+ Manganese, [29H,31H-phthalocyaninato(2-)-N29,N30,N31,N32]-, (SP-4-1)-
118
+ Manganese,[29H,31H-phthalocyaninato(2(-))-N<29>,N<30>,N<31>,N<32>](SP-4-1)-
119
+ Phthalocyanine manganese
120
+
121
+ > <PUBCHEM_XREF_EXT_ID>
122
+ FBVMGXXZRKLOMC-MXKBGJTJSA-N
123
+
124
+ > <PUBCHEM_EXT_DATASOURCE_URL>
125
+ http://www.nist.gov/srd/nist1a.cfm
126
+
127
+ > <PUBCHEM_CID_ASSOCIATIONS>
128
+ 135702311 1
129
+ 23930 2
130
+ 86280045 2
131
+
132
+ > <PUBCHEM_COORDINATE_TYPE>
133
+ 1
134
+ 3
135
+
136
+ $$$$
PHYSPROP_MP_data.tsv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a076dc715c14055e872256fd9bb7fff1e8c860e022b1b0cef559cb56e872a2f4
3
- size 131440
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de7f31b05ea0a60d15aa7aa35185e7639d19f1beba66680dab7b1d3c7d70997e
3
+ size 131480
color2_module/colors.py CHANGED
@@ -98,31 +98,31 @@ def app_post():
98
  isCA = False
99
 
100
  print(chemName)
101
- if chemName == '68186-90-3':
102
- #IDtype = 'SMILES'
103
- #chemName = 'O=[Ti]=O.O=[Sb]O[Sb](=O)=O.O=[Cr]O[Cr]=O'
104
- #iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
105
- iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = None, chemName, 'O=[Ti]=O.O=[Sb]O[Sb]=O.O=[Cr]O[Cr]=O', 1100, None, None, 1001, None, 0
106
- im = ImageFromSmiles(smiles)
107
- im64 = Imageto64(im)
108
- molImage = im64
109
- elif chemName == '14325-24-7':
110
- IDtype = 'SMILES'
111
- chemName = 'C1=CC=C2C(=C1)C3=NC4=NC(=NC5=C6C=CC=CC6=C([N-]5)N=C7C8=CC=CC=C8C(=N7)N=C2[N-]3)C9=CC=CC=C94.[Mn+2]'
112
- iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
113
- #iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = None, chemName, 'C1=CC=C2C(=C1)C3=NC4=NC(=NC5=C6C=CC=CC6=C([N-]5)N=C7C8=CC=CC=C8C(=N7)N=C2[N-]3)C9=CC=CC=C94.[Mn+2]', 567.5, None, None, 500, None, 0
114
- elif chemName == '68187-11-1' or chemName == 'Pigment Blue 36':
115
- # Pigment Blue 36 (Al2O3路Cr2O3路CoO)
116
- iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = None, chemName, 'O=[Al]O[Al]=O.O=[Cr]O[Cr]=O.[Co]=O', 1100, None, None, 1001, None, 0
117
- im = ImageFromSmiles(smiles)
118
- im64 = Imageto64(im)
119
- molImage = im64
120
  #elif chemName == '1326-53-6':
121
  # IDtype = 'SMILES'
122
  # chemName = 'C1=C2C(=C(C(=C1Cl)Cl)Cl)C3=NC4=NC(=NC5=NC(=NC6=C7C(=C([N-]6)N=C2[N-]3)C(=C(C(=C7Cl)Cl)Cl)Cl)C8=C5C(=C(C(=C8Cl)Cl)Cl)Cl)C9=C4C(=C(C(=C9Cl)Cl)Cl)Cl.[Cu+2]'
123
  # iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
124
- else:
125
- iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
126
 
127
  if error > 0:
128
  # TODO output more useful info
 
98
  isCA = False
99
 
100
  print(chemName)
101
+ # if chemName == '68186-90-3':
102
+ # #IDtype = 'SMILES'
103
+ # #chemName = 'O=[Ti]=O.O=[Sb]O[Sb](=O)=O.O=[Cr]O[Cr]=O'
104
+ # #iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
105
+ # iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = None, chemName, 'O=[Ti]=O.O=[Sb]O[Sb]=O.O=[Cr]O[Cr]=O', 1100, None, None, 1001, None, 0
106
+ # im = ImageFromSmiles(smiles)
107
+ # im64 = Imageto64(im)
108
+ # molImage = im64
109
+ # if chemName == '14325-24-7':
110
+ # IDtype = 'SMILES'
111
+ # chemName = 'C1=CC=C2C(=C1)C3=NC4=NC(=NC5=C6C=CC=CC6=C([N-]5)N=C7C8=CC=CC=C8C(=N7)N=C2[N-]3)C9=CC=CC=C94.[Mn+2]'
112
+ # iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
113
+ # #iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = None, chemName, 'C1=CC=C2C(=C1)C3=NC4=NC(=NC5=C6C=CC=CC6=C([N-]5)N=C7C8=CC=CC=C8C(=N7)N=C2[N-]3)C9=CC=CC=C94.[Mn+2]', 567.5, None, None, 500, None, 0
114
+ # if chemName == '68187-11-1' or chemName == 'Pigment Blue 36':
115
+ # # Pigment Blue 36 (Al2O3路Cr2O3路CoO)
116
+ # iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = None, chemName, 'O=[Al]O[Al]=O.O=[Cr]O[Cr]=O.[Co]=O', 1100, None, None, 1001, None, 0
117
+ # im = ImageFromSmiles(smiles)
118
+ # im64 = Imageto64(im)
119
+ # molImage = im64
120
  #elif chemName == '1326-53-6':
121
  # IDtype = 'SMILES'
122
  # chemName = 'C1=C2C(=C(C(=C1Cl)Cl)Cl)C3=NC4=NC(=NC5=NC(=NC6=C7C(=C([N-]6)N=C2[N-]3)C(=C(C(=C7Cl)Cl)Cl)Cl)C8=C5C(=C(C(=C8Cl)Cl)Cl)Cl)C9=C4C(=C(C(=C9Cl)Cl)Cl)Cl.[Cu+2]'
123
  # iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
124
+ # else:
125
+ iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
126
 
127
  if error > 0:
128
  # TODO output more useful info
custom_chemicals_db.tsv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e35d86380fe9a5ea099f0d8734762670c57e9437ead36b02ba9e1ce06fc6de41
3
- size 10174
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3dc9cf2c56f141aad1c46cc168d1a133d288a7fb51ee3290a62041fd117897f3
3
+ size 13049