diff --git a/unittests/Tools/test_lj_cor.py b/unittests/Tools/test_lj_cor.py new file mode 100644 index 0000000..bf3944c --- /dev/null +++ b/unittests/Tools/test_lj_cor.py @@ -0,0 +1,37 @@ +#################################################################################################### +# # +# Sire script to test that LJ correction works correctly # +# # +#################################################################################################### + + +try: + import sire + sire.use_old_api() +except ImportError: + pass + +from Sire.Tools import LJcutoff +from Sire.Tools import readParams +from Sire.Units import * + +from nose.tools import assert_almost_equal + +params = {} +params = readParams("../io/lj_cor/sim.cfg") + +def test_lj_cor(verbose=False): + """Check that LJ correction gives expected dG and SD""" + + dg, _ = LJcutoff.runLambda(params) # Ignore SD as this will be 0 for single frame + + if verbose: + print("#######################################") + print("Testing LJ Correction...") + print(f"LJ correction deltaG = {dg}") + print("#######################################") + + assert_almost_equal(dg.value(), -428.6141143872228) + +if __name__ == '__main__': + test_lj_cor(True) \ No newline at end of file diff --git a/unittests/io/lj_cor/MORPH.vanish.pert b/unittests/io/lj_cor/MORPH.vanish.pert new file mode 100644 index 0000000..4df9974 --- /dev/null +++ b/unittests/io/lj_cor/MORPH.vanish.pert @@ -0,0 +1,309 @@ +version 1 + molecule LIG + atom + name CAB + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAC + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAD + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAE + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAF + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAG + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAH + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAI + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAJ + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAK + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAL + initial_type cc + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAP + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAQ + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAR + initial_type cd + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAS + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAT + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name CAU + initial_type ca + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.31521 0.09880 + final_LJ 0.00000 0.00000 + endatom + atom + name NAM + initial_type nd + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.38417 0.09410 + final_LJ 0.00000 0.00000 + endatom + atom + name NAN + initial_type nc + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.38417 0.09410 + final_LJ 0.00000 0.00000 + endatom + atom + name NAO + initial_type nb + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.38417 0.09410 + final_LJ 0.00000 0.00000 + endatom + atom + name NAV + initial_type na + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.20581 0.20420 + final_LJ 0.00000 0.00000 + endatom + atom + name OAA + initial_type oh + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 3.24287 0.09300 + final_LJ 0.00000 0.00000 + endatom + atom + name H01 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H02 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H03 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H04 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H05 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H06 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H07 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H08 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H09 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H10 + initial_type ha + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.62548 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H11 + initial_type h4 + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 2.53639 0.01610 + final_LJ 0.00000 0.00000 + endatom + atom + name H12 + initial_type ho + final_type du + initial_charge 0.00000 + final_charge 0.00000 + initial_LJ 0.53792 0.00470 + final_LJ 0.00000 0.00000 + endatom +end molecule \ No newline at end of file diff --git a/unittests/io/lj_cor/sim.cfg b/unittests/io/lj_cor/sim.cfg new file mode 100644 index 0000000..d8aceb1 --- /dev/null +++ b/unittests/io/lj_cor/sim.cfg @@ -0,0 +1,27 @@ +morphfile = ../io/lj_cor/MORPH.vanish.pert +trajfile = ../io/lj_cor/traj.dcd +topfile = ../io/receptor_ligand_restraints/SYSTEM.top +crdfile = ../io/receptor_ligand_restraints/SYSTEM.crd +perturbed residue number = 1 +nmoves = 25000 +ncycles = 80 +buffered coordinates frequency = 5000 +save coordinates = True +timestep = 4 * femtosecond +constraint = allbonds +hydrogen mass repartitioning factor = 4.0 +cutoff type = cutoffperiodic +cutoff distance = 12*angstrom +barostat = True +andersen = True +energy frequency = 100 +precision = mixed +minimise = True +equilibrate = False +equilibration iterations = 5000 +center solute = True +reaction field dielectric = 78.3 +minimal coordinate saving = False +lambda array = 0.000, 0.025, 0.050, 0.075, 0.100, 0.125, 0.150, 0.175, 0.200, 0.225, 0.250, 0.275, 0.300, 0.325, 0.350, 0.375, 0.400, 0.425, 0.450, 0.475, 0.500, 0.525, 0.550, 0.575, 0.600, 0.625, 0.650, 0.675, 0.700, 0.725, 0.750, 0.800, 0.850, 0.900, 0.950, 1.000 +use boresch restraints = True +boresch restraints dictionary = {"anchor_points":{"r1":4946, "r2":4944, "r3":4949, "l1":11, "l2":2, "l3":3},"equilibrium_values":{"r0":5.92, "thetaA0":1.85, "thetaB0":1.59,"phiA0":-0.30, "phiB0":-1.55, "phiC0":2.90},"force_constants":{"kr":25.49, "kthetaA":66.74, "kthetaB":38.39, "kphiA":215.36, "kphiB":49.23, "kphiC":49.79}} diff --git a/unittests/io/lj_cor/traj.dcd b/unittests/io/lj_cor/traj.dcd new file mode 100644 index 0000000..6a2393e Binary files /dev/null and b/unittests/io/lj_cor/traj.dcd differ diff --git a/unittests/io/receptor_ligand_restraints/sim.cfg b/unittests/io/receptor_ligand_restraints/sim.cfg new file mode 100644 index 0000000..02f8880 --- /dev/null +++ b/unittests/io/receptor_ligand_restraints/sim.cfg @@ -0,0 +1,26 @@ +morphfile = ../io/lj_cor/MORPH.vanish.pert +topfile= ../io/receptor_ligand_restraints/SYSTEM.top +crdfile= ../io/receptor_ligand_restraints/SYSTEM.crd +perturbed residue number = 1 +nmoves = 25000 +ncycles = 80 +buffered coordinates frequency = 5000 +save coordinates = True +timestep = 4 * femtosecond +constraint = allbonds +hydrogen mass repartitioning factor = 4.0 +cutoff type = cutoffperiodic +cutoff distance = 12*angstrom +barostat = True +andersen = True +energy frequency = 100 +precision = mixed +minimise = True +equilibrate = False +equilibration iterations = 5000 +center solute = True +reaction field dielectric = 78.3 +minimal coordinate saving = False +lambda array = 0.000, 0.025, 0.050, 0.075, 0.100, 0.125, 0.150, 0.175, 0.200, 0.225, 0.250, 0.275, 0.300, 0.325, 0.350, 0.375, 0.400, 0.425, 0.450, 0.475, 0.500, 0.525, 0.550, 0.575, 0.600, 0.625, 0.650, 0.675, 0.700, 0.725, 0.750, 0.800, 0.850, 0.900, 0.950, 1.000 +use boresch restraints = True +boresch restraints dictionary = {"anchor_points":{"r1":4946, "r2":4944, "r3":4949, "l1":11, "l2":2, "l3":3},"equilibrium_values":{"r0":5.92, "thetaA0":1.85, "thetaB0":1.59,"phiA0":-0.30, "phiB0":-1.55, "phiC0":2.90},"force_constants":{"kr":25.49, "kthetaA":66.74, "kthetaB":38.39, "kphiA":215.36, "kphiB":49.23, "kphiC":49.79}}