Modeller with CHARMM with OpenMM 6.1

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
RJ Nowling
Posts: 4
Joined: Tue Sep 14, 2010 11:17 am

Modeller with CHARMM with OpenMM 6.1

Post by RJ Nowling » Thu Jun 11, 2015 9:27 am

Hi,

I'm trying to use the Modeller class to add explicit waters to a protein. I have PDB and PSF files for the protein and topology and parameter files for CHARMM. The addSolvent() method seems inconsistent as to what topology and forcefield should be but I could just be confused.

Code: Select all

psf = CharmmPsfFile(...)
pdb = PDBFile(...)
params = CharmmParameterSet(...)
This works:

Code: Select all

system = psf.createSystem(params, nonbondedCutoff=CutoffNonPeriodic)
This does not:

Code: Select all

modeller = Modeller(params, pdb.positions)
modeller.addSolvent(psf, boxSize=[5.0, 5.0, 5.0])

  File "prepare-water-box.py", line 31, in create_system
    modeller.addSolvent(psf, boxSize=[5.0, 5.0, 5.0])
  File "/usr/lib64/python2.7/site-packages/simtk/openmm/app/modeller.py", line 337, in addSolvent
    for chain in self.topology.chains():
AttributeError: 'CharmmParameterSet' object has no attribute 'chains'
When looking at the source for addSolvent(), I choose params for the topology and psf as the forcefield parameters based on this line in Modeller.addSolvent():

Code: Select all

system = forcefield.createSystem(self.topology)
Where am I going wrong? Thanks!

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

Re: Modeller with CHARMM with OpenMM 6.1

Post by Peter Eastman » Thu Jun 11, 2015 10:10 am

Hi RJ,

The first argument to Modeller is a Topology, not a CharmmParameterSet. I think you want to be calling

Code: Select all

modeller = Modeller(pdb.topology, pdb.positions)
Peter

User avatar
RJ Nowling
Posts: 4
Joined: Tue Sep 14, 2010 11:17 am

Re: Modeller with CHARMM with OpenMM 6.1

Post by RJ Nowling » Thu Jun 11, 2015 10:31 am

Hi Peter,

Thanks for the quick response!

Using pdb.topology, I get the following error:

Code: Select all

  File "prepare-water-box.py", line 31, in create_system
    modeller.addSolvent(psf, boxSize=[5.0, 5.0, 5.0])
  File "/usr/lib64/python2.7/site-packages/simtk/openmm/app/modeller.py", line 317, in addSolvent
    system = forcefield.createSystem(self.topology)
  File "/usr/lib64/python2.7/site-packages/simtk/openmm/app/charmmpsffile.py", line 953, in createSystem
    self.loadParameters(params.condense())
AttributeError: 'Topology' object has no attribute 'condense'
I get the same result if I pass psf.topology.

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

Re: Modeller with CHARMM with OpenMM 6.1

Post by Peter Eastman » Thu Jun 11, 2015 11:13 am

Same problem: you're passing the wrong type of object for an argument. The first argument to addSolvent() is a ForceField, not a CharmmPsfFile. See the API documentation at http://docs.openmm.org/6.2.0/api-python ... d890179435.

Peter

User avatar
RJ Nowling
Posts: 4
Joined: Tue Sep 14, 2010 11:17 am

Re: Modeller with CHARMM with OpenMM 6.1

Post by RJ Nowling » Thu Jun 11, 2015 5:51 pm

Thanks, Peter. I had been confusing the CharmmPsfFile with a Forcefield.

What I'm trying to do, in a nut shell, is read a protein structure, add water, and simulate using the CHARMM 22 forcefield.

OpenMM supports building a system and simulation from CHARMM files -- but I don't see a provided CHARMM .xml file. Is there an easy way to create a Forcefield object from a CharmmPsfFile? E.g., it would be nice if CharmmPsfFile had a .forcfield property :)

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

Re: Modeller with CHARMM with OpenMM 6.1

Post by Peter Eastman » Fri Jun 12, 2015 10:10 am

Unfortunately, we don't currently have any CHARMM force fields (except the polarizable one, which I assume isn't what you want). So you'll need to do all your modelling with the CHARMM tools, then construct your final system directly from the psf file.

User avatar
RJ Nowling
Posts: 4
Joined: Tue Sep 14, 2010 11:17 am

Re: Modeller with CHARMM with OpenMM 6.1

Post by RJ Nowling » Wed Jun 17, 2015 6:18 am

Thanks, Peter! Your help was invaluable as always. :)

POST REPLY