CHARMM?
- luke czapla
- Posts: 36
- Joined: Sat Feb 01, 2014 5:14 pm
CHARMM?
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).
- Charles Brooks
- Posts: 35
- Joined: Fri Feb 24, 2012 11:48 am
Re: CHARMM?
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
Cheers,
Charles Brooks
- Peter Eastman
- Posts: 2583
- Joined: Thu Aug 09, 2007 1:25 pm
Re: CHARMM?
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
Peter
- luke czapla
- Posts: 36
- Joined: Sat Feb 01, 2014 5:14 pm
Re: CHARMM?
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
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
- luke czapla
- Posts: 36
- Joined: Sat Feb 01, 2014 5:14 pm
Re: CHARMM?
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
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
- luke czapla
- Posts: 36
- Joined: Sat Feb 01, 2014 5:14 pm
Re: CHARMM?
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!
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!
- Peter Eastman
- Posts: 2583
- Joined: Thu Aug 09, 2007 1:25 pm
Re: CHARMM?
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
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
- Luke Czapla
- Posts: 2
- Joined: Fri Feb 24, 2012 11:51 am
Re: CHARMM?
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
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
- Peter Eastman
- Posts: 2583
- Joined: Thu Aug 09, 2007 1:25 pm
Re: CHARMM?
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
Peter
- luke czapla
- Posts: 36
- Joined: Sat Feb 01, 2014 5:14 pm
Re: CHARMM?
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?