Inverted metals logic to catch low Mw metals
Browse files- exposure_module/exposure.py +12 -11
exposure_module/exposure.py
CHANGED
|
@@ -51,17 +51,18 @@ def exp_post():
|
|
| 51 |
mp = 'Not found'
|
| 52 |
|
| 53 |
# metals/ceramics logic
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
|
|
| 65 |
# more than one atom, or carbon -> assumed ceramic
|
| 66 |
# TODO say something about what we're doing on report? (e.g. 'detected ceramic, setting MW = 1100')
|
| 67 |
MW = 1100.
|
|
|
|
| 51 |
mp = 'Not found'
|
| 52 |
|
| 53 |
# metals/ceramics logic
|
| 54 |
+
mol = Chem.MolFromSmiles(smiles)
|
| 55 |
+
natoms = mol.GetNumAtoms()
|
| 56 |
+
if natoms == 1 and smiles != '[C]':
|
| 57 |
+
|
| 58 |
+
# only one atom, except for carbon -> assumed metal
|
| 59 |
+
# return render_template('chemError.html')
|
| 60 |
+
return render_template('metalError.html', chemName=chemName, MW=MW, LogP=LogP, rho=rho, mp=mp, iupac=iupac,
|
| 61 |
+
cas=cas, smiles=smiles, molImage=molImage,
|
| 62 |
+
LogP_origin=LogP_origin, rho_origin=rho_origin, mp_origin=mp_origin)
|
| 63 |
+
else:
|
| 64 |
+
if (type(mp) is float or type(mp) is int) and mp > 500.:
|
| 65 |
+
|
| 66 |
# more than one atom, or carbon -> assumed ceramic
|
| 67 |
# TODO say something about what we're doing on report? (e.g. 'detected ceramic, setting MW = 1100')
|
| 68 |
MW = 1100.
|