Skip to content

Commit

Permalink
Merge pull request #6 from MobleyLab/lectures
Browse files Browse the repository at this point in the history
Port in lecture/instructional content from the last time I taught the corse
  • Loading branch information
davidlmobley authored Oct 26, 2017
2 parents 9849426 + d9399e5 commit 7e24776
Show file tree
Hide file tree
Showing 47 changed files with 33,604 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uci-pharmsci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ This will ultimately contain syllabus information, lecture notes and slides, req
- [Documentation](https://docs.eyesopen.com/toolkits/python/index.html)

- **Optionals:**
- [Atom](https://atom.io/): Github's official text editor with so many plugins.
- [Atom](https://atom.io/): GitHub's official text editor with so many plugins.
- [VIDA](https://www.eyesopen.com/vida): Molecular viewer for OEB files. (Requires OpenEye license)

#### Cheatsheets and dotfiles
Under the **uci-pharmasci/docs/** directory, I've 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).
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).

We also have a [Github](https://www.evernote.com/shard/s26/sh/ae73a67b-4d7a-4e97-a896-cef5473db895/178762935c73b559) cheat sheet/tutorial on our group Evernote. I also recommend checking out the [CodeAcademy Github](https://www.codecademy.com/learn/learn-git) tutorial.

I've included some of my _dotfiles_ (configuration files) for VMD and Vim to set some common default settings.
We have also included several _dotfiles_ (configuration files with filenames beginning with the `.` character) for VMD and Vim to set some common default settings.
Binary file added uci-pharmsci/lectures/.DS_Store
Binary file not shown.
588 changes: 588 additions & 0 deletions uci-pharmsci/lectures/3D_structure_shape/3D_Structure_Shape.ipynb

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions uci-pharmsci/lectures/3D_structure_shape/Marvin_molecule.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

Mrv1533004081509272D

12 13 0 0 0 0 999 V2000
-6.4525 1.2822 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-7.1670 0.8697 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-7.8815 1.2822 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-7.8815 2.1072 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-7.1670 2.5197 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-6.4525 2.1072 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.7381 2.5197 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.0236 2.1072 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.0236 1.2822 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.7381 0.8697 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.7381 3.3447 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0
-8.5959 0.8697 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 6 2 0 0 0 0
1 10 1 0 0 0 0
2 3 2 0 0 0 0
3 4 1 0 0 0 0
4 5 2 0 0 0 0
5 6 1 0 0 0 0
6 7 1 0 0 0 0
7 8 2 0 0 0 0
8 9 1 0 0 0 0
9 10 2 0 0 0 0
7 11 1 0 0 0 0
3 12 1 0 0 0 0
M END
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,171 changes: 4,171 additions & 0 deletions uci-pharmsci/lectures/3D_structure_shape/fitted.mol2

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions uci-pharmsci/lectures/3D_structure_shape/mymolecule.mol2
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@<TRIPOS>MOLECULE
*****
21 22 0 0 0
SMALL
NO_CHARGES

@<TRIPOS>ATOM
1 C1 -0.4966 -2.0341 0.4940 C.ar 1 <0> 0.0000
2 C2 -0.0479 -3.3542 0.5448 C.ar 1 <0> 0.0000
3 C3 3.4207 -2.9899 -0.7267 C.ar 1 <0> 0.0000
4 C4 3.8693 -4.3100 -0.6758 C.ar 1 <0> 0.0000
5 C5 0.3500 -1.0275 0.0392 C.ar 1 <0> 0.0000
6 C6 1.7243 -5.0072 0.1848 C.ar 1 <0> 0.0000
7 C7 1.2560 -3.6839 0.1403 C.ar 1 <0> 0.0000
8 C8 2.1168 -2.6602 -0.3222 C.ar 1 <0> 0.0000
9 C9 3.0228 -5.3167 -0.2210 C.ar 1 <0> 0.0000
10 C10 1.6484 -1.3369 -0.3665 C.ar 1 <0> 0.0000
11 C11 3.5042 -6.7273 -0.1668 C.3 1 <0> 0.0000
12 Cl1 2.6181 -0.0066 -0.9155 Cl 1 <0> 0.0000
13 H1 -1.5075 -1.7929 0.8097 H 1 <0> 0.0000
14 H2 -0.7273 -4.1251 0.9026 H 1 <0> 0.0000
15 H3 4.1207 -2.2422 -1.0895 H 1 <0> 0.0000
16 H4 4.8822 -4.5432 -0.9933 H 1 <0> 0.0000
17 H5 -0.0191 -0.0052 0.0084 H 1 <0> 0.0000
18 H6 1.0718 -5.8045 0.5367 H 1 <0> 0.0000
19 H7 3.9631 -6.9370 0.8071 H 1 <0> 0.0000
20 H8 2.6803 -7.4357 -0.3230 H 1 <0> 0.0000
21 H9 4.2463 -6.9253 -0.9512 H 1 <0> 0.0000
@<TRIPOS>BOND
1 1 2 ar
2 1 5 ar
3 2 7 ar
4 3 4 ar
5 3 8 ar
6 4 9 ar
7 5 10 ar
8 6 7 ar
9 6 9 ar
10 7 8 ar
11 8 10 ar
12 9 11 1
13 10 12 1
14 1 13 1
15 2 14 1
16 3 15 1
17 4 16 1
18 5 17 1
19 6 18 1
20 11 19 1
21 11 20 1
22 11 21 1
92 changes: 92 additions & 0 deletions uci-pharmsci/lectures/3D_structure_shape/ref.mol2
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@<TRIPOS>MOLECULE
*****
40 44 0 0 0
SMALL
NO_CHARGES

@<TRIPOS>ATOM
1 C1 -0.4937 -0.6652 -0.7033 C.ar 1 <0> 0.0000
2 C2 -0.7967 -0.1996 -1.9988 C.ar 1 <0> 0.0000
3 C3 -0.7946 -1.9790 -0.3401 C.ar 1 <0> 0.0000
4 C4 -1.4233 -2.7664 -1.2875 C.ar 1 <0> 0.0000
5 C5 -1.6446 -2.3426 -2.5788 C.ar 1 <0> 0.0000
6 C6 -1.3646 -1.0483 -2.9577 C.ar 1 <0> 0.0000
7 C7 0.5075 -5.0406 -0.8643 C.2 1 <0> 0.0000
8 C8 0.6163 -5.2127 -2.1898 C.2 1 <0> 0.0000
9 C9 -0.3666 -2.6058 0.9595 C.3 1 <0> 0.0000
10 C10 -3.2477 -4.2463 -0.4718 C.3 1 <0> 0.0000
11 C11 -3.2556 -3.7298 0.9766 C.3 1 <0> 0.0000
12 C12 -0.8372 -4.8920 -0.2004 C.3 1 <0> 0.0000
13 C13 -0.5786 -5.3058 -3.0978 C.3 1 <0> 0.0000
14 C14 -0.8153 -4.0962 1.1450 C.3 1 <0> 0.0000
15 C15 -1.8604 -4.5782 -2.6123 C.3 1 <0> 0.0000
16 C16 -1.8486 -4.1872 -1.1165 C.3 1 <0> 0.0000
17 C17 -2.2081 -3.8150 3.1532 C.3 1 <0> 0.0000
18 N1 -2.1487 -4.2742 1.7694 N.3 1 <0> 0.0000
19 O1 -2.0905 -3.3515 -3.3899 O.3 1 <0> 0.0000
20 O2 -1.5947 -0.6121 -4.2206 O.3 1 <0> 0.0000
21 O3 -0.2068 -4.8636 -4.4003 O.3 1 <0> 0.0000
22 H1 -0.0002 -0.0001 0.0002 H 1 <0> 0.0000
23 H2 -0.5479 0.8259 -2.2621 H 1 <0> 0.0000
24 H3 1.4007 -5.0529 -0.2475 H 1 <0> 0.0000
25 H4 1.6025 -5.3643 -2.6195 H 1 <0> 0.0000
26 H5 0.7317 -2.5912 0.9762 H 1 <0> 0.0000
27 H6 -0.6942 -1.9797 1.7952 H 1 <0> 0.0000
28 H7 -3.5923 -5.2893 -0.4742 H 1 <0> 0.0000
29 H8 -3.9810 -3.6745 -1.0551 H 1 <0> 0.0000
30 H9 -3.2387 -2.6329 0.9805 H 1 <0> 0.0000
31 H10 -4.2110 -4.0229 1.4297 H 1 <0> 0.0000
32 H11 -1.1798 -5.9160 0.0123 H 1 <0> 0.0000
33 H12 -0.8056 -6.3762 -3.1858 H 1 <0> 0.0000
34 H13 -0.0839 -4.5795 1.8076 H 1 <0> 0.0000
35 H14 -2.7143 -5.2318 -2.8324 H 1 <0> 0.0000
36 H15 -1.3746 -4.2329 3.7238 H 1 <0> 0.0000
37 H16 -3.1461 -4.1324 3.6168 H 1 <0> 0.0000
38 H17 -2.1494 -2.7240 3.1923 H 1 <0> 0.0000
39 H18 -1.3151 0.3140 -4.3184 H 1 <0> 0.0000
40 H19 0.5055 -5.4503 -4.6987 H 1 <0> 0.0000
@<TRIPOS>BOND
1 1 2 ar
2 1 3 ar
3 2 6 ar
4 3 4 ar
5 3 9 1
6 4 5 ar
7 4 16 1
8 5 6 ar
9 5 19 1
10 6 20 1
11 7 8 2
12 7 12 1
13 8 13 1
14 9 14 1
15 10 11 1
16 10 16 1
17 11 18 1
18 12 14 1
19 12 16 1
20 13 15 1
21 13 21 1
22 14 18 1
23 15 16 1
24 15 19 1
25 17 18 1
26 1 22 1
27 2 23 1
28 7 24 1
29 8 25 1
30 9 26 1
31 9 27 1
32 10 28 1
33 10 29 1
34 11 30 1
35 11 31 1
36 12 32 1
37 13 33 1
38 14 34 1
39 15 35 1
40 17 36 1
41 17 37 1
42 17 38 1
43 20 39 1
44 21 40 1
396 changes: 396 additions & 0 deletions uci-pharmsci/lectures/MC_sandbox/Lec6 MC sandbox.ipynb

Large diffs are not rendered by default.

430 changes: 430 additions & 0 deletions uci-pharmsci/lectures/MC_sandbox/Lec6 MC sandbox_completed.ipynb

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions uci-pharmsci/lectures/MC_sandbox/mc_sandbox.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

subroutine CalcEnergy(Pos, L, rc, PEnergy, Dim, NAtom)
implicit none
integer, intent(in) :: Dim, NAtom
real(8), intent(in), dimension(0:NAtom-1, 0:Dim-1) :: Pos
real(8), intent(in) :: L, rc
real(8), intent(out) :: PEnergy
real(8), parameter :: k = 3000., r0 = 1.
integer:: i, j
real(8) :: d2, sep, disp, shiftval, rc2, id6, id2, id12
real(8), dimension(Dim) :: rij, Posi


!Assign initially zeros to the force array and potential energy
PEnergy = 0.
rc2 = rc**2

!Precompute constants such as LJ shift value up here
id6 = 1./rc**6
shiftval = 4*(id6**2 - id6)


do i=0, NAtom - 1
!store Pos(i,:) in a temporary array for faster access in j looop
Posi = Pos(i,:)
do j = i+1, NAtom - 1
!compute initial rij
rij = Pos(j,:) - Posi
!Apply minimum image convention
rij = rij - L*dnint(rij / L)

!compute scalar distance
d2 = sum(rij*rij)
!Check against cutoff
if ( d2 > rc2) then
cycle
end if
id2 = 1./d2 !inverse squared distance
id6 = id2 * id2 * id2 !inverse sixth distance
id12 = id6 * id6 !inverse twelfth distance
PEnergy = Penergy + 4. * (id12 - id6) + shiftval

enddo
enddo
end subroutine


295 changes: 295 additions & 0 deletions uci-pharmsci/lectures/MD_sandbox/MD Sandbox.ipynb

Large diffs are not rendered by default.

318 changes: 318 additions & 0 deletions uci-pharmsci/lectures/MD_sandbox/MD Sandbox_completed.ipynb

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions uci-pharmsci/lectures/MD_sandbox/md_sandbox.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

subroutine CalcEnergy(Pos, M, L, rc, PEnergy, Dim, NAtom)
implicit none
integer, intent(in) :: M, Dim, NAtom
real(8), intent(in), dimension(0:NAtom-1, 0:Dim-1) :: Pos
real(8), intent(in) :: L, rc
real(8), intent(out) :: PEnergy
real(8), parameter :: k = 3000., r0 = 1.
integer:: i, j
real(8) :: d2, sep, disp, shiftval, rc2, id6, id2, id12
real(8), dimension(Dim) :: rij, Posi


!Assign initially zeros to the force array and potential energy
PEnergy = 0.
rc2 = rc**2

!Precompute constants such as LJ shift value up here
id6 = 1./rc**6
shiftval = 4*(id6**2 - id6)


do i=0, NAtom - 1
!store Pos(i,:) in a temporary array for faster access in j looop
Posi = Pos(i,:)
do j = i+1, NAtom - 1
!compute initial rij
rij = Pos(j,:) - Posi
!Apply minimum image convention
rij = rij - L*dnint(rij / L)

!compute scalar distance
d2 = sum(rij*rij)
!Check against cutoff
if ( d2 > rc2) then
cycle
end if
id2 = 1./d2 !inverse squared distance
id6 = id2 * id2 * id2 !inverse sixth distance
id12 = id6 * id6 !inverse twelfth distance
PEnergy = Penergy + 4. * (id12 - id6) + shiftval

enddo
enddo
end subroutine



subroutine CalcEnergyForces(Pos, M, L, rc, PEnergy, Forces, Dim, NAtom)
implicit none
integer, intent(in) :: M, Dim, NAtom
real(8), intent(in), dimension(0:NAtom-1, 0:Dim-1) :: Pos
real(8), intent(in) :: L, rc
real(8), intent(out) :: PEnergy
real(8), intent(inout), dimension(0:NAtom-1, 0:Dim-1) :: Forces
!f2py intent(in, out, inplace) :: Forces
real(8), parameter :: k = 3000., r0 = 1.
integer :: i, j
real(8) :: d2, sep, disp, shiftval, rc2, id6, id2, id12
real(8), dimension(Dim) :: rij, Fij, Posi


!Assign initially zeros to the force array and potential energy
Forces = 0.
PEnergy = 0.
rc2 = rc**2

!Precompute constants such as LJ shift value up here
id6 = 1./rc**6
shiftval = 4.*(id6**2 - id6)


do i=0, NAtom - 1
!store Pos(i,:) in a temporary array for faster access in j looop
Posi = Pos(i,:)
do j = i+1, NAtom - 1
!compute initial rij
rij = Pos(j,:) - Posi
!Apply minimum image convention
rij = rij - L*dnint(rij / L)

!compute scalar distance
d2 = sum(rij*rij)
!Check against cutoff
if ( d2 > rc2) then
cycle
end if
id2 = 1./d2 !inverse squared distance
id6 = id2 * id2 * id2 !inverse sixth distance
id12 = id6 * id6 !inverse twelfth distance
PEnergy = Penergy + 4. * (id12 - id6) + shiftval
Fij = rij * (-48. * id12 + 24. * id6) * id2
Forces(i,:) = Forces(i,:) + Fij
Forces(j,:) = Forces(j,:) - Fij

enddo
enddo
end subroutine


subroutine VVIntegrate(Pos, Vel, Accel, M, L, rc, dt, KEnergy, PEnergy, Dim, NAtom)
implicit none
integer, intent(in) :: M, Dim, NAtom
real(8), intent(in) :: L, rc, dt
real(8), intent(inout), dimension(0:NAtom-1, 0:Dim-1) :: Pos, Vel, Accel
!f2py intent(in,out,inplace) :: Pos, Vel, Accel
real(8), intent(out) :: KEnergy, PEnergy
external :: CalcEnergyForces
Pos = Pos + dt * Vel + 0.5 * dt*dt * Accel
Vel = Vel + 0.5 * dt * Accel
call CalcEnergyForces(Pos, M, L, rc, PEnergy, Accel, Dim, NAtom)
Vel = Vel + 0.5 * dt * Accel
KEnergy = 0.5 * sum(Vel*Vel)
end subroutine
Loading

0 comments on commit 7e24776

Please sign in to comment.