SimTk/openmm — pull request #171 by swails (2013-10-16 03:52:50+00:00)
Title: Take 1-4 nonbonded scaling parameters from the amber topology file

To accommodate mixing force fields with different 1-4 scaling parameters (notably GLYCAM carbohydrate parameters that use scaling factors of 1 for both SCEE and SCNB with Amber force fields that use 1.2 and 2.0, respectively), 1-4 scaling parameters for SCEE and SCNB were introduced into the topology file ca. 2009 or 2010 to allow torsion-specific scaling factors.

All Amber topology files that are written from tleap as of May, 2011 contain the SCEE_SCALE_FACTOR and SCNB_SCALE_FACTOR sections in the topology file.

This commit uses the scaling factors found in the topology file (permitting variable 1-4 scaling) rather than relying on a single scaling factor applied to all 1-4 nonbonded interactions. The code changes were simple and I checked the results against an alternative (Python) Amber topology file class included with the Amber source code that I modified to generate an OpenMM System and Topology.

As a side-note, a user would have to jump through hoops (i.e., call readAmberSystem directly from openmm.app.internal.amber_file_parser) in order to specify scee != 1.2 and scnb != 2.0. As a result, correctly simulating a GLYCAM-based molecule using the classes provided in the application layer was non-obvious and simulating a protein-carbohydrate complex was impossible. Both are now handled correctly by default after this commit.

Code cleanups: This commit also fixes a code block that was indented with 5 spaces and reduces the indentation to 4 spaces. I believe this inconsistency is a SyntaxError in Python 3... The 'copy' module was imported but never used, so I removed the import.