Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "c78a6079",
"metadata": {},
"outputs": [],
"source": [
"from rdkit import Chem\n",
"from rdkit.Chem import AllChem\n",
"from rdkit.Chem.Draw import IPythonConsole\n",
"from rdkit.Chem import rdFMCS\n",
"import py3Dmol\n",
"import espsim\n",
"from espsim import EmbedAlignConstrainedScore"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "51a95d3f",
"metadata": {},
"outputs": [],
"source": [
"mols = [m for m in Chem.SDMolSupplier('./cdk2.sdf', removeHs=False)]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "8fe7e599",
"metadata": {},
"outputs": [],
"source": [
"def drawTwoMols(m1, m2,p=None, confId1=-1, confId2=-1, viewergrid=(1,2)):\n",
" if p is None:\n",
" p = py3Dmol.view(width=800, height=400, viewergrid=viewergrid)\n",
" p.removeAllModels(viewer=(0,0))\n",
" p.removeAllModels(viewer=(0,1)) \n",
" mb1=Chem.MolToMolBlock(m1, confId=confId1)\n",
" p.addModel(mb1, 'sdf', viewer=(0,0))\n",
" mb2=Chem.MolToMolBlock(m2, confId=confId2)\n",
" p.addModel(mb2, 'sdf', viewer=(0,1))\n",
" p.setStyle({'stick':{'radius':0.15}}, viewer=(0,0))\n",
" p.setStyle({'stick':{'radius':0.15}}, viewer=(0,1))\n",
" p.zoomTo(viewer=(0,0))\n",
" p.zoomTo(viewer=(0,1)) \n",
" return p"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "9c6bd27c",
"metadata": {},
"outputs": [],
"source": [
"p = drawTwoMols(mols[0], mols[1])"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "157da9cb",
"metadata": {},
"outputs": [
{
"data": {
"application/3dmoljs_load.v0": "<div id=\"3dmolviewer_16391426587325096\" style=\"position: relative; width: 800px; height: 400px\">\n <p id=\"3dmolwarning_16391426587325096\" style=\"background-color:#ffcccc;color:black\">You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: <br>\n <tt>jupyter labextension install jupyterlab_3dmol</tt></p>\n </div>\n<script>\n\nvar loadScriptAsync = function(uri){\n return new Promise((resolve, reject) => {\n var tag = document.createElement('script');\n tag.src = uri;\n tag.async = true;\n tag.onload = () => {\n resolve();\n };\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n});\n};\n\nif(typeof $3Dmolpromise === 'undefined') {\n$3Dmolpromise = null;\n $3Dmolpromise = loadScriptAsync('https://3dmol.org/build/3Dmol.js');\n}\n\nvar viewer_16391426587325096 = null;\nvar warn = document.getElementById(\"3dmolwarning_16391426587325096\");\nif(warn) {\n warn.parentNode.removeChild(warn);\n}\n$3Dmolpromise.then(function() {\nvar viewergrid_16391426587325096 = null;\nviewergrid_16391426587325096 = $3Dmol.createViewerGrid($(\"#3dmolviewer_16391426587325096\"),{rows: 1, cols: 2, control_all: true},{backgroundColor:\"white\"});\nviewer_16391426587325096 = viewergrid_16391426587325096[0][0];\nviewergrid_16391426587325096[0][0].zoomTo();viewergrid_16391426587325096[0][1].zoomTo();\tviewergrid_16391426587325096[0][0].removeAllModels();\n\tviewergrid_16391426587325096[0][1].removeAllModels();\n\tviewergrid_16391426587325096[0][0].addModel(\"ZINC03814457\\n RDKit 3D\\n\\n 30 31 0 0 1 0 0 0 0 0999 V2000\\n 5.4230 -0.4412 0.7616 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.2434 0.3667 0.1880 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.5978 0.9630 -1.1852 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9575 -0.4703 0.1074 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9988 -1.6999 0.0580 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6357 0.2975 0.0804 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5374 -0.6063 0.0692 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7229 -0.0532 0.0310 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.8848 -0.8592 -0.0106 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1098 -0.1432 -0.0466 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0854 -1.1212 -0.0831 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.4330 -2.2959 -0.0687 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1041 -2.2310 -0.0241 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2721 1.2054 -0.0433 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0919 1.8123 -0.0064 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8677 1.2990 0.0350 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1448 3.1672 -0.0074 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.7118 -1.2538 0.0931 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 6.2974 0.1913 0.9136 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.1671 -0.8852 1.7247 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.0364 1.1881 0.8743 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.4832 1.5956 -1.1194 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.8059 0.1785 -1.9146 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7887 1.5777 -1.5810 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6085 0.9288 -0.8080 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.5821 0.9425 0.9579 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.0816 -0.9900 -0.1173 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9506 -3.2459 -0.0915 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0380 3.6039 0.1519 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.3036 3.6737 0.2145 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 2 1 0\\n 1 18 1 0\\n 1 19 1 0\\n 1 20 1 0\\n 2 3 1 0\\n 2 4 1 0\\n 2 21 1 0\\n 3 22 1 0\\n 3 23 1 0\\n 3 24 1 0\\n 4 5 2 0\\n 4 6 1 0\\n 6 7 1 0\\n 6 25 1 0\\n 6 26 1 0\\n 7 8 1 0\\n 8 16 2 0\\n 8 9 1 0\\n 9 13 1 0\\n 9 10 2 0\\n 10 11 1 0\\n 10 14 1 0\\n 11 12 1 0\\n 11 27 1 0\\n 12 13 2 0\\n 12 28 1 0\\n 14 15 2 0\\n 15 16 1 0\\n 15 17 1 0\\n 17 29 1 0\\n 17 30 1 0\\nM END\\n\",\"sdf\");\n\tviewergrid_16391426587325096[0][1].addModel(\"ZINC03814459\\n RDKit 3D\\n\\n 30 32 0 0 1 0 0 0 0 0999 V2000\\n 3.2069 2.4332 0.1683 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.9680 1.3361 0.0191 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0936 0.2661 -0.0051 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.8080 0.8502 0.1384 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.8933 2.2332 0.2504 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7321 -0.0685 0.1386 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.0086 -1.3940 0.0148 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.2734 -1.7772 -0.1068 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3866 -1.0536 -0.1367 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.4572 -3.1158 -0.2204 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5735 0.3558 0.2686 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.5971 -0.6310 0.2422 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.9575 0.0650 0.3723 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.1165 -0.8888 0.6548 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.3322 -0.1496 0.1130 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.7364 0.9594 -0.7584 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.3578 0.6367 -0.8635 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.6300 3.4278 0.2204 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.9699 1.3070 -0.0571 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3600 -3.4373 -0.5285 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6460 -3.6786 -0.4180 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.4556 -1.3123 1.0829 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.5595 -1.2189 -0.6765 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.9193 0.8386 1.1419 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.2043 -1.1389 1.7124 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9777 -1.8177 0.0998 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.9676 -0.8188 -0.4679 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.9361 0.2761 0.9151 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.2028 1.0183 -1.7422 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.8426 1.9307 -0.2727 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 5 2 0\\n 1 2 1 0\\n 1 18 1 0\\n 2 3 1 0\\n 2 19 1 0\\n 3 9 1 0\\n 3 4 2 0\\n 4 5 1 0\\n 4 6 1 0\\n 6 7 2 0\\n 6 11 1 0\\n 7 8 1 0\\n 8 9 2 0\\n 8 10 1 0\\n 10 20 1 0\\n 10 21 1 0\\n 11 12 1 0\\n 12 13 1 0\\n 12 22 1 0\\n 12 23 1 0\\n 13 17 1 0\\n 13 14 1 0\\n 13 24 1 0\\n 14 15 1 0\\n 14 25 1 0\\n 14 26 1 0\\n 15 16 1 0\\n 15 27 1 0\\n 15 28 1 0\\n 16 17 1 0\\n 16 29 1 0\\n 16 30 1 0\\nM END\\n\",\"sdf\");\n\tviewergrid_16391426587325096[0][0].setStyle({\"stick\": {\"radius\": 0.15}});\n\tviewergrid_16391426587325096[0][1].setStyle({\"stick\": {\"radius\": 0.15}});\n\tviewergrid_16391426587325096[0][0].zoomTo();\n\tviewergrid_16391426587325096[0][1].zoomTo();\nviewergrid_16391426587325096[0][1].render();\nviewergrid_16391426587325096[0][0].render();\n});\n</script>",
"text/html": [
"<div id=\"3dmolviewer_16391426587325096\" style=\"position: relative; width: 800px; height: 400px\">\n",
" <p id=\"3dmolwarning_16391426587325096\" style=\"background-color:#ffcccc;color:black\">You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: <br>\n",
" <tt>jupyter labextension install jupyterlab_3dmol</tt></p>\n",
" </div>\n",
"<script>\n",
"\n",
"var loadScriptAsync = function(uri){\n",
" return new Promise((resolve, reject) => {\n",
" var tag = document.createElement('script');\n",
" tag.src = uri;\n",
" tag.async = true;\n",
" tag.onload = () => {\n",
" resolve();\n",
" };\n",
" var firstScriptTag = document.getElementsByTagName('script')[0];\n",
" firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n",
"});\n",
"};\n",
"\n",
"if(typeof $3Dmolpromise === 'undefined') {\n",
"$3Dmolpromise = null;\n",
" $3Dmolpromise = loadScriptAsync('https://3dmol.org/build/3Dmol.js');\n",
"}\n",
"\n",
"var viewer_16391426587325096 = null;\n",
"var warn = document.getElementById(\"3dmolwarning_16391426587325096\");\n",
"if(warn) {\n",
" warn.parentNode.removeChild(warn);\n",
"}\n",
"$3Dmolpromise.then(function() {\n",
"var viewergrid_16391426587325096 = null;\n",
"viewergrid_16391426587325096 = $3Dmol.createViewerGrid($(\"#3dmolviewer_16391426587325096\"),{rows: 1, cols: 2, control_all: true},{backgroundColor:\"white\"});\n",
"viewer_16391426587325096 = viewergrid_16391426587325096[0][0];\n",
"viewergrid_16391426587325096[0][0].zoomTo();viewergrid_16391426587325096[0][1].zoomTo();\tviewergrid_16391426587325096[0][0].removeAllModels();\n",
"\tviewergrid_16391426587325096[0][1].removeAllModels();\n",
"\tviewergrid_16391426587325096[0][0].addModel(\"ZINC03814457\\n RDKit 3D\\n\\n 30 31 0 0 1 0 0 0 0 0999 V2000\\n 5.4230 -0.4412 0.7616 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.2434 0.3667 0.1880 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.5978 0.9630 -1.1852 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9575 -0.4703 0.1074 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9988 -1.6999 0.0580 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6357 0.2975 0.0804 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5374 -0.6063 0.0692 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7229 -0.0532 0.0310 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.8848 -0.8592 -0.0106 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1098 -0.1432 -0.0466 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0854 -1.1212 -0.0831 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.4330 -2.2959 -0.0687 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1041 -2.2310 -0.0241 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2721 1.2054 -0.0433 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0919 1.8123 -0.0064 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8677 1.2990 0.0350 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1448 3.1672 -0.0074 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.7118 -1.2538 0.0931 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 6.2974 0.1913 0.9136 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.1671 -0.8852 1.7247 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.0364 1.1881 0.8743 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.4832 1.5956 -1.1194 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.8059 0.1785 -1.9146 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7887 1.5777 -1.5810 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6085 0.9288 -0.8080 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.5821 0.9425 0.9579 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.0816 -0.9900 -0.1173 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9506 -3.2459 -0.0915 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0380 3.6039 0.1519 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.3036 3.6737 0.2145 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 2 1 0\\n 1 18 1 0\\n 1 19 1 0\\n 1 20 1 0\\n 2 3 1 0\\n 2 4 1 0\\n 2 21 1 0\\n 3 22 1 0\\n 3 23 1 0\\n 3 24 1 0\\n 4 5 2 0\\n 4 6 1 0\\n 6 7 1 0\\n 6 25 1 0\\n 6 26 1 0\\n 7 8 1 0\\n 8 16 2 0\\n 8 9 1 0\\n 9 13 1 0\\n 9 10 2 0\\n 10 11 1 0\\n 10 14 1 0\\n 11 12 1 0\\n 11 27 1 0\\n 12 13 2 0\\n 12 28 1 0\\n 14 15 2 0\\n 15 16 1 0\\n 15 17 1 0\\n 17 29 1 0\\n 17 30 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewergrid_16391426587325096[0][1].addModel(\"ZINC03814459\\n RDKit 3D\\n\\n 30 32 0 0 1 0 0 0 0 0999 V2000\\n 3.2069 2.4332 0.1683 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.9680 1.3361 0.0191 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0936 0.2661 -0.0051 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.8080 0.8502 0.1384 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.8933 2.2332 0.2504 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7321 -0.0685 0.1386 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.0086 -1.3940 0.0148 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.2734 -1.7772 -0.1068 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3866 -1.0536 -0.1367 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.4572 -3.1158 -0.2204 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5735 0.3558 0.2686 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.5971 -0.6310 0.2422 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.9575 0.0650 0.3723 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.1165 -0.8888 0.6548 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.3322 -0.1496 0.1130 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.7364 0.9594 -0.7584 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.3578 0.6367 -0.8635 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.6300 3.4278 0.2204 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.9699 1.3070 -0.0571 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3600 -3.4373 -0.5285 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6460 -3.6786 -0.4180 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.4556 -1.3123 1.0829 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.5595 -1.2189 -0.6765 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.9193 0.8386 1.1419 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.2043 -1.1389 1.7124 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9777 -1.8177 0.0998 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.9676 -0.8188 -0.4679 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.9361 0.2761 0.9151 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.2028 1.0183 -1.7422 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.8426 1.9307 -0.2727 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 5 2 0\\n 1 2 1 0\\n 1 18 1 0\\n 2 3 1 0\\n 2 19 1 0\\n 3 9 1 0\\n 3 4 2 0\\n 4 5 1 0\\n 4 6 1 0\\n 6 7 2 0\\n 6 11 1 0\\n 7 8 1 0\\n 8 9 2 0\\n 8 10 1 0\\n 10 20 1 0\\n 10 21 1 0\\n 11 12 1 0\\n 12 13 1 0\\n 12 22 1 0\\n 12 23 1 0\\n 13 17 1 0\\n 13 14 1 0\\n 13 24 1 0\\n 14 15 1 0\\n 14 25 1 0\\n 14 26 1 0\\n 15 16 1 0\\n 15 27 1 0\\n 15 28 1 0\\n 16 17 1 0\\n 16 29 1 0\\n 16 30 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewergrid_16391426587325096[0][0].setStyle({\"stick\": {\"radius\": 0.15}});\n",
"\tviewergrid_16391426587325096[0][1].setStyle({\"stick\": {\"radius\": 0.15}});\n",
"\tviewergrid_16391426587325096[0][0].zoomTo();\n",
"\tviewergrid_16391426587325096[0][1].zoomTo();\n",
"viewergrid_16391426587325096[0][1].render();\n",
"viewergrid_16391426587325096[0][0].render();\n",
"});\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"p.show()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "68c108f9",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'[#6]-&!@[#6](-&!@[#8]-&!@[#6]1:&@[#7]:&@[#6](:&@[#7]:&@[#6]2:&@[#6]:&@1:&@[#7]:&@[#6](:&@[#7]:&@2-&!@[#1])-&!@[#1])-&!@[#7](-&!@[#1])-&!@[#1])(-&!@[#1])-&!@[#1]'"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mcs = rdFMCS.FindMCS(mols[:2],completeRingsOnly=True, atomCompare=rdFMCS.AtomCompare.CompareElements)\n",
"mcs.smartsString"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "b29a60a5",
"metadata": {},
"outputs": [],
"source": [
"def getMCSmol(mol,mcs):\n",
" mcsp = Chem.MolFromSmarts(mcs.smartsString)\n",
" match = mol.GetSubstructMatch(mcsp)\n",
" match_smi = Chem.MolFragmentToSmiles(mol,atomsToUse=match,canonical=True)\n",
" return Chem.MolFromSmiles(match_smi)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "1160af8a",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"RDKit WARNING: [22:24:18] Molecule does not have explicit Hs. Consider calling AddHs()\n",
"[22:24:18] Molecule does not have explicit Hs. Consider calling AddHs()\n"
]
}
],
"source": [
"mcsmol = getMCSmol(mols[0], mcs)\n",
"AllChem.AddHs(mcsmol)\n",
"AllChem.EmbedMolecule(mcsmol, AllChem.ETKDGv2())\n",
"core = AllChem.DeleteSubstructs(AllChem.ReplaceSidechains(mols[0],mcsmol),Chem.MolFromSmiles('*'))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "b93cea04",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[0.809231468849477] [0.39958657762640165]\n"
]
}
],
"source": [
"shapesim, espsim = EmbedAlignConstrainedScore(mols[0], [mols[1]], core\n",
" , prbNumConfs=mols[0].GetNumConformers()\n",
" , refNumConfs=mols[1].GetNumConformers())\n",
"print(shapesim, espsim)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "b5544ad0",
"metadata": {},
"outputs": [
{
"data": {
"application/3dmoljs_load.v0": "<div id=\"3dmolviewer_16391426588176754\" style=\"position: relative; width: 800px; height: 400px\">\n <p id=\"3dmolwarning_16391426588176754\" style=\"background-color:#ffcccc;color:black\">You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: <br>\n <tt>jupyter labextension install jupyterlab_3dmol</tt></p>\n </div>\n<script>\n\nvar loadScriptAsync = function(uri){\n return new Promise((resolve, reject) => {\n var tag = document.createElement('script');\n tag.src = uri;\n tag.async = true;\n tag.onload = () => {\n resolve();\n };\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n});\n};\n\nif(typeof $3Dmolpromise === 'undefined') {\n$3Dmolpromise = null;\n $3Dmolpromise = loadScriptAsync('https://3dmol.org/build/3Dmol.js');\n}\n\nvar viewer_16391426588176754 = null;\nvar warn = document.getElementById(\"3dmolwarning_16391426588176754\");\nif(warn) {\n warn.parentNode.removeChild(warn);\n}\n$3Dmolpromise.then(function() {\nvar viewergrid_16391426588176754 = null;\nviewergrid_16391426588176754 = $3Dmol.createViewerGrid($(\"#3dmolviewer_16391426588176754\"),{rows: 1, cols: 2, control_all: true},{backgroundColor:\"white\"});\nviewer_16391426588176754 = viewergrid_16391426588176754[0][0];\nviewergrid_16391426588176754[0][0].zoomTo();viewergrid_16391426588176754[0][1].zoomTo();\tviewergrid_16391426588176754[0][0].removeAllModels();\n\tviewergrid_16391426588176754[0][1].removeAllModels();\n\tviewergrid_16391426588176754[0][0].addModel(\"ZINC03814457\\n RDKit 3D\\n\\n 30 31 0 0 1 0 0 0 0 0999 V2000\\n 4.6093 -0.9158 1.9435 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.2943 -1.3837 1.3125 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3706 -2.8626 0.9204 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9515 -0.5341 0.1104 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7030 -0.5056 -0.8539 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6826 0.2580 0.0816 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5455 -0.6090 0.0636 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7375 -0.0620 0.0306 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.9003 -0.8336 -0.0095 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1102 -0.2140 -0.0456 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0850 -1.1258 -0.0828 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.4173 -2.3069 -0.0678 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0613 -2.1727 -0.0227 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2525 1.1324 -0.0448 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1149 1.8827 -0.0055 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8884 1.2915 0.0323 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1980 3.2946 -0.0069 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.8269 -1.5097 2.8568 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.5320 0.1536 2.2350 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.4540 -1.0339 1.2308 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.4932 -1.2762 2.0774 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.4045 -3.1895 0.4793 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.1807 -3.0339 0.1790 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5704 -3.4856 1.8182 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6698 0.9088 -0.8211 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6482 0.9073 0.9836 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.1166 -0.9690 -0.1164 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9144 -3.2677 -0.0899 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1275 3.7694 -0.0368 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.3314 3.8766 0.0223 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 2 1 0\\n 1 18 1 0\\n 1 19 1 0\\n 1 20 1 0\\n 2 3 1 0\\n 2 4 1 0\\n 2 21 1 0\\n 3 22 1 0\\n 3 23 1 0\\n 3 24 1 0\\n 4 5 2 0\\n 4 6 1 0\\n 6 7 1 0\\n 6 25 1 0\\n 6 26 1 0\\n 7 8 1 0\\n 8 16 2 0\\n 8 9 1 0\\n 9 13 1 0\\n 9 10 2 0\\n 10 11 1 0\\n 10 14 1 0\\n 11 12 1 0\\n 11 27 1 0\\n 12 13 2 0\\n 12 28 1 0\\n 14 15 2 0\\n 15 16 1 0\\n 15 17 1 0\\n 17 29 1 0\\n 17 30 1 0\\nM END\\n\",\"sdf\");\n\tviewergrid_16391426588176754[0][1].addModel(\"ZINC03814459\\n RDKit 3D\\n\\n 30 32 0 0 1 0 0 0 0 0999 V2000\\n -3.4186 -2.3068 -0.0679 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0865 -1.1257 -0.0830 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1120 -0.2137 -0.0459 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.9025 -0.8332 -0.0097 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0627 -2.1724 -0.0228 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7406 -0.0617 0.0306 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8904 1.2917 0.0321 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1165 1.8831 -0.0058 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2542 1.1328 -0.0450 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1990 3.2950 -0.0071 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5404 -0.6095 0.0652 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6781 0.2574 0.0836 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9786 -0.5359 0.1084 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.1940 -1.3370 -1.1685 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.9212 -2.5472 -0.6749 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.4444 -2.6694 0.7582 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9898 -1.4143 1.2126 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9156 -3.2676 -0.0899 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.1181 -0.9691 -0.1165 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.3323 3.8767 0.0220 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1284 3.7701 -0.0368 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6690 0.9143 -0.8146 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6383 0.9005 0.9905 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.8235 0.1794 0.2266 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7957 -0.7720 -1.9135 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.2285 -1.6479 -1.6268 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.6746 -3.4516 -1.2727 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.0189 -2.3664 -0.6964 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.2677 -3.0289 1.4116 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.6043 -3.3953 0.8153 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 5 2 0\\n 1 2 1 0\\n 1 18 1 0\\n 2 3 1 0\\n 2 19 1 0\\n 3 9 1 0\\n 3 4 2 0\\n 4 5 1 0\\n 4 6 1 0\\n 6 7 2 0\\n 6 11 1 0\\n 7 8 1 0\\n 8 9 2 0\\n 8 10 1 0\\n 10 20 1 0\\n 10 21 1 0\\n 11 12 1 0\\n 12 13 1 0\\n 12 22 1 0\\n 12 23 1 0\\n 13 17 1 0\\n 13 14 1 0\\n 13 24 1 0\\n 14 15 1 0\\n 14 25 1 0\\n 14 26 1 0\\n 15 16 1 0\\n 15 27 1 0\\n 15 28 1 0\\n 16 17 1 0\\n 16 29 1 0\\n 16 30 1 0\\nM END\\n\",\"sdf\");\n\tviewergrid_16391426588176754[0][0].setStyle({\"stick\": {\"radius\": 0.15}});\n\tviewergrid_16391426588176754[0][1].setStyle({\"stick\": {\"radius\": 0.15}});\n\tviewergrid_16391426588176754[0][0].zoomTo();\n\tviewergrid_16391426588176754[0][1].zoomTo();\nviewergrid_16391426588176754[0][1].render();\nviewergrid_16391426588176754[0][0].render();\n});\n</script>",
"text/html": [
"<div id=\"3dmolviewer_16391426588176754\" style=\"position: relative; width: 800px; height: 400px\">\n",
" <p id=\"3dmolwarning_16391426588176754\" style=\"background-color:#ffcccc;color:black\">You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: <br>\n",
" <tt>jupyter labextension install jupyterlab_3dmol</tt></p>\n",
" </div>\n",
"<script>\n",
"\n",
"var loadScriptAsync = function(uri){\n",
" return new Promise((resolve, reject) => {\n",
" var tag = document.createElement('script');\n",
" tag.src = uri;\n",
" tag.async = true;\n",
" tag.onload = () => {\n",
" resolve();\n",
" };\n",
" var firstScriptTag = document.getElementsByTagName('script')[0];\n",
" firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n",
"});\n",
"};\n",
"\n",
"if(typeof $3Dmolpromise === 'undefined') {\n",
"$3Dmolpromise = null;\n",
" $3Dmolpromise = loadScriptAsync('https://3dmol.org/build/3Dmol.js');\n",
"}\n",
"\n",
"var viewer_16391426588176754 = null;\n",
"var warn = document.getElementById(\"3dmolwarning_16391426588176754\");\n",
"if(warn) {\n",
" warn.parentNode.removeChild(warn);\n",
"}\n",
"$3Dmolpromise.then(function() {\n",
"var viewergrid_16391426588176754 = null;\n",
"viewergrid_16391426588176754 = $3Dmol.createViewerGrid($(\"#3dmolviewer_16391426588176754\"),{rows: 1, cols: 2, control_all: true},{backgroundColor:\"white\"});\n",
"viewer_16391426588176754 = viewergrid_16391426588176754[0][0];\n",
"viewergrid_16391426588176754[0][0].zoomTo();viewergrid_16391426588176754[0][1].zoomTo();\tviewergrid_16391426588176754[0][0].removeAllModels();\n",
"\tviewergrid_16391426588176754[0][1].removeAllModels();\n",
"\tviewergrid_16391426588176754[0][0].addModel(\"ZINC03814457\\n RDKit 3D\\n\\n 30 31 0 0 1 0 0 0 0 0999 V2000\\n 4.6093 -0.9158 1.9435 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.2943 -1.3837 1.3125 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3706 -2.8626 0.9204 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9515 -0.5341 0.1104 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7030 -0.5056 -0.8539 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6826 0.2580 0.0816 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5455 -0.6090 0.0636 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7375 -0.0620 0.0306 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.9003 -0.8336 -0.0095 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1102 -0.2140 -0.0456 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0850 -1.1258 -0.0828 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.4173 -2.3069 -0.0678 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0613 -2.1727 -0.0227 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2525 1.1324 -0.0448 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1149 1.8827 -0.0055 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8884 1.2915 0.0323 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1980 3.2946 -0.0069 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.8269 -1.5097 2.8568 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.5320 0.1536 2.2350 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.4540 -1.0339 1.2308 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.4932 -1.2762 2.0774 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.4045 -3.1895 0.4793 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.1807 -3.0339 0.1790 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5704 -3.4856 1.8182 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6698 0.9088 -0.8211 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6482 0.9073 0.9836 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.1166 -0.9690 -0.1164 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9144 -3.2677 -0.0899 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1275 3.7694 -0.0368 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.3314 3.8766 0.0223 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 2 1 0\\n 1 18 1 0\\n 1 19 1 0\\n 1 20 1 0\\n 2 3 1 0\\n 2 4 1 0\\n 2 21 1 0\\n 3 22 1 0\\n 3 23 1 0\\n 3 24 1 0\\n 4 5 2 0\\n 4 6 1 0\\n 6 7 1 0\\n 6 25 1 0\\n 6 26 1 0\\n 7 8 1 0\\n 8 16 2 0\\n 8 9 1 0\\n 9 13 1 0\\n 9 10 2 0\\n 10 11 1 0\\n 10 14 1 0\\n 11 12 1 0\\n 11 27 1 0\\n 12 13 2 0\\n 12 28 1 0\\n 14 15 2 0\\n 15 16 1 0\\n 15 17 1 0\\n 17 29 1 0\\n 17 30 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewergrid_16391426588176754[0][1].addModel(\"ZINC03814459\\n RDKit 3D\\n\\n 30 32 0 0 1 0 0 0 0 0999 V2000\\n -3.4186 -2.3068 -0.0679 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0865 -1.1257 -0.0830 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1120 -0.2137 -0.0459 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.9025 -0.8332 -0.0097 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0627 -2.1724 -0.0228 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7406 -0.0617 0.0306 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8904 1.2917 0.0321 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1165 1.8831 -0.0058 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2542 1.1328 -0.0450 N 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1990 3.2950 -0.0071 N 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5404 -0.6095 0.0652 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6781 0.2574 0.0836 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9786 -0.5359 0.1084 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.1940 -1.3370 -1.1685 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.9212 -2.5472 -0.6749 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.4444 -2.6694 0.7582 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9898 -1.4143 1.2126 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9156 -3.2676 -0.0899 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -5.1181 -0.9691 -0.1165 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.3323 3.8767 0.0220 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1284 3.7701 -0.0368 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6690 0.9143 -0.8146 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.6383 0.9005 0.9905 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.8235 0.1794 0.2266 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7957 -0.7720 -1.9135 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.2285 -1.6479 -1.6268 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.6746 -3.4516 -1.2727 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.0189 -2.3664 -0.6964 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.2677 -3.0289 1.4116 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.6043 -3.3953 0.8153 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 5 2 0\\n 1 2 1 0\\n 1 18 1 0\\n 2 3 1 0\\n 2 19 1 0\\n 3 9 1 0\\n 3 4 2 0\\n 4 5 1 0\\n 4 6 1 0\\n 6 7 2 0\\n 6 11 1 0\\n 7 8 1 0\\n 8 9 2 0\\n 8 10 1 0\\n 10 20 1 0\\n 10 21 1 0\\n 11 12 1 0\\n 12 13 1 0\\n 12 22 1 0\\n 12 23 1 0\\n 13 17 1 0\\n 13 14 1 0\\n 13 24 1 0\\n 14 15 1 0\\n 14 25 1 0\\n 14 26 1 0\\n 15 16 1 0\\n 15 27 1 0\\n 15 28 1 0\\n 16 17 1 0\\n 16 29 1 0\\n 16 30 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewergrid_16391426588176754[0][0].setStyle({\"stick\": {\"radius\": 0.15}});\n",
"\tviewergrid_16391426588176754[0][1].setStyle({\"stick\": {\"radius\": 0.15}});\n",
"\tviewergrid_16391426588176754[0][0].zoomTo();\n",
"\tviewergrid_16391426588176754[0][1].zoomTo();\n",
"viewergrid_16391426588176754[0][1].render();\n",
"viewergrid_16391426588176754[0][0].render();\n",
"});\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"<py3Dmol.view at 0x7f84c09c79d0>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"drawTwoMols(mols[0], mols[1])"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment