Skip to content
Snippets Groups Projects
Commit 15810121 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

compute 2D coordinates during SMILES to MOL conversion

to enable loading SMILES in MarvinJS (related to #83)


Former-commit-id: f3f0006b98d5bb0f5e303c14e1f7fc8c0bf03f9f
parent 1f5944a6
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,11 @@ def mol2smi(mol_string):
def smi2mol(smi_string):
m = pybel.readstring('smi', smi_string)
# generate 2D coordinates for MarvinJS layout
#NB: the line below should be replaced as soon as the new version of openbabel
# is out (>2.4.1), by a call to m.make2D()
# (see https://github.com/openbabel/openbabel/blob/06e233e2ca0c6d9f86f74bafe74ffcb75e9d76cd/scripts/python/pybel.py#L577)
pybel._operations['gen2D'].Do(m.OBMol)
return m.write(format='mol')
class FingerPrinter(object):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment