Is there a C++ API for read CHARMM force field and psf file?

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Xinqiang Ding
Posts: 33
Joined: Tue May 05, 2015 2:27 pm

Is there a C++ API for read CHARMM force field and psf file?

Post by Xinqiang Ding » Sat Apr 09, 2016 6:42 pm

Hi,

I'm wondering if OpenMM has C++ public API for reading CHARMM force field and PSF file to set up the system in OpenMM, like the Python API functions CharmmPsfFile() and CharmmParameterSet(). I looked in the C++ API documentation and didn't find it.

I want to use OpenMM simulation in my C++ application with CHARMM force field. If there aren't such C++ APIs, do I have to write them myself or is there other way to do it? Any help is greatly appreciated.

Thanks,
Xinqiang

User avatar
Jason Swails
Posts: 47
Joined: Mon Jan 07, 2013 5:11 pm

Re: Is there a C++ API for read CHARMM force field and psf f

Post by Jason Swails » Sat Apr 09, 2016 7:01 pm

No, there is no C++ API for working with force field files. It basically just has the library for actually running molecular mechanical calculations -- nothing for setup or analysis (for instance, there is no trajectory writer, either!).

If you want to work with CHARMM files, you will need to write your own C++ classes to deal with it. If you are OK using Amber files, you can use the C++ code I've written as well: https://github.com/swails/omm_cphmd

It doesn't do CpHMD like I had intended, but it does have the basic app-layer classes in C++ for dealing with Amber files.

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

Re: Is there a C++ API for read CHARMM force field and psf f

Post by Peter Eastman » Sat Apr 09, 2016 7:21 pm

Something you can do, though, is to use the Python API for reading the CHARMM files, then save the System it creates to an XML file with XMLSerializer. You can then load that file into your C++ program and simulate it there.

Peter

User avatar
Xinqiang Ding
Posts: 33
Joined: Tue May 05, 2015 2:27 pm

Re: Is there a C++ API for read CHARMM force field and psf f

Post by Xinqiang Ding » Sat Apr 09, 2016 8:11 pm

Thanks for your response, Jason and Peter. It's very helpful. I guess I will first try to use the XMLSerializer, which sounds easier, to test my application. I can probably write a C++ function to do this at the end if it is necessary.

Xinqiang

POST REPLY