{"id":9608,"date":"2023-04-10T17:51:02","date_gmt":"2023-04-10T16:51:02","guid":{"rendered":"https:\/\/www.blopig.com\/blog\/?p=9608"},"modified":"2023-04-18T16:23:58","modified_gmt":"2023-04-18T15:23:58","slug":"brics-decomposition-in-3d","status":"publish","type":"post","link":"https:\/\/www.blopig.com\/blog\/2023\/04\/brics-decomposition-in-3d\/","title":{"rendered":"BRICS Decomposition in 3D"},"content":{"rendered":"\n<p>Inspired by <a href=\"https:\/\/www.blopig.com\/blog\/2023\/03\/brics-decomposition-and-synthetic-accessibility\/\" data-type=\"URL\" data-id=\"https:\/\/www.blopig.com\/blog\/2023\/03\/brics-decomposition-and-synthetic-accessibility\/\">this blog post<\/a> by the lovely Kate, I&#8217;ve been doing some BRICS decomposing of molecules myself. Like the structure-based goblin that I am, though, I&#8217;ve been applying it to 3D structures of molecules, rather than using the smiles approach she detailed. I thought it may be helpful to share the code snippets I&#8217;ve been using for this: unsurprisingly, it can also be done with RDKit!<\/p>\n\n\n\n<p>I&#8217;ll use the same example as in the original blog post, propranolol.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><a href=\"https:\/\/www.rcsb.org\/structure\/1dy4\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-12-01-35.png?resize=311%2C311&#038;ssl=1\" alt=\"\" class=\"wp-image-9611\" width=\"311\" height=\"311\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-12-01-35.png?w=892&amp;ssl=1 892w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-12-01-35.png?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-12-01-35.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-12-01-35.png?resize=768%2C768&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-12-01-35.png?resize=624%2C624&amp;ssl=1 624w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><\/a><figcaption class=\"wp-element-caption\"><em><a href=\"https:\/\/www.rcsb.org\/structure\/1dy4\" data-type=\"URL\" data-id=\"https:\/\/www.rcsb.org\/structure\/1dy4\">1DY4<\/a>: CBH1 IN COMPLEX WITH S-PROPRANOLOL<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n<p>First, I import RDKit and load the ligand in question:<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from rdkit import Chem\nfrom rdkit.Chem import AllChem\nfrom rdkit.Chem import BRICS\nligand = Chem.MolFromMolFile('propranolol.sdf')<\/pre>\n\n\n\n<p>Then I use BRICS.BreakBRICSBonds to generate an RDKit molecule with the BRICS bonds removed, and then Chem.GetMolFrags to separate the substructures into individual RDKit molecules:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ligand_broken = BRICS.BreakBRICSBonds(ligand)\nbrics_bits = Chem.GetMolFrags(ligand_broken, asMols=True)<\/pre>\n\n\n\n<p>You can either write these directly to SDF files using Chem.SDWriter, or remove the dummy atoms first. I followed <a href=\"https:\/\/sourceforge.net\/p\/rdkit\/mailman\/message\/18450857\/\" data-type=\"URL\" data-id=\"https:\/\/sourceforge.net\/p\/rdkit\/mailman\/message\/18450857\/\">this post<\/a> to do this as follows:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">w = Chem.SDWriter('propranolol_brics.sdf')\ndummy = Chem.MolFromSmiles('*')\nhydrogen = Chem.MolFromSmiles('[H]')\nfor mol in brics_bits:\n    for atom in mol.GetAtoms():\n        atom.SetIsotope(0)\n    \n    rmv_dummy = AllChem.ReplaceSubstructs(mol,dummy,hydrogen,True)[0]\n    final_mol = Chem.RemoveHs(rmv_dummy)\n\n\n    w.write(final_mol)\n<\/pre>\n\n\n\n<p>The final molecules loaded into PyMOL look like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-17-45-50.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-17-45-50.png?resize=302%2C347&#038;ssl=1\" alt=\"\" class=\"wp-image-9612\" width=\"302\" height=\"347\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-17-45-50.png?w=590&amp;ssl=1 590w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2023\/04\/Screenshot-from-2023-04-10-17-45-50.png?resize=261%2C300&amp;ssl=1 261w\" sizes=\"auto, (max-width: 302px) 100vw, 302px\" \/><\/a><figcaption class=\"wp-element-caption\"><em>BRICS decomposition applied to propranolol in 3D<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n<p>Happy decomposing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inspired by this blog post by the lovely Kate, I&#8217;ve been doing some BRICS decomposing of molecules myself. Like the structure-based goblin that I am, though, I&#8217;ve been applying it to 3D structures of molecules, rather than using the smiles approach she detailed. I thought it may be helpful to share the code snippets I&#8217;ve [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","wikipediapreview_detectlinks":true,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14,227,201],"tags":[129,134],"ppma_author":[559],"class_list":["post-9608","post","type-post","status-publish","format-standard","hentry","category-howto","category-python-code","category-small-molecules","tag-rdkit","tag-small-molecules"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"authors":[{"term_id":559,"user_id":94,"is_guest":0,"slug":"lucy_vost","display_name":"Lucy Vost","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/410b510f70dab77a9fa285069d544f6f8069c1743e6050067edc992e470b551e?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/9608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/comments?post=9608"}],"version-history":[{"count":3,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/9608\/revisions"}],"predecessor-version":[{"id":9659,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/9608\/revisions\/9659"}],"wp:attachment":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/media?parent=9608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/categories?post=9608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/tags?post=9608"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=9608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}