Skip to content

Instantly share code, notes, and snippets.

@ptosco
Last active July 28, 2016 10:41
Show Gist options
  • Save ptosco/a4af20da568078cce16d09cef7563180 to your computer and use it in GitHub Desktop.
Save ptosco/a4af20da568078cce16d09cef7563180 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A [recent post on](http://blogs.sciencemag.org/pipeline/archives/2016/07/27/maoecrystal-v-you-poor-people) In the Pipeline talked about a recent JACS communication on the total synthesis of the natural product maoecrystal V. The article is open access:\n",
"http://pubs.acs.org/doi/abs/10.1021/jacs.6b06623\n",
"\n",
"Here's the ToC figure, which shows a sketch of the final product on the left:\n",
"![ToC Figure](http://pubs.acs.org/appl/literatum/publisher/achs/journals/content/jacsat/0/jacsat.ahead-of-print/jacs.6b06623/20160725/images/medium/ja-2016-066232_0004.gif)\n",
"\n",
"Since I've been looking at how well the RDKit does at conformation generation for highly constrained systems, I thought this would be a nice example molecule to try out. I was also quite curious about the shape of that beast.\n",
"\n",
"The first problem was getting the structure in. I wasn't completely confident in my ability to reproduce that sketch and JACS, of course, doesn't have a way to provide structures in electronic form. Fortunately the authors had solved x-ray structures of their final product and a bunch of intermediates and the CIF files were in the supplementary material. So I converted the CIF to a mol file with OpenBabel (hopefully using the correct CIF file... they aren't particularly well labelled as far as I can tell) and got started from there.\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2016.09.1.dev1\n",
"Thu Jul 28 11:40:24 2016\n"
]
}
],
"source": [
"from rdkit import Chem\n",
"from rdkit.Chem import AllChem\n",
"from rdkit.Chem import Draw\n",
"from rdkit.Chem.Draw import IPythonConsole\n",
"from rdkit import rdBase\n",
"print(rdBase.rdkitVersion)\n",
"import sys,os,time,tempfile,subprocess,platform,shutil\n",
"print( time.asctime())\n",
"if (sys.version_info < (3, 0, 0)):\n",
" import urllib\n",
"else:\n",
" import urllib.request as urllib\n",
"si = None\n",
"if (platform.system() == 'Windows'):\n",
" si = subprocess.STARTUPINFO()\n",
" si.dwFlags |= subprocess.STARTF_USESHOWWINDOW\n",
" si.wShowWindow = subprocess.SW_HIDE"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We'll use py3Dmol to show structures in the notebook"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import py3Dmol\n",
"def drawit(m,p=None,confId=-1):\n",
" mb = Chem.MolToMolBlock(m,confId=confId)\n",
" if p is None:\n",
" p = py3Dmol.view(width=400,height=400)\n",
" p.removeAllModels()\n",
" p.addModel(mb,'sdf')\n",
" p.setStyle({'stick':{}})\n",
" p.setBackgroundColor('0xeeeeee')\n",
" p.zoomTo()\n",
" return p.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Start by reading in the mol file and displaying that:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div id=\"3dmolviewer_14697024253629704\" style=\"position: relative; width: 400px; height: 400px\">\n",
"<script>\n",
"if(typeof $3Dmolpromise === 'undefined') $3Dmolpromise = $.when($.getScript('http://3dmol.csb.pitt.edu/build/3Dmol.js'))\n",
"$3Dmolpromise.done(function() {\n",
"var viewer = $3Dmol.createViewer($(\"#3dmolviewer_14697024253629704\"),{backgroundColor:\"white\"});\n",
"\tviewer.removeAllModels();\n",
"\tviewer.addModel(\"?\\n RDKit 3D\\n\\n 46 50 0 0 1 0 0 0 0 0999 V2000\\n 2.3140 11.5885 3.7586 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3676 11.6106 1.1323 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.7299 10.1636 0.8819 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 7.0018 11.3895 3.5441 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.1009 9.9967 5.6539 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.6890 10.3405 3.1133 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 1.8661 9.1475 3.5533 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.1742 8.9442 2.8747 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.4135 9.3454 4.4104 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.8094 7.9359 3.7246 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 2.2760 7.0965 3.8259 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.6346 8.1959 4.9962 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 2.9923 8.3186 5.7506 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.3722 9.5051 4.8099 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.1856 10.1241 3.4238 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 4.6298 11.5851 3.3114 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 3.5455 12.2305 4.1803 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 3.7154 11.9098 5.1119 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5196 13.7482 4.2620 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.9430 14.1415 4.5712 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.0855 15.0218 4.9014 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 6.0280 13.3602 4.4228 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 6.8609 13.6836 4.7445 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.9991 12.0299 3.7900 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.5549 10.6652 1.6214 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7383 7.8263 2.5118 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.1988 7.8131 1.6815 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.2496 6.9804 2.5609 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.7235 9.0260 2.4706 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.6242 8.7357 2.7603 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.7906 9.3797 1.5482 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.6008 7.0767 5.3956 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.0995 6.2452 5.5284 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.0557 7.3209 6.2286 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.2645 6.9487 4.6856 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.6024 11.9573 1.8195 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.7456 12.9339 1.7345 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 5.3537 11.5033 1.3657 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0083 14.4886 3.0093 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.6621 14.3936 2.2850 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.8879 15.4389 3.2179 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.1526 14.1046 2.7289 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.6372 14.1653 5.4499 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.7045 13.9356 5.2603 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.7149 15.1314 5.5911 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9313 13.6928 6.2567 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 17 1 0\\n 2 25 1 0\\n 2 36 1 0\\n 3 25 2 0\\n 4 24 2 0\\n 6 25 1 0\\n 6 15 1 0\\n 6 7 1 0\\n 6 1 1 1\\n 7 10 1 0\\n 7 9 1 0\\n 8 7 1 0\\n 10 11 1 1\\n 10 12 1 0\\n 12 32 1 0\\n 12 13 1 1\\n 14 12 1 0\\n 14 5 2 0\\n 15 29 1 0\\n 15 14 1 1\\n 16 36 1 0\\n 16 15 1 0\\n 16 24 1 1\\n 16 17 1 0\\n 17 19 1 0\\n 17 18 1 1\\n 19 20 1 0\\n 19 43 1 0\\n 20 21 1 0\\n 22 20 2 0\\n 22 23 1 0\\n 24 22 1 0\\n 26 28 1 0\\n 26 10 1 0\\n 27 26 1 0\\n 29 26 1 0\\n 29 30 1 0\\n 31 29 1 0\\n 32 33 1 0\\n 32 34 1 0\\n 35 32 1 0\\n 37 36 1 0\\n 38 36 1 0\\n 39 41 1 0\\n 39 19 1 0\\n 40 39 1 0\\n 42 39 1 0\\n 43 45 1 0\\n 43 46 1 0\\n 44 43 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewer.setStyle({\"stick\": {}});\n",
"\tviewer.setBackgroundColor(\"0xeeeeee\");\n",
"\tviewer.zoomTo();\n",
"viewer.render();\n",
"});\n",
"</script>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tempDir = tempfile.mkdtemp()\n",
"cifLoc = os.path.join(tempDir, 'ja6b06623_si_010.cif')\n",
"molLoc = cifLoc + '.mol'\n",
"urllib.urlretrieve('https://ndownloader.figshare.com/files/5529005', cifLoc)\n",
"cmdLine = 'babel -icif ' + cifLoc + ' -omol ' + molLoc\n",
"pOpenObj = subprocess.Popen(cmdLine.split(),\n",
" stdin = subprocess.PIPE, stdout = subprocess.PIPE,\n",
" stderr = subprocess.PIPE, startupinfo = si)\n",
"(stdoutData, stderrData) = pOpenObj.communicate()\n",
"mExpt = Chem.MolFromMolFile(molLoc, removeHs = False)\n",
"drawit(mExpt)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now generate a conformer for the molecule:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div id=\"3dmolviewer_14697024254833179\" style=\"position: relative; width: 400px; height: 400px\">\n",
"<script>\n",
"if(typeof $3Dmolpromise === 'undefined') $3Dmolpromise = $.when($.getScript('http://3dmol.csb.pitt.edu/build/3Dmol.js'))\n",
"$3Dmolpromise.done(function() {\n",
"var viewer = $3Dmol.createViewer($(\"#3dmolviewer_14697024254833179\"),{backgroundColor:\"white\"});\n",
"\tviewer.removeAllModels();\n",
"\tviewer.addModel(\"?\\n RDKit 3D\\n\\n 46 50 0 0 1 0 0 0 0 0999 V2000\\n -0.6803 0.9350 0.9981 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5958 -1.7282 1.9567 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7293 -0.5808 3.4562 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.2214 -1.9079 -2.4319 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.0226 0.6111 -2.1870 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5037 0.3036 1.2123 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 1.6670 1.0963 1.6427 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.5437 2.1768 1.4566 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.8993 0.9969 2.7298 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.8698 0.6178 0.8117 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 3.8153 1.0101 1.1897 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.5696 1.2060 -0.5684 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 2.2480 2.2472 -0.4051 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.3859 0.4364 -1.0566 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7585 -0.4840 -0.0974 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -0.6298 -0.8980 -0.3531 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.2941 0.4426 -0.1022 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -0.9386 1.1047 -0.9557 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7654 0.4527 -0.1845 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -3.1684 -0.2520 -1.4399 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.1984 -0.0469 -1.7598 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.3747 -1.0568 -2.1234 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7804 -1.5153 -3.0273 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.0121 -1.3287 -1.6856 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.2326 -0.6969 2.3158 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9682 -0.8768 0.7744 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0370 -1.2213 1.8341 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.8986 -1.1438 0.2354 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.7553 -1.5655 0.1784 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.4074 -2.4243 0.7376 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.0869 -1.9551 -0.8289 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7395 1.1231 -1.4911 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.3310 2.0738 -1.3667 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3565 1.1685 -2.5387 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.4170 0.2882 -1.3189 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.0343 -1.9405 0.6576 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0933 -2.1906 0.6692 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5240 -2.8893 0.3048 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.5242 0.0372 1.0237 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.9350 -0.0471 1.9519 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0997 -0.9194 0.8633 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.3478 0.7668 1.2990 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1748 1.9184 -0.4537 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7885 2.1415 -1.4682 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7791 2.5780 0.3198 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.2826 1.9366 -0.5104 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 17 1 0\\n 2 25 1 0\\n 2 36 1 0\\n 3 25 2 0\\n 4 24 2 0\\n 6 25 1 0\\n 6 15 1 0\\n 6 7 1 0\\n 6 1 1 6\\n 7 10 1 0\\n 7 9 1 0\\n 8 7 1 0\\n 10 11 1 1\\n 10 12 1 0\\n 12 32 1 0\\n 12 13 1 1\\n 14 12 1 0\\n 14 5 2 0\\n 15 29 1 0\\n 15 14 1 6\\n 16 36 1 0\\n 16 15 1 0\\n 16 24 1 6\\n 16 17 1 0\\n 17 19 1 0\\n 17 18 1 6\\n 19 20 1 0\\n 19 43 1 6\\n 20 21 1 0\\n 22 20 2 0\\n 22 23 1 0\\n 24 22 1 0\\n 26 28 1 0\\n 26 10 1 0\\n 27 26 1 0\\n 29 26 1 0\\n 29 30 1 0\\n 31 29 1 0\\n 32 33 1 0\\n 32 34 1 0\\n 35 32 1 0\\n 37 36 1 0\\n 38 36 1 0\\n 39 41 1 0\\n 39 19 1 0\\n 40 39 1 0\\n 42 39 1 0\\n 43 45 1 0\\n 43 46 1 0\\n 44 43 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewer.setStyle({\"stick\": {}});\n",
"\tviewer.setBackgroundColor(\"0xeeeeee\");\n",
"\tviewer.zoomTo();\n",
"viewer.render();\n",
"});\n",
"</script>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = Chem.MolFromMolFile(molLoc, removeHs = False)\n",
"Chem.AssignAtomChiralTagsFromStructure(m)\n",
"AllChem.EmbedMolecule(m,useExpTorsionAnglePrefs = True, useBasicKnowledge = True)\n",
"drawit(m)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"At least by eye that looks very close, let's check the RMS:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RMS: 0.4592790169788881 Heavy Atom RMS: 0.1537802048332032\n"
]
}
],
"source": [
"print(\"RMS: \",AllChem.GetBestRMS(m,mExpt),\n",
" \"Heavy Atom RMS:\",\n",
" AllChem.GetBestRMS(Chem.RemoveHs(m),Chem.RemoveHs(mExpt)))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Not bad! But then, this is a highly constrained structure.\n",
"\n",
"Because we can, let's look at the two structures superimposed:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def align2mols(m1, m2):\n",
" AllChem.AlignMol(m1, m2)\n",
" mb1 = Chem.MolToMolBlock(m1)\n",
" mb2 = Chem.MolToMolBlock(m2)\n",
" p = py3Dmol.view(width = 400, height = 400)\n",
" p.removeAllModels()\n",
" p.addModel(mb1, 'sdf')\n",
" p.addModel(mb2, 'sdf')\n",
"\n",
" p.setStyle({'stick':{}})\n",
" p.setBackgroundColor('0xeeeeee')\n",
" p.zoomTo()\n",
" return p"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div id=\"3dmolviewer_14697024256800942\" style=\"position: relative; width: 400px; height: 400px\">\n",
"<script>\n",
"if(typeof $3Dmolpromise === 'undefined') $3Dmolpromise = $.when($.getScript('http://3dmol.csb.pitt.edu/build/3Dmol.js'))\n",
"$3Dmolpromise.done(function() {\n",
"var viewer = $3Dmol.createViewer($(\"#3dmolviewer_14697024256800942\"),{backgroundColor:\"white\"});\n",
"\tviewer.removeAllModels();\n",
"\tviewer.addModel(\"?\\n RDKit 3D\\n\\n 46 50 0 0 1 0 0 0 0 0999 V2000\\n -0.6723 0.9285 1.0097 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.6091 -1.7467 1.9361 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7259 -0.6281 3.4486 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.2379 -1.8766 -2.4546 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.0267 0.6290 -2.1800 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5066 0.2850 1.2156 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 1.6766 1.0630 1.6549 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.5619 2.1466 1.4818 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.9084 0.9486 2.7406 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.8751 0.5848 0.8176 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 3.8239 0.9649 1.1998 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.5790 1.1919 -0.5552 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 2.2660 2.2337 -0.3792 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.3890 0.4379 -1.0520 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7545 -0.4889 -0.1036 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -0.6372 -0.8885 -0.3635 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.2905 0.4544 -0.0962 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -0.9300 1.1238 -0.9419 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7617 0.4774 -0.1776 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -3.1709 -0.2089 -1.4413 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.1993 0.0084 -1.7581 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.3841 -1.0118 -2.1348 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7938 -1.4562 -3.0439 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.0236 -1.3001 -1.7009 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.2279 -0.7265 2.3071 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9613 -0.9101 0.7623 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0277 -1.2678 1.8178 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.8893 -1.1781 0.2197 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.7426 -1.5816 0.1587 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.3880 -2.4443 0.7078 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.0706 -1.9618 -0.8534 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.7478 1.1106 -1.4794 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.3471 2.0550 -1.3438 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3648 1.1717 -2.5262 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.4187 0.2682 -1.3176 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.0497 -1.9398 0.6348 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1108 -2.1814 0.6439 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5473 -2.8884 0.2703 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.5234 0.0535 1.0259 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.9345 -0.0467 1.9527 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.1067 -0.8963 0.8542 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.3409 0.7865 1.3103 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1593 1.9495 -0.4290 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7716 2.1816 -1.4410 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7580 2.5965 0.3521 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.2669 1.9773 -0.4849 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 17 1 0\\n 2 25 1 0\\n 2 36 1 0\\n 3 25 2 0\\n 4 24 2 0\\n 6 25 1 0\\n 6 15 1 0\\n 6 7 1 0\\n 6 1 1 6\\n 7 10 1 0\\n 7 9 1 0\\n 8 7 1 0\\n 10 11 1 1\\n 10 12 1 0\\n 12 32 1 0\\n 12 13 1 1\\n 14 12 1 0\\n 14 5 2 0\\n 15 29 1 0\\n 15 14 1 6\\n 16 36 1 0\\n 16 15 1 0\\n 16 24 1 6\\n 16 17 1 0\\n 17 19 1 0\\n 17 18 1 6\\n 19 20 1 0\\n 19 43 1 6\\n 20 21 1 0\\n 22 20 2 0\\n 22 23 1 0\\n 24 22 1 0\\n 26 28 1 0\\n 26 10 1 0\\n 27 26 1 0\\n 29 26 1 0\\n 29 30 1 0\\n 31 29 1 0\\n 32 33 1 0\\n 32 34 1 0\\n 35 32 1 0\\n 37 36 1 0\\n 38 36 1 0\\n 39 41 1 0\\n 39 19 1 0\\n 40 39 1 0\\n 42 39 1 0\\n 43 45 1 0\\n 43 46 1 0\\n 44 43 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewer.addModel(\"?\\n RDKit 3D\\n\\n 46 50 0 0 1 0 0 0 0 0999 V2000\\n -0.7453 0.9929 1.1009 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7068 -1.6898 2.0009 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.6849 -0.7772 3.4393 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.3824 -2.2005 -2.3243 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.9243 0.6780 -2.2166 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5208 0.2954 1.2592 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 1.6805 1.1984 1.6246 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.8660 1.1358 2.5953 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.4592 2.1383 1.4095 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9224 0.7536 0.8202 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 3.7418 1.2009 1.1777 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.6793 1.1798 -0.6375 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 2.5276 2.1665 -0.6401 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.3982 0.5217 -1.1048 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7859 -0.4310 -0.0769 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -0.6578 -0.8473 -0.3719 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.3482 0.4975 -0.1229 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.0305 1.1063 -0.8496 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.8666 0.5319 -0.1870 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2133 -0.1661 -1.4789 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.0912 -0.0329 -1.8194 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.3936 -0.9588 -2.1927 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.6910 -1.2627 -3.0418 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.0594 -1.3827 -1.7335 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.2054 -0.7632 2.3217 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0752 -0.7681 0.9016 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0774 -1.0506 1.8507 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.9378 -1.0370 0.4978 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.9107 -1.4728 0.1539 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.2293 -1.8270 -0.7136 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.5680 -2.2290 0.6936 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.8276 0.8911 -1.6090 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.6400 1.3413 -1.2966 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5916 1.2235 -2.5002 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.9850 -0.0756 -1.6514 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.0169 -1.9764 0.6085 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.9872 -2.1626 0.5347 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5331 -2.7951 0.3400 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.6127 -0.1126 0.9991 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.4885 -1.0847 0.9729 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.5685 0.0962 0.9362 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.2559 0.2394 1.8400 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.3249 1.9955 -0.2939 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1258 2.4619 0.5437 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.2890 2.0243 -0.4642 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.8500 2.4333 -1.0311 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 17 1 0\\n 2 25 1 0\\n 2 36 1 0\\n 3 25 2 0\\n 4 24 2 0\\n 6 25 1 0\\n 6 15 1 0\\n 6 7 1 0\\n 6 1 1 6\\n 7 10 1 0\\n 7 9 1 0\\n 8 7 1 0\\n 10 11 1 1\\n 10 12 1 0\\n 12 32 1 0\\n 12 13 1 1\\n 14 12 1 0\\n 14 5 2 0\\n 15 29 1 0\\n 15 14 1 6\\n 16 36 1 0\\n 16 15 1 0\\n 16 24 1 6\\n 16 17 1 0\\n 17 19 1 0\\n 17 18 1 6\\n 19 20 1 0\\n 19 43 1 0\\n 20 21 1 0\\n 22 20 2 0\\n 22 23 1 0\\n 24 22 1 0\\n 26 28 1 0\\n 26 10 1 0\\n 27 26 1 0\\n 29 26 1 0\\n 29 30 1 0\\n 31 29 1 0\\n 32 33 1 0\\n 32 34 1 0\\n 35 32 1 0\\n 37 36 1 0\\n 38 36 1 0\\n 39 41 1 0\\n 39 19 1 0\\n 40 39 1 0\\n 42 39 1 0\\n 43 45 1 0\\n 43 46 1 0\\n 44 43 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewer.setStyle({\"stick\": {}});\n",
"\tviewer.setBackgroundColor(\"0xeeeeee\");\n",
"\tviewer.zoomTo();\n",
"viewer.render();\n",
"});\n",
"</script>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"align2mols(m, mExpt).show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, a bit of 2D work. \n",
"\n",
"Just to have it, here's the SMILES for maoecrystal V "
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"'C[C@H]1C(=O)[C@@]23CC[C@@H]1C[C@@]21O[C@@H]2C(C)(C)C=CC(=O)[C@]23COC1=O'"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Chem.MolToSmiles(Chem.RemoveHs(m),True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's see how well the RDKit's 2D coordinate generation works here:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAYAAABNcIgQAAAiiElEQVR4nO3deVTU9f4/8OfgMKwi\nqMhFNoEkFVATBRLXEtOESgv1VpJmmqahVoi35Yt5r4nW716X3HBJxSXR0EBbcCWVxQNaBG6I4gYq\nlpjsw/D+/UGOjmCCzsxnJp6Pc+ac5v2Z+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at 0x7f2b0c063590>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Chem.MolFromSmiles('C[C@H]1C(=O)[C@@]23CC[C@@H]1C[C@@]21O[C@@H]2C(C)(C)C=CC(=O)[C@]23COC1=O')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Not great, but definitely not as bad as I had expected."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's generate 3D coordinates starting from SMILES, and let's do some MMFF94s minimization:"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div id=\"3dmolviewer_14697024263924992\" style=\"position: relative; width: 400px; height: 400px\">\n",
"<script>\n",
"if(typeof $3Dmolpromise === 'undefined') $3Dmolpromise = $.when($.getScript('http://3dmol.csb.pitt.edu/build/3Dmol.js'))\n",
"$3Dmolpromise.done(function() {\n",
"var viewer = $3Dmol.createViewer($(\"#3dmolviewer_14697024263924992\"),{backgroundColor:\"white\"});\n",
"\tviewer.removeAllModels();\n",
"\tviewer.addModel(\"\\n RDKit 3D\\n\\n 46 50 0 0 0 0 0 0 0 0999 V2000\\n -3.8210 1.0178 -1.4662 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7241 -0.0007 -1.1859 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.3964 0.6909 -0.9109 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8932 1.4608 -1.7246 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7598 0.3719 0.4614 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.8218 0.8578 1.4634 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0736 -0.0424 1.3284 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0053 -0.8960 0.0374 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -1.8288 -1.9029 0.1423 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5643 -1.1542 0.5941 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 0.6111 -1.4917 -0.1913 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.2945 -0.2488 -0.4332 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 2.8342 -0.2933 -0.5607 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.1858 -0.9399 -1.9226 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5352 -1.1373 0.5143 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3396 1.1489 -0.5677 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.5961 2.2389 -0.2967 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.1846 2.1332 0.1906 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5274 3.1452 0.4103 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7084 0.7571 0.5781 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 1.1347 0.5480 2.0337 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.8103 -0.7413 2.5841 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.1615 -1.5225 2.0399 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.6297 -2.4631 2.6706 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.6244 1.5387 -2.4099 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.8824 1.7856 -0.6885 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.7964 0.5284 -1.5498 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.5899 -0.6328 -2.0725 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.4882 0.8379 2.5049 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0940 1.8998 1.2519 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1436 -0.7065 2.1990 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9775 0.5767 1.3430 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9433 -1.4453 -0.1018 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.6620 -2.3956 -0.8237 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1133 -2.6983 0.8393 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.9599 0.0394 -1.4393 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.7967 -1.9628 -1.9853 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.2707 -0.9866 -2.0763 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.7666 -0.3717 -2.7616 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.4991 -0.6931 1.5090 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.5999 -1.2621 0.2804 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0978 -2.1398 0.5791 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.3763 1.2992 -0.8688 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9949 3.2450 -0.3727 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.6658 1.2963 2.6853 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.2046 0.7112 2.1823 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 2 1 0\\n 2 3 1 0\\n 3 4 2 0\\n 5 3 1 6\\n 5 6 1 0\\n 6 7 1 0\\n 7 8 1 0\\n 8 9 1 0\\n 9 10 1 0\\n 10 11 1 6\\n 11 12 1 0\\n 12 13 1 0\\n 13 14 1 0\\n 13 15 1 0\\n 13 16 1 0\\n 16 17 2 0\\n 17 18 1 0\\n 18 19 2 0\\n 20 18 1 6\\n 20 21 1 0\\n 21 22 1 0\\n 22 23 1 0\\n 23 24 2 0\\n 8 2 1 0\\n 23 10 1 0\\n 10 5 1 0\\n 20 12 1 0\\n 20 5 1 0\\n 1 25 1 0\\n 1 26 1 0\\n 1 27 1 0\\n 2 28 1 6\\n 6 29 1 0\\n 6 30 1 0\\n 7 31 1 0\\n 7 32 1 0\\n 8 33 1 6\\n 9 34 1 0\\n 9 35 1 0\\n 12 36 1 6\\n 14 37 1 0\\n 14 38 1 0\\n 14 39 1 0\\n 15 40 1 0\\n 15 41 1 0\\n 15 42 1 0\\n 16 43 1 0\\n 17 44 1 0\\n 21 45 1 0\\n 21 46 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewer.setStyle({\"stick\": {}});\n",
"\tviewer.setBackgroundColor(\"0xeeeeee\");\n",
"\tviewer.zoomTo();\n",
"viewer.render();\n",
"});\n",
"</script>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = Chem.AddHs(Chem.MolFromSmiles('C[C@H]1C(=O)[C@@]23CC[C@@H]1C[C@@]21O[C@@H]2C(C)(C)C=CC(=O)[C@]23COC1=O'))\n",
"AllChem.EmbedMolecule(m,useExpTorsionAnglePrefs=True,useBasicKnowledge=True)\n",
"AllChem.MMFFOptimizeMolecule(m, mmffVariant='MMFF94s')\n",
"drawit(m)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RMS: 0.5202380243306567 Heavy Atom RMS: 0.09596337627784711\n"
]
}
],
"source": [
"print(\"RMS: \",AllChem.GetBestRMS(m,mExpt),\n",
" \"Heavy Atom RMS:\",\n",
" AllChem.GetBestRMS(Chem.RemoveHs(m),Chem.RemoveHs(mExpt)))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This brings heavy atom RMS below 0.1 from the experimental structure, which is quite impressive. This is how the MMFF94s-minimized structure compares to the experimental one:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div id=\"3dmolviewer_14697024265211134\" style=\"position: relative; width: 400px; height: 400px\">\n",
"<script>\n",
"if(typeof $3Dmolpromise === 'undefined') $3Dmolpromise = $.when($.getScript('http://3dmol.csb.pitt.edu/build/3Dmol.js'))\n",
"$3Dmolpromise.done(function() {\n",
"var viewer = $3Dmol.createViewer($(\"#3dmolviewer_14697024265211134\"),{backgroundColor:\"white\"});\n",
"\tviewer.removeAllModels();\n",
"\tviewer.addModel(\"\\n RDKit 3D\\n\\n 46 50 0 0 0 0 0 0 0 0999 V2000\\n -3.8234 1.0549 -1.4351 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7293 0.0283 -1.1744 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.3979 0.7108 -0.8947 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8951 1.4909 -1.6990 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7569 0.3692 0.4700 C 0 0 1 0 0 0 0 0 0 0 0 0\\n -1.8129 0.8440 1.4835 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0686 -0.0494 1.3404 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0088 -0.8840 0.0366 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -1.8357 -1.8967 0.1217 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5665 -1.1595 0.5792 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 0.6043 -1.4897 -0.2160 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.2914 -0.2459 -0.4422 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 2.8304 -0.2941 -0.5767 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.1740 -0.9218 -1.9495 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5326 -1.1567 0.4826 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.3412 1.1461 -0.5645 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.6029 2.2347 -0.2743 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.1931 2.1270 0.2173 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.5406 3.1381 0.4547 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7133 0.7471 0.5863 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 1.1448 0.5148 2.0369 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.8178 -0.7813 2.5694 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.1592 -1.5507 2.0177 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.6284 -2.4988 2.6363 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.6288 1.5891 -2.3717 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.8788 1.8113 -0.6458 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.8011 0.5704 -1.5219 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.6011 -0.5911 -2.0709 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.4751 0.8075 2.5233 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0820 1.8901 1.2886 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.1375 -0.7261 2.2013 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9701 0.5727 1.3679 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9495 -1.4277 -0.1068 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.6747 -2.3756 -0.8522 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.1203 -2.7013 0.8080 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.9538 0.0585 -1.4425 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.7808 -1.9421 -2.0258 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.2580 -0.9702 -2.1085 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.7534 -0.3396 -2.7783 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5022 -0.7272 1.4840 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.5959 -1.2819 0.2425 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0917 -2.1583 0.5344 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.3773 1.2970 -0.8676 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.0052 3.2403 -0.3370 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.6813 1.2551 2.7015 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.2158 0.6719 2.1835 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 2 1 0\\n 2 3 1 0\\n 3 4 2 0\\n 5 3 1 6\\n 5 6 1 0\\n 6 7 1 0\\n 7 8 1 0\\n 8 9 1 0\\n 9 10 1 0\\n 10 11 1 6\\n 11 12 1 0\\n 12 13 1 0\\n 13 14 1 0\\n 13 15 1 0\\n 13 16 1 0\\n 16 17 2 0\\n 17 18 1 0\\n 18 19 2 0\\n 20 18 1 6\\n 20 21 1 0\\n 21 22 1 0\\n 22 23 1 0\\n 23 24 2 0\\n 8 2 1 0\\n 23 10 1 0\\n 10 5 1 0\\n 20 12 1 0\\n 20 5 1 0\\n 1 25 1 0\\n 1 26 1 0\\n 1 27 1 0\\n 2 28 1 6\\n 6 29 1 0\\n 6 30 1 0\\n 7 31 1 0\\n 7 32 1 0\\n 8 33 1 6\\n 9 34 1 0\\n 9 35 1 0\\n 12 36 1 6\\n 14 37 1 0\\n 14 38 1 0\\n 14 39 1 0\\n 15 40 1 0\\n 15 41 1 0\\n 15 42 1 0\\n 16 43 1 0\\n 17 44 1 0\\n 21 45 1 0\\n 21 46 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewer.addModel(\"?\\n RDKit 3D\\n\\n 46 50 0 0 1 0 0 0 0 0999 V2000\\n 0.6393 -1.5062 -0.1647 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7466 -0.7849 2.5696 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7520 -2.3931 2.6504 O 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.6084 3.1236 0.6259 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.8887 1.5428 -1.6685 O 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.5827 -1.1731 0.5496 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -1.8117 -1.8965 0.0394 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0265 -2.6596 0.6327 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.6456 -2.2464 -0.8709 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.9925 -0.9004 0.0121 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -3.8518 -1.3898 -0.1347 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.7273 0.0660 -1.1546 C 0 0 2 0 0 0 0 0 0 0 0 0\\n -2.6410 -0.4823 -1.9844 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.3898 0.7322 -0.9091 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.7523 0.3566 0.4295 C 0 0 2 0 0 0 0 0 0 0 0 0\\n 0.7251 0.7359 0.5623 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 1.3161 -0.2537 -0.4470 C 0 0 1 0 0 0 0 0 0 0 0 0\\n 0.9844 0.0398 -1.3433 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.8302 -0.3186 -0.5655 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.2673 1.1185 -0.7071 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.1458 1.2719 -1.0372 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.5273 2.2018 -0.4095 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.8737 3.0570 -0.6342 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.2087 2.1385 0.2449 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -0.2355 -1.5001 2.0062 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0472 -0.1247 1.3316 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.0640 -0.7615 2.0897 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.8754 0.4160 1.3645 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.8132 0.8085 1.4658 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -2.0771 1.7469 1.2951 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -1.4404 0.7501 2.3813 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.8191 1.1098 -1.4075 C 0 0 0 0 0 0 0 0 0 0 0 0\\n -4.6700 0.6559 -1.5818 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.5746 1.6555 -2.1839 H 0 0 0 0 0 0 0 0 0 0 0 0\\n -3.9107 1.6850 -0.6189 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1.1236 0.5132 2.0309 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.1060 0.6130 2.1107 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 0.7046 1.2173 2.5833 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5752 -1.0038 0.5983 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.5165 -0.4413 1.3990 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.5167 -1.1285 0.3551 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.1667 -1.8746 0.7805 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 3.1942 -1.0613 -1.8615 C 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.9356 -2.0023 -1.7822 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 4.1597 -0.9982 -2.0139 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 2.7175 -0.6550 -2.6154 H 0 0 0 0 0 0 0 0 0 0 0 0\\n 1 17 1 0\\n 2 25 1 0\\n 2 36 1 0\\n 3 25 2 0\\n 4 24 2 0\\n 6 25 1 0\\n 6 15 1 0\\n 6 7 1 0\\n 6 1 1 6\\n 7 10 1 0\\n 7 9 1 0\\n 8 7 1 0\\n 10 11 1 6\\n 10 12 1 0\\n 12 32 1 0\\n 12 13 1 6\\n 14 12 1 0\\n 14 5 2 0\\n 15 29 1 0\\n 15 14 1 6\\n 16 36 1 0\\n 16 15 1 0\\n 16 24 1 6\\n 16 17 1 0\\n 17 19 1 0\\n 17 18 1 6\\n 19 20 1 0\\n 19 43 1 0\\n 20 21 1 0\\n 22 20 2 0\\n 22 23 1 0\\n 24 22 1 0\\n 26 28 1 0\\n 26 10 1 0\\n 27 26 1 0\\n 29 26 1 0\\n 29 30 1 0\\n 31 29 1 0\\n 32 33 1 0\\n 32 34 1 0\\n 35 32 1 0\\n 37 36 1 0\\n 38 36 1 0\\n 39 41 1 0\\n 39 19 1 0\\n 40 39 1 0\\n 42 39 1 0\\n 43 45 1 0\\n 43 46 1 0\\n 44 43 1 0\\nM END\\n\",\"sdf\");\n",
"\tviewer.setStyle({\"stick\": {}});\n",
"\tviewer.setBackgroundColor(\"0xeeeeee\");\n",
"\tviewer.zoomTo();\n",
"viewer.render();\n",
"});\n",
"</script>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"align2mols(m, mExpt).show()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"shutil.rmtree(tempDir)"
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3",
"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.4.4"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment