Re: [Rdkit-discuss] Question of substructure "neighborhood"

2023-06-30 Thread Wim Dehaen
Hi Joey, I think the most straightforward way to do this is to use GetNeighbors() on all atoms. See below for an example: from rdkit import Chem mol=Chem.MolFromSmiles("O1COc2c1ccc(CC(NC)C)c2") substruct=Chem.MolFromSmarts("c1c1") a=mol.GetSubstructMatch(substruct) print("substructure benzene

[Rdkit-discuss] Question of substructure "neighborhood"

2023-06-30 Thread Storer, Joey (J) via Rdkit-discuss
Dear RDKit experts, Substructure search is working well these days. RDKit is wonderful. For subsequent QM calcs., I would like to get the "next atom over" or the "one-atom-neighborhood" surrounding a substructure. The result would be something bigger than the original substructure with open v