Minimizing and running a simulation of an organic molecule

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
User avatar
Jonathan Saboury
Posts: 22
Joined: Fri Feb 24, 2012 11:48 am

Minimizing and running a simulation of an organic molecule

Post by Jonathan Saboury » Thu Jan 17, 2013 7:06 pm

Hi, I would like to minimize and run a simulation of an organic molecule in water.

I'm an intermediate C++ programmer (no GUI experience), studying chemistry, and have no experience with molecular dynamic simulations.

I have a couple of molecules I want to simulate, but no one with current knowledge of modern simulations to help me. The the largest molecule has an Da of 1500 (~100 atoms).

I would prefer to have GPU accelerated simulation software, but I would assume that CPU code for such small molecules are fine as well.

Can OpenMM be used for such a project? If so, can you lead me on how to do this? If not, can you lead me to an easy to use software that does?

Edit: CUDA will be the best as running a GTX 460 V2
Do you think that a molecule of this size will undergo different states like proteins? I.e. misfolding

Currently watching "3b -- Video: OpenMM API & Roadmap -- Peter Eastman", let's hope I understand it.
Watched it, I never installed a library before, but there is a first time for everything. Tryign to install the library to VS 2012, or will just get VS2009 if too many problems.

Rebuilt .sln to 2012, read the OpenMMUserGuide.pdf and di what it said to do. Tried to build "HelloArgon" and got this error:

Code: Select all

1>------ Build started: Project: HelloArgon, Configuration: Debug Win32 ------
1>  HelloArgon.cpp
1>c:\program files (x86)\openmm\include\openmm\system.h(127): warning C4018: '<' : signed/unsigned mismatch
1>LINK : fatal error LNK1104: cannot open file 'OpenMM_d.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
going to try it on VS2009

nevermind, just needed to set to Release, not debug

getting a OpenMM.dll is not installed, double checkign steps to see if I followed directions correctly

FINAL: I can't seem to find teh solution to this problem. My guess would be that I set up PATH wrong. How do I edit it so it accepts multiple paths? Seperate by semicolon?

Looks like Zephr now supports HETATM's! Does not convert to gromacs format correctly, gives this error (i used pymol to make the pbd, will use spartan next):

Code: Select all

Software inconsistency error:
Trying to deduce atomnumbers when no pdb information is present

Code: Select all

C:\Program Files (x86)\FAHClient; C:\Program Files\OpenMM\lib; C:\Program Files\OpenMM\lib\plugins
spartan 08 pdb file does not work as well.

Thanks!

P.S. Thank you for all your work on F@H and making the code open source. I run my desktop and laptop 24/7 to show my appreciation :)

User avatar
Peter Eastman
Posts: 2580
Joined: Thu Aug 09, 2007 1:25 pm

Re: Minimizing and running a simulation of an organic molecu

Post by Peter Eastman » Fri Jan 18, 2013 11:40 am

Hi Jonathan,

Welcome! Let me go through your questions.

Yes, you can definitely use OpenMM for this project. That's what it's for!

Is 100 atoms the size of your total system, or do you plan to put it in a box of water (in which case your total system will probably be around 1000 atoms)? If you only have 100 atoms, it will be much faster on the CPU than GPU, since just the latency of communicating with the GPU will take longer than running the whole calculation. But for 1000 atoms, the GPU will give a big speedup.

No idea what range of states your molecule will go through - you haven't told me what it is. This will depend a lot on details of the molecule, such as how flexible it is. I'm also not the best person to answer that question, but perhaps someone more biologically oriented will join in.

The video you're watching is badly out of date - it's from 2009. (Joy, can we get them cleaned up so people find the current videos, not old ones?) A much more recent set is at https://simtk.org/project/xml/downloads ... oup_id=732. Sorry about that!

Zephyr has been deprecated for a couple of years now. I don't know if it even works with a recent OpenMM.

What do you mean by, "getting a OpenMM.dll is not installed?" I'm not sure what you're describing.

Peter

User avatar
Jonathan Saboury
Posts: 22
Joined: Fri Feb 24, 2012 11:48 am

Re: Minimizing and running a simulation of an organic molecu

Post by Jonathan Saboury » Fri Jan 18, 2013 2:15 pm

Let me first apologize for the sporadic details, I was typing problems as I was occurring them like a lab manual.

This winter the research group I am in will be synthesizing 9 dendrimers. Some having a more rigid backbone consisting of benzene, others having a flexible saturated backbone.

The importance of these dendrimers is to be round in order to improve drug delivery, if they are not, they will do us no good. My professor wanted to use spartan or another commercial chemistry software we had lying around to minimize the energy of these molecules to make sure they they are indeed round. It is to my understanding that minimizing the system does not truly indicate how their structure will truly be as it does not factor in water (or ions which are in the body).

So from your info it will be best if I surround the molecule in a box of water (explicit solvation?) as it will be more accurate and can put it on the GPU.

I am also sorry to hear than Zephyr has been discontinued. I found it very easy for new people like me to use. In the future when I get OpenMM working on Visual Studio, I'll learn MFC and make a GUI program that is able to take PyMol and Spartan '08 PBD files (as I found it hard to make a PDB that is compatible with OpenMM Zephr).

As for the VS Error of no .DLL, here is the process I did in order to try to get "HelloArgon" working (From "3.2 Quick Instructions" in "OpenMMUserGuide.pdf")

1.)Downloaded and extracted the files to "C:\Program Files (x86)\OpenMM\". So the "lib" folder is in "C:\Program Files (x86)\OpenMM\lib"
2.) Ran the Python 2.7 API Installer.
3.) Followed directions of "3.3.1 Windows". The PATH was originally" C:\Program Files (x86)\FAHClient" and I changed it to "C:\Program Files (x86)\FAHClient; C:\Program Files\OpenMM\lib; C:\Program Files\OpenMM\lib\plugins"
4.) I have CUDA installed on my Desktop, I do not have the toolkit installed however, will that matter? The error seems to be unrelated to this.
5.) Skipped to "5.2 Running Example Files" because the previous parts did not apply to me. I have VS2010 and 2012 installed, testing on 2010 first.
6.) Opened "HelloArgon.sln" in "C:\Program Files (x86)\OpenMM\examples\VisualStudio", converted it.
Here is the Conversion Report: http://i45.tinypic.com/2mwfsrr.jpg
7.) Set to Release, then I start without debugging. and this is the error I get (same in 2012): http://i50.tinypic.com/20afok3.jpg

Thank you for your help, it is extremely appreciated! Let me know if I didn't include any other information. This is the first time I am including a library of any kind.

Thanks again, Jonathan

EDIT: As I was rereading I realized that I did step 3 wrong. I changed it to "C:\Program Files (x86)\FAHClient; C:\Program Files (x86)\OpenMM\lib; C:\Program Files (x86)\OpenMM\lib\plugins" but still get the same error.

User avatar
Peter Eastman
Posts: 2580
Joined: Thu Aug 09, 2007 1:25 pm

Re: Minimizing and running a simulation of an organic molecu

Post by Peter Eastman » Fri Jan 18, 2013 4:21 pm

Hi Jonathan,

Are you really sure you need to be messing with Visual Studio? It sounds to me like you should be able to do everything you want with the application layer. Take a look at the OpenMM Application Guide. I think that will be a much easier way for you to do what you want.

Peter

User avatar
Jonathan Saboury
Posts: 22
Joined: Fri Feb 24, 2012 11:48 am

Re: Minimizing and running a simulation of an organic molecu

Post by Jonathan Saboury » Fri Jan 18, 2013 7:11 pm

Wow, you guys made it even easier than I previously thought!

I've encountered a couple of problems however.

1.) Problem creating a .pdb file that will input correctly.
The way I understand .pdb's are that first there are the atom names and coordinates and next is all the connect information.
I.E. n-hexane
PyMol: http://pastebin.com/DR2nqZeQ
Spartan: http://pastebin.com/ckiTZTqf
Your input.PDB file seems to have no connect information, which confuses me on how the program knows how they are connected.
How would I make a .pdb file with all HETATM's that inputs correctly? I would prefer the ability to make them not by hand.

2.) Outputting the results onto a .pdb that has the different time steps so i can play the progression in a program such as VMD. (like Zephyr).
"simulatePdb.py" does 10000 time steps and supposedly appends the results to "output.pdb". But when I look at the .pbd all I see is the last result and water surrounding it. I don't know how I would show the progression of the folding, is it just a larger .pdb file? Which leads to the last problem.

3.) Remove all water molecules in the output file.
In the output there is water that surrounds the target molecule making it very hard to see. I could write a C++ program that fixes the output, was just wondering if there was a parameter I could pass that does this. I also don't think that is what "modeller.deleteWater()" does

Thanks, Jonathan.

User avatar
Jonathan Saboury
Posts: 22
Joined: Fri Feb 24, 2012 11:48 am

Re: Minimizing and running a simulation of an organic molecu

Post by Jonathan Saboury » Sat Jan 19, 2013 4:52 pm

Started the "Day 1 Workshop Exercises"

The starting .pdb file seems fine enough, a small molecule surrounded by water: http://i49.tinypic.com/11w3fk5.jpg

But after I run the .py for it the result comes out funky. It seems the water is split into octants and the molecule of interest flickers between these octants. Here is a video of it: http://www.youtube.com/watch?v=fW-VzyTewXU

.py file used (exercise1.py):

Code: Select all

from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *

pdb = PDBFile('input_exercise1.pdb')
forcefield = ForceField('amber99sb.xml', 'tip3p.xml')
print "Creating System"
system = forcefield.createSystem(pdb.topology, nonbondedMethod=PME, nonbondedCutoff=1.0*nanometer, constraints=HBonds)
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
simulation = Simulation(pdb.topology, system, integrator)
print "Using Platform:", simulation.context.getPlatform().getName()
simulation.context.setPositions(pdb.positions)
print "Minimizing Energy"
simulation.minimizeEnergy(maxIterations=25)
simulation.reporters.append(PDBReporter('output_exercise1.pdb', 5))
print "Running Simulation for 1000 steps"
for i in range(10):
	step=i*100
	print "Running step:", step 
	simulation.step(100)
print "Finished Simulation."
It is good news that I can now print out all the steps in a single .pdb (my previous problem #2) though!

User avatar
Peter Eastman
Posts: 2580
Joined: Thu Aug 09, 2007 1:25 pm

Re: Minimizing and running a simulation of an organic molecu

Post by Peter Eastman » Mon Jan 21, 2013 10:55 am

Your input.PDB file seems to have no connect information, which confuses me on how the program knows how they are connected.
If you include CONECT records in your PDB file, OpenMM will process them correctly. Most PDB files omit them for standard amino acids, since they assume any program will know how everything is connected without them. But for other molecules, go ahead and include them.
3.) Remove all water molecules in the output file.
Currently it doesn't support doing that, though it's in the feature request tracker. When you load it into VMD, though, you can tell it to hide the water.
It seems the water is split into octants and the molecule of interest flickers between these octants.
This is just differences in how the periodic boundary conditions get interpreted: does the unit cell run from [0 to width], or from [-width/2 to width/2]. We've fixed this in 5.0 to produce better looking results. But your simulation is still correct, the output just makes it look odd.

Peter

User avatar
Jonathan Saboury
Posts: 6
Joined: Fri Feb 24, 2012 11:49 am

Re: Minimizing and running a simulation of an organic molecu

Post by Jonathan Saboury » Tue Jan 22, 2013 4:43 pm

Was able to remove all water.
Tried same simulation on laptop with ati gpu (vs desktop with nvidea) and it did not split into octants for some reason. When I get home I will test the .pdb with water disabled in vmd.

Lastly, how would I change the .pdb below so that it reads it correctly?
Obviously it is because it doesn't recognize the "residue" PSD. What should I put as a residue for nonprotein organic molecules for it to be recognized?

Error:

Code: Select all

C:\OpenMM\examples>python simulateHexane.py
Traceback (most recent call last):
  File "simulateHexane.py", line 8, in <module>
    system = forcefield.createSystem(pdb.topology, nonbondedMethod=PME, nonbonde
dCutoff=1*nanometer, constraints=HBonds)
  File "C:\Python27-32bit\lib\site-packages\simtk\openmm\app\forcefield.py", lin
e 309, in createSystem
    raise ValueError('No template found for residue %d (%s)' % (res.index+1, res
.name))
ValueError: No template found for residue 1 (PSD)
.pdb

Code: Select all

HETATM    1  C01 PSD P   1      -1.469   3.894   0.000  0.00  0.00      PSDO C  
HETATM    2  C02 PSD P   1      -0.165   3.728   0.802  0.00  0.00      PSDO C  
HETATM    3  C03 PSD P   1       0.352   2.285   0.649  0.00  0.00      PSDO C  
HETATM    4  C04 PSD P   1       1.720   2.155   1.344  0.00  0.00      PSDO C  
HETATM    5  C05 PSD P   1       2.255   0.722   1.162  0.00  0.00      PSDO C  
HETATM    6  C06 PSD P   1       3.625   0.595   1.854  0.00  0.00      PSDO C  
HETATM    7  H01 PSD P   1       0.459   2.047  -0.409  0.00  0.00      PSDO H  
HETATM    8  H02 PSD P   1      -1.838   2.914  -0.303  0.00  0.00      PSDO H  
HETATM    9  H03 PSD P   1      -1.277   4.500  -0.885  0.00  0.00      PSDO H  
HETATM   10  H04 PSD P   1      -2.217   4.386   0.622  0.00  0.00      PSDO H  
HETATM   11  H05 PSD P   1      -0.356   3.936   1.855  0.00  0.00      PSDO H  
HETATM   12  H06 PSD P   1       0.584   4.424   0.425  0.00  0.00      PSDO H  
HETATM   13  H07 PSD P   1      -0.355   1.594   1.108  0.00  0.00      PSDO H  
HETATM   14  H08 PSD P   1       2.363   0.507   0.100  0.00  0.00      PSDO H  
HETATM   15  H09 PSD P   1       1.610   2.370   2.407  0.00  0.00      PSDO H  
HETATM   16  H10 PSD P   1       2.421   2.863   0.902  0.00  0.00      PSDO H  
HETATM   17  H11 PSD P   1       1.556   0.014   1.608  0.00  0.00      PSDO H  
HETATM   18  H12 PSD P   1       4.004  -0.419   1.727  0.00  0.00      PSDO H  
HETATM   19  H13 PSD P   1       3.518   0.813   2.917  0.00  0.00      PSDO H  
HETATM   20  H14 PSD P   1       4.324   1.302   1.407  0.00  0.00      PSDO H  
CONECT    1    2    8    9   10
CONECT    2    1    3   11   12
CONECT    3    2    4    7   13
CONECT    4    3    5   15   16
CONECT    5    4    6   14   17
CONECT    6    5   18   19   20
CONECT    7    3
CONECT    8    1
CONECT    9    1
CONECT   10    1
CONECT   11    2
CONECT   12    2
CONECT   13    3
CONECT   14    5
CONECT   15    4
CONECT   16    4
CONECT   17    5
CONECT   18    6
CONECT   19    6
CONECT   20    6
END
Thanks, Jonathan
Last edited by Jonathan Saboury on Thu Jan 24, 2013 5:36 pm, edited 1 time in total.

User avatar
Jonathan Saboury
Posts: 6
Joined: Fri Feb 24, 2012 11:49 am

Re: Minimizing and running a simulation of an organic molecu

Post by Jonathan Saboury » Wed Jan 23, 2013 3:12 pm

For some reason when loading the old output it looks fine....can't reproduce results.

User avatar
Jonathan Saboury
Posts: 22
Joined: Fri Feb 24, 2012 11:48 am

Re: Minimizing and running a simulation of an organic molecu

Post by Jonathan Saboury » Fri Jan 25, 2013 11:45 am

Hi Peter,

Would I need to create a custom XML file as in "6.2 Writing the XML File"?

Thanks, Jonathan

POST REPLY