Skip to content

Commit

Permalink
fix: Depict SMILES with R-group in 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
Kohulan committed Apr 5, 2023
1 parent 4d455a5 commit e402b54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/modules/rdkitmodules.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from chembl_structure_pipeline import standardizer
from rdkit import Chem
from rdkit.Chem import AllChem, Descriptors, QED, Lipinski, rdMolDescriptors, rdmolops
from app.modules.cdkmodules import getCDKSDGMol


def checkSMILES(smiles: str):
Expand Down Expand Up @@ -94,7 +95,11 @@ def get3Dconformers(smiles, depict=True):
"""
if any(char.isspace() for char in smiles):
smiles = smiles.replace(" ", "+")
mol = Chem.MolFromSmiles(smiles)
if smiles.__contains__("R"):
mol_str = getCDKSDGMol(smiles)
mol = Chem.MolFromMolBlock(mol_str)
else:
mol = Chem.MolFromSmiles(smiles)
if mol:
AllChem.Compute2DCoords(mol)
mol = Chem.AddHs(mol)
Expand Down

0 comments on commit e402b54

Please sign in to comment.