Hi Ling, Having done something similar (but not in RDKit), I would suggest a different algorithm. I think that fragmenting the molecule first and then stitching the bits together is always going to be very complicated. Instead, just fragment the molecule in the ways that you want:
- Find the set B of all breakable bonds according to your rules. I’m assuming here that B contains only acyclic bonds. - To get all of the pairwise pieces, for each element b of B break all bonds in B _except_ b. Keep the fragment containing b, and clean up. - To get all of the triplets, for each tuple (b1, b2) in B, break all bonds in B except b1 and b2. Keep the fragment containing b1 only if it also contains b2. Regards, Mark -- Mark Mackey Chief Scientific Officer Cresset New Cambridge House, Bassingbourn Road, Litlington, Cambridgeshire, SG8 0SS, UK tel: +44 (0)1223 858890 mobile: +44 (0)7595 099165 fax: +44 (0)1223 853667 email: m...@cresset-group.com<mailto:m...@cresset-group.com> web: www.cresset-group.com<http://www.cresset-group.com/> skype: mark_cresset From: Ling Chan <lingtrek...@gmail.com> Sent: 31 March 2021 20:56 To: RDKit <rdkit-discuss@lists.sourceforge.net> Subject: [Rdkit-discuss] rejoining pairs of fragments after fragmenting a molecule Dear Colleagues, I am trying to do something that I think is quite simple, but I have not figured out a simple way. Don't know if I am missing something. I am sure that ultimately I can figure it out, but I wonder if there is a good way. I fragmented a molecule with some rules, using FragmentOnBonds. I did get a list of primary fragments. I wish to recombine pairs (and triplets, but no bigger) of these primary fragments, but only if the resulting fragment is part of the original molecule. I.e. I want to undo some of the cuttings. (FragmentOnSomeBonds does not help, since you cannot ensure that the resulting fragments consist only of pairs of primary fragments.) What is the best way to do this? The following is what I am trying. I see that you can mark the original cut points using the dummyLabels argument in FragmentOnBonds. So I converted the primary fragments to smiles. I looked for the two sides of the original cut point and substituted the two dummyLables to [2H] and [3H]. I then tried to rejoin the fragments using a reaction string "[*:1][2H].[*:2][3H]>>[*:1][*:2]". Unfortunately the ReactionFromSmarts function does not accept this string. So I'll have to use Smarts search to look for [2H] and [3H], then create an editable molecule from the two primary fragments, look for neighbours of [2H] and [3H], add a bond, then delete the atoms [2H] and [3H], then sanitize. Thank you for your ideas. Ling This email has been sent from Cresset BioMolecular Discovery Limited, registered in England and Wales, Company Number: 04151475. The information in this email and any attachments are confidential and may be privileged. It is intended solely for the addressee and access to this email by anyone else is unauthorised. If an addressing or transmission error has misdirected this email, please notify the author by replying to this email. If you are not the intended recipient you must not use, disclose, distribute, store or copy the information in any medium. Although this e-mail and any attachments are believed to be free from any virus or other defect which might affect any system into which they are opened or received, it is the responsibility of the recipient to check that they are virus-free and that they will in no way affect systems and data. No responsibility is accepted by Cresset BioMolecular Discovery Limited for any loss or damage arising in any way from their receipt, opening or use. Privacy notice<https://www.cresset-group.com/privacy/>
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss