Dear Greg, awesome! Just what I was trying to achieve! I mistakenly thought maxDepth would be > 0 without trying.
Just one additional question, although it's more curiosity than anything. I am supposing that if you "lose" the parent molecule, it is not possible to go back and retrieve it deterministically from the fragments alone. One should just apply BRICSBuild up to some depth and then "assume" (or rather, "hope") the original molecule is among the ones that the algorithm has recombined. Am I correct? I was thinking about whether there is a particular fragment order that could foster the recovery of the original molecule, but that doesn't seem to be the case. Are you aware of any fragmentation algorithm that is able to go both ways (i.e. from the molecule to the fragments, and from the fragments to the same molecule)? Thank you again, Marco Il giorno lun 11 mar 2019 alle ore 17:37 Greg Landrum < greg.land...@gmail.com> ha scritto: > Hi Marco, > > Welcome to the mailing list! > > The trick in this particular case is that you want to do a maxDepth of 0 > (that means a single iteration) and to tell BRICSBuild that you're willing > to see incomplete molecules (i.e. molecules that still contain a dummy > atom): > > In [22]: from rdkit import Chem > ...: from rdkit.Chem import BRICS > ...: frags = ['[8*]C(C)(C)C', '[16*]c1ccc2occ([16*])c2c1'] > ...: molfrags = [Chem.MolFromSmiles(f) for f in frags] > ...: print(list(Chem.MolToSmiles(x) for x in > BRICS.BRICSBuild(molfrags, onlyCompleteMols=False, maxDepth=0))) > > ['[16*]c1coc2ccc(-c3ccc4occ([16*])c4c3)cc12', > '[16*]c1ccc2occ(-c3ccc4occ([16*])c4c3)c2c1', > '[16*]c1ccc2occ(-c3coc4ccc([16*])cc34)c2c1', > '[16*]c1coc2ccc(C(C)(C)C)cc12', '[16*]c1ccc2occ(C(C)(C)C)c2c1'] > > > The results with two [16*] attachment points happen because there's a rule > that allows [16*] - [[16*] bonds to be formed. This wasn't in the original > BRICS paper but it is consistent with the rest of the rules, so we added it. > > I hope this helps, > -greg > > > > > > On Mon, Mar 11, 2019 at 3:37 PM Marco Podda <marcopodda1...@gmail.com> > wrote: > >> Hello, >> first of all, many thanks for this awesome library. >> >> I have little to none knowledge of chemistry, so I hope you'll excuse me >> if I say some chemical nonsense below. >> >> I have a fragmented molecule (fragmentation being done with the BRICS >> implementation in rdkit) which (for example) looks like this: >> >> frags = ['[8*]C(C)(C)C', '[16*]c1ccc2occ([16*])c2c1'] >> >> Say I want to join the two fragments in the list. Then, I would write: >> >> from rdkit import Chem >> from rdkit.Chem import BRICS >> frags = ['[8*]C(C)(C)C', '[16*]c1ccc2occ([16*])c2c1'] >> molfrags = [Chem.MolFromSmiles(f) for f in frags] >> combined = list(BRICS.BRICSBuild(molfrags, maxDepth=1))[0] # maxDepth=1 >> gives me 1 result in this case >> print(Chem.MolToSmiles(combined, True)) >> # 'CC(C)(C)c1ccc2occ(C(C)(C)C)c2c1' >> >> If I understood this code correctly, BRICSBuild has reacted both dummy >> spots in the second fragment with the dummy spot in the first fragment. >> However, I would like to perform a partial join, meaning joining the first >> fragment only with one of the two dummy spots in the second fragment. In >> practice, I'm looking for a result like this: >> >> 'CC(C)(C)c1ccc2occ([16*])c2c1' >> or >> [16*]c1ccc2occ(C(C)(C)C)c2c1' >> >> Is there a way in rdkit to achieve this? >> Again, sorry for the poor chemical jargon and if I make not much sense >> from a chemical point of view. >> >> Thank you. >> _______________________________________________ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss