Skip to content

Commit

Permalink
Update tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
smliu1997 committed Jul 10, 2023
1 parent 1d2f13e commit f783b76
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 86 deletions.
46 changes: 16 additions & 30 deletions tutorials/HPS-protein-condensate/DDX4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,9 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b7a111b53ee34e5a8773645803b6b9e4",
"version_major": 2,
"version_minor": 0
},
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"# load packages\n",
"import numpy as np\n",
Expand Down Expand Up @@ -62,7 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -92,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -108,11 +95,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,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"
"100,1.0000000000000007,415.40962760108846,818.3687351783914,1233.7783627794797,279.22591510139614,0\n",
"200,2.0000000000000013,464.5620796734739,892.222926069195,1356.7850057426688,304.42482990483444,441\n",
"300,2.99999999999998,496.8126190050852,894.7733811728059,1391.586000177891,305.2950405197055,441\n",
"400,3.9999999999999587,470.2296462922997,890.0405431473952,1360.2701894396948,303.68020484494826,441\n",
"500,4.999999999999938,506.9387355003922,971.8017278232937,1478.740463323686,331.576971460703,441\n"
]
}
],
Expand All @@ -139,24 +126,23 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Show HP1alpha dimer slab simulation trajectory.\n"
"Show DDX4 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.')"
"# show trajectory\n",
"traj = mdtraj.load_dcd(output_dcd, top=ca_pdb)\n",
"print('Show DDX4 simulation trajectory.')\n",
"view = nglview.show_mdtraj(traj)\n",
"view"
]
}
],
Expand Down
10 changes: 4 additions & 6 deletions tutorials/HPS-protein-condensate/DDX4_condensate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,10 @@
],
"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.')"
"traj = mdtraj.load_dcd(output_dcd, top='start.pdb')\n",
"print('Show DDX4 simulation trajectory.')\n",
"view = nglview.show_mdtraj(traj)\n",
"view"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,10 @@
],
"source": [
"# let's view the trajectory\n",
"try:\n",
" traj = mdtraj.load_dcd('output.dcd', top='start.pdb')\n",
" nglview.show_mdtraj(traj)\n",
" print('Show HP1alpha dimer and dsDNA simulation trajectory.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
"traj = mdtraj.load_dcd('output.dcd', top='start.pdb')\n",
"print('Show HP1alpha dimer and dsDNA simulation trajectory.')\n",
"view = nglview.show_mdtraj(traj)\n",
"view"
]
}
],
Expand Down
14 changes: 6 additions & 8 deletions tutorials/MOFF-protein-condensate/condensate_analysis.ipynb

Large diffs are not rendered by default.

28 changes: 11 additions & 17 deletions tutorials/MOFF-protein-condensate/hp1alpha_condensate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,10 @@
],
"source": [
"# visualize start.pdb\n",
"try:\n",
" pdb = mdtraj.load_pdb('start.pdb')\n",
" nglview.show_mdtraj(pdb)\n",
" print('Show start.pdb structure.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
"pdb = mdtraj.load_pdb('start.pdb')\n",
"print('Show start.pdb structure.')\n",
"view = nglview.show_mdtraj(pdb)\n",
"view"
]
},
{
Expand Down Expand Up @@ -2887,11 +2885,9 @@
],
"source": [
"# visualize compression trajectory\n",
"try:\n",
" nglview.show_mdtraj(npt_traj)\n",
" print('Show HP1alpha dimer NPT compression trajectory.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
"print('Show HP1alpha dimer NPT compression trajectory.')\n",
"view = nglview.show_mdtraj(npt_traj)\n",
"view"
]
},
{
Expand Down Expand Up @@ -2934,12 +2930,10 @@
" multiple_chains_CA2AA('slab_NVT_relaxed.pdb', [2*n_mol], [191])\n",
" \n",
" # show all-aton structure\n",
" try:\n",
" pdb = mdtraj.load_pdb('slab_NVT_relaxed_AA.pdb')\n",
" nglview.show_mdtraj(pdb)\n",
" print('Show HP1alpha dimer condensate all-atom structure.')\n",
" except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
" pdb = mdtraj.load_pdb('slab_NVT_relaxed_AA.pdb')\n",
" print('Show HP1alpha dimer condensate all-atom structure.')\n",
" view = nglview.show_mdtraj(pdb)\n",
" view"
]
},
{
Expand Down
22 changes: 9 additions & 13 deletions tutorials/MOFF-protein-condensate/hp1alpha_dimer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@
"source": [
"hp1alpha_dimer_parser = MOFFParser.from_atomistic_pdb('input-pdb/hp1a.pdb', 'hp1alpha_dimer_CA.pdb')\n",
"\n",
"try:\n",
" pdb = mdtraj.load_pdb('input-pdb/hp1a.pdb')\n",
" nglview.show_mdtraj(pdb)\n",
" print('Show HP1alpha dimer all-atom structure.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
"pdb = mdtraj.load_pdb('input-pdb/hp1a.pdb')\n",
"print('Show HP1alpha dimer all-atom structure.')\n",
"view = nglview.show_mdtraj(pdb)\n",
"view"
]
},
{
Expand All @@ -99,12 +97,10 @@
}
],
"source": [
"try:\n",
" pdb = mdtraj.load_pdb('hp1alpha_dimer_CA.pdb')\n",
" nglview.show_mdtraj(pdb)\n",
" print('Show HP1alpha dimer CG structure.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
"pdb = mdtraj.load_pdb('hp1alpha_dimer_CA.pdb')\n",
"print('Show HP1alpha dimer CG structure.')\n",
"view = nglview.show_mdtraj(pdb)\n",
"view"
]
},
{
Expand Down Expand Up @@ -429,7 +425,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.9.16"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
Expand Down
10 changes: 4 additions & 6 deletions tutorials/MRG-dsDNA/dsDNA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,10 @@
],
"source": [
"# view trajectory\n",
"try:\n",
" traj = mdtraj.load_dcd(output_dcd, top='MRG_dsDNA.pdb')\n",
" nglview.show_mdtraj(traj)\n",
" print('Show dsDNA simulation trajectory.')\n",
"except NameError:\n",
" print('Please install nglview to visualize molecules in the jupyter notebooks.')"
"traj = mdtraj.load_dcd(output_dcd, top='MRG_dsDNA.pdb')\n",
"print('Show dsDNA simulation trajectory.')\n",
"view = nglview.show_mdtraj(traj)\n",
"view"
]
}
],
Expand Down

0 comments on commit f783b76

Please sign in to comment.