Page 1 of 1

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

Posted: Sat Apr 09, 2016 6:42 pm
by negelis
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

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

Posted: Sat Apr 09, 2016 7:01 pm
by jswails1
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.

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

Posted: Sat Apr 09, 2016 7:21 pm
by peastman
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

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

Posted: Sat Apr 09, 2016 8:11 pm
by negelis
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