CHARMM?

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
User avatar
luke czapla
Posts: 36
Joined: Sat Feb 01, 2014 5:14 pm

CHARMM?

Post by luke czapla » Fri Feb 14, 2014 5:51 pm

I am looking through the examples and the Python XML files and I don't see CHARMM anywhere. Anyone working on this? Could I just make a converter for a top/par file to an XML file? Seems it's pretty simple because CHARMM just has the full 1-4 scaling and they use the R_min and epsilon for the 12-6 interactions. The sigma is just R_min/2^(1/6).

User avatar
Charles Brooks
Posts: 35
Joined: Fri Feb 24, 2012 11:48 am

Re: CHARMM?

Post by Charles Brooks » Sun Feb 16, 2014 9:02 am

The CHARMM force fields and a growing amount of CHARMM's capabilities are available through the CHARMM/OpenMM interface we introduced a couple of years ago. This doesn't preclude moving the latest parameter/RTF files over to XML for support through the python interface, but just wanted you to know that much is available through CHARMM already.

Cheers,

Charles Brooks

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

Re: CHARMM?

Post by Peter Eastman » Sun Feb 16, 2014 12:23 pm

Also, the GromacsTopFile class can handle topology files that use some of the CHARMM force fields. So that's another way to get it in. But including force field definitions for CHARMM force fields is definitely on our to-do list.

Peter

User avatar
luke czapla
Posts: 36
Joined: Sat Feb 01, 2014 5:14 pm

Re: CHARMM?

Post by luke czapla » Sun Feb 16, 2014 1:53 pm

Thanks Charlie and Peter,

So what I'm working on is basically some routines that read a PSF file and all the CHARMM-formatted par files you give it and assigns the parameters to the molecule. I have the CHARMM program here but what I'm working on is fairly generic, I want to output these "PMOD" statement to import the molecules with the MMC code (Mezei's lab), add the potentials to my System for OpenMM to use pure OpenMM, and also play around with the molecules in C++ by putting potentials on grids and then having some grid potential regions and also regions of the molecules where I have the real molecule and do dihedral MC sampling.

So the code is almost done and it's basically a generic translator for PSF files and CHARMM "par"/"prm" files. It checks that all the bonds/angles/dihedrals are assigned (at least one dihedral potential per dihedral/improper) and it turns the "R_min" values into "sigma".

Might this be useful for other people who want to use CHARMM with OpenMM outside of CHARMM? I love the program CHARMM but it's not F/OSS and I'm not a CHARMM developer, but I use the program extensively and also want to provide CHARMM FF functionality to other programs. MMC has older par22 values and so I am working on putting my par36 parameters and SwissParam and CGENFF parameters into the methods there and into my own source code and using OpenMM routines when helpful.

Thanks,
Luke

User avatar
luke czapla
Posts: 36
Joined: Sat Feb 01, 2014 5:14 pm

Re: CHARMM?

Post by luke czapla » Sun Feb 16, 2014 4:29 pm

Basically done except for CMAP. My implementation is just based on Monte Carlo sampling but I'm loading the data into OpenMM and MMC and will write the XML too. Which source example should I be looking at?

So this thing just reads the PSF file and then reads all the par files you give it and does the check at the end to make sure everything is legit and you've got a full molecule with bonds/angles/etc. You would have to excuse my coding style though, it uses C routines a lot (printf, strcmp, etc.) but C++ new and delete and class structures.. I'll keep working on it though, it does the job for parsing the "prm" format and psf file.

Regarding the rtf, it's something CHARMM already handles. This thing here is more for just parsing the CHARMM FF job data since you have the pdb file already typically for the input coordinates.

Thanks,
Luke

User avatar
luke czapla
Posts: 36
Joined: Sat Feb 01, 2014 5:14 pm

Re: CHARMM?

Post by luke czapla » Mon Feb 17, 2014 2:16 pm

Here's an update on the problem with specific details (I went through examples and found something similar to what I had in mind),

So what I am looking for is something like these examples like HelloEthane and HelloWaterBox.cpp and these statements like: bondBend.addAngle(h1Index, oIndex, h2Index,
HOH_nominalAngleInDeg * OpenMM::RadiansPerDegree,
HOH_stiffnessInKcalPerRad2 * 2 * OpenMM::KJPerKcal);

I have CMAP phi/psi terms and bonds (harmonic), angles (harmonic + UB), dihedrals (Ryckaert Belleman and improper "psi" terms), but these are complex molecules that I loaded from the XPLOR PSF and CHARMM PRM files.

I am storing everything in a "charmmmolecule" class so that I can create my simulation with OpenMM and write out other formats like XML and some other programs to do MC sampling with grids. It just reads XPLOR PSF data (there are groups and donors/acceptors too, not sure which part of OpenMM specifies these) and then it gets everything it needs from the PRM files you give it (I am using par_all36_prot.prm from CHARMM36 along with a par_water_ions.prm file for TIP3P and ions for my tests).

I can post the source code if it helps (it's just a derived class with all the CHARMM data in it with "loadmoleculePSF" and "loadmoleculePRM" functions and a base "loadmoleculePDB" with all the data for either CHARMM or AMBER), I am just interested finding in a complex example of loading molecules systematically in OpenMM C++, so that I can compute the energies and make sure it is working properly vs. the values reported in CHARMM.

Thanks!

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

Re: CHARMM?

Post by Peter Eastman » Tue Feb 18, 2014 11:23 am

Hi Luke,

I don't have an example that's exactly what you want. The API docs for CMAPTorsionForce should hopefully be clear enough to show exactly what you need to do, and feel free to ask questions about anything that isn't clear. And if you don't mind examples that are in Python instead of C++, take a look at gromacsgrofile.py and forcefield.py. Both of those can create CMAPTorsionForces.

Peter

User avatar
Luke Czapla
Posts: 2
Joined: Fri Feb 24, 2012 11:51 am

Re: CHARMM?

Post by Luke Czapla » Tue Feb 18, 2014 1:53 pm

Thanks Peter,

I'll take a look through the Python because I'd like to see if I can do the XML formatting from the data sets loaded into my code. I didn't really see any C++ example files for loading generic sets with AMBER or GROMACS either so I'll just put it together from the manuals. It would be nice if my code could use the OpenMM C++ interface because I play around with the MC to set it up (I take the frames from MD and aMD and then construct things with MC sampling) and what I make usually ends up getting simulated with MD at the end... seems if OpenMM does it all I'd rather just use that.

Luke

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

Re: CHARMM?

Post by Peter Eastman » Tue Feb 18, 2014 2:48 pm

The AMBER and Gromacs readers are written in Python, so they aren't accessible from C++. But for your own reader, you can do whatever you want. The API for constructing a System is identical in both languages.

Peter

User avatar
luke czapla
Posts: 36
Joined: Sat Feb 01, 2014 5:14 pm

Re: CHARMM?

Post by luke czapla » Tue Feb 18, 2014 4:09 pm

Perfect, so I will just work on adding a function "System *GetSystem()" to my Charmmmolecule class to return a pointer with the generated OpenMM System and put in some addition operators for Charmmmolecule class to add two systems loaded from separate PSF files into my data structures before calling the GetSystem(). I'll give it a shot and post it after I debug and add some more error checking (presumably people might try to load misformatted PSF and PRM files). Is there a developers forum?

POST REPLY