Skip to content

Commit

Permalink
Update .gitignore and tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
smliu1997 committed Jul 9, 2023
1 parent d04cf35 commit 1d2f13e
Show file tree
Hide file tree
Showing 15 changed files with 4,663 additions and 546 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ examples/minimal-example/
dist/
openabc.egg-info/

.ipynb_checkpoints/

62 changes: 49 additions & 13 deletions tutorials/HPS-protein-condensate/DDX4.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -12,7 +11,20 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b7a111b53ee34e5a8773645803b6b9e4",
"version_major": 2,
"version_minor": 0
},
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# load packages\n",
"import numpy as np\n",
Expand All @@ -26,6 +38,11 @@
" import simtk.openmm as mm\n",
" import simtk.openmm.app as app\n",
" import simtk.unit as unit\n",
"import mdtraj\n",
"try:\n",
" import nglview\n",
"except ImportError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')\n",
"\n",
"sys.path.append('../../')\n",
"from openabc.forcefields.parsers import HPSParser\n",
Expand All @@ -37,7 +54,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -68,7 +84,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -93,11 +108,11 @@
"Set water dielectric as 80.0.\n",
"Use platform: CPU\n",
"#\"Step\",\"Time (ps)\",\"Potential Energy (kJ/mole)\",\"Kinetic Energy (kJ/mole)\",\"Total Energy (kJ/mole)\",\"Temperature (K)\",\"Speed (ns/day)\"\n",
"100,1.0000000000000007,447.53549761014756,779.044497497912,1226.5799951080594,265.8085571550383,0\n",
"200,2.0000000000000013,486.8404272736629,926.2961924995544,1413.1366197732173,316.05056606817516,138\n",
"300,2.99999999999998,501.57864499170245,993.0885992430132,1494.6672442347156,338.8400130412459,129\n",
"400,3.9999999999999587,509.68876815099037,923.0584351486611,1432.7472032996516,314.945849184065,128\n",
"500,4.999999999999938,464.9724526697726,904.4309334315047,1369.4033861012774,308.59017968027825,115\n"
"100,1.0000000000000007,426.4861149069394,864.7997214241839,1291.2858363311234,295.0680826552625,0\n",
"200,2.0000000000000013,494.52917464130536,807.7471804554941,1302.2763550967995,275.60186006384146,453\n",
"300,2.99999999999998,543.3895317584377,819.7461130785344,1363.135644836972,279.69587392078347,457\n",
"400,3.9999999999999587,490.5923645594664,851.3156034074129,1341.9079679668794,290.4673262593729,457\n",
"500,4.999999999999938,594.9643276032544,872.0971948033958,1467.0615224066503,297.55796722031056,460\n"
]
}
],
Expand All @@ -121,13 +136,35 @@
"protein.simulation.context.setVelocitiesToTemperature(temperature)\n",
"protein.simulation.step(500)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Show HP1alpha dimer slab simulation trajectory.\n"
]
}
],
"source": [
"try:\n",
" traj = mdtraj.load_dcd(output_dcd, top=ca_pdb)\n",
" nglview.show_mdtraj(traj)\n",
" print('Show HP1alpha dimer slab simulation trajectory.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "py38",
"display_name": "Python [conda env:.conda-py39]",
"language": "python",
"name": "python3"
"name": "conda-env-.conda-py39-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -141,13 +178,12 @@
"pygments_lexer": "ipython3",
"version": "3.9.16"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "95d07581651f3c45a5651aa035df7e4a83b5587ddccf2e46662da40695cb8d28"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
68 changes: 41 additions & 27 deletions tutorials/HPS-protein-condensate/DDX4_condensate.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -10,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -27,6 +26,11 @@
" import simtk.openmm as mm\n",
" import simtk.openmm.app as app\n",
" import simtk.unit as unit\n",
"import mdtraj\n",
"try:\n",
" import nglview\n",
"except ImportError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')\n",
"\n",
"sys.path.append('../../')\n",
"from openabc.forcefields.parsers import HPSParser\n",
Expand All @@ -39,7 +43,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -48,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -68,7 +71,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -77,18 +79,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Check contact with FastNS method. \n",
"Successfully inserted 10 molecules.\n"
]
}
],
"outputs": [],
"source": [
"# insert molecules into the simulation box randomly\n",
"n_mol = 10\n",
Expand All @@ -97,7 +90,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -106,7 +98,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -122,11 +114,11 @@
"Set water dielectric as 80.0.\n",
"Use platform: CPU\n",
"#\"Step\",\"Time (ps)\",\"Potential Energy (kJ/mole)\",\"Kinetic Energy (kJ/mole)\",\"Total Energy (kJ/mole)\",\"Temperature (K)\",\"Speed (ns/day)\"\n",
"100,1.0000000000000007,2400.4719434697204,5926.867498388963,8327.339441858683,201.45211588453614,0\n",
"200,2.0000000000000013,2872.814568603486,5477.84798418303,8350.662552786516,186.19010247950905,49.8\n",
"300,2.99999999999998,2863.9280415233243,5521.199733759883,8385.127775283207,187.66361301132497,48.9\n",
"400,3.9999999999999587,2835.6026344951633,5601.691907684705,8437.294542179869,190.39951334209988,48.7\n",
"500,4.999999999999938,2702.3308074140296,5789.900599375048,8492.231406789077,196.79665975699544,47.8\n"
"100,1.0000000000000007,2600.623669551789,5956.331977768012,8556.9556473198,202.45360304718304,0\n",
"200,2.0000000000000013,3081.0428007288133,5521.044159836187,8602.086960565,187.6583251090539,323\n",
"300,2.99999999999998,2912.410144432957,5789.632299945443,8702.0424443784,196.7875403549168,324\n",
"400,3.9999999999999587,2817.8429803771583,5934.708888941865,8752.551869319022,201.7186419573374,323\n",
"500,4.999999999999938,2649.3505835466144,6163.174527363165,8812.525110909779,209.48410765728644,321\n"
]
}
],
Expand All @@ -153,13 +145,36 @@
"protein.simulation.context.setVelocitiesToTemperature(temperature)\n",
"protein.simulation.step(500)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Show DDX4 simulation trajectory.\n"
]
}
],
"source": [
"# view trajectory\n",
"try:\n",
" traj = mdtraj.load_dcd(output_dcd, top='start.pdb')\n",
" nglview.show_mdtraj(traj)\n",
" print('Show DDX4 simulation trajectory.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "py38",
"display_name": "Python [conda env:.conda-py39]",
"language": "python",
"name": "python3"
"name": "conda-env-.conda-py39-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -173,13 +188,12 @@
"pygments_lexer": "ipython3",
"version": "3.9.16"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "95d07581651f3c45a5651aa035df7e4a83b5587ddccf2e46662da40695cb8d28"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading

0 comments on commit 1d2f13e

Please sign in to comment.