Skip to content

Can I get the largest substructure that contains a specific substructure? #7311

Answered by DavidACosgrove
YoavShamir5 asked this question in Q&A
Discussion options

You must be logged in to vote

I think the RASCAL MCES code can help you here.

from rdkit.Chem import rdRascalMCES
opts = rdRascalMCES.RascalOptions()
results = rdRascalMCES.FindMCES(mol1, mol2, opts)
for res in results:
    print(res.similarity, res.numFragments, res.smartsString)

which gives

0.9234615384615384 2 O=C(-C=C)-C1CC1.C1CC(-C2CCC2C2C(-C3CC3)-CC2)-CC

Mapping the SMARTS strings back onto the molecules gives

where the blue bonds are the unmatched ones. You would need to add some extra code to fragment the molecules based on bonds you don't want and then pick out the fragment that matches the substructure you care about. I believe (though I can't prove it) that in a fragmented system like this, the largest …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@YoavShamir5
Comment options

@YoavShamir5
Comment options

Comment options

You must be logged in to vote
1 reply
@YoavShamir5
Comment options

Answer selected by YoavShamir5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants