From 2db0b3f1a0d4cb99a6dfbbe4bf2e3aab7efa02c1 Mon Sep 17 00:00:00 2001 From: Bas Rustenburg Date: Wed, 3 Apr 2019 16:07:08 -0400 Subject: [PATCH] Compatibility changes in ligands.py module Adds compatibility changes based on comments for the tautomer addition to protons in commit 008b3a334c7f3164083d0c54eb1ddf2c3efb6bed. --- protons/app/ligands.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/protons/app/ligands.py b/protons/app/ligands.py index b18c2a0..4aed42a 100644 --- a/protons/app/ligands.py +++ b/protons/app/ligands.py @@ -2048,7 +2048,7 @@ def prepare_calibration_systems( output_basename: str, ffxml: str = None, hxml: str = None, - delete_old_H: bool = True, + delete_old_H: bool = False, minimize: bool = True, box_size: app.modeller.Vec3 = None, ): @@ -2076,11 +2076,8 @@ def prepare_calibration_systems( app.Modeller.loadHydrogenDefinitions(hxml) if ffxml is not None: forcefield = app.ForceField( - "amber10.xml", "gaff.xml", ffxml, "tip3p.xml", "ions_tip3p.xml" + "amber10-constph.xml", "gaff.xml", ffxml, "tip3p.xml", "ions_tip3p.xml" ) - # forcefield = app.ForceField( - # "amber10-constph.xml", "gaff.xml", ffxml, "tip3p.xml", "ions_tip3p.xml" - # ) else: forcefield = app.ForceField( "amber10-constph.xml", "gaff.xml", "tip3p.xml", "ions_tip3p.xml" @@ -2099,11 +2096,11 @@ def prepare_calibration_systems( # The system will likely have different hydrogen names. # In this case its easiest to just delete and re-add with the right names based on hydrogen files - # if delete_old_H: - # to_delete = [ - # atom for atom in modeller.topology.atoms() if atom.element.symbol in ["H"] - # ] - # modeller.delete(to_delete) + if delete_old_H: + to_delete = [ + atom for atom in modeller.topology.atoms() if atom.element.symbol in ["H"] + ] + modeller.delete(to_delete) modeller.addHydrogens(forcefield=forcefield)