Commit a36ea281 authored by Jacob Durrant's avatar Jacob Durrant

Update to version 1.1.1. See CHANGES.md.

parent 1222fd97
Changes
=======
1.1.1
-----
* `run_with_mol_list()` now preserves non-string properties.
* `run_with_mol_list()` throws a warning if it cannot process a molecule,
rather than terminating the program with an error.
1.1
---
......
Dimorphite-DL 1.1
=================
Dimorphite-DL 1.1.1
===================
What is it?
-----------
......@@ -34,7 +34,7 @@ usage: dimorphite_dl.py [-h] [--min_ph MIN] [--max_ph MAX]
[--smiles_file FILE] [--output_file FILE]
[--label_states] [--test]
Dimorphite 1.1: Creates models of appropriately protonated small moleucles.
Dimorphite 1.1.1: Creates models of appropriately protonated small moleucles.
Apache 2.0 License. Copyright 2018 Jacob D. Durrant.
optional arguments:
......
......@@ -137,7 +137,7 @@ class ArgParseFuncs:
:return: A parser object.
"""
parser = MyParser(description="Dimorphite 1.1: Creates models of " +
parser = MyParser(description="Dimorphite 1.1.1: Creates models of " +
"appropriately protonated small moleucles. " +
"Apache 2.0 License. Copyright 2018 Jacob D. " +
"Durrant.")
......@@ -1037,9 +1037,19 @@ def run_with_mol_list(mol_lst, **kwargs):
mols = []
for s, props in protonated_smiles_and_props:
m = Chem.MolFromSmiles(s)
for prop, val in props.items():
m.SetProp(prop, val)
mols.append(m)
if m:
for prop, val in props.items():
if type(val) is int:
m.SetIntProp(prop, val)
elif type(val) is float:
m.SetDoubleProp(prop, val)
elif type(val) is bool:
m.SetBoolProp(prop, val)
else:
m.SetProp(prop, str(val))
mols.append(m)
else:
UtilFuncs.eprint("WARNING: Could not process molecule with SMILES string " + s + " and properties " + str(props))
return mols
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment