Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
b56e638
Update MD slide link to video
davidlmobley Jan 17, 2022
e1c004b
Update MD/MC
davidlmobley Jan 19, 2022
1843995
Merge branch 'updates' of github.com:MobleyLab/drug-computing into up…
davidlmobley Jan 19, 2022
f9e6bec
Update MD/MC keynote
davidlmobley Jan 19, 2022
04a1eff
Update MD sandbox to have correct Colab link
davidlmobley Jan 19, 2022
89fb7e0
Add M1 fortran instructions to getting started info
davidlmobley Jan 19, 2022
69e9772
Update documentation about when Drive is mounted to avoid errors
davidlmobley Jan 19, 2022
4292c40
Merge pull request #114 from MobleyLab/updates
davidlmobley Jan 19, 2022
6b0279f
Slightly cleanup assignment to standardize with lecture
davidlmobley Jan 24, 2022
8e7cc97
Merge pull request #115 from MobleyLab/updates
davidlmobley Jan 24, 2022
e2d9185
Make updates to library searching lecture
davidlmobley Feb 3, 2022
138ecb5
Extend sandbox exercise slightly
davidlmobley Feb 3, 2022
68e5891
Merge pull request #116 from MobleyLab/updates
davidlmobley Feb 3, 2022
f8fc4f0
Slightly update ligand based design slides
davidlmobley Feb 8, 2022
395f025
Merge pull request #117 from MobleyLab/updates
davidlmobley Feb 8, 2022
06d80d8
Fix some confusing instructions and a typo in the library searching a…
davidlmobley Feb 9, 2022
66d2fb5
Replace ammonia with aniline in example as OEChem is not happy with a…
davidlmobley Feb 9, 2022
1f5187c
Merge pull request #118 from MobleyLab/updates
davidlmobley Feb 9, 2022
a42d80b
Add correct keynote slides for this one
davidlmobley Feb 10, 2022
d913245
Update slides for fluctuations paper a bit
davidlmobley Feb 15, 2022
de8f94d
Merge pull request #119 from MobleyLab/updates
davidlmobley Feb 15, 2022
b574f25
Add evaluator-based version of convergence notebook
davidlmobley Feb 15, 2022
0c0b1d8
Update convergence jupyter notebook and density script
davidlmobley Feb 16, 2022
3d99cc1
Merge pull request #120 from MobleyLab/updates
davidlmobley Feb 16, 2022
89fefee
Update visualization notebook
davidlmobley Feb 22, 2022
608e196
Add README updates for visualization
davidlmobley Feb 22, 2022
7bf79e8
Merge pull request #121 from MobleyLab/updates2
davidlmobley Feb 22, 2022
9e105be
Add 2022 version of OpenFF slides
davidlmobley Feb 23, 2022
1038467
Update host-guest example to current OpenFF
davidlmobley Feb 23, 2022
7904dfd
Update mixture simulations notebook
davidlmobley Feb 24, 2022
2445826
Merge pull request #122 from MobleyLab/updates2
davidlmobley Feb 24, 2022
701560a
Correct issues with mixture simulation book
davidlmobley Feb 24, 2022
e13d9e4
Merge pull request #123 from MobleyLab/updates2
davidlmobley Feb 24, 2022
b7229b7
Update free energy lecture
davidlmobley Mar 3, 2022
1bb3ec0
Merge pull request #124 from MobleyLab/updates2
davidlmobley Mar 3, 2022
cc7a984
update MSM slides
trevorgokey Mar 9, 2022
50a4c1f
Merge pull request #125 from trevorgokey/update_MSM_slides
davidlmobley Mar 9, 2022
b2d32a5
Update where to get anaconda from
davidlmobley Jan 7, 2023
68c1ff6
Update a couple broken links in lecture 1
davidlmobley Jan 8, 2023
c0e29aa
Update instructions for my mac for 2023
davidlmobley Jan 8, 2023
183401a
Remove stuff we don't need from notebooks, docs
davidlmobley Jan 9, 2023
dfce11c
Remove references to solvationtoolkit
davidlmobley Jan 9, 2023
ff31a5e
Merge pull request #127 from MobleyLab/update23
davidlmobley Jan 9, 2023
7ad9125
Make some updates concerning fortran in Colab
davidlmobley Jan 18, 2023
b3daddf
Merge pull request #128 from MobleyLab/update23
davidlmobley Jan 18, 2023
85e6700
Make some minor updates/formatting fixes to QM slides
davidlmobley Jan 24, 2023
ea1cd7e
Update psi4 example for 2023
davidlmobley Jan 24, 2023
3940145
Merge pull request #129 from MobleyLab/update23
davidlmobley Jan 24, 2023
c1ffed8
Make molecule sandbox current
davidlmobley Jan 31, 2023
41a7065
Update README to reflect removal of solvation content
davidlmobley Jan 31, 2023
4e122a6
Update assigned materials file to change lecture 7
davidlmobley Jan 31, 2023
452e697
Update readmes to note prereqs for revised lecture 7
davidlmobley Jan 31, 2023
05e5a5e
Merge pull request #130 from MobleyLab/update23
davidlmobley Jan 31, 2023
e6c38ba
Add Jespers content
davidlmobley Feb 21, 2023
ec599be
Merge pull request #131 from MobleyLab/update23
davidlmobley Feb 21, 2023
ab1e195
Update drugex links
davidlmobley Feb 21, 2023
09eb93d
Add extra video to VMD lecture
davidlmobley Feb 22, 2023
5f27b87
Update free energy slides a bit
davidlmobley Feb 28, 2023
1e90946
Fix title
davidlmobley Feb 28, 2023
a9a1c73
Update an image in protein slide deck
davidlmobley Mar 1, 2023
7ac7b4f
Add 2023 OpenFF slides
davidlmobley Mar 6, 2023
509e0a6
Fix some format issues in MSM slides
davidlmobley Mar 8, 2023
42a955b
Fix MDTraj example code
davidlmobley Mar 8, 2023
d205896
Add usage note to PyEmma notebook
davidlmobley Mar 8, 2023
49f927a
Merge pull request #132 from MobleyLab/update23
davidlmobley Mar 8, 2023
ffcde9c
Make updates for start of 2024 class
davidlmobley Jan 3, 2024
db0689e
Merge pull request #133 from MobleyLab/update24
davidlmobley Jan 3, 2024
7bc3b5c
Update notebook description of miniconda to mamba
davidlmobley Jan 9, 2024
cd121e8
Merge pull request #134 from MobleyLab/update24
davidlmobley Jan 9, 2024
c810dab
Add some modernization updates to 3D structure/shape notebook
davidlmobley Jan 12, 2024
cd4051a
Merge pull request #135 from MobleyLab/update24
davidlmobley Jan 12, 2024
995fc68
Add improved documentation of using colab with fortran
davidlmobley Jan 18, 2024
e06ce80
Merge pull request #136 from MobleyLab/update24
davidlmobley Jan 18, 2024
1aac88b
Update QM example for 2024
davidlmobley Jan 24, 2024
e7d5c27
Merge pull request #137 from MobleyLab/update24
davidlmobley Jan 24, 2024
83f919c
Update MD sandbox for 2024
davidlmobley Jan 28, 2024
e22f20e
Merge pull request #138 from MobleyLab/update24
davidlmobley Jan 28, 2024
02b26b4
2024 MC sandbox updates
davidlmobley Jan 30, 2024
356b255
Merge pull request #139 from MobleyLab/update24
davidlmobley Jan 30, 2024
8df77b1
Make minor tweaks to library/lingo lecture including removing obsolet…
davidlmobley Feb 6, 2024
37b6a62
Merge pull request #140 from MobleyLab/update24
davidlmobley Feb 6, 2024
937043c
Update intro to notebook to reflect current colab install
davidlmobley Feb 14, 2024
95aea75
Update broken link in MD assignmemnt
davidlmobley Feb 28, 2024
f38a414
Merge pull request #142 from MobleyLab/update24
davidlmobley Feb 28, 2024
7b7ef10
Update gfortran instructions
davidlmobley Jan 3, 2025
39ce033
Add meson info
davidlmobley Jan 3, 2025
8ca1bda
Minor fix to MD sandbox molecule visualization to improve view
davidlmobley Jan 3, 2025
e696b21
Update colab instructions to python 3.12
davidlmobley Jan 3, 2025
c9f0995
Update fotran info for colab
davidlmobley Jan 3, 2025
5d9b08b
Merge pull request #143 from MobleyLab/update25
davidlmobley Jan 8, 2025
9c7c30d
Fix open-in-colab button
Jan 8, 2025
fc664a3
Add info to getting started on how to get our jupyter notebooks loade…
Jan 8, 2025
2e35c97
Correct some discussion of how CG minimizer here relates to previous one
Jan 9, 2025
6b2e124
Fix a coupel broken links in main README.md
davidlmobley Jan 9, 2025
ab451b4
Improve clarity in MD assignment
davidlmobley Jan 9, 2025
25a692d
Merge pull request #144 from MobleyLab/update25
davidlmobley Jan 9, 2025
483792e
Remove extraneous directory
davidlmobley Jan 9, 2025
1dca873
Provide code comments only in in-class sandbox portion for MC
davidlmobley Jan 9, 2025
943f78e
Make a couple of clarity/current-ness updates in 3D structure/shape
davidlmobley Jan 9, 2025
9ace0ed
Merge pull request #145 from MobleyLab/update25
davidlmobley Jan 9, 2025
fd43e56
Fix issue with escapes in SMILES in newer python version
davidlmobley Feb 3, 2025
e0d9747
Minor updates to library searching lecture
davidlmobley Feb 3, 2025
49e8cca
Fix the mdlib fortran code slightly -- correct that a variable is out…
davidlmobley Feb 6, 2025
293298d
Merge pull request #146 from MobleyLab/update25
davidlmobley Feb 6, 2025
08cf7b1
Correct prior error introduced in mdlib
davidlmobley Feb 9, 2025
5362e67
Merge pull request #147 from MobleyLab/update25
davidlmobley Feb 9, 2025
81cd8ec
A couple additions to empirical physical properties slides
davidlmobley Feb 11, 2025
ecee9b8
Switch to python 3.12 for colab and add open-in-colab button
davidlmobley Feb 11, 2025
68f969f
Make doc tweaks to physprops/solubility notebook
davidlmobley Feb 12, 2025
d6eb552
Merge pull request #148 from MobleyLab/update25
davidlmobley Feb 12, 2025
c30399f
Update library searching asssignment to make more clear they should s…
davidlmobley Feb 12, 2025
db01a2a
Merge pull request #149 from MobleyLab/update25
davidlmobley Feb 12, 2025
6ac76d7
Update error analysis code for 2025 OpenFF and OpenMM
davidlmobley Feb 24, 2025
d333e23
Merge pull request #150 from MobleyLab/update25
davidlmobley Feb 24, 2025
c30a120
Update proteins lecture for 2025
davidlmobley Mar 11, 2025
f4aa6b3
Merge pull request #151 from MobleyLab/update25
davidlmobley Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions oelicense/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion other-materials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It may be crosslinked from course content, etc.

## Manifest
- `python-intro`: Directory containing introductory material on Python; see [`python-intro/README.md`](python-intro/README.md). See also the Beckstein material linked below.
- `solvation-free-energies`: Directory containing example materials for hydration free energy calculations with Yank; see [`solvation-free-energies/README.md`][solvation-free-energies/README.md]i
- `solvation-free-energies`: Directory containing example materials for hydration free energy calculations with Yank; see [`solvation-free-energies/README.md`][solvation-free-energies/README.md]; Yank would need to be installed first, and support for it is not currently very good, so hopefully we can improve on this soon.

## Other useful materials:
- For very helpful material on Linux and Python relevant to our area, refer to [Oliver Beckstein's Computational Methods in Physics course](https://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/overview/), which has sectionns on Linux/Unix, Python, git, etc.
Expand Down
2 changes: 1 addition & 1 deletion other-materials/solvation-free-energies/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Solvation free energy calculations with Yank

This provides example materials for solvation free energy calculations with implicit and explicit solvent in Yank.
This provides example materials for solvation free energy calculations with implicit and explicit solvent in Yank. You would need to install Yank first.
Demonstrations are set up for hydration free energy calculations on FreeSolv and/or FreeSolvMini.

I validated this, in the implicit solvent case, for phenol from IUPAC name, SMILES, and FreeSolv (mobley_20524.mol2) and get consistent values -- basically -10.08+/-0.01 kT in all cases.
Expand Down
2 changes: 1 addition & 1 deletion other-materials/solvation-free-energies/run_hydration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from simtk.openmm import app
import netCDF4 as netcdf
from tempfile import TemporaryDirectory
import yank
import yank #Note before using this you should install yank
import mdtraj
from yank.experiment import *
import textwrap
Expand Down
1,191 changes: 871 additions & 320 deletions uci-pharmsci/Getting_Started.ipynb

Large diffs are not rendered by default.

5,482 changes: 0 additions & 5,482 deletions uci-pharmsci/Getting_Started_condacolab.ipynb

This file was deleted.

2 changes: 1 addition & 1 deletion uci-pharmsci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Please begin by reading the beginning portion of [`getting-started.md`](getting-


#### Cheatsheets and dotfiles
Under the **uci-pharmasci/docs/** directory, we have included some useful command cheat sheets for [BASH](https://github.com/nathanmlim/blues-apps/tree/master/docs/bash_cheatsheet.jpg) and [vi](https://github.com/nathanmlim/blues-apps/tree/master/docs/vi_cheatsheet.pdf) (on OS X, zsh is becoming default instead, but in general it is similar.).
Under the **uci-pharmasci/docs/** directory, we have included some useful command cheat sheets for [BASH](https://github.com/MobleyLab/drug-computing/blob/master/uci-pharmsci/docs/bash_cheatsheet.jpg) and [vi](https://github.com/MobleyLab/drug-computing/blob/master/uci-pharmsci/docs/vi_cheatsheet.pdf) (on OS X, zsh is becoming default instead, but in general it is similar.).

You may also want to check out the [CodeAcademy Github](https://www.codecademy.com/learn/learn-git) tutorial.

Expand Down
7 changes: 5 additions & 2 deletions uci-pharmsci/assigned_materials.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ To prepare for Lecture 1, on Python, Linux, text editors, and GitHub, please:
- Skim through the PDF of the MD (part II)/MC slides in the `MC` directory, noting any questions for discussion in class
- Review the MC sandbox Jupyter notebook in the same directory

## Before Lecture 7 ([Solvation](lectures/solvation)):
- Read the Jupyter notebook in the `solvation` directory under lectures.
## Before Lecture 7 ([ChEMBL database work](https://github.com/volkamerlab/teachopencadd/tree/master/teachopencadd/talktorials/T001_query_chembl)
- For this lecture we draw on the [TeachOpenCADD](https://github.com/volkamerlab/teachopencadd) repo
- Clone or download the GitHub repo, or at least the content of the `T001_query_chembl` directory from the `talktorials` directory
- Skim the content in the `talktorial.ipynb` notebook
- Install chembl_webresource_client, which is conda-installable

## Before Lecture 8 ([Docking, scoring and pose prediction](lectures/docking_scoring_pose)):
- Read the `docking.ipynb` Jupyter notebook in the relevant directory and `old_slides.pdf` there, from the slide numbered 11 (bottom left corner) onwards.
Expand Down
1,120 changes: 558 additions & 562 deletions uci-pharmsci/assignments/3D_structure_shape/3D_structure_shape_assignment.ipynb

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions uci-pharmsci/assignments/MD/MD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"\n",
"The left-hand term is the kinetic energy, and here can be simplified by noting all of the masses in the system are defined to be 1. The right hand term involves the Boltzmann constant, the number of particles in the system, and the instantaneous temperature.\n",
"\n",
"So, you can compute the effective temperature of your system, and translate this into a scaling factor which you can use to multiply (scale) all velocities in the system to ensure you get the correct average temperature (see http://www.pages.drexel.edu/~cfa22/msim/node33.html). **Specifically, following the Drexel page (eq. 177), compute a (scalar) constant by which you will multiply all of the velocities to ensure that the effective temperature is at the correct target value after rescaling.** To do this calculation you will need to compute the kinetic energy, which involves the sum above. \n",
"So, you can compute the effective temperature of your system, and translate this into a scaling factor which you can use to multiply (scale) all velocities in the system to ensure you get the correct average temperature (see https://www.compchems.com/thermostats-in-molecular-dynamics/#velocity-rescaling). **Specifically, following the page above, compute a (scalar) constant $\\lambda$ by which you will multiply all of the velocities to ensure that the effective temperature is at the correct target value after rescaling.** To do this calculation you will need to compute the kinetic energy, which involves the sum above. \n",
" \n",
"Remove translational motion, rescale the velocities, and have your function return the updated velocity array.\n",
"Once the above two functions are written, finishing write a simple MD code using the available functions to:\n",
Expand All @@ -105,7 +105,7 @@
"\n",
"Use the settings given above for $N$, $\\rho$, $T$, the timestep, and the cutoff distance. \n",
"\n",
"Perform simulations for $M = 2, 4, 6, 8, 12,$ and $16$ and store the total energies versus time out to 2,000 timesteps. (Remember, $M$ controls the number of particles per polymer; you are keeping the same total number of particles in the system and changing the size of the polymers). On a single graph, plot the potential energy versus time for each of these cases (each in a different color). Turn in this graph. \n",
"Perform simulations for $M = 2, 4, 6, 8, 12,$ and $16$ and store the total energies (kinetic plus potential) versus time out to 2,000 timesteps. (Remember, $M$ controls the number of particles per polymer; you are keeping the same total number of particles in the system and changing the size of the polymers). On a single graph, plot the potential energy versus time for each of these cases (each in a different color). Turn in this graph. \n",
"\n",
"Note also you can visualize, if desired, using the Python module for writing to PDB files which you saw in the Energy Minimization exercise. \n",
"\n",
Expand All @@ -114,12 +114,12 @@
"\n",
"Modify your MD code from above to perform a series of steps that will allow you to compute the self-diffusion coefficient as a function of chain length and determine how diffusion of polymers depends on the size of the polymer. To compute the self-diffusion coefficient, you will simply need to monitor the motion of each polymer in time. \n",
"\n",
"Here, you will first perform two equilibrations at constant temperature using velocity rescaling . The first will allow the system to reach the desired temperature and forget about its initial configuration (remember, it was started on a lattice). The second will allow you to compute the average total energy of the system. Then, you will fix the total energy at this value and perform a production simulation. \n",
"Here, you will first perform two equilibrations at constant temperature using velocity rescaling . The first will allow the system to reach the desired temperature and forget about its initial configuration (remember, it was started on a lattice). The second will allow you to compute the average total energy (kinetic plus potential) of the system. Then, you will fix the total energy at this value and perform a production simulation. \n",
"\n",
"Here’s what you should do:\n",
"* Following initial preparation (like above), first perform equilibration for NStepsEquil1 using velocity rescaling to target temperature T every RescaleFreq steps, using whatever value of RescaleFreq you used previously (NOT every step!)\n",
"* Perform a second equilibration for `NStepsEquil2` timesteps using velocity rescaling at the same frequency, storing energies while you do this. \n",
"* Compute the average total energy over this second equilibration and rescale the velocities to start the final phase with the correct total energy. In other words, the total energy at the end of equilibration will be slightly above or below the average; you should find the kinetic energy you need to have to get the correct total energy, and rescale the velocities to get this kinetic energy. After this you will be doing no more velocity rescaling. (Hint: You can do this final rescaling easily by computing a scaling factor, and you will probably not be using the rescaling code you use to maintain the temperature during equilibration.)\n",
"* Perform a second equilibration for `NStepsEquil2` timesteps using velocity rescaling at the same frequency, storing energies (kinetic and potential, separately) while you do this. \n",
"* Compute the average total energy (kinetic plus potential) over this second equilibration and rescale the velocities to start the final phase with the correct total energy. In other words, the total energy at the end of equilibration will be slightly above or below the average; you should find the kinetic energy you need to have to get the correct total energy, and rescale the velocities to get this kinetic energy. After this you will be doing no more velocity rescaling. (Hint: You can do this final rescaling easily by computing a scaling factor, and you will probably not be using the rescaling code you use to maintain the temperature during equilibration.)\n",
"* Copy the initial positions of the particles into a reference array for computing the mean squared displacement, for example using `Pos0 = Pos.copy()`\n",
"* Perform a production run for `NStepsProd` integration steps with constant energy (NVE) rather than velocity rescaling. Periodically record the time and mean squared displacement of the atoms from their initial positions. (You will need to write a small bit of code to compute mean squared displacements, but it shouldn’t take more than a couple of lines; you may send it to me to check if you are concerned about it). The mean squared displacement is given by \n",
"\\begin{equation}\n",
Expand Down Expand Up @@ -157,7 +157,7 @@
"You can send your comments/discussion as an e-mail, and the rest of the items as attachments.\n",
"\n",
"### What’s provided for you: \n",
"In this case, most of what you need is provided in the importable module `MD_functions.py` (which you can view with your favorite text editor, like `vi` or Atom), except for the functions for initial velocities and velocity rescaling -- in those cases, the shells are present below and you need to write the core (which will be very brief!). **However, you will also need to insert the code for the `ConjugateGradient` function in `MD_functions.py`** from your work you did in the Energy Minimization assignment. If you did not do this, or did not get it correct (or if you are not certain if you did), you will need to e-mail David Mobley for solutions.\n",
"In this case, most of what you need is provided in the importable module `MD_functions.py` (which you can view with your favorite text editor, like `vi` or Atom), except for the functions for initial velocities and velocity rescaling -- in those cases, the shells are present below and you need to write the core (which will be very brief!). **However, you will also need to insert the code for the `ConjugateGradient` function in `MD_functions.py`**. This is similar to (but not identical to) the ConjugateGradient code from the energy minimization assignment -- specifically, now our particles are joined into polymers, meaning that the function needs slightly different arguments to pass to energy and force evaluation routines. \n",
"\n",
"From the Fortran library `mdlib` (which you will compile as usual via `f2py3 -c -m mdlib mdlib.f90` or similar), the only new function you need is Velocity Verlet. In `MD_functions.py`, the following tools are available (this shows their documentation, not the details of the code, but you should only need to read the documentation in order to be able to use them. NOTE: No modification of these functions is needed; you only need to use them. You will only need to write `InitVelocities` and `RescaleVelocities` as described above, plus provide your previous code for `ConjugateGradient`: \n"
]
Expand Down Expand Up @@ -358,9 +358,8 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"collapsed": true,
"id": "uezEQuk55C2F"
},
"outputs": [],
Expand All @@ -374,7 +373,7 @@
"#Set up as in A\n",
"#Equilibrate for NStepsEquil1 with velocity rescaling every RescaleFreq steps, discarding energies\n",
"#Equilibrate for NStepsEquil2 with velocity rescaling, storing energies\n",
"#Stop and average the energy. Rescale the velocities so the current (end-of-equilibration) energy matches the average\n",
"#Stop and average the toal energy. Rescale the velocities so the current (end-of-equilibration) total energy matches the average total energy.\n",
"#Store the particle positions so you can later compute the mean squared displacement\n",
"#Run for NStepsProd at constant energy (NVE) recording time and mean squared displacement periodically\n",
"\n",
Expand Down Expand Up @@ -416,7 +415,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.8"
},
"toc": {
"nav_menu": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,11 @@
"iPython notebooks such as this one often contain a variety of cells containing code. These are normally intended to be run, which you can when you have an individual cell selected, by hitting the button at the top with a 'play' symbol, or by typing shift-enter. If you do NOT do so on each of the cells defining variables/functions which will be used here, then you will encounter an error about undefined variables when you run the later cells. \n",
" \n",
"## Your step 1 for the assignment: Start by doing some file bookkeeping:\n",
" * Find `emlib.f90` and optional utility `pos_to_pdb.py` in this directory.\n",
" * In the command prompt navigate to that folder and type 'f2py3 -c -m emlib emlib.f90' which should compile the fortran library for use within python (For more on F2Py, refer to the [f2py documentation](https://numpy.org/doc/stable/f2py)). In OS X, this may require you to install the (free) XCode developer tools (available from the Mac App store) and the command-line developer tools first (the latter via `xcode-select --install`). In Linux it should just work. Windows would be a hurdle.\n",
" * Find `emlib.f90` and optional utility `pos_to_pdb.py` in this directory. **If you are on Google Colab**, you will need to have uploaded this library and/or the directory enclosing it to Google Drive, mount Google Drive, and navigate to the directory containing this library.** See notes below on \"Installing Packages\" as well as background in `Getting_Started.ipynb`.\n",
" * In the command prompt navigate to that folder and type 'f2py -c -m emlib emlib.f90' which should compile the fortran library for use within python (For more on F2Py, refer to the [f2py documentation](https://numpy.org/doc/stable/f2py)). In OS X, this may require you to install the (free) XCode developer tools (available from the Mac App store) and the command-line developer tools first (the latter via `xcode-select --install`). In Linux it should just work. Windows would be a hurdle.\n",
" * In your command prompt, start theis Jupyter notebook (in OSX this would be something like 'Jupyter notebook energy_minimization_assignment'), which should open it in your web browser; you're running it already unless you are looking at the HTML version of this file.\n",
" \n",
"Template Python code for the assignment is provided below. I suggest making a new notebook which is a copy of this one (perhaps containing your name in the filename) and working from there. \n",
" \n",
" \n",
" ## Next, we prep Python for the work:\n",
" \n",
" First we import the numpy numerical library we're going to need, as well as the compiled Fortran library emlib"
"Template Python code for the assignment is provided below. I suggest making a new notebook which is a copy of this one (perhaps containing your name in the filename) and working from there. \n"
]
},
{
Expand All @@ -85,22 +80,32 @@
"source": [
"## Installing Packages\n",
"\n",
"***If you are running this on Google Colab, please add the installation blocks from the [getting started notebook](https://github.com/MobleyLab/drug-computing/blob/master/uci-pharmsci/Getting_Started.ipynb) or [condacolab](https://github.com/aakankschit/drug-computing/blob/master/uci-pharmsci/Getting_Started_condacolab.ipynb) here and then execute the code below***"
"If you are running this notebook locally, you should have installed everything already. If you are running **on Google Colab** you will likely need to install prerequisites. (On occasion, Google Colab has had a fortran compiler installed already, meaning it might not be necessary to install anything, but this is typically not the case.)\n",
"\n",
"If you are running this on Google Colab, you will typically need to add the installation blocks from the [getting started notebook](https://github.com/MobleyLab/drug-computing/blob/master/uci-pharmsci/Getting_Started.ipynb) here **in a new code block** and then execute the code below. \n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Next, we prep Python for the work:\n",
" \n",
" First we import the numpy numerical library we're going to need, as well as the compiled Fortran library emlib"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"collapsed": true,
"id": "DiyM0EjL5cdN"
},
"outputs": [],
"source": [
"import numpy as np\n",
"import emlib\n",
"from pos_to_pdb import * \n",
"#This would allow you to export coordinates if you want, later"
"#from pos_to_pdb import * #This would allow you to export coordinates if you want, later"
]
},
{
Expand Down Expand Up @@ -134,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"id": "Cz_zeUNd5cdP"
},
Expand Down Expand Up @@ -283,7 +288,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"id": "FoKqhioL5cdQ",
"outputId": "132969c7-2e96-439f-fe88-9ca13c98281d"
Expand All @@ -294,10 +299,10 @@
"output_type": "stream",
"text": [
"a=\n",
" [ 0.27969529 0.37836589 0.96785443]\n",
" [0.89598508 0.71295953 0.01997318]\n",
"b=\n",
" [[ 0.37068791 0.64081204 0.21422213]\n",
" [ 0.471194 0.28575791 0.54468387]]\n"
" [[0.09347335 0.12438994 0.73166013]\n",
" [0.19155384 0.72085277 0.76497705]]\n"
]
}
],
Expand Down Expand Up @@ -618,9 +623,9 @@
"provenance": []
},
"kernelspec": {
"display_name": "drugcomp",
"display_name": "drugcomp23",
"language": "python",
"name": "drugcomp"
"name": "drugcomp23"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -632,7 +637,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.16"
},
"toc": {
"nav_menu": {},
Expand Down
Loading