Last active
August 29, 2015 14:25
-
-
Save ptosco/5d8b9e24ded67d56a999 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"import rdkit\n", | |
"from rdkit import Chem\n", | |
"from rdkit.Chem.Draw import IPythonConsole" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 41, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"m = Chem.MolFromSmiles('C=C-[C+]')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 42, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAC+0lEQVR4nO3cwW6bQBRA0VD1/3+Z\nLixZUZLWeC54oD5nbcMsJjfPgFjWdf0AYNSv2QsAuDYZBUhkFCCRUYBERgESGQVIZBQgkVGAREYB\nEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERGARIZBUhk\nFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQgkVGA\nREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERGARIZ\n5byWZZm9BHjs9+wFwA9uAV3XdfZC4DEZ5VwElMuRUc7ibwFdlkVVOTMblPkeTqBGVM5MRpls+7Ap\nppyTO/VMsyzLxobeA7quq9v3nI1plAm2z5U/ftJYyqnIKC8VAzp2KDiUjPIiOwZ0+MNwBBnlFZ66\njzSwJz0UxUQ2H8c6aAjd/eswTEY5yssCetChYCMZZX9TAvrlsDY2L2O3sbOjL4NuX8bHo0B/fgTV\nHwLDZJTdTB9CnzrRl4gbYBlm67CDEwb03ycVTXbkDU8kzz7jOSVet5M+dXadZTsZZdDlHpKXRQ4i\no4z4j1/LdL/vdLmVM4uMMuK0l0G7gSsAvDkvyuMQtwydtkTfX7jn/XsM8y+XnV1oCN3+3Oh9ODWl\n8p09wW4uFFDYkWuj7EBAeWcySuV3Lm/OLSYqDeXNyShAIqMAiYwCJDIKkMgoQCKjAImMAiQyCpDI\nKEAiowCJjAIkMgqQyChAIqMAiYwCJDIKkMgoQCKjAImMAiQyCpDIKEAiowCJjAIkMgqQyChAIqMA\niYwCJDIKkMgoQCKjAImMAiQyCpDIKEAiowCJjAIkMgqQyChAIqMAiYwCJDIKkMgoQCKjAImMAiQy\nCpDIKEAiowCJjAIkMgqQyChAIqMAiYwCJDIKkMgoQCKjAImMAiQyCpDIKEAiowCJjAIkMgqQyChA\n8gcBMgMMZ0JPMAAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<rdkit.Chem.rdchem.Mol at 0x95d60a0>" | |
] | |
}, | |
"execution_count": 42, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"m" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 43, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"False\n", | |
"False\n" | |
] | |
} | |
], | |
"source": [ | |
"for b in m.GetBonds():\n", | |
" print(b.GetIsConjugated())" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 47, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"mn = Chem.MolFromSmiles('N-C=[N+]')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 48, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANS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MgqQyChAIqMAiYwCJDIKkMgoQCKjAImMAiQyCpDIKEAiowCJjAIk\nMgqQyChAIqMAiYwCJH8Ab6DlB+FxA8gAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<rdkit.Chem.rdchem.Mol at 0x95c1ed8>" | |
] | |
}, | |
"execution_count": 48, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"mn" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 49, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"True\n", | |
"True\n" | |
] | |
} | |
], | |
"source": [ | |
"for b in mn.GetBonds():\n", | |
" print(b.GetIsConjugated())" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 52, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"mo = Chem.MolFromSmiles('[O-]-C=O')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 53, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAC/ElEQVR4nO3c0W7aMABA0WTa//+y\n94BasbYrpnfEAZ3zjmJL1pWdhOxjjA2An/q1egAAz01GARIZBUhkFCCRUYBERgESGQVIZBQgkVGA\nREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERGARIZ\nBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQg\nkVGAREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERG\neQL7vq8eAvyTjPIExhj7vosp57SPMVaPAWZdSmrRcip2o5zd9SZ0jHHZmS4cD3xgN8p5fbP3tC3l\nPGSUM5qspJhyBjLKuVyXcd+n1qeYspaMchZf1vCORO77ZjGzgoyy3s1Wzsb08ujJkuZYMspKd53H\nJ8/4YsrBZJRlZrP490+2+TP+JqYcQUZZoTVOTDkVGeVY/69rYspJyChHeVDL5h/QiymPIaPMuf7/\n5Q/WzEPfRrqrj9cjiZOCbdtklCkfInhXEw/bA957oTIpuCKj3PJlX2ais+QQPVnDH08KPvm9egC8\nqFVJGsM9UA4mozzGwopdLi2mHEVGefPhI57PHiAx5SgyypuXbM17TF9ydpyDr99zy/vdxndPV6XP\no32BSXEantQz5yVfsXzJSXE4GQVIHOoBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQg\nkVGAREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERG\nARIZBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVI\nZBQgkVGAREYBEhkFSGQUIJFRgERGARIZBUhkFCCRUYBERgESGQVIZBQgkVGAREYBEhkFSGQUIJFR\ngOQPczTQ6d9Bfa8AAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<rdkit.Chem.rdchem.Mol at 0x95c1960>" | |
] | |
}, | |
"execution_count": 53, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"mo" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 54, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"True\n", | |
"True\n" | |
] | |
} | |
], | |
"source": [ | |
"for b in mo.GetBonds():\n", | |
" print(b.GetIsConjugated())" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"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.2" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment