Skip to content

Commit

Permalink
Merge pull request #24 from Autodesk/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
avirshup authored Jul 26, 2016
2 parents 6768e79 + 0018314 commit 7d632d6
Show file tree
Hide file tree
Showing 14 changed files with 551 additions and 88 deletions.
9 changes: 9 additions & 0 deletions moldesign/_notebooks/Example 1. Build and simulate DNA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@
"interact_manual(plot_rmsd)\n",
"rs"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
102 changes: 63 additions & 39 deletions moldesign/_notebooks/Tutorial 1. Making a molecule.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<a href=\"http://moldesign.bionano.autodesk.com\" target=\"_blank\"><img src=\"img/Top.png\"></a>\n",
"\n",
"<span style=\"float:right\"><a href=\"http://moldesign.bionano.autodesk.com/\" target=\"_blank\" title=\"About\">About</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"https://forum.bionano.autodesk.com/c/Molecular-Design-Toolkit\" target=\"_blank\" title=\"Forum\">Forum</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"https://github.com/autodesk/molecular-design-toolkit/issues\" target=\"_blank\" title=\"Issues\">Issues</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://bionano.autodesk.com/MolecularDesignToolkit/explore.html\" target=\"_blank\" title=\"Tutorials\">Tutorials</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://autodesk.github.io/molecular-design-toolkit/\" target=\"_blank\" title=\"Documentation\">Documentation</a></span>\n",
"</span>\n",
"![Molecular Design Toolkit](img/top.png)\n",
"<br>\n",
"\n",
"<center><h1>Tutorial 1: Making a molecule</h1></center>\n",
"\n",
Expand All @@ -19,11 +23,13 @@
"=======\n",
"---\n",
" - [1. Import the toolkit](#1.-Import-the-toolkit)\n",
" - [A. Optional: Set up your computing backend](#A.-Optional:-Set-up-your-computing-backend)\n",
" - [2. Read in the molecule](#2.-Read-in-the-molecule)\n",
" - [3. Draw it](#3.-Draw-it)\n",
" - [4. Inspect it](#4.-Inspect-it)\n",
" - [5. Move it](#5.-Move-it)\n",
" - [6. Write it](#6.-Write-it)\n"
" - [4. Simulate it](#4.-Simulate-it)\n",
" - [5. Minimize it](#5.-Minimize-it)\n",
" - [6. Write it](#6.-Write-it)\n",
" - [7. Examine it](#7.-Examine-it)"
]
},
{
Expand All @@ -46,6 +52,26 @@
"import moldesign.units as u"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### A. Optional: Set up your computing backend\n",
"\n",
"By default, MDT is configured to use Autodesk's free demo cluster on the cloud. However, if you'd like to run jobs elsewhere (e.g., on your local computer, on your private cloud cluster, etc.), you can set that up by running `mdt.configure()`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"mdt.configure()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -61,11 +87,11 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": false
},
"outputs": [],
"source": [
"molecule = mdt.read('data/bipyridine.sdf')"
"molecule = mdt.read('data/butane.xyz')"
]
},
{
Expand Down Expand Up @@ -131,7 +157,8 @@
},
"outputs": [],
"source": [
"molecule.set_energy_model(mdt.models.RHF, basis='sto-3g')"
"molecule.set_energy_model(mdt.models.RHF, basis='sto-3g')\n",
"properties = molecule.calculate()"
]
},
{
Expand All @@ -142,20 +169,9 @@
},
"outputs": [],
"source": [
"properties = molecule.calculate()\n",
"print properties.keys()\n",
"print 'Energy: ', properties['potential_energy']"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"atom.bonds"
"print 'Energy: ', properties['potential_energy']\n",
"molecule.draw_orbitals()"
]
},
{
Expand All @@ -173,7 +189,7 @@
},
"outputs": [],
"source": [
"mdt.widgets.GeometryBuilder(molecule)"
"mintraj = molecule.minimize()"
]
},
{
Expand All @@ -184,36 +200,46 @@
},
"outputs": [],
"source": [
"atom.distance(molecule.atoms[0])"
"mintraj.draw_orbitals()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 6. Write it"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": true
},
"outputs": [],
"source": [
"atom.calc_distances(molecule.atoms)"
"molecule.write('my_first_molecule.xyz')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": true
},
"outputs": [],
"source": [
"mdt.angle(molecule.atoms[0], molecule.atoms[1], molecule.atoms[2])"
"mintraj.write('my_first_minimization.P.gz')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"collapsed": false
},
"source": [
"## 6. Write it"
"## 7. Examine it\n",
"There are any number of directions to go from here. For this tutorial, try click on some bonds to check the molecule's geometry."
]
},
{
Expand All @@ -224,28 +250,26 @@
},
"outputs": [],
"source": [
"molecule.write('my_first_molecule.xyz')"
"mdt.widgets.GeometryBuilder(molecule)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"cell_type": "markdown",
"metadata": {},
"source": [
"!cat my_first_molecule.xyz"
"You can also use the corresponding python functions to measure these parameters:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": false
},
"outputs": [],
"source": []
"source": [
"mdt.dihedral(*molecule.atoms[:4]).to(u.degrees)"
]
}
],
"metadata": {
Expand All @@ -264,7 +288,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
"version": "2.7.12"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 7d632d6

Please sign in to comment.