rmcgibbo / openmm-cmd

OpenMM Command Line Application
7 stars 3 forks source link

Specifying forcefield and water is intuitive but not sufficiently flexible. #3

Closed leeping closed 11 years ago

leeping commented 11 years ago

Hi Robert,

Force field XML files are pretty flexible; in principle the user can specify more than two of them (although in the most common use case, the user just specifies the protein force field and water.)

For example, if I had protein, lipid, and water in three XML files, then I could do ForceField('protein.xml', 'lipid.xml', 'water.xml'), and it would work as long as the atom type definitions do not overlap.

The same might go for a simulation with a ligand, for instance I might need four XML files for Steve R's simulation. If I don't have any protein in my system, I should have the ability to set the protein force field to None.

Since the number of force field XML files can vary from zero to 2 or greater, how can we allow the user to input this on the command line? Perhaps something like:

openmm --forcefield_xml=lipid.xml --forcefield_xml=ligand.xml

Or:

openmm --forcefield_xml=lipid.xml,ligand.xml

Or:

openmm --forcefield_xml=[lipid.xml,ligand.xml]

The third case is probably the most canonical, but it's awkward when there's only one; also, I wish the "List" construct allowed the user to have spaces inside the list. My script used Python's built in "literal eval" on the configuration file which allowed it to disregard spaces.

Finally, for the protein force field and water models, we can either force the user to choose one (i.e. error out if the selection is not provided), or default to amber99sb-ildn and tip3p as you have done. Personally, I am in favor of making the user choose, because the user should know the consequences of making that choice, plus having a default is something like an implicit endorsement - and that force field is from DE Shaw.. >:)