Dear RDKit users,

I am trying to remove a common substructure from a number of molecules (with 
AllChem.DeleteSubstructs). My problem is best illustrated by this short code:

from rdkit import Chem
from rdkit.Chem import AllChem

ss = Chem.MolFromSmiles('C1=CC=CC(C)=C1')
print("Substituting substructure with hydrogen")
frags = AllChem.ReplaceSubstructs(m, ss,hyd)
for frag in frags:
print("\nDeleting substructure")
frag = AllChem.DeleteSubstructs(m, ss)

I create a toluene connected to pyridine and try to remove toluene.

When replacing toluene substructure with hydrogen (AllChem.ReplaceSubstructs), 
I receive two sets of results: pyridine (with explicit hydrogen) and single 
carbon plus single hydrogen plus aromatic open chain (what is left from 
pyridine after removing one ring atom).

When deleting the toluene substructure (AllChem.DeleteSubstructs), I receive 
just the open chain of ex-pyridine (corresponding to second set of the 
ReplaceSubstructs results).

Is there a way of directing DeleteSubstructs method to a specific variant (in 
this case, leaving pyridine as a ring seems to be logical).

Best regards,

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Rdkit-discuss mailing list

Reply via email to