Example #1
0
 def setup_class(cls):
     """
     setup any state specific to the execution of the given class (which usually contains tests).
     """
     super(TestAmber99SB, cls).setup_class()
     tinkerpath = which('testgrad')
     # try to find mdrun_d or gmx_d
     # gmx should be built with config -DGMX_DOUBLE=ON
     gmxpath = which('mdrun_d') or which('gmx_d')
     gmxsuffix = '_d'
     # Tests will FAIL if use single precision gromacs
     # gmxpath = which('mdrun') or which('gmx')
     # gmxsuffix = ''
     # self.logger.debug("\nBuilding options for target...\n")
     cls.cwd = os.path.dirname(os.path.realpath(__file__))
     os.chdir(os.path.join(cls.cwd, "files", "amber_alaglu"))
     cls.tmpfolder = os.path.join(cls.cwd, "files", "amber_alaglu", "temp")
     if not os.path.exists(cls.tmpfolder):
         os.makedirs(cls.tmpfolder)
     os.chdir(cls.tmpfolder)
     for i in [
             "topol.top", "shot.mdp", "a99sb.xml", "a99sb.prm", "all.gro",
             "all.arc", "AceGluNme.itp", "AceAlaNme.itp", "a99sb.itp"
     ]:
         os.system("ln -fs ../%s" % i)
     cls.engines = OrderedDict()
     # Set up GMX engine
     if gmxpath != '':
         cls.engines['GMX'] = GMX(coords="all.gro",
                                  gmx_top="topol.top",
                                  gmx_mdp="shot.mdp",
                                  gmxpath=gmxpath,
                                  gmxsuffix=gmxsuffix)
     else:
         logger.warn("GROMACS cannot be found, skipping GMX tests.")
     # Set up TINKER engine
     if tinkerpath != '':
         cls.engines['TINKER'] = TINKER(coords="all.arc",
                                        tinker_key="alaglu.key",
                                        tinkerpath=tinkerpath)
     else:
         logger.warn("TINKER cannot be found, skipping TINKER tests.")
     # Set up OpenMM engine
     try:
         try:
             import openmm
         except ImportError:
             import simtk.openmm
         cls.engines['OpenMM'] = OpenMM(coords="all.gro",
                                        pdb="conf.pdb",
                                        ffxml="a99sb.xml",
                                        platname="Reference",
                                        precision="double")
     except:
         logger.warn("OpenMM cannot be imported, skipping OpenMM tests.")
Example #2
0
 def setUp(self):
     tinkerpath = which('testgrad')
     gmxsuffix = '_d'
     gmxpath = which('mdrun' + gmxsuffix)
     self.logger.debug("\nBuilding options for target...\n")
     self.cwd = os.getcwd()
     os.chdir(os.path.join(os.getcwd(), "test", "files", "amber_alaglu"))
     if not os.path.exists("temp"): os.makedirs("temp")
     os.chdir("temp")
     for i in [
             "topol.top", "shot.mdp", "a99sb.xml", "a99sb.prm", "all.gro",
             "all.arc", "AceGluNme.itp", "AceAlaNme.itp", "a99sb.itp"
     ]:
         os.system("ln -fs ../%s" % i)
     self.engines = OrderedDict()
     # Set up GMX engine
     if gmxpath != '':
         self.engines['GMX'] = GMX(coords="all.gro",
                                   gmx_top="topol.top",
                                   gmx_mdp="shot.mdp",
                                   gmxpath=gmxpath,
                                   gmxsuffix=gmxsuffix)
     else:
         logger.warn("GROMACS cannot be found, skipping GMX tests.")
     # Set up TINKER engine
     if tinkerpath != '':
         self.engines['TINKER'] = TINKER(coords="all.arc",
                                         tinker_key="alaglu.key",
                                         tinkerpath=tinkerpath)
     else:
         logger.warn("TINKER cannot be found, skipping TINKER tests.")
     # Set up OpenMM engine
     openmm = False
     try:
         import simtk.openmm
         openmm = True
     except:
         logger.warn("OpenMM cannot be imported, skipping OpenMM tests.")
     if openmm:
         self.engines['OpenMM'] = OpenMM(coords="all.gro",
                                         pdb="conf.pdb",
                                         ffxml="a99sb.xml",
                                         platname="Reference",
                                         precision="double")
     self.addCleanup(os.system, 'cd .. ; rm -rf temp')
Example #3
0
 def setup_class(cls):
     super(TestAmoebaWater6, cls).setup_class()
     #self.logger.debug("\nBuilding options for target...\n")
     cls.cwd = os.path.dirname(os.path.realpath(__file__))
     os.chdir(os.path.join(cls.cwd, "files", "amoeba_h2o6"))
     cls.tmpfolder = os.path.join(cls.cwd, "files", "amoeba_h2o6", "temp")
     if not os.path.exists(cls.tmpfolder):
         os.makedirs(cls.tmpfolder)
     os.chdir(cls.tmpfolder)
     os.system("ln -s ../prism.pdb")
     os.system("ln -s ../prism.key")
     os.system("ln -s ../hex.arc")
     os.system("ln -s ../water.prm")
     os.system("ln -s ../amoebawater.xml")
     cls.O = OpenMM(coords="hex.arc", pdb="prism.pdb", ffxml="amoebawater.xml", precision="double", \
                         mmopts={'rigidWater':False, 'mutualInducedTargetEpsilon':1e-6})
     tinkerpath = which('testgrad')
     if tinkerpath:
         cls.T = TINKER(coords="hex.arc", tinker_key="prism.key", tinkerpath=tinkerpath)
Example #4
0
 def setUp(self):
     self.logger.debug("\nBuilding options for target...\n")
     self.cwd = os.getcwd()
     os.chdir(os.path.join(os.getcwd(), "test", "files", "amoeba_h2o6"))
     if not os.path.exists("temp"): os.makedirs("temp")
     os.chdir("temp")
     os.system("ln -s ../prism.pdb")
     os.system("ln -s ../prism.key")
     os.system("ln -s ../hex.arc")
     os.system("ln -s ../water.prm")
     os.system("ln -s ../amoebawater.xml")
     self.O = OpenMM(coords="hex.arc", pdb="prism.pdb", ffxml="amoebawater.xml", precision="double", \
                         mmopts={'rigidWater':False, 'mutualInducedTargetEpsilon':1e-6})
     tinkerpath = which('testgrad')
     if (which('testgrad') != ''):
         self.T = TINKER(coords="hex.arc",
                         tinker_key="prism.key",
                         tinkerpath=tinkerpath)
     os.chdir("..")
     self.addCleanup(os.system, 'rm -rf temp')