Example #1
0
 def test_atomtyping(self, mol_name, testfiles_dir=TRAPPE_TESTFILES_DIR):
     files = glob.glob(os.path.join(testfiles_dir, mol_name, '*'))
     for mol_file in files:
         _, ext = os.path.splitext(mol_file)
         mol2_path = os.path.join(testfiles_dir, mol_name, mol_file)
         structure = pmd.load_file(mol2_path, structure=True)
     atomtype(structure, TRAPPE_UA, non_atomistic=True)
Example #2
0
 def test_atomtyping(self, mol_name, testfiles_dir=TRAPPE_TESTFILES_DIR):
     files = glob.glob(os.path.join(testfiles_dir, mol_name, '*'))
     for mol_file in files:
         _, ext = os.path.splitext(mol_file)
         mol2_path = os.path.join(testfiles_dir, mol_name, mol_file)
         structure = pmd.load_file(mol2_path, structure=True)
     atomtype(structure, TRAPPE_UA, non_atomistic=True)
Example #3
0
 def test_atomtyping(self, mol_name, testfiles_dir=OPLS_TESTFILES_DIR):
     files = glob.glob(os.path.join(testfiles_dir, mol_name, '*'))
     for mol_file in files:
         _, ext = os.path.splitext(mol_file)
         if ext == '.top':
             top_filename = '{}.top'.format(mol_name)
             gro_filename = '{}.gro'.format(mol_name)
             top_path = os.path.join(testfiles_dir, mol_name, top_filename)
             gro_path = os.path.join(testfiles_dir, mol_name, gro_filename)
             structure = pmd.load_file(top_path, xyz=gro_path, parametrize=False)
         elif ext == '.mol2':
             mol2_path = os.path.join(testfiles_dir, mol_name, mol_file)
             structure = pmd.load_file(mol2_path, structure=True)
     atomtype(structure, OPLSAA)
Example #4
0
 def test_atomtyping(self, mol_name, testfiles_dir=OPLS_TESTFILES_DIR):
     files = glob.glob(os.path.join(testfiles_dir, mol_name, '*'))
     for mol_file in files:
         _, ext = os.path.splitext(mol_file)
         if ext == '.top':
             top_filename = '{}.top'.format(mol_name)
             gro_filename = '{}.gro'.format(mol_name)
             top_path = os.path.join(testfiles_dir, mol_name, top_filename)
             gro_path = os.path.join(testfiles_dir, mol_name, gro_filename)
             structure = pmd.load_file(top_path, xyz=gro_path, parametrize=False)
         elif ext == '.mol2':
             mol2_path = os.path.join(testfiles_dir, mol_name, mol_file)
             structure = pmd.load_file(mol2_path, structure=True)
     atomtype(structure, OPLSAA)
Example #5
0
 def test_atomtyping(self,
                     mol_name,
                     oplsaa,
                     testfiles_dir=OPLS_TESTFILES_DIR):
     files = glob.glob(os.path.join(testfiles_dir, mol_name, "*"))
     for mol_file in files:
         _, ext = os.path.splitext(mol_file)
         if ext == ".top":
             top_filename = "{}.top".format(mol_name)
             gro_filename = "{}.gro".format(mol_name)
             top_path = os.path.join(testfiles_dir, mol_name, top_filename)
             gro_path = os.path.join(testfiles_dir, mol_name, gro_filename)
             structure = pmd.load_file(top_path,
                                       xyz=gro_path,
                                       parametrize=False)
         elif ext == ".mol2":
             mol2_path = os.path.join(testfiles_dir, mol_name, mol_file)
             structure = pmd.load_file(mol2_path, structure=True)
     atomtype(structure, oplsaa)
def test_atomtyping(mol2_file):
    structure = pmd.load_file(mol2_file, structure=True)
    atomtype(structure, FORCEFIELD)
from glob import glob

import parmed as pmd
import pytest

from foyer import Forcefield
from foyer.tests.utils import atomtype

MOL2_FILES = glob('test_molecules/*.mol2')
FORCEFIELD_FILES = 'forcefield.xml'

FORCEFIELD = Forcefield(forcefield_files=FORCEFIELD_FILES)


@pytest.mark.parametrize('mol2_file', MOL2_FILES)
def test_atomtyping(mol2_file):
    structure = pmd.load_file(mol2_file, structure=True)
    atomtype(structure, FORCEFIELD)


if __name__ == "__main__":
    structure = pmd.load_file(mol2_file, structure=True)
    atomtype(structure, FORCEFIELD)