forked from enviPath/enviPy
[Feature] Changes required for non public tenants (#370)
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#370
This commit is contained in:
@ -88,6 +88,10 @@ class FormatConverter(object):
|
||||
def from_smiles(smiles):
|
||||
return Chem.MolFromSmiles(smiles)
|
||||
|
||||
@staticmethod
|
||||
def from_molfile(molfile: str):
|
||||
return Chem.MolFromMolBlock(molfile)
|
||||
|
||||
@staticmethod
|
||||
def to_smiles(mol, canonical=False):
|
||||
return Chem.MolToSmiles(mol, canonical=canonical)
|
||||
@ -171,12 +175,17 @@ class FormatConverter(object):
|
||||
try:
|
||||
Chem.Kekulize(mol)
|
||||
except Exception:
|
||||
mc = Chem.Mol(mol.ToBinary())
|
||||
mol = Chem.Mol(mol.ToBinary())
|
||||
|
||||
if not mc.GetNumConformers():
|
||||
Chem.rdDepictor.Compute2DCoords(mc)
|
||||
if not mol.GetNumConformers():
|
||||
Chem.rdDepictor.Compute2DCoords(mol)
|
||||
|
||||
pass
|
||||
drawer = rdMolDraw2D.MolDraw2DCairo(*mol_size)
|
||||
opts = drawer.drawOptions()
|
||||
opts.clearBackground = False
|
||||
drawer.DrawMolecule(mol)
|
||||
drawer.FinishDrawing()
|
||||
return drawer.GetDrawingText()
|
||||
|
||||
@staticmethod
|
||||
def normalize(smiles):
|
||||
|
||||
Reference in New Issue
Block a user