Skip to content

Commit

Permalink
Try MolToRandomSmilesVect with a ramsom seed for consist chem space
Browse files Browse the repository at this point in the history
  • Loading branch information
hgandhi2411 committed Jun 2, 2024
1 parent 8ff1371 commit 2ec0797
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions exmol/stoned/stoned.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
from rdkit import Chem # type: ignore
from rdkit.Chem import MolFromSmiles as smi2mol # type: ignore
from rdkit.Chem import MolToSmiles as mol2smi # type: ignore
from rdkit.Chem import MolToRandomSmilesVect # type: ignore

from rdkit.Chem import AllChem # type: ignore
from rdkit.DataStructs.cDataStructs import TanimotoSimilarity # type: ignore
Expand All @@ -237,9 +238,10 @@ def randomize_smiles(mol):
if not mol:
return None

return mol2smi(
mol, canonical=False, doRandom=True, isomericSmiles=True, kekuleSmiles=True
)
# return mol2smi(
# mol, canonical=False, doRandom=True, isomericSmiles=True, kekuleSmiles=True
# )
return MolToRandomSmilesVect(mol, 1, isomericSmiles=True, kekuleSmiles=True, randomSeed=np.random.randint(0,100))[0]


def largest_mol(smiles):
Expand Down

0 comments on commit 2ec0797

Please sign in to comment.