Share 
Follow 
AboutDownloadsDocumentsForumsWikiIssuesNews
Date:
2013-06-13 17:36
Priority:
3
State:
Open
Submitted by:
Lee-Ping Wang (leeping)
Assigned to:
Nobody (None)
Summary:
system.updateParametersInContext() method.

Detailed description
The proposed feature would be a method in the System class to update the corresponding parameters in an OpenMM Context. Hopefully, it would be called like this:

pdb = PDBFile('molecule.pdb')
forcefield = ForceField('ff.xml')
system = forcefield.createSystem(pdb.topology)
integrator = VerletIntegrator(0.001*picosecond)
simulation = Simulation(pdb.topology, system, integrator)

forcefield2 = ForceField('ff2.xml')
system2 = forcefield2.createSystem(pdb.topology)

# This line
system2.updateParametersInContext(simulation.context)

Alternatively, it could be called like this (even though it's less convenient):

# I had to write function to copy the parameters from system2 to simulation.system; currently required for the force.updateParametersInContext() methods.
CopySystemParameters(system2, simulation.system)
simulation.system.updateParametersInContext(simulation.context)

In this example, ff2.xml and ff.xml only differ in the force field parameters. Thus, system and system2 are expected to differ in the following ways:

1) Floating point parameters for every Force, such as atomic charges and bond lengths.
2) Virtual site weights.
3) Atomic masses (though not very important for my research).

system and system2 are not expected to differ in the following ways:
4) Numbers of Forces, types of Forces, or the Forces being in a different order
5) Numbers of particles

However, there are some other potential use cases for other people, which I cannot really comment on:
6) The atom indices that particlular interactions depend on.
7) Periodic box vectors (I usually don't set these from the System, but it is conceivable).

For the purposes of force field optimization, only items (1) and (2) are sufficient. I would be happy with a updateParametersInContext() method that carried out just these two things and nothing else.

Add A Comment: Notepad

No Comments Have Been Posted

No Changes Have Been Made to This Item

Feedback