From 3141ffdc3a5a1a61e51f46c531f7e62917e7b85d Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Fri, 17 Nov 2023 16:53:34 +0100 Subject: [PATCH 01/12] restructure grappa input generation --- run_kimmdy-grappa.py | 0 src/grappa_interface.py | 31 +++++++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 run_kimmdy-grappa.py diff --git a/run_kimmdy-grappa.py b/run_kimmdy-grappa.py new file mode 100644 index 0000000..e69de29 diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 3838e3e..18d912b 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -9,7 +9,7 @@ from kimmdy.plugins import Parameterizer from kimmdy.parsing import write_json -import grappa.ff +from grappa.data import Molecule import openmm.unit @@ -100,24 +100,23 @@ def clean_parameters(parameters: dict) -> dict: return parameters_clean -def generate_input(top: Topology) -> dict: +def generate_input(top: Topology) -> Molecule: at_map = top.ff.atomtypes - atoms = [ - [ - int(atom.nr), - atom.atom, - atom.residue, - int(atom.resnr), - [float(at_map[atom.type].sigma), float(at_map[atom.type].epsilon)], - int(at_map[atom.type].at_num), - ] - for atom in top.atoms.values() - ] - atoms.sort(key=lambda x: x[2]) + atom_info = {'nr':[],'atomic_number':[],'partial_charges':[],'sigma':[],'epsilon':[],'is_radical':[]} + for atom in top.atoms.values(): + atom_info['nr'].append(int(atom.nr)) + atom_info['atomic_number'].append(int(at_map[atom.type].at_num)) + atom_info['partial_charges'].append(float(atom.charge)) + atom_info['sigma'].append(float(at_map[atom.type].sigma)) + atom_info['epsilon'].append(float(at_map[atom.type].epsilon)) + atom_info['is_radical'].append(int(atom.is_radical)) + bonds = [(int(bond.ai), int(bond.aj)) for bond in top.bonds.values()] - radicals = [int(radical) for radical in top.radicals.keys()] + impropers = [(int(improper.ai), int(improper.aj),int(improper.ak),int(improper.al)) for improper in top.improper_dihedrals.values()] + + mol = Molecule(atom_info["nr"],) - return {"atoms": atoms, "bonds": bonds, "radicals": radicals} + return mol def apply_parameters(top: Topology, parameters: dict): From 9169c8d5756a511fda908329623f8f36b25d1c32 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Fri, 15 Dec 2023 16:33:30 +0100 Subject: [PATCH 02/12] wip --- .gitignore | 2 +- src/grappa_interface.py | 42 +- tests/in_alanine.json | 878 +++++++++++++++++++++++++++++++++++ tests/test_parameterizers.py | 32 +- 4 files changed, 926 insertions(+), 28 deletions(-) create mode 100644 tests/in_alanine.json diff --git a/.gitignore b/.gitignore index 20440a3..97d7fe1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,7 @@ example/**/pycallgraph.png # tutorials and example output files guide/kimmdy-tutorial - +amber* # excludes !tests/test_files/test_coordinates/pull.trr diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 18d912b..57219e0 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -10,6 +10,8 @@ from kimmdy.parsing import write_json from grappa.data import Molecule +from grappa.utils.loading_utils import load_model +from grappa.grappa import Grappa import openmm.unit @@ -100,7 +102,11 @@ def clean_parameters(parameters: dict) -> dict: return parameters_clean -def generate_input(top: Topology) -> Molecule: +def move_residual_charge_to_radical(partial_charges:list[float],radical_idx:int, total_charge:float): + partial_charges[radical_idx] += total_charge - sum(partial_charges) + return partial_charges + +def build_molecule(top: Topology) -> Molecule: at_map = top.ff.atomtypes atom_info = {'nr':[],'atomic_number':[],'partial_charges':[],'sigma':[],'epsilon':[],'is_radical':[]} for atom in top.atoms.values(): @@ -114,8 +120,7 @@ def generate_input(top: Topology) -> Molecule: bonds = [(int(bond.ai), int(bond.aj)) for bond in top.bonds.values()] impropers = [(int(improper.ai), int(improper.aj),int(improper.ak),int(improper.al)) for improper in top.improper_dihedrals.values()] - mol = Molecule(atom_info["nr"],) - + mol = Molecule(atoms=atom_info["nr"],bonds=bonds,impropers=impropers,atomic_numbers=atom_info["atomic_number"],partial_charges=atom_info["partial_charges"],additional_features={k:np.asarray(v) for k,v in atom_info.items() if k not in ['nr','atomic_number','partial_charges']}) return mol @@ -215,16 +220,23 @@ def parameterize_topology( self, current_topology: Topology, focus_nr: list[str] = [] ) -> Topology: ## get atoms, bonds, radicals in required format - input_dict = generate_input(current_topology) - write_json(input_dict, "in.json") - - ff = grappa.ff.ForceField.from_tag("radical_latest") - ff.units["angle"] = openmm.unit.degree - # gromacs angle force constant are already in kJ/mol/rad-2] - parameters = ff.params_from_topology_dict(input_dict) - write_json(parameters, "out_raw.json") - parameters = clean_parameters(parameters) - write_json(parameters, "out_clean.json") - - apply_parameters(current_topology, parameters) + mol = build_molecule(current_topology) + mol.to_json("in.json") + + # load model, tag will be changed to be more permanent + model_tag = 'https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth' + model = load_model(model_tag) + + # initialize class that handles ML part + grappa = Grappa(model,device='cpu') + parameters = grappa.predict(mol) + + parameters_dict = parameters.to_dict() + write_json(parameters_dict, "out_raw.json") + + + # parameters = clean_parameters(parameters) + + + # apply_parameters(current_topology, parameters) return current_topology diff --git a/tests/in_alanine.json b/tests/in_alanine.json new file mode 100644 index 0000000..6986fc8 --- /dev/null +++ b/tests/in_alanine.json @@ -0,0 +1,878 @@ +{ + "atoms": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "bonds": [ + [ + 1, + 2 + ], + [ + 1, + 3 + ], + [ + 1, + 4 + ], + [ + 1, + 5 + ], + [ + 5, + 6 + ], + [ + 5, + 7 + ], + [ + 7, + 8 + ], + [ + 7, + 9 + ], + [ + 9, + 10 + ], + [ + 9, + 14 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 14, + 15 + ], + [ + 14, + 16 + ], + [ + 16, + 17 + ], + [ + 16, + 18 + ], + [ + 18, + 19 + ], + [ + 18, + 20 + ], + [ + 18, + 21 + ] + ], + "angles": [ + [ + 1, + 5, + 6 + ], + [ + 1, + 5, + 7 + ], + [ + 2, + 1, + 3 + ], + [ + 2, + 1, + 4 + ], + [ + 2, + 1, + 5 + ], + [ + 3, + 1, + 4 + ], + [ + 3, + 1, + 5 + ], + [ + 4, + 1, + 5 + ], + [ + 5, + 7, + 8 + ], + [ + 5, + 7, + 9 + ], + [ + 6, + 5, + 7 + ], + [ + 7, + 9, + 10 + ], + [ + 7, + 9, + 14 + ], + [ + 8, + 7, + 9 + ], + [ + 9, + 10, + 11 + ], + [ + 9, + 10, + 12 + ], + [ + 9, + 10, + 13 + ], + [ + 9, + 14, + 15 + ], + [ + 9, + 14, + 16 + ], + [ + 10, + 9, + 14 + ], + [ + 14, + 16, + 17 + ], + [ + 14, + 16, + 18 + ], + [ + 11, + 10, + 12 + ], + [ + 11, + 10, + 13 + ], + [ + 12, + 10, + 13 + ], + [ + 15, + 14, + 16 + ], + [ + 16, + 18, + 19 + ], + [ + 16, + 18, + 20 + ], + [ + 16, + 18, + 21 + ], + [ + 17, + 16, + 18 + ], + [ + 19, + 18, + 20 + ], + [ + 19, + 18, + 21 + ], + [ + 20, + 18, + 21 + ] + ], + "propers": [ + [ + 2, + 1, + 5, + 6 + ], + [ + 3, + 1, + 5, + 6 + ], + [ + 4, + 1, + 5, + 6 + ], + [ + 2, + 1, + 5, + 7 + ], + [ + 3, + 1, + 5, + 7 + ], + [ + 4, + 1, + 5, + 7 + ], + [ + 1, + 5, + 7, + 8 + ], + [ + 6, + 5, + 7, + 8 + ], + [ + 1, + 5, + 7, + 9 + ], + [ + 6, + 5, + 7, + 9 + ], + [ + 5, + 7, + 9, + 10 + ], + [ + 8, + 7, + 9, + 10 + ], + [ + 5, + 7, + 9, + 14 + ], + [ + 8, + 7, + 9, + 14 + ], + [ + 11, + 10, + 9, + 14 + ], + [ + 12, + 10, + 9, + 14 + ], + [ + 13, + 10, + 9, + 14 + ], + [ + 7, + 9, + 10, + 11 + ], + [ + 7, + 9, + 10, + 12 + ], + [ + 7, + 9, + 10, + 13 + ], + [ + 7, + 9, + 14, + 15 + ], + [ + 10, + 9, + 14, + 15 + ], + [ + 7, + 9, + 14, + 16 + ], + [ + 10, + 9, + 14, + 16 + ], + [ + 9, + 14, + 16, + 17 + ], + [ + 15, + 14, + 16, + 17 + ], + [ + 9, + 14, + 16, + 18 + ], + [ + 15, + 14, + 16, + 18 + ], + [ + 14, + 16, + 18, + 19 + ], + [ + 17, + 16, + 18, + 19 + ], + [ + 14, + 16, + 18, + 20 + ], + [ + 17, + 16, + 18, + 20 + ], + [ + 14, + 16, + 18, + 21 + ], + [ + 17, + 16, + 18, + 21 + ] + ], + "impropers": [ + [ + 1, + 7, + 5, + 6 + ], + [ + 7, + 6, + 5, + 1 + ], + [ + 6, + 1, + 5, + 7 + ], + [ + 5, + 9, + 7, + 8 + ], + [ + 9, + 8, + 7, + 5 + ], + [ + 8, + 5, + 7, + 9 + ], + [ + 7, + 10, + 9, + 14 + ], + [ + 10, + 14, + 9, + 7 + ], + [ + 14, + 7, + 9, + 10 + ], + [ + 9, + 16, + 14, + 15 + ], + [ + 16, + 15, + 14, + 9 + ], + [ + 15, + 9, + 14, + 16 + ], + [ + 14, + 18, + 16, + 17 + ], + [ + 18, + 17, + 16, + 14 + ], + [ + 17, + 14, + 16, + 18 + ] + ], + "atomic_numbers": [ + 6, + 1, + 1, + 1, + 6, + 8, + 7, + 1, + 6, + 6, + 1, + 1, + 1, + 6, + 8, + 7, + 1, + 6, + 1, + 1, + 1 + ], + "partial_charges": [ + -0.3662000000476837, + 0.11230000108480453, + 0.11230000108480453, + 0.11230000108480453, + 0.5971999764442444, + -0.5679000020027161, + -0.4156999886035919, + 0.2718999981880188, + 0.11599999666213989, + -0.18250000476837158, + 0.06030000001192093, + 0.06030000001192093, + 0.06030000001192093, + 0.5972999930381775, + -0.5679000020027161, + -0.4156999886035919, + 0.2718999981880188, + -0.14900000393390656, + 0.09759999811649323, + 0.09759999811649323, + 0.09759999811649323 + ], + "sigma": [ + 0.339967, + 0.264953, + 0.264953, + 0.264953, + 0.339967, + 0.295992, + 0.325, + 0.106908, + 0.339967, + 0.339967, + 0.264953, + 0.264953, + 0.264953, + 0.339967, + 0.295992, + 0.325, + 0.106908, + 0.339967, + 0.247135, + 0.247135, + 0.247135 + ], + "epsilon": [ + 0.45773, + 0.0656888, + 0.0656888, + 0.0656888, + 0.359824, + 0.87864, + 0.71128, + 0.0656888, + 0.45773, + 0.45773, + 0.0656888, + 0.0656888, + 0.0656888, + 0.359824, + 0.87864, + 0.71128, + 0.0656888, + 0.45773, + 0.0656888, + 0.0656888, + 0.0656888 + ], + "is_radical": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "ring_encoding": [ + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ] + ] +} \ No newline at end of file diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index 1733b80..3cb665a 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -11,10 +11,15 @@ from grappa_interface import ( clean_parameters, - generate_input, + build_molecule, apply_parameters, GrappaInterface, ) + +from grappa.grappa import Grappa +from grappa.data.Molecule import Molecule +from grappa.utils.loading_utils import load_model + from kimmdy.topology.topology import Topology from kimmdy.constants import AA3 from kimmdy.parsing import write_json, read_json, read_top @@ -23,7 +28,7 @@ ## fixtures ## @pytest.fixture def grappa_input(): - return read_json(Path(__file__).parent / "GrAPPa_input_alanine.json") + return Molecule.from_json(Path(__file__).parent / "in_alanine.json") @pytest.fixture @@ -34,14 +39,14 @@ def grappa_output(): ## test scripts ## def test_generate_input(): top = Topology(read_top(Path(__file__).parent / "Ala_out.top")) - input_dict = generate_input(top) + mol = build_molecule(top) + mol.to_json("in.json") # with open("GrAPPa_input_alanine.json", "w") as f: # json.dump(input_dict, f) - assert len(input_dict["atoms"]) == 21 - assert len(input_dict["bonds"]) == 20 - assert input_dict["radicals"] == [9] - assert input_dict["atoms"][0] == [1, "CH3", "ACE", 1, [0.339967, 0.45773], 6] + assert len(mol.atoms) == 21 + assert len(mol.bonds) == 20 + assert mol.additional_features['is_radical'][9] == 1 assert all([len(x) == 6 for x in input_dict["atoms"]]) assert all([isinstance(x[s], str) for x in input_dict["atoms"] for s in [1, 2]]) @@ -59,11 +64,14 @@ def test_clean_parameters(grappa_output): def test_generate_parameters(grappa_input): - import grappa.ff - - ff = grappa.ff.ForceField.from_tag("radical_example") - # in rad to avoid import openmm - parameters = ff.params_from_topology_dict(grappa_input) + # load model, tag will be changed to be more permanent + model_tag = 'https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth' + model = load_model(model_tag) + + # initialize class that handles ML part + grappa = Grappa(model,device='cpu') + parameters = grappa.predict(grappa_input) + breakpoint() clean_parameters(parameters) # write_json(parameters, "GrAPPa_output_alanine.json") # with open("GrAPPa_output_alanine.json", "r") as f: From 9708ff1824dbeee6a39ad3e2c7838b2538942ad8 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Mon, 18 Dec 2023 18:10:08 +0100 Subject: [PATCH 03/12] wip --- in.json | 878 +++++++++++++++++++ out_converted.json | 1388 ++++++++++++++++++++++++++++++ out_raw.json | 1388 ++++++++++++++++++++++++++++++ src/grappa_interface.py | 196 +++-- tests/out_converted_alanine.json | 1388 ++++++++++++++++++++++++++++++ tests/out_parameterized.top | 1170 +++++++++++++++++++++++++ tests/out_raw_alanine.json | 1388 ++++++++++++++++++++++++++++++ tests/test_parameterizers.py | 120 ++- 8 files changed, 7749 insertions(+), 167 deletions(-) create mode 100644 in.json create mode 100644 out_converted.json create mode 100644 out_raw.json create mode 100644 tests/out_converted_alanine.json create mode 100644 tests/out_parameterized.top create mode 100644 tests/out_raw_alanine.json diff --git a/in.json b/in.json new file mode 100644 index 0000000..6986fc8 --- /dev/null +++ b/in.json @@ -0,0 +1,878 @@ +{ + "atoms": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "bonds": [ + [ + 1, + 2 + ], + [ + 1, + 3 + ], + [ + 1, + 4 + ], + [ + 1, + 5 + ], + [ + 5, + 6 + ], + [ + 5, + 7 + ], + [ + 7, + 8 + ], + [ + 7, + 9 + ], + [ + 9, + 10 + ], + [ + 9, + 14 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 14, + 15 + ], + [ + 14, + 16 + ], + [ + 16, + 17 + ], + [ + 16, + 18 + ], + [ + 18, + 19 + ], + [ + 18, + 20 + ], + [ + 18, + 21 + ] + ], + "angles": [ + [ + 1, + 5, + 6 + ], + [ + 1, + 5, + 7 + ], + [ + 2, + 1, + 3 + ], + [ + 2, + 1, + 4 + ], + [ + 2, + 1, + 5 + ], + [ + 3, + 1, + 4 + ], + [ + 3, + 1, + 5 + ], + [ + 4, + 1, + 5 + ], + [ + 5, + 7, + 8 + ], + [ + 5, + 7, + 9 + ], + [ + 6, + 5, + 7 + ], + [ + 7, + 9, + 10 + ], + [ + 7, + 9, + 14 + ], + [ + 8, + 7, + 9 + ], + [ + 9, + 10, + 11 + ], + [ + 9, + 10, + 12 + ], + [ + 9, + 10, + 13 + ], + [ + 9, + 14, + 15 + ], + [ + 9, + 14, + 16 + ], + [ + 10, + 9, + 14 + ], + [ + 14, + 16, + 17 + ], + [ + 14, + 16, + 18 + ], + [ + 11, + 10, + 12 + ], + [ + 11, + 10, + 13 + ], + [ + 12, + 10, + 13 + ], + [ + 15, + 14, + 16 + ], + [ + 16, + 18, + 19 + ], + [ + 16, + 18, + 20 + ], + [ + 16, + 18, + 21 + ], + [ + 17, + 16, + 18 + ], + [ + 19, + 18, + 20 + ], + [ + 19, + 18, + 21 + ], + [ + 20, + 18, + 21 + ] + ], + "propers": [ + [ + 2, + 1, + 5, + 6 + ], + [ + 3, + 1, + 5, + 6 + ], + [ + 4, + 1, + 5, + 6 + ], + [ + 2, + 1, + 5, + 7 + ], + [ + 3, + 1, + 5, + 7 + ], + [ + 4, + 1, + 5, + 7 + ], + [ + 1, + 5, + 7, + 8 + ], + [ + 6, + 5, + 7, + 8 + ], + [ + 1, + 5, + 7, + 9 + ], + [ + 6, + 5, + 7, + 9 + ], + [ + 5, + 7, + 9, + 10 + ], + [ + 8, + 7, + 9, + 10 + ], + [ + 5, + 7, + 9, + 14 + ], + [ + 8, + 7, + 9, + 14 + ], + [ + 11, + 10, + 9, + 14 + ], + [ + 12, + 10, + 9, + 14 + ], + [ + 13, + 10, + 9, + 14 + ], + [ + 7, + 9, + 10, + 11 + ], + [ + 7, + 9, + 10, + 12 + ], + [ + 7, + 9, + 10, + 13 + ], + [ + 7, + 9, + 14, + 15 + ], + [ + 10, + 9, + 14, + 15 + ], + [ + 7, + 9, + 14, + 16 + ], + [ + 10, + 9, + 14, + 16 + ], + [ + 9, + 14, + 16, + 17 + ], + [ + 15, + 14, + 16, + 17 + ], + [ + 9, + 14, + 16, + 18 + ], + [ + 15, + 14, + 16, + 18 + ], + [ + 14, + 16, + 18, + 19 + ], + [ + 17, + 16, + 18, + 19 + ], + [ + 14, + 16, + 18, + 20 + ], + [ + 17, + 16, + 18, + 20 + ], + [ + 14, + 16, + 18, + 21 + ], + [ + 17, + 16, + 18, + 21 + ] + ], + "impropers": [ + [ + 1, + 7, + 5, + 6 + ], + [ + 7, + 6, + 5, + 1 + ], + [ + 6, + 1, + 5, + 7 + ], + [ + 5, + 9, + 7, + 8 + ], + [ + 9, + 8, + 7, + 5 + ], + [ + 8, + 5, + 7, + 9 + ], + [ + 7, + 10, + 9, + 14 + ], + [ + 10, + 14, + 9, + 7 + ], + [ + 14, + 7, + 9, + 10 + ], + [ + 9, + 16, + 14, + 15 + ], + [ + 16, + 15, + 14, + 9 + ], + [ + 15, + 9, + 14, + 16 + ], + [ + 14, + 18, + 16, + 17 + ], + [ + 18, + 17, + 16, + 14 + ], + [ + 17, + 14, + 16, + 18 + ] + ], + "atomic_numbers": [ + 6, + 1, + 1, + 1, + 6, + 8, + 7, + 1, + 6, + 6, + 1, + 1, + 1, + 6, + 8, + 7, + 1, + 6, + 1, + 1, + 1 + ], + "partial_charges": [ + -0.3662000000476837, + 0.11230000108480453, + 0.11230000108480453, + 0.11230000108480453, + 0.5971999764442444, + -0.5679000020027161, + -0.4156999886035919, + 0.2718999981880188, + 0.11599999666213989, + -0.18250000476837158, + 0.06030000001192093, + 0.06030000001192093, + 0.06030000001192093, + 0.5972999930381775, + -0.5679000020027161, + -0.4156999886035919, + 0.2718999981880188, + -0.14900000393390656, + 0.09759999811649323, + 0.09759999811649323, + 0.09759999811649323 + ], + "sigma": [ + 0.339967, + 0.264953, + 0.264953, + 0.264953, + 0.339967, + 0.295992, + 0.325, + 0.106908, + 0.339967, + 0.339967, + 0.264953, + 0.264953, + 0.264953, + 0.339967, + 0.295992, + 0.325, + 0.106908, + 0.339967, + 0.247135, + 0.247135, + 0.247135 + ], + "epsilon": [ + 0.45773, + 0.0656888, + 0.0656888, + 0.0656888, + 0.359824, + 0.87864, + 0.71128, + 0.0656888, + 0.45773, + 0.45773, + 0.0656888, + 0.0656888, + 0.0656888, + 0.359824, + 0.87864, + 0.71128, + 0.0656888, + 0.45773, + 0.0656888, + 0.0656888, + 0.0656888 + ], + "is_radical": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "ring_encoding": [ + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ] + ] +} \ No newline at end of file diff --git a/out_converted.json b/out_converted.json new file mode 100644 index 0000000..290608c --- /dev/null +++ b/out_converted.json @@ -0,0 +1,1388 @@ +{ + "atoms": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "19", + "20", + "21" + ], + "bonds": [ + [ + "1", + "2" + ], + [ + "1", + "3" + ], + [ + "1", + "4" + ], + [ + "1", + "5" + ], + [ + "5", + "6" + ], + [ + "5", + "7" + ], + [ + "7", + "8" + ], + [ + "7", + "9" + ], + [ + "9", + "10" + ], + [ + "9", + "14" + ], + [ + "10", + "11" + ], + [ + "10", + "12" + ], + [ + "10", + "13" + ], + [ + "14", + "15" + ], + [ + "14", + "16" + ], + [ + "16", + "17" + ], + [ + "16", + "18" + ], + [ + "18", + "19" + ], + [ + "18", + "20" + ], + [ + "18", + "21" + ] + ], + "bond_k": [ + "315945.8067", + "315945.8067", + "315945.8067", + "223856.8196", + "620877.6113", + "238725.3419", + "409606.7816", + "159153.2668", + "213063.1007", + "81753.6209", + "314854.8869", + "314854.8869", + "314854.8869", + "595271.7050", + "328862.3745", + "404914.9762", + "273226.4874", + "315059.3881", + "315059.3881", + "315059.3881" + ], + "bond_eq": [ + "0.1094", + "0.1094", + "0.1094", + "0.1527", + "0.1217", + "0.1381", + "0.1018", + "0.1349", + "0.1494", + "0.1411", + "0.1095", + "0.1095", + "0.1095", + "0.1217", + "0.1355", + "0.1012", + "0.1446", + "0.1093", + "0.1093", + "0.1093" + ], + "angles": [ + [ + "1", + "5", + "6" + ], + [ + "1", + "5", + "7" + ], + [ + "2", + "1", + "3" + ], + [ + "2", + "1", + "4" + ], + [ + "2", + "1", + "5" + ], + [ + "3", + "1", + "4" + ], + [ + "3", + "1", + "5" + ], + [ + "4", + "1", + "5" + ], + [ + "5", + "7", + "8" + ], + [ + "5", + "7", + "9" + ], + [ + "6", + "5", + "7" + ], + [ + "7", + "9", + "10" + ], + [ + "7", + "9", + "14" + ], + [ + "8", + "7", + "9" + ], + [ + "9", + "10", + "11" + ], + [ + "9", + "10", + "12" + ], + [ + "9", + "10", + "13" + ], + [ + "9", + "14", + "15" + ], + [ + "9", + "14", + "16" + ], + [ + "10", + "9", + "14" + ], + [ + "14", + "16", + "17" + ], + [ + "14", + "16", + "18" + ], + [ + "11", + "10", + "12" + ], + [ + "11", + "10", + "13" + ], + [ + "12", + "10", + "13" + ], + [ + "15", + "14", + "16" + ], + [ + "16", + "18", + "19" + ], + [ + "16", + "18", + "20" + ], + [ + "16", + "18", + "21" + ], + [ + "17", + "16", + "18" + ], + [ + "19", + "18", + "20" + ], + [ + "19", + "18", + "21" + ], + [ + "20", + "18", + "21" + ] + ], + "angle_k": [ + "501.9412", + "447.3940", + "340.6539", + "340.6539", + "433.5625", + "340.6539", + "433.5625", + "433.5625", + "326.2912", + "352.9718", + "691.8903", + "489.0848", + "326.8016", + "339.0491", + "413.6513", + "413.6513", + "413.6513", + "435.6668", + "379.4164", + "286.4854", + "416.5870", + "235.9870", + "329.9621", + "329.9621", + "329.9621", + "638.2252", + "508.9698", + "508.9698", + "508.9698", + "361.0943", + "351.7994", + "351.7994", + "351.7994" + ], + "angle_eq": [ + "147.6662", + "141.2754", + "103.3643", + "103.3643", + "105.2882", + "103.3643", + "105.2882", + "105.2882", + "114.9818", + "114.1798", + "139.9348", + "125.2240", + "120.1065", + "112.1479", + "104.6645", + "104.6645", + "104.6645", + "141.9027", + "138.8595", + "127.8208", + "114.0763", + "106.9759", + "102.5684", + "102.5684", + "102.5684", + "140.0279", + "105.5001", + "105.5001", + "105.5001", + "111.1294", + "103.3665", + "103.3665", + "103.3665" + ], + "propers": [ + [ + "2", + "1", + "5", + "6" + ], + [ + "3", + "1", + "5", + "6" + ], + [ + "4", + "1", + "5", + "6" + ], + [ + "2", + "1", + "5", + "7" + ], + [ + "3", + "1", + "5", + "7" + ], + [ + "4", + "1", + "5", + "7" + ], + [ + "1", + "5", + "7", + "8" + ], + [ + "6", + "5", + "7", + "8" + ], + [ + "1", + "5", + "7", + "9" + ], + [ + "6", + "5", + "7", + "9" + ], + [ + "5", + "7", + "9", + "10" + ], + [ + "8", + "7", + "9", + "10" + ], + [ + "5", + "7", + "9", + "14" + ], + [ + "8", + "7", + "9", + "14" + ], + [ + "14", + "9", + "10", + "11" + ], + [ + "14", + "9", + "10", + "12" + ], + [ + "14", + "9", + "10", + "13" + ], + [ + "7", + "9", + "10", + "11" + ], + [ + "7", + "9", + "10", + "12" + ], + [ + "7", + "9", + "10", + "13" + ], + [ + "7", + "9", + "14", + "15" + ], + [ + "10", + "9", + "14", + "15" + ], + [ + "7", + "9", + "14", + "16" + ], + [ + "10", + "9", + "14", + "16" + ], + [ + "9", + "14", + "16", + "17" + ], + [ + "15", + "14", + "16", + "17" + ], + [ + "9", + "14", + "16", + "18" + ], + [ + "15", + "14", + "16", + "18" + ], + [ + "14", + "16", + "18", + "19" + ], + [ + "17", + "16", + "18", + "19" + ], + [ + "14", + "16", + "18", + "20" + ], + [ + "17", + "16", + "18", + "20" + ], + [ + "14", + "16", + "18", + "21" + ], + [ + "17", + "16", + "18", + "21" + ] + ], + "proper_ks": [ + [ + "0.1880", + "2.8235", + "0.2748", + "0.0079", + "0.0246", + "0.0006" + ], + [ + "0.1880", + "2.8235", + "0.2748", + "0.0079", + "0.0246", + "0.0006" + ], + [ + "0.1880", + "2.8235", + "0.2748", + "0.0079", + "0.0246", + "0.0006" + ], + [ + "0.1764", + "3.2621", + "0.4171", + "0.0103", + "0.0575", + "0.0045" + ], + [ + "0.1764", + "3.2621", + "0.4171", + "0.0103", + "0.0575", + "0.0045" + ], + [ + "0.1764", + "3.2621", + "0.4171", + "0.0103", + "0.0575", + "0.0045" + ], + [ + "1.7931", + "9.6984", + "0.6622", + "0.2991", + "0.0097", + "0.1326" + ], + [ + "7.3992", + "14.8666", + "0.2974", + "0.0871", + "0.0240", + "0.1531" + ], + [ + "1.7415", + "12.9853", + "0.5074", + "0.2668", + "0.0356", + "0.0285" + ], + [ + "6.0148", + "18.2605", + "0.1417", + "0.8047", + "0.0455", + "0.0153" + ], + [ + "0.3902", + "11.0027", + "0.7300", + "0.3757", + "0.0288", + "0.0102" + ], + [ + "3.6074", + "6.0950", + "1.1335", + "0.1172", + "0.0250", + "0.0647" + ], + [ + "3.2324", + "6.5537", + "0.7782", + "0.0273", + "0.0029", + "0.0055" + ], + [ + "0.0351", + "4.9404", + "0.0838", + "0.1089", + "0.0117", + "0.0598" + ], + [ + "1.5012", + "2.7971", + "0.7349", + "0.3854", + "0.0534", + "0.0592" + ], + [ + "1.5012", + "2.7971", + "0.7349", + "0.3854", + "0.0534", + "0.0592" + ], + [ + "1.5012", + "2.7971", + "0.7349", + "0.3854", + "0.0534", + "0.0592" + ], + [ + "0.3769", + "2.5366", + "0.8548", + "0.0055", + "0.0325", + "0.0136" + ], + [ + "0.3769", + "2.5366", + "0.8548", + "0.0055", + "0.0325", + "0.0136" + ], + [ + "0.3769", + "2.5366", + "0.8548", + "0.0055", + "0.0325", + "0.0136" + ], + [ + "4.7216", + "4.4144", + "0.3480", + "0.3173", + "0.0027", + "0.0981" + ], + [ + "5.6503", + "4.1278", + "0.2307", + "0.2222", + "0.0280", + "0.1189" + ], + [ + "7.6452", + "8.6446", + "0.3095", + "0.1632", + "0.0233", + "0.1571" + ], + [ + "8.2641", + "8.7774", + "0.3183", + "0.4378", + "0.0258", + "0.1407" + ], + [ + "5.0360", + "9.2646", + "1.2911", + "0.0552", + "0.0416", + "0.0350" + ], + [ + "10.5685", + "14.4833", + "0.3155", + "0.1779", + "0.0888", + "0.0304" + ], + [ + "4.2301", + "13.4323", + "1.2454", + "0.0755", + "0.0403", + "0.0552" + ], + [ + "2.5828", + "22.7140", + "0.0880", + "1.0765", + "0.0505", + "0.0159" + ], + [ + "0.3064", + "0.6640", + "0.2691", + "0.4435", + "0.0293", + "0.0015" + ], + [ + "0.7291", + "1.0519", + "0.1107", + "0.0357", + "0.0008", + "0.0032" + ], + [ + "0.3064", + "0.6640", + "0.2691", + "0.4435", + "0.0293", + "0.0015" + ], + [ + "0.7291", + "1.0519", + "0.1107", + "0.0357", + "0.0008", + "0.0032" + ], + [ + "0.3064", + "0.6640", + "0.2691", + "0.4435", + "0.0293", + "0.0015" + ], + [ + "0.7291", + "1.0519", + "0.1107", + "0.0357", + "0.0008", + "0.0032" + ] + ], + "proper_phases": [ + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "180.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ] + ], + "impropers": [ + [ + "1", + "7", + "5", + "6" + ], + [ + "7", + "6", + "5", + "1" + ], + [ + "6", + "1", + "5", + "7" + ], + [ + "5", + "9", + "7", + "8" + ], + [ + "9", + "8", + "7", + "5" + ], + [ + "8", + "5", + "7", + "9" + ], + [ + "7", + "10", + "9", + "14" + ], + [ + "10", + "14", + "9", + "7" + ], + [ + "14", + "7", + "9", + "10" + ], + [ + "9", + "16", + "14", + "15" + ], + [ + "16", + "15", + "14", + "9" + ], + [ + "15", + "9", + "14", + "16" + ], + [ + "14", + "18", + "16", + "17" + ], + [ + "18", + "17", + "16", + "14" + ], + [ + "17", + "14", + "16", + "18" + ] + ], + "improper_ks": [ + [ + "0.0003", + "29.4530", + "0.0000" + ], + [ + "0.0000", + "49.4767", + "0.0003" + ], + [ + "0.0002", + "21.0667", + "0.0000" + ], + [ + "0.0001", + "6.9972", + "0.0000" + ], + [ + "0.0000", + "21.8583", + "0.0001" + ], + [ + "0.0002", + "13.0353", + "0.0000" + ], + [ + "0.0000", + "1.9672", + "0.0001" + ], + [ + "0.0000", + "5.0084", + "0.0001" + ], + [ + "0.0000", + "11.0318", + "0.0002" + ], + [ + "0.0002", + "23.1931", + "0.0000" + ], + [ + "0.0000", + "33.2880", + "0.0003" + ], + [ + "0.0002", + "19.2299", + "0.0000" + ], + [ + "0.0002", + "15.9088", + "0.0000" + ], + [ + "0.0000", + "48.5030", + "0.0003" + ], + [ + "0.0002", + "14.7781", + "0.0000" + ] + ], + "improper_phases": [ + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ] + ] +} \ No newline at end of file diff --git a/out_raw.json b/out_raw.json new file mode 100644 index 0000000..02caea0 --- /dev/null +++ b/out_raw.json @@ -0,0 +1,1388 @@ +{ + "atoms": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "bonds": [ + [ + 1, + 2 + ], + [ + 1, + 3 + ], + [ + 1, + 4 + ], + [ + 1, + 5 + ], + [ + 5, + 6 + ], + [ + 5, + 7 + ], + [ + 7, + 8 + ], + [ + 7, + 9 + ], + [ + 9, + 10 + ], + [ + 9, + 14 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 14, + 15 + ], + [ + 14, + 16 + ], + [ + 16, + 17 + ], + [ + 16, + 18 + ], + [ + 18, + 19 + ], + [ + 18, + 20 + ], + [ + 18, + 21 + ] + ], + "bond_k": [ + 755.1286010742188, + 755.1286010742188, + 755.1286010742188, + 535.0306396484375, + 1483.93310546875, + 570.5672607421875, + 978.9837036132812, + 380.38543701171875, + 509.2330322265625, + 195.39584350585938, + 752.521240234375, + 752.521240234375, + 752.521240234375, + 1422.7335205078125, + 785.9999389648438, + 967.77001953125, + 653.0269775390625, + 753.010009765625, + 753.010009765625, + 753.010009765625 + ], + "bond_eq": [ + 1.0938714742660522, + 1.0938714742660522, + 1.0938714742660522, + 1.5267786979675293, + 1.2169218063354492, + 1.381420373916626, + 1.018121361732483, + 1.3490225076675415, + 1.49397873878479, + 1.410969614982605, + 1.09508216381073, + 1.09508216381073, + 1.09508216381073, + 1.2173930406570435, + 1.3548707962036133, + 1.012398600578308, + 1.446398377418518, + 1.0925675630569458, + 1.0925675630569458, + 1.0925675630569458 + ], + "angles": [ + [ + 1, + 5, + 6 + ], + [ + 1, + 5, + 7 + ], + [ + 2, + 1, + 3 + ], + [ + 2, + 1, + 4 + ], + [ + 2, + 1, + 5 + ], + [ + 3, + 1, + 4 + ], + [ + 3, + 1, + 5 + ], + [ + 4, + 1, + 5 + ], + [ + 5, + 7, + 8 + ], + [ + 5, + 7, + 9 + ], + [ + 6, + 5, + 7 + ], + [ + 7, + 9, + 10 + ], + [ + 7, + 9, + 14 + ], + [ + 8, + 7, + 9 + ], + [ + 9, + 10, + 11 + ], + [ + 9, + 10, + 12 + ], + [ + 9, + 10, + 13 + ], + [ + 9, + 14, + 15 + ], + [ + 9, + 14, + 16 + ], + [ + 10, + 9, + 14 + ], + [ + 14, + 16, + 17 + ], + [ + 14, + 16, + 18 + ], + [ + 11, + 10, + 12 + ], + [ + 11, + 10, + 13 + ], + [ + 12, + 10, + 13 + ], + [ + 15, + 14, + 16 + ], + [ + 16, + 18, + 19 + ], + [ + 16, + 18, + 20 + ], + [ + 16, + 18, + 21 + ], + [ + 17, + 16, + 18 + ], + [ + 19, + 18, + 20 + ], + [ + 19, + 18, + 21 + ], + [ + 20, + 18, + 21 + ] + ], + "angle_k": [ + 119.9668197631836, + 106.92973327636719, + 81.41822814941406, + 81.41822814941406, + 103.62391662597656, + 81.41822814941406, + 103.62391662597656, + 103.62391662597656, + 77.98545837402344, + 84.3622817993164, + 165.36575317382812, + 116.89408111572266, + 78.10746765136719, + 81.03467559814453, + 98.86503601074219, + 98.86503601074219, + 98.86503601074219, + 104.12686157226562, + 90.68270111083984, + 68.47164916992188, + 99.56668853759766, + 56.40223693847656, + 78.86282348632812, + 78.86282348632812, + 78.86282348632812, + 152.5394744873047, + 121.64669036865234, + 121.64669036865234, + 121.64669036865234, + 86.3036117553711, + 84.08207702636719, + 84.08207702636719, + 84.08207702636719 + ], + "angle_eq": [ + 2.577260732650757, + 2.4657208919525146, + 1.8040478229522705, + 1.8040478229522705, + 1.837625503540039, + 1.8040478229522705, + 1.837625503540039, + 1.837625503540039, + 2.0068106651306152, + 1.9928127527236938, + 2.4423227310180664, + 2.185570240020752, + 2.096254348754883, + 1.9573496580123901, + 1.8267408609390259, + 1.8267408609390259, + 1.8267408609390259, + 2.4766693115234375, + 2.4235546588897705, + 2.230893611907959, + 1.9910074472427368, + 1.8670819997787476, + 1.7901557683944702, + 1.7901557683944702, + 1.7901557683944702, + 2.4439475536346436, + 1.8413236141204834, + 1.8413236141204834, + 1.8413236141204834, + 1.9395732879638672, + 1.8040862083435059, + 1.8040862083435059, + 1.8040862083435059 + ], + "propers": [ + [ + 2, + 1, + 5, + 6 + ], + [ + 3, + 1, + 5, + 6 + ], + [ + 4, + 1, + 5, + 6 + ], + [ + 2, + 1, + 5, + 7 + ], + [ + 3, + 1, + 5, + 7 + ], + [ + 4, + 1, + 5, + 7 + ], + [ + 1, + 5, + 7, + 8 + ], + [ + 6, + 5, + 7, + 8 + ], + [ + 1, + 5, + 7, + 9 + ], + [ + 6, + 5, + 7, + 9 + ], + [ + 5, + 7, + 9, + 10 + ], + [ + 8, + 7, + 9, + 10 + ], + [ + 5, + 7, + 9, + 14 + ], + [ + 8, + 7, + 9, + 14 + ], + [ + 11, + 10, + 9, + 14 + ], + [ + 12, + 10, + 9, + 14 + ], + [ + 13, + 10, + 9, + 14 + ], + [ + 7, + 9, + 10, + 11 + ], + [ + 7, + 9, + 10, + 12 + ], + [ + 7, + 9, + 10, + 13 + ], + [ + 7, + 9, + 14, + 15 + ], + [ + 10, + 9, + 14, + 15 + ], + [ + 7, + 9, + 14, + 16 + ], + [ + 10, + 9, + 14, + 16 + ], + [ + 9, + 14, + 16, + 17 + ], + [ + 15, + 14, + 16, + 17 + ], + [ + 9, + 14, + 16, + 18 + ], + [ + 15, + 14, + 16, + 18 + ], + [ + 14, + 16, + 18, + 19 + ], + [ + 17, + 16, + 18, + 19 + ], + [ + 14, + 16, + 18, + 20 + ], + [ + 17, + 16, + 18, + 20 + ], + [ + 14, + 16, + 18, + 21 + ], + [ + 17, + 16, + 18, + 21 + ] + ], + "proper_ks": [ + [ + 0.04494260251522064, + 0.6748359203338623, + 0.06567462533712387, + 0.0018822925630956888, + 0.005876102019101381, + 0.0001455173478461802 + ], + [ + 0.04494260251522064, + 0.6748359203338623, + 0.06567462533712387, + 0.0018822925630956888, + 0.005876102019101381, + 0.0001455173478461802 + ], + [ + 0.04494260251522064, + 0.6748359203338623, + 0.06567462533712387, + 0.0018822925630956888, + 0.005876102019101381, + 0.0001455173478461802 + ], + [ + 0.04216618090867996, + 0.779660701751709, + 0.0996779352426529, + 0.0024542033206671476, + 0.013731980696320534, + 0.0010647684102877975 + ], + [ + 0.04216618090867996, + 0.779660701751709, + 0.0996779352426529, + 0.0024542033206671476, + 0.013731980696320534, + 0.0010647684102877975 + ], + [ + 0.04216618090867996, + 0.779660701751709, + 0.0996779352426529, + 0.0024542033206671476, + 0.013731980696320534, + 0.0010647684102877975 + ], + [ + 0.4285593032836914, + 2.317983865737915, + 0.15826106071472168, + 0.07149321585893631, + 0.002321923151612282, + 0.03168807923793793 + ], + [ + 1.76844322681427, + 3.553204298019409, + 0.0710846558213234, + 0.020816639065742493, + 0.005745828617364168, + 0.03658169507980347 + ], + [ + 0.41623467206954956, + 3.1035726070404053, + 0.12127675116062164, + 0.06377430260181427, + 0.008512343280017376, + 0.006807954050600529 + ], + [ + 1.437559962272644, + 4.364359378814697, + 0.03386424109339714, + 0.192324697971344, + 0.01088003907352686, + 0.0036552846431732178 + ], + [ + 0.09326191246509552, + 2.629699230194092, + 0.17447513341903687, + 0.08979395031929016, + 0.006880050990730524, + 0.002431943081319332 + ], + [ + 0.8621795177459717, + 1.4567458629608154, + 0.27090883255004883, + 0.028016723692417145, + 0.005979370325803757, + 0.01546785794198513 + ], + [ + 0.7725563049316406, + 1.566367745399475, + 0.18599750101566315, + 0.006534155923873186, + 0.0006819289992563426, + 0.001302878255955875 + ], + [ + 0.008390707895159721, + 1.1807739734649658, + 0.02002820000052452, + 0.026027575135231018, + 0.00280350586399436, + 0.014300660230219364 + ], + [ + 0.35878416895866394, + 0.6685130596160889, + 0.1756485253572464, + 0.09212284535169601, + 0.012770860455930233, + 0.014153237454593182 + ], + [ + 0.35878416895866394, + 0.6685130596160889, + 0.1756485253572464, + 0.09212284535169601, + 0.012770860455930233, + 0.014153237454593182 + ], + [ + 0.35878416895866394, + 0.6685130596160889, + 0.1756485253572464, + 0.09212284535169601, + 0.012770860455930233, + 0.014153237454593182 + ], + [ + 0.09008254110813141, + 0.60626620054245, + 0.20429131388664246, + 0.0013158542569726706, + 0.007764535024762154, + 0.0032613291405141354 + ], + [ + 0.09008254110813141, + 0.60626620054245, + 0.20429131388664246, + 0.0013158542569726706, + 0.007764535024762154, + 0.0032613291405141354 + ], + [ + 0.09008254110813141, + 0.60626620054245, + 0.20429131388664246, + 0.0013158542569726706, + 0.007764535024762154, + 0.0032613291405141354 + ], + [ + 1.1284929513931274, + 1.0550589561462402, + 0.08317933976650238, + 0.0758308470249176, + 0.0006398173281922936, + 0.023438507691025734 + ], + [ + 1.3504596948623657, + 0.9865561723709106, + 0.0551498718559742, + 0.053106434643268585, + 0.006684677675366402, + 0.028416384011507034 + ], + [ + 1.827253818511963, + 2.06610369682312, + 0.07396615296602249, + 0.039012253284454346, + 0.0055722338147461414, + 0.0375509038567543 + ], + [ + 1.9751782417297363, + 2.097846031188965, + 0.07606945186853409, + 0.10462893545627594, + 0.006167523562908173, + 0.03363082930445671 + ], + [ + 1.2036311626434326, + 2.2142984867095947, + 0.3085859417915344, + 0.013190153054893017, + 0.009937243536114693, + 0.008372116833925247 + ], + [ + 2.525923252105713, + 3.4615910053253174, + 0.07541729509830475, + 0.042516548186540604, + 0.021215463057160378, + 0.007254273165017366 + ], + [ + 1.0110245943069458, + 3.2103850841522217, + 0.29765740036964417, + 0.01805623434484005, + 0.009621884673833847, + 0.013184653595089912 + ], + [ + 0.6173112988471985, + 5.428781509399414, + 0.021032366901636124, + 0.25730106234550476, + 0.012070788070559502, + 0.0038080583326518536 + ], + [ + 0.07324298471212387, + 0.15870366990566254, + 0.06431722640991211, + 0.10600262880325317, + 0.007004760205745697, + 0.0003594254667405039 + ], + [ + 0.17425981163978577, + 0.25140509009361267, + 0.02646039053797722, + 0.008538116700947285, + 0.00018829142209142447, + 0.0007575735216960311 + ], + [ + 0.07324298471212387, + 0.15870366990566254, + 0.06431722640991211, + 0.10600262880325317, + 0.007004760205745697, + 0.0003594254667405039 + ], + [ + 0.17425981163978577, + 0.25140509009361267, + 0.02646039053797722, + 0.008538116700947285, + 0.00018829142209142447, + 0.0007575735216960311 + ], + [ + 0.0732429102063179, + 0.15870371460914612, + 0.06431721150875092, + 0.10600259900093079, + 0.007004757411777973, + 0.0003594244481064379 + ], + [ + 0.17425979673862457, + 0.2514052391052246, + 0.026460394263267517, + 0.008538112975656986, + 0.00018829276086762547, + 0.0007575732888653874 + ] + ], + "proper_phases": [ + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ] + ], + "impropers": [ + [ + 1, + 7, + 5, + 6 + ], + [ + 7, + 6, + 5, + 1 + ], + [ + 6, + 1, + 5, + 7 + ], + [ + 5, + 9, + 7, + 8 + ], + [ + 9, + 8, + 7, + 5 + ], + [ + 8, + 5, + 7, + 9 + ], + [ + 7, + 10, + 9, + 14 + ], + [ + 10, + 14, + 9, + 7 + ], + [ + 14, + 7, + 9, + 10 + ], + [ + 9, + 16, + 14, + 15 + ], + [ + 16, + 15, + 14, + 9 + ], + [ + 15, + 9, + 14, + 16 + ], + [ + 14, + 18, + 16, + 17 + ], + [ + 18, + 17, + 16, + 14 + ], + [ + 17, + 14, + 16, + 18 + ] + ], + "improper_ks": [ + [ + 7.061033829813823e-05, + 7.039442539215088, + 2.5443000570973817e-12 + ], + [ + 1.6675303715976697e-12, + 11.82522201538086, + 6.906843191245571e-05 + ], + [ + 4.957116470905021e-05, + 5.035053253173828, + 1.3721930258725479e-09 + ], + [ + 1.612351661606226e-05, + 1.6723710298538208, + 1.6308449630741961e-06 + ], + [ + 3.572121443085052e-08, + 5.224257469177246, + 2.798713649099227e-05 + ], + [ + 4.1046303522307426e-05, + 3.115514039993286, + 7.626833053997473e-10 + ], + [ + 1.3283370208228007e-06, + 0.4701811969280243, + 1.7553611542098224e-05 + ], + [ + 1.8493884113013337e-07, + 1.1970317363739014, + 3.0034112569410354e-05 + ], + [ + 2.4897314432337225e-08, + 2.636653423309326, + 3.9613834815099835e-05 + ], + [ + 5.474128920468502e-05, + 5.543274402618408, + 1.225876483657018e-10 + ], + [ + 3.510047461019461e-11, + 7.956034183502197, + 6.594436126761138e-05 + ], + [ + 4.4454209273681045e-05, + 4.596062183380127, + 9.936862443993277e-10 + ], + [ + 3.990923869423568e-05, + 3.8023033142089844, + 5.639988920336236e-09 + ], + [ + 9.445317791789698e-12, + 11.592504501342773, + 6.293354817898944e-05 + ], + [ + 4.342288229963742e-05, + 3.532057762145996, + 2.5205488807245047e-09 + ] + ], + "improper_phases": [ + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ] + ] +} \ No newline at end of file diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 57219e0..5122042 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -1,5 +1,6 @@ import logging import numpy as np +np.set_printoptions(suppress=True,precision=6) #prevent numpy exponential import math from typing import Union @@ -10,21 +11,24 @@ from kimmdy.parsing import write_json from grappa.data import Molecule +from grappa.data import Parameters + from grappa.utils.loading_utils import load_model from grappa.grappa import Grappa -import openmm.unit +from openmm import unit as openmm_unit +from grappa.units import convert logger = logging.getLogger("kimmdy.grappa_interface") - +# helper functions def check_equal_length(d: dict, name: str): lengths = [len(y) for y in d.values()] assert ( len(set(lengths)) == 1 ), f"Different length of {name} parameters: { {k:len(v) for k, v in d.items()} }" - +# unused? def convert_to_python_types(array: Union[list, np.ndarray]) -> list: return getattr(array, "tolist", lambda: array)() @@ -37,7 +41,7 @@ def order_proper(idxs: np.ndarray) -> np.ndarray: else: return np.flip(idxs) - +# unused? def elements_to_string(l: list): for i, e in enumerate(l): if isinstance(e, list): @@ -45,67 +49,7 @@ def elements_to_string(l: list): else: l[i] = str(e) - -def clean_parameters(parameters: dict) -> dict: - harmonic_keys = {"idxs", "eq", "k"} - dihedral_keys = {"idxs", "phases", "ks", "ns"} - parameters_clean = { - "atom": {"idxs": [], "q": []}, - "bond": {k: [] for k in harmonic_keys}, - "angle": {k: [] for k in harmonic_keys}, - "proper": {k: [] for k in dihedral_keys}, - "improper": {k: [] for k in dihedral_keys}, - } - # convert from kJ/mol/deg-2 to kJ/mol/rad-2 because GROMACS units are inconsistent - parameters["angle_k"] = parameters["angle_k"] * (180.0**2 / math.pi**2) - parameters["proper_idxs"] = np.array( - [order_proper(x) for x in parameters["proper_idxs"]] - ) - - try: - for atomic in parameters_clean.keys(): - for parameter in parameters_clean[atomic].keys(): - key = atomic + "_" + parameter - parameters_clean[atomic][parameter] = convert_to_python_types( - parameters[key] - ) - elements_to_string(parameters_clean[atomic][parameter]) - except KeyError: - raise KeyError( - f"GrAPPa returned parameters {list(parameters.keys())}, which do not contain the required sections to fill {parameters_clean}" - ) - - for name, atomic in parameters_clean.items(): - check_equal_length(atomic, name) - - ## sample type check - assert parameters_clean["atom"]["idxs"][ - 0 - ].isdigit(), f"atom idxs element does not look like int {parameters_clean['atom']['idxs'][0]}." - assert ( - parameters_clean["bond"]["k"][0] - .strip() - .lstrip("-") - .replace(".", "", 1) - .isdigit() - ), f"b k element does not look like float {parameters_clean['bond']['k'][0]}." - assert isinstance( - parameters_clean["proper"]["ns"][0], list - ), f"proper ns element has wrong type {type(parameters_clean['proper']['ns'][0])}, should be list." - assert ( - parameters_clean["improper"]["phases"][0][0] - .strip() - .lstrip("-") - .replace(".", "", 1) - .isdigit() - ), f"improper phases element does not look like float {type(parameters_clean['improper']['phases'][0][0])}" - return parameters_clean - - -def move_residual_charge_to_radical(partial_charges:list[float],radical_idx:int, total_charge:float): - partial_charges[radical_idx] += total_charge - sum(partial_charges) - return partial_charges - +# workflow functions def build_molecule(top: Topology) -> Molecule: at_map = top.ff.atomtypes atom_info = {'nr':[],'atomic_number':[],'partial_charges':[],'sigma':[],'epsilon':[],'is_radical':[]} @@ -124,13 +68,60 @@ def build_molecule(top: Topology) -> Molecule: return mol -def apply_parameters(top: Topology, parameters: dict): - # parameter structure is defined in clean_parameters() +def convert_parameters(parameters: Parameters) -> Parameters: + # parameters are in kcal/mol, Angstrom und rad + # convert to kJ/mol, nm and degree(mostly) + distance_factor = convert(1,openmm_unit.angstrom,openmm_unit.nanometer) + degree_factor = convert(1,openmm_unit.radian, openmm_unit.degree) + energy_factor = convert(1,openmm_unit.kilocalorie_per_mole,openmm_unit.kilojoule_per_mole) + + # convert parameters + parameters.bond_eq = parameters.bond_eq * distance_factor + parameters.bond_k = parameters.bond_k * energy_factor / np.power(distance_factor,2) + # angles are given in degrees and force constants in kJ/mol/rad**2. + parameters.angle_eq = parameters.angle_eq * degree_factor + parameters.angle_k = parameters.angle_k * energy_factor + + parameters.propers = np.array([order_proper(x) for x in parameters.propers]) + parameters.proper_phases = parameters.proper_phases * degree_factor + parameters.proper_ks = parameters.proper_ks * energy_factor + + parameters.improper_phases = parameters.improper_phases * degree_factor + parameters.improper_ks = parameters.improper_ks * energy_factor + + # convert to list of strings + for k in parameters.__annotations__.keys(): + v = getattr(parameters,k) + if isinstance(v[0],float): + v_list = [f"{i:11.4f}".strip() for i in v] + elif isinstance(v[0],np.ndarray) and isinstance(v[0,0],float): + v_list = [] + for sub_list in v: + v_list.append([f"{i:11.4f}".strip() for i in sub_list]) + else: + v_list = v.astype(str).tolist() + setattr(parameters,k,v_list) + + return parameters + + +def move_residual_charge_to_radical(partial_charges:list[float],radical_idx:int, total_charge:float): + partial_charges[radical_idx] += total_charge - sum(partial_charges) + return partial_charges + + +def treat_radical_partial_charges(partial_charges: list[float]) -> list[float]: + return partial_charges + + + +def apply_parameters(top: Topology, parameters: Parameters, partial_charges: list[float]): + # parameter structure is defined in grappa.data.Parameters.Parameters # assume units are according to https://manual.gromacs.org/current/reference-manual/definitions.html # namely: length [nm], mass [kg], time [ps], energy [kJ/mol], force [kJ mol-1 nm-1], angle [deg] ## atoms - for i, idx in enumerate(parameters["atom"]["idxs"]): + for i, idx in enumerate(parameters.atoms): if not (atom := top.atoms.get(idx)): # raise KeyError(f"bad index {idx} in {list(top.atoms.keys())}") logging.warning( @@ -138,39 +129,39 @@ def apply_parameters(top: Topology, parameters: dict): ) # this can happen when removing a hydrogen in kimmdy-remove-hydrogen continue # can anything but charge change?? - atom.charge = parameters["atom"]["q"][i] + atom.charge = f"{partial_charges[i]:7.4f}" atom.chargeB = None ## bonds - for i, idx in enumerate(parameters["bond"]["idxs"]): + for i, idx in enumerate(parameters.bonds): tup = tuple(idx) if not top.bonds.get(tup): # raise KeyError(f"bad index {tup} in {list(top.bonds.keys())}") logging.warning(f"Ignored parameters with invalid ids: {tup} for bonds") continue top.bonds[tup] = Bond( - *parameters["bond"]["idxs"][i], + *tup, funct="1", - c0=parameters["bond"]["eq"][i], - c1=parameters["bond"]["k"][i], + c0=parameters.bond_eq[i], + c1=parameters.bond_k[i], ) ## angles - for i, idx in enumerate(parameters["angle"]["idxs"]): + for i, idx in enumerate(parameters.angles): tup = tuple(idx) if not top.angles.get(tup): # raise KeyError(f"bad index {tup} in {list(top.angles.keys())}") logging.warning(f"Ignored parameters with invalid ids: {tup} for angles") continue top.angles[tup] = Angle( - *parameters["angle"]["idxs"][i], + *tup, funct="1", - c0=parameters["angle"]["eq"][i], - c1=parameters["angle"]["k"][i], + c0=parameters.angle_eq[i], + c1=parameters.angle_k[i], ) ## proper dihedrals - for i, idx in enumerate(parameters["proper"]["idxs"]): + for i, idx in enumerate(parameters.propers): tup = tuple(idx) if not top.proper_dihedrals.get(tup): # raise KeyError(f"bad index {tup} in {list(top.proper_dihedrals.keys())}") @@ -179,12 +170,13 @@ def apply_parameters(top: Topology, parameters: dict): ) continue dihedral_dict = {} - for ii, n in enumerate(parameters["proper"]["ns"][i]): + for ii in range(len(parameters.proper_ks[i])): + n = str(ii+1) dihedral_dict[n] = Dihedral( *tup, funct="9", - c0=parameters["proper"]["phases"][i][ii], - c1=parameters["proper"]["ks"][i][ii], + c0=parameters.proper_phases[i][ii], + c1=parameters.proper_ks[i][ii], periodicity=n, ) top.proper_dihedrals[tup] = MultipleDihedrals( @@ -193,23 +185,37 @@ def apply_parameters(top: Topology, parameters: dict): ## improper dihedrals top.improper_dihedrals = {} - for i, idx in enumerate(parameters["improper"]["idxs"]): + for i, idx in enumerate(parameters.impropers): tup = tuple(idx) - for ii, n in enumerate(parameters["improper"]["ns"][i]): + for ii in range(len(parameters.improper_ks[i])): + n = str(ii+1) if not math.isclose( - float(parameters["improper"]["ks"][i][ii]), 0.0, abs_tol=1e-4 + float(parameters.improper_ks[i][ii]), 0.0, abs_tol=1e-3 ): - if not top.improper_dihedrals.get(tup): + if curr_improper := (top.improper_dihedrals.get(tup)) is None: top.improper_dihedrals[tup] = Dihedral( *tup, funct="4", - c0=parameters["improper"]["phases"][i][ii], - c1=parameters["improper"]["ks"][i][ii], + c0=parameters.improper_phases[i][ii], + c1=parameters.improper_ks[i][ii], periodicity=n, ) else: + new_improper = Dihedral( + *tup, + funct="4", + c0=parameters.improper_phases[i][ii], + c1=parameters.improper_ks[i][ii], + periodicity=n, + ) + if new_improper.c1 > curr_improper.c1: + top.improper_dihedrals[tup] = new_improper + deserted_improper = curr_improper + else: + deserted_improper = new_improper + logger.warning( - f"There are multiple improper dihedrals for {tup} and only one can be chosen, dihedral {n} with amplitude of {parameters['proper']['ks'][i][ii]} will be ignored." + f"There are multiple improper dihedrals for {tup} and only one can be chosen, dihedral p{deserted_improper} will be ignored." ) return @@ -231,12 +237,12 @@ def parameterize_topology( grappa = Grappa(model,device='cpu') parameters = grappa.predict(mol) - parameters_dict = parameters.to_dict() - write_json(parameters_dict, "out_raw.json") - - - # parameters = clean_parameters(parameters) + # convert units et cetera + parameters = convert_parameters(parameters) + # check for changes to partial charges + partial_charges = treat_radical_partial_charges(mol.partial_charges) - # apply_parameters(current_topology, parameters) - return current_topology + # apply parameters + apply_parameters(current_topology, parameters, partial_charges) + return current_topology \ No newline at end of file diff --git a/tests/out_converted_alanine.json b/tests/out_converted_alanine.json new file mode 100644 index 0000000..290608c --- /dev/null +++ b/tests/out_converted_alanine.json @@ -0,0 +1,1388 @@ +{ + "atoms": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "19", + "20", + "21" + ], + "bonds": [ + [ + "1", + "2" + ], + [ + "1", + "3" + ], + [ + "1", + "4" + ], + [ + "1", + "5" + ], + [ + "5", + "6" + ], + [ + "5", + "7" + ], + [ + "7", + "8" + ], + [ + "7", + "9" + ], + [ + "9", + "10" + ], + [ + "9", + "14" + ], + [ + "10", + "11" + ], + [ + "10", + "12" + ], + [ + "10", + "13" + ], + [ + "14", + "15" + ], + [ + "14", + "16" + ], + [ + "16", + "17" + ], + [ + "16", + "18" + ], + [ + "18", + "19" + ], + [ + "18", + "20" + ], + [ + "18", + "21" + ] + ], + "bond_k": [ + "315945.8067", + "315945.8067", + "315945.8067", + "223856.8196", + "620877.6113", + "238725.3419", + "409606.7816", + "159153.2668", + "213063.1007", + "81753.6209", + "314854.8869", + "314854.8869", + "314854.8869", + "595271.7050", + "328862.3745", + "404914.9762", + "273226.4874", + "315059.3881", + "315059.3881", + "315059.3881" + ], + "bond_eq": [ + "0.1094", + "0.1094", + "0.1094", + "0.1527", + "0.1217", + "0.1381", + "0.1018", + "0.1349", + "0.1494", + "0.1411", + "0.1095", + "0.1095", + "0.1095", + "0.1217", + "0.1355", + "0.1012", + "0.1446", + "0.1093", + "0.1093", + "0.1093" + ], + "angles": [ + [ + "1", + "5", + "6" + ], + [ + "1", + "5", + "7" + ], + [ + "2", + "1", + "3" + ], + [ + "2", + "1", + "4" + ], + [ + "2", + "1", + "5" + ], + [ + "3", + "1", + "4" + ], + [ + "3", + "1", + "5" + ], + [ + "4", + "1", + "5" + ], + [ + "5", + "7", + "8" + ], + [ + "5", + "7", + "9" + ], + [ + "6", + "5", + "7" + ], + [ + "7", + "9", + "10" + ], + [ + "7", + "9", + "14" + ], + [ + "8", + "7", + "9" + ], + [ + "9", + "10", + "11" + ], + [ + "9", + "10", + "12" + ], + [ + "9", + "10", + "13" + ], + [ + "9", + "14", + "15" + ], + [ + "9", + "14", + "16" + ], + [ + "10", + "9", + "14" + ], + [ + "14", + "16", + "17" + ], + [ + "14", + "16", + "18" + ], + [ + "11", + "10", + "12" + ], + [ + "11", + "10", + "13" + ], + [ + "12", + "10", + "13" + ], + [ + "15", + "14", + "16" + ], + [ + "16", + "18", + "19" + ], + [ + "16", + "18", + "20" + ], + [ + "16", + "18", + "21" + ], + [ + "17", + "16", + "18" + ], + [ + "19", + "18", + "20" + ], + [ + "19", + "18", + "21" + ], + [ + "20", + "18", + "21" + ] + ], + "angle_k": [ + "501.9412", + "447.3940", + "340.6539", + "340.6539", + "433.5625", + "340.6539", + "433.5625", + "433.5625", + "326.2912", + "352.9718", + "691.8903", + "489.0848", + "326.8016", + "339.0491", + "413.6513", + "413.6513", + "413.6513", + "435.6668", + "379.4164", + "286.4854", + "416.5870", + "235.9870", + "329.9621", + "329.9621", + "329.9621", + "638.2252", + "508.9698", + "508.9698", + "508.9698", + "361.0943", + "351.7994", + "351.7994", + "351.7994" + ], + "angle_eq": [ + "147.6662", + "141.2754", + "103.3643", + "103.3643", + "105.2882", + "103.3643", + "105.2882", + "105.2882", + "114.9818", + "114.1798", + "139.9348", + "125.2240", + "120.1065", + "112.1479", + "104.6645", + "104.6645", + "104.6645", + "141.9027", + "138.8595", + "127.8208", + "114.0763", + "106.9759", + "102.5684", + "102.5684", + "102.5684", + "140.0279", + "105.5001", + "105.5001", + "105.5001", + "111.1294", + "103.3665", + "103.3665", + "103.3665" + ], + "propers": [ + [ + "2", + "1", + "5", + "6" + ], + [ + "3", + "1", + "5", + "6" + ], + [ + "4", + "1", + "5", + "6" + ], + [ + "2", + "1", + "5", + "7" + ], + [ + "3", + "1", + "5", + "7" + ], + [ + "4", + "1", + "5", + "7" + ], + [ + "1", + "5", + "7", + "8" + ], + [ + "6", + "5", + "7", + "8" + ], + [ + "1", + "5", + "7", + "9" + ], + [ + "6", + "5", + "7", + "9" + ], + [ + "5", + "7", + "9", + "10" + ], + [ + "8", + "7", + "9", + "10" + ], + [ + "5", + "7", + "9", + "14" + ], + [ + "8", + "7", + "9", + "14" + ], + [ + "14", + "9", + "10", + "11" + ], + [ + "14", + "9", + "10", + "12" + ], + [ + "14", + "9", + "10", + "13" + ], + [ + "7", + "9", + "10", + "11" + ], + [ + "7", + "9", + "10", + "12" + ], + [ + "7", + "9", + "10", + "13" + ], + [ + "7", + "9", + "14", + "15" + ], + [ + "10", + "9", + "14", + "15" + ], + [ + "7", + "9", + "14", + "16" + ], + [ + "10", + "9", + "14", + "16" + ], + [ + "9", + "14", + "16", + "17" + ], + [ + "15", + "14", + "16", + "17" + ], + [ + "9", + "14", + "16", + "18" + ], + [ + "15", + "14", + "16", + "18" + ], + [ + "14", + "16", + "18", + "19" + ], + [ + "17", + "16", + "18", + "19" + ], + [ + "14", + "16", + "18", + "20" + ], + [ + "17", + "16", + "18", + "20" + ], + [ + "14", + "16", + "18", + "21" + ], + [ + "17", + "16", + "18", + "21" + ] + ], + "proper_ks": [ + [ + "0.1880", + "2.8235", + "0.2748", + "0.0079", + "0.0246", + "0.0006" + ], + [ + "0.1880", + "2.8235", + "0.2748", + "0.0079", + "0.0246", + "0.0006" + ], + [ + "0.1880", + "2.8235", + "0.2748", + "0.0079", + "0.0246", + "0.0006" + ], + [ + "0.1764", + "3.2621", + "0.4171", + "0.0103", + "0.0575", + "0.0045" + ], + [ + "0.1764", + "3.2621", + "0.4171", + "0.0103", + "0.0575", + "0.0045" + ], + [ + "0.1764", + "3.2621", + "0.4171", + "0.0103", + "0.0575", + "0.0045" + ], + [ + "1.7931", + "9.6984", + "0.6622", + "0.2991", + "0.0097", + "0.1326" + ], + [ + "7.3992", + "14.8666", + "0.2974", + "0.0871", + "0.0240", + "0.1531" + ], + [ + "1.7415", + "12.9853", + "0.5074", + "0.2668", + "0.0356", + "0.0285" + ], + [ + "6.0148", + "18.2605", + "0.1417", + "0.8047", + "0.0455", + "0.0153" + ], + [ + "0.3902", + "11.0027", + "0.7300", + "0.3757", + "0.0288", + "0.0102" + ], + [ + "3.6074", + "6.0950", + "1.1335", + "0.1172", + "0.0250", + "0.0647" + ], + [ + "3.2324", + "6.5537", + "0.7782", + "0.0273", + "0.0029", + "0.0055" + ], + [ + "0.0351", + "4.9404", + "0.0838", + "0.1089", + "0.0117", + "0.0598" + ], + [ + "1.5012", + "2.7971", + "0.7349", + "0.3854", + "0.0534", + "0.0592" + ], + [ + "1.5012", + "2.7971", + "0.7349", + "0.3854", + "0.0534", + "0.0592" + ], + [ + "1.5012", + "2.7971", + "0.7349", + "0.3854", + "0.0534", + "0.0592" + ], + [ + "0.3769", + "2.5366", + "0.8548", + "0.0055", + "0.0325", + "0.0136" + ], + [ + "0.3769", + "2.5366", + "0.8548", + "0.0055", + "0.0325", + "0.0136" + ], + [ + "0.3769", + "2.5366", + "0.8548", + "0.0055", + "0.0325", + "0.0136" + ], + [ + "4.7216", + "4.4144", + "0.3480", + "0.3173", + "0.0027", + "0.0981" + ], + [ + "5.6503", + "4.1278", + "0.2307", + "0.2222", + "0.0280", + "0.1189" + ], + [ + "7.6452", + "8.6446", + "0.3095", + "0.1632", + "0.0233", + "0.1571" + ], + [ + "8.2641", + "8.7774", + "0.3183", + "0.4378", + "0.0258", + "0.1407" + ], + [ + "5.0360", + "9.2646", + "1.2911", + "0.0552", + "0.0416", + "0.0350" + ], + [ + "10.5685", + "14.4833", + "0.3155", + "0.1779", + "0.0888", + "0.0304" + ], + [ + "4.2301", + "13.4323", + "1.2454", + "0.0755", + "0.0403", + "0.0552" + ], + [ + "2.5828", + "22.7140", + "0.0880", + "1.0765", + "0.0505", + "0.0159" + ], + [ + "0.3064", + "0.6640", + "0.2691", + "0.4435", + "0.0293", + "0.0015" + ], + [ + "0.7291", + "1.0519", + "0.1107", + "0.0357", + "0.0008", + "0.0032" + ], + [ + "0.3064", + "0.6640", + "0.2691", + "0.4435", + "0.0293", + "0.0015" + ], + [ + "0.7291", + "1.0519", + "0.1107", + "0.0357", + "0.0008", + "0.0032" + ], + [ + "0.3064", + "0.6640", + "0.2691", + "0.4435", + "0.0293", + "0.0015" + ], + [ + "0.7291", + "1.0519", + "0.1107", + "0.0357", + "0.0008", + "0.0032" + ] + ], + "proper_phases": [ + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "180.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "180.0000", + "180.0000", + "0.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ], + [ + "180.0000", + "0.0000", + "0.0000", + "180.0000", + "0.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000", + "180.0000", + "180.0000", + "0.0000" + ] + ], + "impropers": [ + [ + "1", + "7", + "5", + "6" + ], + [ + "7", + "6", + "5", + "1" + ], + [ + "6", + "1", + "5", + "7" + ], + [ + "5", + "9", + "7", + "8" + ], + [ + "9", + "8", + "7", + "5" + ], + [ + "8", + "5", + "7", + "9" + ], + [ + "7", + "10", + "9", + "14" + ], + [ + "10", + "14", + "9", + "7" + ], + [ + "14", + "7", + "9", + "10" + ], + [ + "9", + "16", + "14", + "15" + ], + [ + "16", + "15", + "14", + "9" + ], + [ + "15", + "9", + "14", + "16" + ], + [ + "14", + "18", + "16", + "17" + ], + [ + "18", + "17", + "16", + "14" + ], + [ + "17", + "14", + "16", + "18" + ] + ], + "improper_ks": [ + [ + "0.0003", + "29.4530", + "0.0000" + ], + [ + "0.0000", + "49.4767", + "0.0003" + ], + [ + "0.0002", + "21.0667", + "0.0000" + ], + [ + "0.0001", + "6.9972", + "0.0000" + ], + [ + "0.0000", + "21.8583", + "0.0001" + ], + [ + "0.0002", + "13.0353", + "0.0000" + ], + [ + "0.0000", + "1.9672", + "0.0001" + ], + [ + "0.0000", + "5.0084", + "0.0001" + ], + [ + "0.0000", + "11.0318", + "0.0002" + ], + [ + "0.0002", + "23.1931", + "0.0000" + ], + [ + "0.0000", + "33.2880", + "0.0003" + ], + [ + "0.0002", + "19.2299", + "0.0000" + ], + [ + "0.0002", + "15.9088", + "0.0000" + ], + [ + "0.0000", + "48.5030", + "0.0003" + ], + [ + "0.0002", + "14.7781", + "0.0000" + ] + ], + "improper_phases": [ + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" + ], + [ + "0.0000", + "0.0000", + "0.0000" + ] + ] +} \ No newline at end of file diff --git a/tests/out_parameterized.top b/tests/out_parameterized.top new file mode 100644 index 0000000..e17428f --- /dev/null +++ b/tests/out_parameterized.top @@ -0,0 +1,1170 @@ +#define _FF_AMBER +#define _FF_AMBER99SBILDN +#define torsion_ILE_N_CA_CB_CG2_mult10.0 0.8158800 1 +#define torsion_ILE_N_CA_CB_CG2_mult20.0 -3.5396640 2 +#define torsion_LEU_C_CA_CB_CG_mult10.0 2.3890640 1 +#define torsion_LEU_C_CA_CB_CG_mult20.0 -1.4978720 2 +#define torsion_LEU_C_CA_CB_CG_mult30.0 0.5648400 3 +#define torsion_ASP_N_CA_CB_CG_mult10.0 -11.024840 1 +#define torsion_ASP_N_CA_CB_CG_mult20.0 -4.978960 2 +#define torsion_ASP_N_CA_CB_CG_mult30.0 -0.029288 3 +#define torsion_ASP_N_CA_CB_CG_mult40.0 1.769832 4 +#define torsion_ASP_N_CA_CB_CG_mult50.0 0.970688 5 +#define torsion_ASP_N_CA_CB_CG_mult60.0 -0.891192 6 +#define torsion_ASP_CA_CB_CG_OD_mult10.0 0.0 1 +#define torsion_ASP_CA_CB_CG_OD_mult20.0 -1.853512 2 +#define torsion_ASP_CA_CB_CG_OD_mult30.0 0.0 3 +#define torsion_ASP_CA_CB_CG_OD_mult40.0 -0.577392 4 +#define torsion_ASP_CA_CB_CG_OD_mult50.0 0.0 5 +#define torsion_ASP_CA_CB_CG_OD_mult60.0 -0.054392 6 +#define torsion_ASN_C_CA_CB_CG_mult10.0 2.389064 1 +#define torsion_ASN_C_CA_CB_CG_mult20.0 -2.493664 2 +#define torsion_ASN_C_CA_CB_CG_mult30.0 0.493712 3 +#define torsion_ASN_C_CA_CB_CG_mult40.0 -1.744728 4 +#define torsion_ASN_C_CA_CB_CG_mult50.0 0.435136 5 +#define torsion_ASN_C_CA_CB_CG_mult60.0 -0.422584 6 +#define torsion_ASN_CA_CB_CG_ND2_mult10.0 -4.376464 1 +#define torsion_ASN_CA_CB_CG_ND2_mult20.0 -0.757304 2 +#define torsion_ASN_CA_CB_CG_ND2_mult30.0 -0.146440 3 +#define torsion_ASN_CA_CB_CG_ND2_mult40.0 0.418400 4 +#define torsion_ASN_CA_CB_CG_ND2_mult50.0 0.543920 5 +#define torsion_ASN_CA_CB_CG_ND2_mult60.0 -0.443504 6 +#define torsion_PRO_CA_CB_CG_CD_mult30.0 4.3474000 3 +#define torsion_HYP_N_CD_CG_O_mult330.0 5.5138 3 + + +[ defaults ] +1 2 yes 0.5 0.8333 + + +[ atomtypes ] +Br 35 79.90 0.0000 A 0.00000e+00 0.00000e+00 +C 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CA 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CB 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CC 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CK 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CM 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CN 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CQ 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CR 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CT 6 12.01 0.0000 A 3.39967e-01 4.57730e-01 +CV 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +CW 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +C* 6 12.01 0.0000 A 3.39967e-01 3.59824e-01 +C0 20 40.08 0.0000 A 3.05240e-01 1.92376e+00 +F 9 19.00 0.0000 A 3.11815e-01 2.55224e-01 +H 1 1.008 0.0000 A 1.06908e-01 6.56888e-02 +HC 1 1.008 0.0000 A 2.64953e-01 6.56888e-02 +H1 1 1.008 0.0000 A 2.47135e-01 6.56888e-02 +H2 1 1.008 0.0000 A 2.29317e-01 6.56888e-02 +H3 1 1.008 0.0000 A 2.11499e-01 6.56888e-02 +HA 1 1.008 0.0000 A 2.59964e-01 6.27600e-02 +H4 1 1.008 0.0000 A 2.51055e-01 6.27600e-02 +H5 1 1.008 0.0000 A 2.42146e-01 6.27600e-02 +HO 1 1.008 0.0000 A 0.00000e+00 0.00000e+00 +HS 1 1.008 0.0000 A 1.06908e-01 6.56888e-02 +HW 1 1.008 0.0000 A 0.00000e+00 0.00000e+00 +HP 1 1.008 0.0000 A 1.95998e-01 6.56888e-02 +I 53 126.9 0.0000 A 4.18722e-01 1.67360e+00 +Cl 17 35.45 0.0000 A 4.40104e-01 4.18400e-01 +Na 11 22.99 0.0000 A 3.32840e-01 1.15897e-02 +IB 0 131.0 0.0000 A 8.90899e-01 4.18400e-01 +MG 12 24.305 0.0000 A 1.41225e-01 3.74342e+00 +N 7 14.01 0.0000 A 3.25000e-01 7.11280e-01 +NA 7 14.01 0.0000 A 3.25000e-01 7.11280e-01 +NB 7 14.01 0.0000 A 3.25000e-01 7.11280e-01 +NC 7 14.01 0.0000 A 3.25000e-01 7.11280e-01 +N2 7 14.01 0.0000 A 3.25000e-01 7.11280e-01 +N3 7 14.01 0.0000 A 3.25000e-01 7.11280e-01 +N* 7 14.01 0.0000 A 3.25000e-01 7.11280e-01 +O 8 16.00 0.0000 A 2.95992e-01 8.78640e-01 +OW 8 16.00 0.0000 A 3.15061e-01 6.36386e-01 +OH 8 16.00 0.0000 A 3.06647e-01 8.80314e-01 +OS 8 16.00 0.0000 A 3.00001e-01 7.11280e-01 +O2 8 16.00 0.0000 A 2.95992e-01 8.78640e-01 +P 15 30.97 0.0000 A 3.74177e-01 8.36800e-01 +S 16 32.06 0.0000 A 3.56359e-01 1.04600e+00 +SH 16 32.06 0.0000 A 3.56359e-01 1.04600e+00 +CU 29 63.55 0.0000 A 3.39967e-01 3.59824e-01 +FE 26 55.00 0.0000 A 0.00000e+00 0.00000e+00 +K 19 39.10 0.0000 A 4.73602e-01 1.37235e-03 +Rb 37 85.47 0.0000 A 5.26699e-01 7.11280e-04 +Cs 55 132.91 0.0000 A 6.04920e-01 3.37230e-04 +OW_spc 8 15.9994 0.0000 A 3.16557e-01 6.50629e-01 +HW_spc 1 1.0080 0.0000 A 0.00000e+00 0.00000e+00 +Li 3 6.94 0.0000 A 2.02590e-01 7.65672e-02 +Zn 30 65.4 0.0000 A 1.95998e-01 5.23000e-02 +HW_tip4pew 1 1.008 0.0000 A 0.00000e+00 0.00000e+00 +OW_tip4pew 8 16.00 0.0000 A 3.16435e-01 6.80946e-01 +HW_tip4p 1 1.008 0.0000 A 0.00000e+00 0.00000e+00 +OW_tip4p 8 16.00 0.0000 A 3.15365e-01 6.48520e-01 +HW_tip5p 1 1.008 0.0000 A 0.00000e+00 0.00000e+00 +OW_tip5p 8 16.00 0.0000 A 3.12000e-01 6.69440e-01 +MW 0 0.0000 0.0000 A 0.00000e+00 0.00000e+00 +MCH3 0 0.0000 0.0000 A 0.00000e+00 0.00000e+00 +MNH3 0 0.0000 0.0000 A 0.00000e+00 0.00000e+00 + + +[ bondtypes ] +C C 1 0.1525 259408.0 +C OS 1 0.1323 376560.0 +C H4 1 0.1080 307105.6 +C H5 1 0.1080 307105.6 +CA OH 1 0.1364 376560.0 +CM OS 1 0.1240 401664.0 +Cl CT 1 0.1766 194137.6 +Br CT 1 0.1944 133051.2 +I CT 1 0.2166 123846.4 +F CA 1 0.1359 323004.8 +Cl CA 1 0.1727 161502.4 +I CA 1 0.2075 143092.8 +Br CA 1 0.1890 143929.6 +OW HW 1 0.09572 462750.4 +HW HW 1 0.15136 462750.4 +C CA 1 0.14090 392459.2 +C CB 1 0.14190 374049.6 +C CM 1 0.14440 343088.0 +C CT 1 0.15220 265265.6 +C N* 1 0.13830 354803.2 +C NA 1 0.13880 349782.4 +C NC 1 0.13580 382417.6 +C O 1 0.12290 476976.0 +C O2 1 0.12500 548940.8 +C OH 1 0.13640 376560.0 +CA CA 1 0.14000 392459.2 +CA CB 1 0.14040 392459.2 +CA CM 1 0.14330 357313.6 +CA CT 1 0.15100 265265.6 +CA HA 1 0.10800 307105.6 +CA H4 1 0.10800 307105.6 +CA N2 1 0.13400 402500.8 +CA NA 1 0.13810 357313.6 +CA NC 1 0.13390 404174.4 +CB CB 1 0.13700 435136.0 +CB N* 1 0.13740 364844.8 +CB NB 1 0.13910 346435.2 +CB NC 1 0.13540 385764.8 +CK H5 1 0.10800 307105.6 +CK N* 1 0.13710 368192.0 +CK NB 1 0.13040 442667.2 +CM CM 1 0.13500 459403.2 +CM CT 1 0.15100 265265.6 +CM HA 1 0.10800 307105.6 +CM H4 1 0.10800 307105.6 +CM H5 1 0.10800 307105.6 +CM N* 1 0.13650 374886.4 +CQ H5 1 0.10800 307105.6 +CQ NC 1 0.13240 420073.6 +CT CT 1 0.15260 259408.0 +CT HC 1 0.10900 284512.0 +CT H1 1 0.10900 284512.0 +CT H2 1 0.10900 284512.0 +CT H3 1 0.10900 284512.0 +CT HP 1 0.10900 284512.0 +CT N* 1 0.14750 282001.6 +CT N2 1 0.14630 282001.6 +CT OH 1 0.14100 267776.0 +CT OS 1 0.14100 267776.0 +H N2 1 0.10100 363171.2 +H N* 1 0.10100 363171.2 +H NA 1 0.10100 363171.2 +HO OH 1 0.09600 462750.4 +HO OS 1 0.09600 462750.4 +O2 P 1 0.14800 439320.0 +OH P 1 0.16100 192464.0 +OS P 1 0.16100 192464.0 +C* HC 1 0.10800 307105.6 +C N 1 0.13350 410032.0 +C* CB 1 0.14590 324678.4 +C* CT 1 0.14950 265265.6 +C* CW 1 0.13520 456892.8 +CA CN 1 0.14000 392459.2 +CB CN 1 0.14190 374049.6 +CC CT 1 0.15040 265265.6 +CC CV 1 0.13750 428441.6 +CC CW 1 0.13710 433462.4 +CC NA 1 0.13850 353129.6 +CC NB 1 0.13940 343088.0 +CN NA 1 0.13800 358150.4 +CR H5 1 0.10800 307105.6 +CR NA 1 0.13430 399153.6 +CR NB 1 0.13350 408358.4 +CT N 1 0.14490 282001.6 +CT N3 1 0.14710 307105.6 +CT S 1 0.18100 189953.6 +CT SH 1 0.18100 198321.6 +CV H4 1 0.10800 307105.6 +CV NB 1 0.13940 343088.0 +CW H4 1 0.10800 307105.6 +CW NA 1 0.13810 357313.6 +H N 1 0.10100 363171.2 +H N3 1 0.10100 363171.2 +HS SH 1 0.13360 229283.2 +S S 1 0.20380 138908.8 +CT F 1 0.13800 307105.6 +CC CC 1 0.14290 350030.0 +CV N* 1 0.13710 367190.0 + + +[ constrainttypes ] +MCH3 CT 2 0.166426 +MCH3 S 2 0.193875 +MCH3 MCH3 2 0.092163 +MNH3 CT 2 0.158254 +MNH3 MNH3 2 0.080229 +C HO 2 0.195074 +CA HO 2 0.195074 +CT HO 2 0.194132 +CT HS 2 0.235935 + + +[ angletypes ] +HW OW HW 1 104.520 836.800 +HW HW OW 1 127.740 0.000 +C C O 1 120.000 669.440 +C C OH 1 120.000 669.440 +CT C CT 1 117.000 527.184 +CT C OS 1 115.000 669.440 +O C OS 1 125.000 669.440 +H4 C C 1 120.000 418.400 +H4 C CM 1 115.000 418.400 +H4 C CT 1 115.000 418.400 +H4 C O 1 120.000 418.400 +H4 C OH 1 120.000 418.400 +H5 C N 1 120.000 418.400 +H5 C O 1 119.000 418.400 +H5 C OH 1 107.000 418.400 +H5 C OS 1 107.000 418.400 +CA CA OH 1 120.000 585.760 +CA OH HO 1 113.000 418.400 +F CA CA 1 121.000 585.760 +Cl CA CA 1 118.800 585.760 +Br CA CA 1 118.800 585.760 +I CA CA 1 118.800 585.760 +CM CM OS 1 125.000 669.440 +H4 CM OS 1 113.000 418.400 +HA CM HA 1 120.000 292.880 +HA CM CT 1 120.000 418.400 +H1 CT CM 1 109.500 418.400 +HC CT CM 1 109.500 418.400 +C CT OS 1 109.500 502.080 +CM CT CT 1 111.000 527.184 +CM CT OS 1 109.500 418.400 +CT CT CA 1 114.000 527.184 +OS CT OS 1 101.000 502.080 +F CT CT 1 109.000 418.400 +F CT H2 1 109.500 418.400 +Cl CT CT 1 108.500 418.400 +Cl CT H1 1 108.500 418.400 +Br CT CT 1 108.000 418.400 +Br CT H1 1 106.500 418.400 +I CT CT 1 106.000 418.400 +CB C NA 1 111.300 585.760 +CB C O 1 128.800 669.440 +CM C NA 1 114.100 585.760 +CM C O 1 125.300 669.440 +CT C O 1 120.400 669.440 +CT C O2 1 117.000 585.760 +CT C OH 1 110.000 669.440 +N* C NA 1 115.400 585.760 +N* C NC 1 118.600 585.760 +N* C O 1 120.900 669.440 +NA C O 1 120.600 669.440 +NC C O 1 122.500 669.440 +CT C N 1 116.600 585.760 +N C O 1 122.900 669.440 +O C O 1 126.000 669.440 +O2 C O2 1 126.000 669.440 +O C OH 1 120.000 669.440 +CA C CA 1 120.000 527.184 +CA C OH 1 120.000 585.760 +C CA OH 1 120.000 585.760 +C CA CA 1 120.000 527.184 +CA CA CA 1 120.000 527.184 +CA CA CB 1 120.000 527.184 +CA CA CT 1 120.000 585.760 +CA CA HA 1 120.000 418.400 +CA CA H4 1 120.000 418.400 +CB CA HA 1 120.000 418.400 +CB CA H4 1 120.000 418.400 +CB CA N2 1 123.500 585.760 +CB CA NC 1 117.300 585.760 +CM CA N2 1 120.100 585.760 +CM CA NC 1 121.500 585.760 +N2 CA NA 1 116.000 585.760 +N2 CA NC 1 119.300 585.760 +NA CA NC 1 123.300 585.760 +C CA HA 1 120.000 418.400 +N2 CA N2 1 120.000 585.760 +CN CA HA 1 120.000 418.400 +CA CA CN 1 120.000 527.184 +C CB CB 1 119.200 527.184 +C CB NB 1 130.000 585.760 +CA CB CB 1 117.300 527.184 +CA CB NB 1 132.400 585.760 +CB CB N* 1 106.200 585.760 +CB CB NB 1 110.400 585.760 +CB CB NC 1 127.700 585.760 +N* CB NC 1 126.200 585.760 +C* CB CA 1 134.900 527.184 +C* CB CN 1 108.800 527.184 +CA CB CN 1 116.200 527.184 +H5 CK N* 1 123.050 418.400 +H5 CK NB 1 123.050 418.400 +N* CK NB 1 113.900 585.760 +C CM CM 1 120.700 527.184 +C CM CT 1 119.700 585.760 +C CM HA 1 119.700 418.400 +C CM H4 1 119.700 418.400 +CA CM CM 1 117.000 527.184 +CA CM HA 1 123.300 418.400 +CA CM H4 1 123.300 418.400 +CM CM CT 1 119.700 585.760 +CM CM HA 1 119.700 418.400 +CM CM H4 1 119.700 418.400 +CM CM N* 1 121.200 585.760 +H4 CM N* 1 119.100 418.400 +H5 CQ NC 1 115.450 418.400 +NC CQ NC 1 129.100 585.760 +CM CT HC 1 109.500 418.400 +CT CT CT 1 109.500 334.720 +CT CT HC 1 109.500 418.400 +CT CT H1 1 109.500 418.400 +CT CT H2 1 109.500 418.400 +CT CT HP 1 109.500 418.400 +CT CT N* 1 109.500 418.400 +CT CT OH 1 109.500 418.400 +CT CT OS 1 109.500 418.400 +HC CT HC 1 109.500 292.880 +H1 CT H1 1 109.500 292.880 +HP CT HP 1 109.500 292.880 +H2 CT N* 1 109.500 418.400 +H1 CT N* 1 109.500 418.400 +H1 CT OH 1 109.500 418.400 +H1 CT OS 1 109.500 418.400 +H2 CT OS 1 109.500 418.400 +N* CT OS 1 109.500 418.400 +H1 CT N 1 109.500 418.400 +C CT H1 1 109.500 418.400 +C CT HP 1 109.500 418.400 +H1 CT S 1 109.500 418.400 +H1 CT SH 1 109.500 418.400 +CT CT S 1 114.700 418.400 +CT CT SH 1 108.600 418.400 +H2 CT H2 1 109.500 292.880 +H1 CT N2 1 109.500 418.400 +HP CT N3 1 109.500 418.400 +CA CT CT 1 114.000 527.184 +C CT HC 1 109.500 418.400 +C CT N 1 110.100 527.184 +CT CT N2 1 111.200 669.440 +CT CT N 1 109.700 669.440 +C CT CT 1 111.100 527.184 +CA CT HC 1 109.500 418.400 +CT CT N3 1 111.200 669.440 +CC CT CT 1 113.100 527.184 +CC CT HC 1 109.500 418.400 +C CT N3 1 111.200 669.440 +C* CT CT 1 115.600 527.184 +C* CT HC 1 109.500 418.400 +CT CC NA 1 120.000 585.760 +CT CC CV 1 120.000 585.760 +CT CC NB 1 120.000 585.760 +CV CC NA 1 120.000 585.760 +CW CC NA 1 120.000 585.760 +CW CC NB 1 120.000 585.760 +CT CC CW 1 120.000 585.760 +H5 CR NA 1 120.000 418.400 +H5 CR NB 1 120.000 418.400 +NA CR NA 1 120.000 585.760 +NA CR NB 1 120.000 585.760 +CC CV H4 1 120.000 418.400 +CC CV NB 1 120.000 585.760 +H4 CV NB 1 120.000 418.400 +CC CW H4 1 120.000 418.400 +CC CW NA 1 120.000 585.760 +H4 CW NA 1 120.000 418.400 +C* CW H4 1 120.000 418.400 +C* CW NA 1 108.700 585.760 +CT C* CW 1 125.000 585.760 +CB C* CT 1 128.600 585.760 +CB C* CW 1 106.400 527.184 +CA CN NA 1 132.800 585.760 +CB CN NA 1 104.400 585.760 +CA CN CB 1 122.700 527.184 +C N CT 1 121.900 418.400 +C N H 1 120.000 418.400 +CT N H 1 118.040 418.400 +CT N CT 1 118.000 418.400 +H N H 1 120.000 292.880 +C N* CM 1 121.600 585.760 +C N* CT 1 117.600 585.760 +C N* H 1 119.200 418.400 +CB N* CK 1 105.400 585.760 +CB N* CT 1 125.800 585.760 +CB N* H 1 125.800 418.400 +CK N* CT 1 128.800 585.760 +CK N* H 1 128.800 418.400 +CM N* CT 1 121.200 585.760 +CM N* H 1 121.200 418.400 +CA N2 H 1 120.000 418.400 +H N2 H 1 120.000 292.880 +CT N2 H 1 118.400 418.400 +CA N2 CT 1 123.200 418.400 +CT N3 H 1 109.500 418.400 +CT N3 CT 1 109.500 418.400 +H N3 H 1 109.500 292.880 +C NA C 1 126.400 585.760 +C NA CA 1 125.200 585.760 +C NA H 1 116.800 418.400 +CA NA H 1 118.000 418.400 +CC NA CR 1 120.000 585.760 +CC NA H 1 120.000 418.400 +CR NA CW 1 120.000 585.760 +CR NA H 1 120.000 418.400 +CW NA H 1 120.000 418.400 +CN NA CW 1 111.600 585.760 +CN NA H 1 123.100 418.400 +CB NB CK 1 103.800 585.760 +CC NB CR 1 117.000 585.760 +CR NB CV 1 117.000 585.760 +C NC CA 1 120.500 585.760 +CA NC CB 1 112.200 585.760 +CA NC CQ 1 118.600 585.760 +CB NC CQ 1 111.000 585.760 +C OH HO 1 113.000 418.400 +CT OH HO 1 108.500 460.240 +HO OH P 1 108.500 376.560 +CT OS CT 1 109.500 502.080 +CT OS P 1 120.500 836.800 +P OS P 1 120.500 836.800 +O2 P OH 1 108.230 376.560 +O2 P O2 1 119.900 1171.520 +O2 P OS 1 108.230 836.800 +OH P OS 1 102.600 376.560 +OS P OS 1 102.600 376.560 +CT S CT 1 98.900 518.816 +CT S S 1 103.700 569.024 +CT SH HS 1 96.000 359.824 +HS SH HS 1 92.070 292.880 +F CT F 1 109.100 644.336 +F CT H1 1 109.500 418.400 +N C N 1 120.000 585.760 +CM N* CM 1 120.090 560.490 +N* CM C 1 118.340 587.520 +N* CM HA 1 114.650 434.130 +N* CM CA 1 118.340 587.520 +CM C OH 1 119.940 584.500 +CM C CA 1 119.970 562.160 +C CA CT 1 120.630 534.210 +CM CA CA 1 119.970 562.160 +CM CA CT 1 120.630 534.210 +HC CT N3 1 109.920 413.300 +CT CA H4 1 119.250 379.070 +CT CA N2 1 123.520 556.220 +H4 CA N2 1 120.690 438.480 +N2 CT HC 1 109.610 412.210 +H1 CT N3 1 109.920 413.300 +CC CT H1 1 111.620 393.550 +CC CT N3 1 111.170 558.900 +CC NA CC 1 109.900 576.890 +NB CC NA 1 112.020 625.760 +CC NB CV 1 105.670 594.800 +CC CC CV 1 114.190 570.360 +CV N* CT 1 125.090 523.500 +CV N* CV 1 109.900 576.890 +N* CV H4 1 119.660 420.240 +N* CV CC 1 109.420 610.110 +CT CC CC 1 115.970 541.070 + + +[ dihedraltypes ] +CA CA CA OH 4 180.00 4.60240 2 +H5 O C OH 4 180.00 4.60240 2 +H5 O C OS 4 180.00 4.60240 2 +CM CT CM HA 4 180.00 4.60240 2 +CA CA CA Br 4 180.00 4.60240 2 +CM H4 C O 4 180.00 4.60240 2 +C CT N H 4 180.00 4.60240 2 +C CT N O 4 180.00 4.60240 2 +CB CK N* CT 4 180.00 4.18400 2 +CK CB N* CT 4 180.00 4.18400 2 +C CM N* CT 4 180.00 4.18400 2 +CT N* C CM 4 180.00 4.18400 2 +CM C CM CT 4 180.00 4.60240 2 +CT O C OH 4 180.00 43.93200 2 +NA CV CC CT 4 180.00 4.60240 2 +NB CW CC CT 4 180.00 4.60240 2 +NA CW CC CT 4 180.00 4.60240 2 +CW CB C* CT 4 180.00 4.60240 2 +CA CA CA CT 4 180.00 4.60240 2 +C CM CM CT 4 180.00 4.60240 2 +NC CM CA N2 4 180.00 4.60240 2 +CB NC CA N2 4 180.00 4.60240 2 +NA NC CA N2 4 180.00 4.60240 2 +CA CA C OH 4 180.00 4.60240 2 +C CA CA OH 4 180.00 4.60240 2 +CT CV CC NA 4 180.00 4.60240 2 +CT CW CC NB 4 180.00 4.60240 2 +CT CW CC NA 4 180.00 4.60240 2 +CB CT C* CW 4 180.00 4.60240 2 +CM N2 CA NC 4 180.00 4.60240 2 +CB N2 CA NC 4 180.00 4.60240 2 +N2 NA CA NC 4 180.00 4.60240 2 +N N C O 4 180.00 43.93200 2 +X O2 C O2 4 180.00 43.93200 2 +X N2 CA N2 4 180.00 43.93200 2 +X CT N CT 4 180.00 4.18400 2 +X X C O 4 180.00 43.93200 2 +X X N H 4 180.00 4.18400 2 +X X N2 H 4 180.00 4.18400 2 +X X NA H 4 180.00 4.18400 2 +X X CA HA 4 180.00 4.60240 2 +X X CW H4 4 180.00 4.60240 2 +X X CR H5 4 180.00 4.60240 2 +X X CV H4 4 180.00 4.60240 2 +X X CQ H5 4 180.00 4.60240 2 +X X CK H5 4 180.00 4.60240 2 +X X CM H4 4 180.00 4.60240 2 +X X CM HA 4 180.00 4.60240 2 +X X CA H4 4 180.00 4.60240 2 +X X CA H5 4 180.00 4.60240 2 +CM CA C OH 4 180.0 4.60240 2 +N* CM H4 C 4 180.0 4.60240 2 +N* CM H4 CA 4 180.0 4.60240 2 +CT N* CM CM 4 180.0 4.60240 2 +CT CM CA CA 4 180.0 4.60240 2 +C CA CA CT 4 180.0 4.60240 2 +N* CV H4 CC 4 180.00 4.60240 2 +CV N* CV CT 4 180.00 4.60240 2 +CT CC CC CV 1 180.00 4.60240 2 +CV CC CC CV 1 0.00 4.60240 2 +CT CC CC CT 1 0.00 4.60240 2 +CT N* CV H4 1 0.00 4.60240 2 +CT N* CV CC 1 180.00 4.60240 2 +CV N* CV H4 1 180.00 4.60240 2 +CV N* CV CC 1 0.00 4.60240 2 +CT CT OS CT 9 0.0 1.60247 3 +CT CT OS CT 9 180.0 0.41840 2 +C N CT C 9 0.0 1.12968 2 +C N CT C 9 0.0 1.75728 3 +N CT C N 9 180.0 1.88280 1 +N CT C N 9 180.0 6.61072 2 +N CT C N 9 180.0 2.30120 3 +CT CT N C 9 0.0 8.36800 1 +CT CT N C 9 0.0 8.36800 2 +CT CT N C 9 0.0 1.67360 3 +CT CT C N 9 0.0 0.83680 1 +CT CT C N 9 0.0 0.83680 2 +CT CT C N 9 0.0 1.67360 3 +H N C O 9 180.0 10.46000 2 +H N C O 9 0.0 8.36800 1 +CT S S CT 9 0.0 14.64400 2 +CT S S CT 9 0.0 2.51040 3 +OS CT CT OS 9 0.0 0.60250 3 +OS CT CT OS 9 0.0 4.91620 2 +OS CT CT OH 9 0.0 0.60250 3 +OS CT CT OH 9 0.0 4.91620 2 +OH CT CT OH 9 0.0 0.60250 3 +OH CT CT OH 9 0.0 4.91620 2 +OH P OS CT 9 0.0 1.04600 3 +OH P OS CT 9 0.0 5.02080 2 +OS P OS CT 9 0.0 1.04600 3 +OS P OS CT 9 0.0 5.02080 2 +OS CT N* CK 9 0.0 10.46000 1 +OS CT N* CM 9 0.0 10.46000 1 +H1 CT C O 9 0.0 3.34720 1 +H1 CT C O 9 180.0 0.33472 3 +HC CT C O 9 0.0 3.34720 1 +HC CT C O 9 180.0 0.33472 3 +HC CT CT HC 9 0.0 0.62760 3 +HC CT CT CT 9 0.0 0.66944 3 +HC CT CM CM 9 180.0 1.58992 3 +HC CT CM CM 9 0.0 4.81160 1 +HO OH CT CT 9 0.0 0.66944 3 +HO OH CT CT 9 0.0 1.04600 1 +HO OH C O 9 180.0 9.62320 2 +HO OH C O 9 0.0 7.94960 1 +CM CM C O 9 180.0 9.10020 2 +CM CM C O 9 0.0 1.25520 3 +CT CM CM CT 9 180.0 27.82360 2 +CT CM CM CT 9 180.0 7.94960 1 +CT CT CT CT 9 0.0 0.75312 3 +CT CT CT CT 9 180.0 1.04600 2 +CT CT CT CT 9 180.0 0.83680 1 +CT CT OS C 9 0.0 1.60247 3 +CT CT OS C 9 180.0 3.34720 1 +CT OS CT OS 9 0.0 0.41840 3 +CT OS CT OS 9 180.0 3.55640 2 +CT OS CT OS 9 180.0 5.64840 1 +O C OS CT 9 180.0 11.29680 2 +O C OS CT 9 180.0 5.85760 1 +F CT CT F 9 180.0 5.02080 1 +Cl CT CT Cl 9 180.0 1.88280 1 +Br CT CT Br 9 0.0 0.00000 0 +H1 CT CT OS 9 0.0 1.04600 1 +H1 CT CT OH 9 0.0 1.04600 1 +H1 CT CT F 9 0.0 0.79496 1 +H1 CT CT Cl 9 0.0 1.04600 1 +H1 CT CT Br 9 0.0 2.30120 1 +HC CT CT OS 9 0.0 1.04600 1 +HC CT CT OH 9 0.0 1.04600 1 +HC CT CT F 9 0.0 0.79496 1 +HC CT CT Cl 9 0.0 1.04600 1 +HC CT CT Br 9 0.0 2.30120 1 +CT OS CT N* 9 0.0 1.60247 3 +CT OS CT N* 9 0.0 2.71960 2 +X C C X 9 180.0 15.16700 2 +X C O X 9 180.0 11.71520 2 +X C OS X 9 180.0 11.29680 2 +X CA OH X 9 180.0 3.76560 2 +X CM OS X 9 180.0 4.39320 2 +X C CA X 9 180.0 15.16700 2 +X C CB X 9 180.0 12.55200 2 +X C CM X 9 180.0 9.10020 2 +X C N* X 9 180.0 6.06680 2 +X C NA X 9 180.0 5.64840 2 +X C NC X 9 180.0 16.73600 2 +X C OH X 9 180.0 9.62320 2 +X C CT X 9 0.0 0.00000 0 +X CA CA X 9 180.0 15.16700 2 +X CA CB X 9 180.0 14.64400 2 +X CA CM X 9 180.0 10.66920 2 +X CA CT X 9 0.0 0.00000 0 +X CA N2 X 9 180.0 10.04160 2 +X CA NA X 9 180.0 6.27600 2 +X CA NC X 9 180.0 20.08320 2 +X CB CB X 9 180.0 22.80280 2 +X CB N* X 9 180.0 6.90360 2 +X CB NB X 9 180.0 10.66920 2 +X CB NC X 9 180.0 17.36360 2 +X CK N* X 9 180.0 7.11280 2 +X CK NB X 9 180.0 41.84000 2 +X CM CM X 9 180.0 27.82360 2 +X CM CT X 9 0.0 0.00000 0 +X CM N* X 9 180.0 7.74040 2 +X CQ NC X 9 180.0 28.45120 2 +X CT CT X 9 0.0 0.65084 3 +X CT N X 9 0.0 0.00000 0 +X CT N* X 9 0.0 0.00000 0 +X CT N2 X 9 0.0 0.00000 0 +X CT OH X 9 0.0 0.69733 3 +X CT OS X 9 0.0 1.60387 3 +X OH P X 9 0.0 1.04600 3 +X OS P X 9 0.0 1.04600 3 +X C N X 9 180.0 10.46000 2 +X CT N3 X 9 0.0 0.65084 3 +X CT S X 9 0.0 1.39467 3 +X CT SH X 9 0.0 1.04600 3 +X C* CB X 9 180.0 7.00820 2 +X C* CT X 9 0.0 0.00000 0 +X C* CW X 9 180.0 27.30060 2 +X CA CN X 9 180.0 15.16700 2 +X CB CN X 9 180.0 12.55200 2 +X CC CT X 9 0.0 0.00000 0 +X CC CV X 9 180.0 21.54760 2 +X CC CW X 9 180.0 22.48900 2 +X CC NA X 9 180.0 5.85760 2 +X CC NB X 9 180.0 10.04160 2 +X CN NA X 9 180.0 6.38060 2 +X CR NA X 9 180.0 9.72780 2 +X CR NB X 9 180.0 20.92000 2 +X CV NB X 9 180.0 10.04160 2 +X CW NA X 9 180.0 6.27600 2 + + +[ implicit_genborn_params ] +C 0.172 1 1.554 0.1875 0.72 +CA 0.18 1 1.037 0.1875 0.72 +CB 0.172 0.012 1.554 0.1875 0.72 +CC 0.172 1 1.554 0.1875 0.72 +CN 0.172 0.012 1.554 0.1875 0.72 +CR 0.18 1 1.073 0.1875 0.72 +CT 0.18 1 1.276 0.190 0.72 +CV 0.18 1 1.073 0.1875 0.72 +CW 0.18 1 1.073 0.1875 0.72 +C* 0.172 0.012 1.554 0.1875 0.72 +H 0.1 1 1 0.115 0.85 +HC 0.1 1 1 0.125 0.85 +H1 0.1 1 1 0.125 0.85 +HA 0.1 1 1 0.125 0.85 +H4 0.1 1 1 0.115 0.85 +H5 0.1 1 1 0.125 0.85 +HO 0.1 1 1 0.105 0.85 +HS 0.1 1 1 0.125 0.85 +HP 0.1 1 1 0.125 0.85 +N 0.155 1 1.028 0.17063 0.79 +NA 0.155 1 1.028 0.17063 0.79 +NB 0.155 1 1.215 0.17063 0.79 +N2 0.16 1 1.215 0.17063 0.79 +N3 0.16 1 1.215 0.1625 0.79 +O 0.15 1 0.926 0.148 0.85 +OH 0.152 1 1.080 0.1535 0.85 +O2 0.17 1 0.922 0.148 0.85 +S 0.18 1 1.121 0.1775 0.96 +SH 0.18 1 1.121 0.1775 0.96 +MNH3 0 0 0 0 0 +MCH3 0 0 0 0 0 + + +[ moleculetype ] +SOL 2 + +[ atoms ] +1 OW 1 SOL OW 1 -0.834 16.00000 +2 HW 1 SOL HW1 1 0.417 1.00800 +3 HW 1 SOL HW2 1 0.417 1.00800 + +#ifndef FLEXIBLE +[ settles ] +1 1 0.09572 0.15139 +#endif + +#ifndef FLEXIBLE +[ exclusions ] +1 2 3 +2 1 3 +3 1 2 +#endif + +#ifndef FLEXIBLE +[ bonds ] +#else +[ bonds ] +1 2 1 0.09572 502416.0 0.09572 502416.0 +1 3 1 0.09572 502416.0 0.09572 502416.0 +#endif + +#ifndef FLEXIBLE +[ angles ] +#else +[ angles ] +2 1 3 1 104.52 628.02 104.52 628.02 +#endif + +#ifdef POSRES_WATER +[ position_restraints ] +1 1 1000 1000 1000 +#endif + + +[ moleculetype ] +IB+ 1 + +[ atoms ] +1 IB 1 IB+ IB 1 1.00000 + + +[ moleculetype ] +CA 1 + +[ atoms ] +1 C0 1 CA CA 1 2.00000 + + +[ moleculetype ] +CL 1 + +[ atoms ] +1 Cl 1 CL CL 1 -1.00000 + + +[ moleculetype ] +NA 1 + +[ atoms ] +1 Na 1 NA NA 1 1.00000 + + +[ moleculetype ] +MG 1 + +[ atoms ] +1 MG 1 MG MG 1 2.00000 + + +[ moleculetype ] +K 1 + +[ atoms ] +1 K 1 K K 1 1.00000 + + +[ moleculetype ] +RB 1 + +[ atoms ] +1 Rb 1 RB RB 1 1.00000 + + +[ moleculetype ] +CS 1 + +[ atoms ] +1 Cs 1 CS CS 1 1.00000 + + +[ moleculetype ] +LI 1 + +[ atoms ] +1 Li 1 LI LI 1 1.00000 + + +[ moleculetype ] +ZN 1 + +[ atoms ] +1 Zn 1 ZN ZN 1 2.00000 + + +[ moleculetype ] +Reactive 3 + +[ atoms ] +1 CT 1 ACE CH3 1 0.0000 12.01 +2 HC 1 ACE HH31 2 0.0000 1.008 +3 HC 1 ACE HH32 3 0.0000 1.008 +4 HC 1 ACE HH33 4 0.0000 1.008 +5 C 1 ACE C 5 0.0000 12.01 +6 O 1 ACE O 6 0.0000 16.0 +7 N 2 ALA N 7 0.0000 14.01 +8 H 2 ALA H 8 0.0000 1.008 +9 CT 2 ALA CA 9 0.0000 12.01 +10 CT 2 ALA CB 10 0.0000 12.01 +11 HC 2 ALA HB1 11 0.0000 1.008 +12 HC 2 ALA HB2 12 0.0000 1.008 +13 HC 2 ALA HB3 13 0.0000 1.008 +14 C 2 ALA C 14 0.0000 12.01 +15 O 2 ALA O 15 0.0000 16.0 +16 N 3 NME N 16 0.0000 14.01 +17 H 3 NME H 17 0.0000 1.008 +18 CT 3 NME CH3 18 0.0000 12.01 +19 H1 3 NME HH31 19 0.0000 1.008 +20 H1 3 NME HH32 20 0.0000 1.008 +21 H1 3 NME HH33 21 0.0000 1.008 + +[ bonds ] +1 2 1 0.1094 315945.8067 +1 3 1 0.1094 315945.8067 +1 4 1 0.1094 315945.8067 +1 5 1 0.1527 223856.8196 +5 6 1 0.1217 620877.6113 +5 7 1 0.1381 238725.3419 +7 8 1 0.1018 409606.7816 +7 9 1 0.1349 159153.2668 +9 10 1 0.1494 213063.1007 +9 14 1 0.1411 81753.6209 +10 11 1 0.1095 314854.8869 +10 12 1 0.1095 314854.8869 +10 13 1 0.1095 314854.8869 +14 15 1 0.1217 595271.7050 +14 16 1 0.1355 328862.3745 +16 17 1 0.1012 404914.9762 +16 18 1 0.1446 273226.4874 +18 19 1 0.1093 315059.3881 +18 20 1 0.1093 315059.3881 +18 21 1 0.1093 315059.3881 + +[ pairs ] +1 8 1 +1 9 1 +2 6 1 +2 7 1 +3 6 1 +3 7 1 +4 6 1 +4 7 1 +5 10 1 +5 14 1 +6 8 1 +6 9 1 +7 11 1 +7 12 1 +7 13 1 +7 15 1 +7 16 1 +8 10 1 +8 14 1 +9 17 1 +9 18 1 +10 15 1 +10 16 1 +11 14 1 +12 14 1 +13 14 1 +14 19 1 +14 20 1 +14 21 1 +15 17 1 +15 18 1 +17 19 1 +17 20 1 +17 21 1 + +[ angles ] +2 1 3 1 103.3643 340.6539 +2 1 4 1 103.3643 340.6539 +2 1 5 1 105.2882 433.5625 +3 1 4 1 103.3643 340.6539 +3 1 5 1 105.2882 433.5625 +4 1 5 1 105.2882 433.5625 +1 5 6 1 147.6662 501.9412 +1 5 7 1 141.2754 447.3940 +6 5 7 1 139.9348 691.8903 +5 7 8 1 114.9818 326.2912 +5 7 9 1 114.1798 352.9718 +8 7 9 1 112.1479 339.0491 +7 9 10 1 125.2240 489.0848 +7 9 14 1 120.1065 326.8016 +10 9 14 1 127.8208 286.4854 +9 10 11 1 104.6645 413.6513 +9 10 12 1 104.6645 413.6513 +9 10 13 1 104.6645 413.6513 +11 10 12 1 102.5684 329.9621 +11 10 13 1 102.5684 329.9621 +12 10 13 1 102.5684 329.9621 +9 14 15 1 141.9027 435.6668 +9 14 16 1 138.8595 379.4164 +15 14 16 1 140.0279 638.2252 +14 16 17 1 114.0763 416.5870 +14 16 18 1 106.9759 235.9870 +17 16 18 1 111.1294 361.0943 +16 18 19 1 105.5001 508.9698 +16 18 20 1 105.5001 508.9698 +16 18 21 1 105.5001 508.9698 +19 18 20 1 103.3665 351.7994 +19 18 21 1 103.3665 351.7994 +20 18 21 1 103.3665 351.7994 + +[ dihedrals ] +2 1 5 6 9 0.0000 0.1880 1 +2 1 5 6 9 180.0000 2.8235 2 +2 1 5 6 9 0.0000 0.2748 3 +2 1 5 6 9 180.0000 0.0079 4 +2 1 5 6 9 180.0000 0.0246 5 +2 1 5 6 9 0.0000 0.0006 6 +2 1 5 7 9 180.0000 0.1764 1 +2 1 5 7 9 180.0000 3.2621 2 +2 1 5 7 9 0.0000 0.4171 3 +2 1 5 7 9 180.0000 0.0103 4 +2 1 5 7 9 180.0000 0.0575 5 +2 1 5 7 9 180.0000 0.0045 6 +3 1 5 6 9 0.0000 0.1880 1 +3 1 5 6 9 180.0000 2.8235 2 +3 1 5 6 9 0.0000 0.2748 3 +3 1 5 6 9 180.0000 0.0079 4 +3 1 5 6 9 180.0000 0.0246 5 +3 1 5 6 9 0.0000 0.0006 6 +3 1 5 7 9 180.0000 0.1764 1 +3 1 5 7 9 180.0000 3.2621 2 +3 1 5 7 9 0.0000 0.4171 3 +3 1 5 7 9 180.0000 0.0103 4 +3 1 5 7 9 180.0000 0.0575 5 +3 1 5 7 9 180.0000 0.0045 6 +4 1 5 6 9 0.0000 0.1880 1 +4 1 5 6 9 180.0000 2.8235 2 +4 1 5 6 9 0.0000 0.2748 3 +4 1 5 6 9 180.0000 0.0079 4 +4 1 5 6 9 180.0000 0.0246 5 +4 1 5 6 9 0.0000 0.0006 6 +4 1 5 7 9 180.0000 0.1764 1 +4 1 5 7 9 180.0000 3.2621 2 +4 1 5 7 9 0.0000 0.4171 3 +4 1 5 7 9 180.0000 0.0103 4 +4 1 5 7 9 180.0000 0.0575 5 +4 1 5 7 9 180.0000 0.0045 6 +1 5 7 8 9 0.0000 1.7931 1 +1 5 7 8 9 180.0000 9.6984 2 +1 5 7 8 9 0.0000 0.6622 3 +1 5 7 8 9 180.0000 0.2991 4 +1 5 7 8 9 0.0000 0.0097 5 +1 5 7 8 9 180.0000 0.1326 6 +1 5 7 9 9 0.0000 1.7415 1 +1 5 7 9 9 180.0000 12.9853 2 +1 5 7 9 9 0.0000 0.5074 3 +1 5 7 9 9 0.0000 0.2668 4 +1 5 7 9 9 180.0000 0.0356 5 +1 5 7 9 9 180.0000 0.0285 6 +6 5 7 8 9 0.0000 7.3992 1 +6 5 7 8 9 180.0000 14.8666 2 +6 5 7 8 9 0.0000 0.2974 3 +6 5 7 8 9 180.0000 0.0871 4 +6 5 7 8 9 180.0000 0.0240 5 +6 5 7 8 9 180.0000 0.1531 6 +6 5 7 9 9 0.0000 6.0148 1 +6 5 7 9 9 180.0000 18.2605 2 +6 5 7 9 9 180.0000 0.1417 3 +6 5 7 9 9 0.0000 0.8047 4 +6 5 7 9 9 180.0000 0.0455 5 +6 5 7 9 9 180.0000 0.0153 6 +5 7 9 10 9 180.0000 0.3902 1 +5 7 9 10 9 180.0000 11.0027 2 +5 7 9 10 9 0.0000 0.7300 3 +5 7 9 10 9 0.0000 0.3757 4 +5 7 9 10 9 180.0000 0.0288 5 +5 7 9 10 9 180.0000 0.0102 6 +5 7 9 14 9 0.0000 3.2324 1 +5 7 9 14 9 180.0000 6.5537 2 +5 7 9 14 9 0.0000 0.7782 3 +5 7 9 14 9 0.0000 0.0273 4 +5 7 9 14 9 180.0000 0.0029 5 +5 7 9 14 9 180.0000 0.0055 6 +8 7 9 10 9 0.0000 3.6074 1 +8 7 9 10 9 180.0000 6.0950 2 +8 7 9 10 9 0.0000 1.1335 3 +8 7 9 10 9 180.0000 0.1172 4 +8 7 9 10 9 180.0000 0.0250 5 +8 7 9 10 9 180.0000 0.0647 6 +8 7 9 14 9 0.0000 0.0351 1 +8 7 9 14 9 180.0000 4.9404 2 +8 7 9 14 9 0.0000 0.0838 3 +8 7 9 14 9 0.0000 0.1089 4 +8 7 9 14 9 0.0000 0.0117 5 +8 7 9 14 9 180.0000 0.0598 6 +7 9 10 11 9 180.0000 0.3769 1 +7 9 10 11 9 180.0000 2.5366 2 +7 9 10 11 9 0.0000 0.8548 3 +7 9 10 11 9 0.0000 0.0055 4 +7 9 10 11 9 180.0000 0.0325 5 +7 9 10 11 9 180.0000 0.0136 6 +7 9 10 12 9 180.0000 0.3769 1 +7 9 10 12 9 180.0000 2.5366 2 +7 9 10 12 9 0.0000 0.8548 3 +7 9 10 12 9 0.0000 0.0055 4 +7 9 10 12 9 180.0000 0.0325 5 +7 9 10 12 9 180.0000 0.0136 6 +7 9 10 13 9 180.0000 0.3769 1 +7 9 10 13 9 180.0000 2.5366 2 +7 9 10 13 9 0.0000 0.8548 3 +7 9 10 13 9 0.0000 0.0055 4 +7 9 10 13 9 180.0000 0.0325 5 +7 9 10 13 9 180.0000 0.0136 6 +14 9 10 11 9 180.0000 1.5012 1 +14 9 10 11 9 180.0000 2.7971 2 +14 9 10 11 9 0.0000 0.7349 3 +14 9 10 11 9 180.0000 0.3854 4 +14 9 10 11 9 0.0000 0.0534 5 +14 9 10 11 9 180.0000 0.0592 6 +14 9 10 12 9 180.0000 1.5012 1 +14 9 10 12 9 180.0000 2.7971 2 +14 9 10 12 9 0.0000 0.7349 3 +14 9 10 12 9 180.0000 0.3854 4 +14 9 10 12 9 0.0000 0.0534 5 +14 9 10 12 9 180.0000 0.0592 6 +14 9 10 13 9 180.0000 1.5012 1 +14 9 10 13 9 180.0000 2.7971 2 +14 9 10 13 9 0.0000 0.7349 3 +14 9 10 13 9 180.0000 0.3854 4 +14 9 10 13 9 0.0000 0.0534 5 +14 9 10 13 9 180.0000 0.0592 6 +7 9 14 15 9 180.0000 4.7216 1 +7 9 14 15 9 180.0000 4.4144 2 +7 9 14 15 9 180.0000 0.3480 3 +7 9 14 15 9 180.0000 0.3173 4 +7 9 14 15 9 0.0000 0.0027 5 +7 9 14 15 9 180.0000 0.0981 6 +7 9 14 16 9 0.0000 7.6452 1 +7 9 14 16 9 180.0000 8.6446 2 +7 9 14 16 9 180.0000 0.3095 3 +7 9 14 16 9 180.0000 0.1632 4 +7 9 14 16 9 180.0000 0.0233 5 +7 9 14 16 9 180.0000 0.1571 6 +10 9 14 15 9 180.0000 5.6503 1 +10 9 14 15 9 180.0000 4.1278 2 +10 9 14 15 9 0.0000 0.2307 3 +10 9 14 15 9 180.0000 0.2222 4 +10 9 14 15 9 0.0000 0.0280 5 +10 9 14 15 9 180.0000 0.1189 6 +10 9 14 16 9 0.0000 8.2641 1 +10 9 14 16 9 180.0000 8.7774 2 +10 9 14 16 9 0.0000 0.3183 3 +10 9 14 16 9 180.0000 0.4378 4 +10 9 14 16 9 180.0000 0.0258 5 +10 9 14 16 9 180.0000 0.1407 6 +9 14 16 17 9 0.0000 5.0360 1 +9 14 16 17 9 180.0000 9.2646 2 +9 14 16 17 9 0.0000 1.2911 3 +9 14 16 17 9 0.0000 0.0552 4 +9 14 16 17 9 180.0000 0.0416 5 +9 14 16 17 9 180.0000 0.0350 6 +9 14 16 18 9 0.0000 4.2301 1 +9 14 16 18 9 180.0000 13.4323 2 +9 14 16 18 9 0.0000 1.2454 3 +9 14 16 18 9 180.0000 0.0755 4 +9 14 16 18 9 180.0000 0.0403 5 +9 14 16 18 9 180.0000 0.0552 6 +15 14 16 17 9 0.0000 10.5685 1 +15 14 16 17 9 180.0000 14.4833 2 +15 14 16 17 9 0.0000 0.3155 3 +15 14 16 17 9 0.0000 0.1779 4 +15 14 16 17 9 180.0000 0.0888 5 +15 14 16 17 9 180.0000 0.0304 6 +15 14 16 18 9 0.0000 2.5828 1 +15 14 16 18 9 180.0000 22.7140 2 +15 14 16 18 9 180.0000 0.0880 3 +15 14 16 18 9 0.0000 1.0765 4 +15 14 16 18 9 180.0000 0.0505 5 +15 14 16 18 9 180.0000 0.0159 6 +14 16 18 19 9 180.0000 0.3064 1 +14 16 18 19 9 0.0000 0.6640 2 +14 16 18 19 9 0.0000 0.2691 3 +14 16 18 19 9 180.0000 0.4435 4 +14 16 18 19 9 0.0000 0.0293 5 +14 16 18 19 9 180.0000 0.0015 6 +14 16 18 20 9 180.0000 0.3064 1 +14 16 18 20 9 0.0000 0.6640 2 +14 16 18 20 9 0.0000 0.2691 3 +14 16 18 20 9 180.0000 0.4435 4 +14 16 18 20 9 0.0000 0.0293 5 +14 16 18 20 9 180.0000 0.0015 6 +14 16 18 21 9 180.0000 0.3064 1 +14 16 18 21 9 0.0000 0.6640 2 +14 16 18 21 9 0.0000 0.2691 3 +14 16 18 21 9 180.0000 0.4435 4 +14 16 18 21 9 0.0000 0.0293 5 +14 16 18 21 9 180.0000 0.0015 6 +17 16 18 19 9 0.0000 0.7291 1 +17 16 18 19 9 0.0000 1.0519 2 +17 16 18 19 9 0.0000 0.1107 3 +17 16 18 19 9 180.0000 0.0357 4 +17 16 18 19 9 180.0000 0.0008 5 +17 16 18 19 9 0.0000 0.0032 6 +17 16 18 20 9 0.0000 0.7291 1 +17 16 18 20 9 0.0000 1.0519 2 +17 16 18 20 9 0.0000 0.1107 3 +17 16 18 20 9 180.0000 0.0357 4 +17 16 18 20 9 180.0000 0.0008 5 +17 16 18 20 9 0.0000 0.0032 6 +17 16 18 21 9 0.0000 0.7291 1 +17 16 18 21 9 0.0000 1.0519 2 +17 16 18 21 9 0.0000 0.1107 3 +17 16 18 21 9 180.0000 0.0357 4 +17 16 18 21 9 180.0000 0.0008 5 +17 16 18 21 9 0.0000 0.0032 6 +1 7 5 6 4 +5 9 7 8 4 +7 10 9 14 4 180.0000000 43.93200 2 +7 9 14 16 4 105.4 0.75 1 +9 16 14 15 4 +14 18 16 17 4 + +[ position_restraints ] + +[ dihedral_restraints ] + +[ settles ] + +[ exclusions ] + + +[ system ] +Green Red Orange Magenta Azure Cyan Skyblue in water + + +[ molecules ] +Reactive 1 +SOL 551 +NA 2 +CL 2 diff --git a/tests/out_raw_alanine.json b/tests/out_raw_alanine.json new file mode 100644 index 0000000..02caea0 --- /dev/null +++ b/tests/out_raw_alanine.json @@ -0,0 +1,1388 @@ +{ + "atoms": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "bonds": [ + [ + 1, + 2 + ], + [ + 1, + 3 + ], + [ + 1, + 4 + ], + [ + 1, + 5 + ], + [ + 5, + 6 + ], + [ + 5, + 7 + ], + [ + 7, + 8 + ], + [ + 7, + 9 + ], + [ + 9, + 10 + ], + [ + 9, + 14 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 14, + 15 + ], + [ + 14, + 16 + ], + [ + 16, + 17 + ], + [ + 16, + 18 + ], + [ + 18, + 19 + ], + [ + 18, + 20 + ], + [ + 18, + 21 + ] + ], + "bond_k": [ + 755.1286010742188, + 755.1286010742188, + 755.1286010742188, + 535.0306396484375, + 1483.93310546875, + 570.5672607421875, + 978.9837036132812, + 380.38543701171875, + 509.2330322265625, + 195.39584350585938, + 752.521240234375, + 752.521240234375, + 752.521240234375, + 1422.7335205078125, + 785.9999389648438, + 967.77001953125, + 653.0269775390625, + 753.010009765625, + 753.010009765625, + 753.010009765625 + ], + "bond_eq": [ + 1.0938714742660522, + 1.0938714742660522, + 1.0938714742660522, + 1.5267786979675293, + 1.2169218063354492, + 1.381420373916626, + 1.018121361732483, + 1.3490225076675415, + 1.49397873878479, + 1.410969614982605, + 1.09508216381073, + 1.09508216381073, + 1.09508216381073, + 1.2173930406570435, + 1.3548707962036133, + 1.012398600578308, + 1.446398377418518, + 1.0925675630569458, + 1.0925675630569458, + 1.0925675630569458 + ], + "angles": [ + [ + 1, + 5, + 6 + ], + [ + 1, + 5, + 7 + ], + [ + 2, + 1, + 3 + ], + [ + 2, + 1, + 4 + ], + [ + 2, + 1, + 5 + ], + [ + 3, + 1, + 4 + ], + [ + 3, + 1, + 5 + ], + [ + 4, + 1, + 5 + ], + [ + 5, + 7, + 8 + ], + [ + 5, + 7, + 9 + ], + [ + 6, + 5, + 7 + ], + [ + 7, + 9, + 10 + ], + [ + 7, + 9, + 14 + ], + [ + 8, + 7, + 9 + ], + [ + 9, + 10, + 11 + ], + [ + 9, + 10, + 12 + ], + [ + 9, + 10, + 13 + ], + [ + 9, + 14, + 15 + ], + [ + 9, + 14, + 16 + ], + [ + 10, + 9, + 14 + ], + [ + 14, + 16, + 17 + ], + [ + 14, + 16, + 18 + ], + [ + 11, + 10, + 12 + ], + [ + 11, + 10, + 13 + ], + [ + 12, + 10, + 13 + ], + [ + 15, + 14, + 16 + ], + [ + 16, + 18, + 19 + ], + [ + 16, + 18, + 20 + ], + [ + 16, + 18, + 21 + ], + [ + 17, + 16, + 18 + ], + [ + 19, + 18, + 20 + ], + [ + 19, + 18, + 21 + ], + [ + 20, + 18, + 21 + ] + ], + "angle_k": [ + 119.9668197631836, + 106.92973327636719, + 81.41822814941406, + 81.41822814941406, + 103.62391662597656, + 81.41822814941406, + 103.62391662597656, + 103.62391662597656, + 77.98545837402344, + 84.3622817993164, + 165.36575317382812, + 116.89408111572266, + 78.10746765136719, + 81.03467559814453, + 98.86503601074219, + 98.86503601074219, + 98.86503601074219, + 104.12686157226562, + 90.68270111083984, + 68.47164916992188, + 99.56668853759766, + 56.40223693847656, + 78.86282348632812, + 78.86282348632812, + 78.86282348632812, + 152.5394744873047, + 121.64669036865234, + 121.64669036865234, + 121.64669036865234, + 86.3036117553711, + 84.08207702636719, + 84.08207702636719, + 84.08207702636719 + ], + "angle_eq": [ + 2.577260732650757, + 2.4657208919525146, + 1.8040478229522705, + 1.8040478229522705, + 1.837625503540039, + 1.8040478229522705, + 1.837625503540039, + 1.837625503540039, + 2.0068106651306152, + 1.9928127527236938, + 2.4423227310180664, + 2.185570240020752, + 2.096254348754883, + 1.9573496580123901, + 1.8267408609390259, + 1.8267408609390259, + 1.8267408609390259, + 2.4766693115234375, + 2.4235546588897705, + 2.230893611907959, + 1.9910074472427368, + 1.8670819997787476, + 1.7901557683944702, + 1.7901557683944702, + 1.7901557683944702, + 2.4439475536346436, + 1.8413236141204834, + 1.8413236141204834, + 1.8413236141204834, + 1.9395732879638672, + 1.8040862083435059, + 1.8040862083435059, + 1.8040862083435059 + ], + "propers": [ + [ + 2, + 1, + 5, + 6 + ], + [ + 3, + 1, + 5, + 6 + ], + [ + 4, + 1, + 5, + 6 + ], + [ + 2, + 1, + 5, + 7 + ], + [ + 3, + 1, + 5, + 7 + ], + [ + 4, + 1, + 5, + 7 + ], + [ + 1, + 5, + 7, + 8 + ], + [ + 6, + 5, + 7, + 8 + ], + [ + 1, + 5, + 7, + 9 + ], + [ + 6, + 5, + 7, + 9 + ], + [ + 5, + 7, + 9, + 10 + ], + [ + 8, + 7, + 9, + 10 + ], + [ + 5, + 7, + 9, + 14 + ], + [ + 8, + 7, + 9, + 14 + ], + [ + 11, + 10, + 9, + 14 + ], + [ + 12, + 10, + 9, + 14 + ], + [ + 13, + 10, + 9, + 14 + ], + [ + 7, + 9, + 10, + 11 + ], + [ + 7, + 9, + 10, + 12 + ], + [ + 7, + 9, + 10, + 13 + ], + [ + 7, + 9, + 14, + 15 + ], + [ + 10, + 9, + 14, + 15 + ], + [ + 7, + 9, + 14, + 16 + ], + [ + 10, + 9, + 14, + 16 + ], + [ + 9, + 14, + 16, + 17 + ], + [ + 15, + 14, + 16, + 17 + ], + [ + 9, + 14, + 16, + 18 + ], + [ + 15, + 14, + 16, + 18 + ], + [ + 14, + 16, + 18, + 19 + ], + [ + 17, + 16, + 18, + 19 + ], + [ + 14, + 16, + 18, + 20 + ], + [ + 17, + 16, + 18, + 20 + ], + [ + 14, + 16, + 18, + 21 + ], + [ + 17, + 16, + 18, + 21 + ] + ], + "proper_ks": [ + [ + 0.04494260251522064, + 0.6748359203338623, + 0.06567462533712387, + 0.0018822925630956888, + 0.005876102019101381, + 0.0001455173478461802 + ], + [ + 0.04494260251522064, + 0.6748359203338623, + 0.06567462533712387, + 0.0018822925630956888, + 0.005876102019101381, + 0.0001455173478461802 + ], + [ + 0.04494260251522064, + 0.6748359203338623, + 0.06567462533712387, + 0.0018822925630956888, + 0.005876102019101381, + 0.0001455173478461802 + ], + [ + 0.04216618090867996, + 0.779660701751709, + 0.0996779352426529, + 0.0024542033206671476, + 0.013731980696320534, + 0.0010647684102877975 + ], + [ + 0.04216618090867996, + 0.779660701751709, + 0.0996779352426529, + 0.0024542033206671476, + 0.013731980696320534, + 0.0010647684102877975 + ], + [ + 0.04216618090867996, + 0.779660701751709, + 0.0996779352426529, + 0.0024542033206671476, + 0.013731980696320534, + 0.0010647684102877975 + ], + [ + 0.4285593032836914, + 2.317983865737915, + 0.15826106071472168, + 0.07149321585893631, + 0.002321923151612282, + 0.03168807923793793 + ], + [ + 1.76844322681427, + 3.553204298019409, + 0.0710846558213234, + 0.020816639065742493, + 0.005745828617364168, + 0.03658169507980347 + ], + [ + 0.41623467206954956, + 3.1035726070404053, + 0.12127675116062164, + 0.06377430260181427, + 0.008512343280017376, + 0.006807954050600529 + ], + [ + 1.437559962272644, + 4.364359378814697, + 0.03386424109339714, + 0.192324697971344, + 0.01088003907352686, + 0.0036552846431732178 + ], + [ + 0.09326191246509552, + 2.629699230194092, + 0.17447513341903687, + 0.08979395031929016, + 0.006880050990730524, + 0.002431943081319332 + ], + [ + 0.8621795177459717, + 1.4567458629608154, + 0.27090883255004883, + 0.028016723692417145, + 0.005979370325803757, + 0.01546785794198513 + ], + [ + 0.7725563049316406, + 1.566367745399475, + 0.18599750101566315, + 0.006534155923873186, + 0.0006819289992563426, + 0.001302878255955875 + ], + [ + 0.008390707895159721, + 1.1807739734649658, + 0.02002820000052452, + 0.026027575135231018, + 0.00280350586399436, + 0.014300660230219364 + ], + [ + 0.35878416895866394, + 0.6685130596160889, + 0.1756485253572464, + 0.09212284535169601, + 0.012770860455930233, + 0.014153237454593182 + ], + [ + 0.35878416895866394, + 0.6685130596160889, + 0.1756485253572464, + 0.09212284535169601, + 0.012770860455930233, + 0.014153237454593182 + ], + [ + 0.35878416895866394, + 0.6685130596160889, + 0.1756485253572464, + 0.09212284535169601, + 0.012770860455930233, + 0.014153237454593182 + ], + [ + 0.09008254110813141, + 0.60626620054245, + 0.20429131388664246, + 0.0013158542569726706, + 0.007764535024762154, + 0.0032613291405141354 + ], + [ + 0.09008254110813141, + 0.60626620054245, + 0.20429131388664246, + 0.0013158542569726706, + 0.007764535024762154, + 0.0032613291405141354 + ], + [ + 0.09008254110813141, + 0.60626620054245, + 0.20429131388664246, + 0.0013158542569726706, + 0.007764535024762154, + 0.0032613291405141354 + ], + [ + 1.1284929513931274, + 1.0550589561462402, + 0.08317933976650238, + 0.0758308470249176, + 0.0006398173281922936, + 0.023438507691025734 + ], + [ + 1.3504596948623657, + 0.9865561723709106, + 0.0551498718559742, + 0.053106434643268585, + 0.006684677675366402, + 0.028416384011507034 + ], + [ + 1.827253818511963, + 2.06610369682312, + 0.07396615296602249, + 0.039012253284454346, + 0.0055722338147461414, + 0.0375509038567543 + ], + [ + 1.9751782417297363, + 2.097846031188965, + 0.07606945186853409, + 0.10462893545627594, + 0.006167523562908173, + 0.03363082930445671 + ], + [ + 1.2036311626434326, + 2.2142984867095947, + 0.3085859417915344, + 0.013190153054893017, + 0.009937243536114693, + 0.008372116833925247 + ], + [ + 2.525923252105713, + 3.4615910053253174, + 0.07541729509830475, + 0.042516548186540604, + 0.021215463057160378, + 0.007254273165017366 + ], + [ + 1.0110245943069458, + 3.2103850841522217, + 0.29765740036964417, + 0.01805623434484005, + 0.009621884673833847, + 0.013184653595089912 + ], + [ + 0.6173112988471985, + 5.428781509399414, + 0.021032366901636124, + 0.25730106234550476, + 0.012070788070559502, + 0.0038080583326518536 + ], + [ + 0.07324298471212387, + 0.15870366990566254, + 0.06431722640991211, + 0.10600262880325317, + 0.007004760205745697, + 0.0003594254667405039 + ], + [ + 0.17425981163978577, + 0.25140509009361267, + 0.02646039053797722, + 0.008538116700947285, + 0.00018829142209142447, + 0.0007575735216960311 + ], + [ + 0.07324298471212387, + 0.15870366990566254, + 0.06431722640991211, + 0.10600262880325317, + 0.007004760205745697, + 0.0003594254667405039 + ], + [ + 0.17425981163978577, + 0.25140509009361267, + 0.02646039053797722, + 0.008538116700947285, + 0.00018829142209142447, + 0.0007575735216960311 + ], + [ + 0.0732429102063179, + 0.15870371460914612, + 0.06431721150875092, + 0.10600259900093079, + 0.007004757411777973, + 0.0003594244481064379 + ], + [ + 0.17425979673862457, + 0.2514052391052246, + 0.026460394263267517, + 0.008538112975656986, + 0.00018829276086762547, + 0.0007575732888653874 + ] + ], + "proper_phases": [ + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ], + [ + 3.1415927410125732, + 0.0, + 0.0, + 3.1415927410125732, + 0.0, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0, + 3.1415927410125732, + 3.1415927410125732, + 0.0 + ] + ], + "impropers": [ + [ + 1, + 7, + 5, + 6 + ], + [ + 7, + 6, + 5, + 1 + ], + [ + 6, + 1, + 5, + 7 + ], + [ + 5, + 9, + 7, + 8 + ], + [ + 9, + 8, + 7, + 5 + ], + [ + 8, + 5, + 7, + 9 + ], + [ + 7, + 10, + 9, + 14 + ], + [ + 10, + 14, + 9, + 7 + ], + [ + 14, + 7, + 9, + 10 + ], + [ + 9, + 16, + 14, + 15 + ], + [ + 16, + 15, + 14, + 9 + ], + [ + 15, + 9, + 14, + 16 + ], + [ + 14, + 18, + 16, + 17 + ], + [ + 18, + 17, + 16, + 14 + ], + [ + 17, + 14, + 16, + 18 + ] + ], + "improper_ks": [ + [ + 7.061033829813823e-05, + 7.039442539215088, + 2.5443000570973817e-12 + ], + [ + 1.6675303715976697e-12, + 11.82522201538086, + 6.906843191245571e-05 + ], + [ + 4.957116470905021e-05, + 5.035053253173828, + 1.3721930258725479e-09 + ], + [ + 1.612351661606226e-05, + 1.6723710298538208, + 1.6308449630741961e-06 + ], + [ + 3.572121443085052e-08, + 5.224257469177246, + 2.798713649099227e-05 + ], + [ + 4.1046303522307426e-05, + 3.115514039993286, + 7.626833053997473e-10 + ], + [ + 1.3283370208228007e-06, + 0.4701811969280243, + 1.7553611542098224e-05 + ], + [ + 1.8493884113013337e-07, + 1.1970317363739014, + 3.0034112569410354e-05 + ], + [ + 2.4897314432337225e-08, + 2.636653423309326, + 3.9613834815099835e-05 + ], + [ + 5.474128920468502e-05, + 5.543274402618408, + 1.225876483657018e-10 + ], + [ + 3.510047461019461e-11, + 7.956034183502197, + 6.594436126761138e-05 + ], + [ + 4.4454209273681045e-05, + 4.596062183380127, + 9.936862443993277e-10 + ], + [ + 3.990923869423568e-05, + 3.8023033142089844, + 5.639988920336236e-09 + ], + [ + 9.445317791789698e-12, + 11.592504501342773, + 6.293354817898944e-05 + ], + [ + 4.342288229963742e-05, + 3.532057762145996, + 2.5205488807245047e-09 + ] + ], + "improper_phases": [ + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 0.0, + 0.0, + 0.0 + ] + ] +} \ No newline at end of file diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index 3cb665a..ccee96a 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -10,7 +10,7 @@ import json from grappa_interface import ( - clean_parameters, + convert_parameters, build_molecule, apply_parameters, GrappaInterface, @@ -18,11 +18,20 @@ from grappa.grappa import Grappa from grappa.data.Molecule import Molecule +from grappa.data.Parameters import Parameters from grappa.utils.loading_utils import load_model from kimmdy.topology.topology import Topology from kimmdy.constants import AA3 -from kimmdy.parsing import write_json, read_json, read_top +from kimmdy.parsing import write_json, read_json, read_top, write_top + + +# generic functions +def array_eq(arr1, arr2): + return (isinstance(arr1, np.ndarray) and + isinstance(arr2, np.ndarray) and + arr1.shape == arr2.shape and + (arr1 == arr2).all()) ## fixtures ## @@ -32,9 +41,18 @@ def grappa_input(): @pytest.fixture -def grappa_output(): - return read_json(Path(__file__).parent / "GrAPPa_output_alanine.json") +def grappa_output_raw(): + ref_dict = read_json(Path(__file__).parents[0] / "out_raw_alanine.json") + for k,v in ref_dict.items(): + ref_dict[k] = np.asarray(v) + output_raw= Parameters.from_dict(ref_dict) + return output_raw +@pytest.fixture +def grappa_output_converted(): + ref_dict = read_json(Path(__file__).parents[0] / "out_converted_alanine.json") + output_converted= Parameters.from_dict(ref_dict) + return output_converted ## test scripts ## def test_generate_input(): @@ -42,28 +60,16 @@ def test_generate_input(): mol = build_molecule(top) mol.to_json("in.json") - # with open("GrAPPa_input_alanine.json", "w") as f: - # json.dump(input_dict, f) assert len(mol.atoms) == 21 assert len(mol.bonds) == 20 - assert mol.additional_features['is_radical'][9] == 1 - - assert all([len(x) == 6 for x in input_dict["atoms"]]) - assert all([isinstance(x[s], str) for x in input_dict["atoms"] for s in [1, 2]]) - assert all([isinstance(x[i], int) for x in input_dict["atoms"] for i in [0, 3, 5]]) - assert all([isinstance(x[4], list) for x in input_dict["atoms"]]) - assert all([len(x[4]) == 2 for x in input_dict["atoms"]]) - assert all([x[2] in AA3 for x in input_dict["atoms"]]) - + assert len(mol.impropers) == 15 + feature_keys = list(mol.additional_features.keys()) + assert all(x in feature_keys for x in ['is_radical','ring_encoding']) + assert mol.atomic_numbers[8] == 6 + assert mol.additional_features['is_radical'][8] == 1 -def test_clean_parameters(grappa_output): - parameter_prepared = deepcopy(grappa_output) - parameter_prepared["angle_k"] = np.array(parameter_prepared["angle_k"]) - clean_parameters(parameter_prepared) - pass - -def test_generate_parameters(grappa_input): +def test_predict_parameters(grappa_input,grappa_output_raw): # load model, tag will be changed to be more permanent model_tag = 'https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth' model = load_model(model_tag) @@ -71,60 +77,30 @@ def test_generate_parameters(grappa_input): # initialize class that handles ML part grappa = Grappa(model,device='cpu') parameters = grappa.predict(grappa_input) - breakpoint() - clean_parameters(parameters) - # write_json(parameters, "GrAPPa_output_alanine.json") - # with open("GrAPPa_output_alanine.json", "r") as f: - # parameters = json.load(f,parse_float=lambda x: round(float(x), 3)) - # write_json(parameters, "GrAPPa_output_alanine.json") + + # parameters_dict = parameters.to_dict() + # write_json(parameters_dict, "out_raw.json") + + # check for equality per attribute + for k in grappa_output_raw.__annotations__.keys(): + assert array_eq(getattr(grappa_output_raw,k),getattr(parameters,k)) + + +def test_convert_parameters(grappa_output_raw, grappa_output_converted): + parameters = convert_parameters(grappa_output_raw) + + parameters_dict = parameters.to_dict() + write_json(parameters_dict, "out_converted.json") + + assert parameters == grappa_output_converted -def test_apply_parameters(): +def test_apply_parameters(grappa_output_converted): top = Topology(read_top(Path(__file__).parent / "Ala_out.top")) + partial_charges = np.zeros_like(grappa_output_converted.atoms,dtype=float).tolist() + apply_parameters(top, grappa_output_converted, partial_charges) - parameters_clean = { - "atom": {"idxs": ["1"], "q": ["0.1"]}, - "bond": {"idxs": [["1", "3"]], "eq": ["400.0"], "k": ["0.3"]}, - "angle": {"idxs": [["2", "1", "5"]], "eq": ["1000.0"], "k": ["40.0"]}, - "proper": { - "idxs": [["17", "16", "18", "21"]], - "phases": [["20.0"]], - "ks": [["0.0"]], - "ns": [["1"]], - }, - "improper": { - "idxs": [["18", "14", "16", "17"]], - "phases": [["0.0"]], - "ks": [["2.0"]], - "ns": [["2"]], - }, - } - - apply_parameters(top, parameters_clean) - - assert isinstance(top, Topology) - assert ( - top.atoms[parameters_clean["atom"]["idxs"][0]].charge - == parameters_clean["atom"]["q"][0] - ) - assert ( - top.bonds[tuple(parameters_clean["bond"]["idxs"][0])].c1 - == parameters_clean["bond"]["k"][0] - ) - assert ( - top.angles[tuple(parameters_clean["angle"]["idxs"][0])].c0 - == parameters_clean["angle"]["eq"][0] - ) - assert ( - top.proper_dihedrals[tuple(parameters_clean["proper"]["idxs"][0])] - .dihedrals["1"] - .c0 - == parameters_clean["proper"]["phases"][0][0] - ) - assert ( - top.improper_dihedrals[tuple(parameters_clean["improper"]["idxs"][0])].c1 - == parameters_clean["improper"]["ks"][0][0] - ) + write_top(top.to_dict(),Path(__file__).parents[0] / "out_parameterized.top") def test_parameterize_topology(tmp_path): From 1716a4d11a9289ebc1a87d246a9137c0e935ef25 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Tue, 19 Dec 2023 11:43:23 +0100 Subject: [PATCH 04/12] remove unnecessary files --- in.json | 878 --------------------- out_converted.json | 1388 ---------------------------------- run_kimmdy-grappa.py | 0 tests/test_parameterizers.py | 10 +- 4 files changed, 5 insertions(+), 2271 deletions(-) delete mode 100644 in.json delete mode 100644 out_converted.json delete mode 100644 run_kimmdy-grappa.py diff --git a/in.json b/in.json deleted file mode 100644 index 6986fc8..0000000 --- a/in.json +++ /dev/null @@ -1,878 +0,0 @@ -{ - "atoms": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21 - ], - "bonds": [ - [ - 1, - 2 - ], - [ - 1, - 3 - ], - [ - 1, - 4 - ], - [ - 1, - 5 - ], - [ - 5, - 6 - ], - [ - 5, - 7 - ], - [ - 7, - 8 - ], - [ - 7, - 9 - ], - [ - 9, - 10 - ], - [ - 9, - 14 - ], - [ - 10, - 11 - ], - [ - 10, - 12 - ], - [ - 10, - 13 - ], - [ - 14, - 15 - ], - [ - 14, - 16 - ], - [ - 16, - 17 - ], - [ - 16, - 18 - ], - [ - 18, - 19 - ], - [ - 18, - 20 - ], - [ - 18, - 21 - ] - ], - "angles": [ - [ - 1, - 5, - 6 - ], - [ - 1, - 5, - 7 - ], - [ - 2, - 1, - 3 - ], - [ - 2, - 1, - 4 - ], - [ - 2, - 1, - 5 - ], - [ - 3, - 1, - 4 - ], - [ - 3, - 1, - 5 - ], - [ - 4, - 1, - 5 - ], - [ - 5, - 7, - 8 - ], - [ - 5, - 7, - 9 - ], - [ - 6, - 5, - 7 - ], - [ - 7, - 9, - 10 - ], - [ - 7, - 9, - 14 - ], - [ - 8, - 7, - 9 - ], - [ - 9, - 10, - 11 - ], - [ - 9, - 10, - 12 - ], - [ - 9, - 10, - 13 - ], - [ - 9, - 14, - 15 - ], - [ - 9, - 14, - 16 - ], - [ - 10, - 9, - 14 - ], - [ - 14, - 16, - 17 - ], - [ - 14, - 16, - 18 - ], - [ - 11, - 10, - 12 - ], - [ - 11, - 10, - 13 - ], - [ - 12, - 10, - 13 - ], - [ - 15, - 14, - 16 - ], - [ - 16, - 18, - 19 - ], - [ - 16, - 18, - 20 - ], - [ - 16, - 18, - 21 - ], - [ - 17, - 16, - 18 - ], - [ - 19, - 18, - 20 - ], - [ - 19, - 18, - 21 - ], - [ - 20, - 18, - 21 - ] - ], - "propers": [ - [ - 2, - 1, - 5, - 6 - ], - [ - 3, - 1, - 5, - 6 - ], - [ - 4, - 1, - 5, - 6 - ], - [ - 2, - 1, - 5, - 7 - ], - [ - 3, - 1, - 5, - 7 - ], - [ - 4, - 1, - 5, - 7 - ], - [ - 1, - 5, - 7, - 8 - ], - [ - 6, - 5, - 7, - 8 - ], - [ - 1, - 5, - 7, - 9 - ], - [ - 6, - 5, - 7, - 9 - ], - [ - 5, - 7, - 9, - 10 - ], - [ - 8, - 7, - 9, - 10 - ], - [ - 5, - 7, - 9, - 14 - ], - [ - 8, - 7, - 9, - 14 - ], - [ - 11, - 10, - 9, - 14 - ], - [ - 12, - 10, - 9, - 14 - ], - [ - 13, - 10, - 9, - 14 - ], - [ - 7, - 9, - 10, - 11 - ], - [ - 7, - 9, - 10, - 12 - ], - [ - 7, - 9, - 10, - 13 - ], - [ - 7, - 9, - 14, - 15 - ], - [ - 10, - 9, - 14, - 15 - ], - [ - 7, - 9, - 14, - 16 - ], - [ - 10, - 9, - 14, - 16 - ], - [ - 9, - 14, - 16, - 17 - ], - [ - 15, - 14, - 16, - 17 - ], - [ - 9, - 14, - 16, - 18 - ], - [ - 15, - 14, - 16, - 18 - ], - [ - 14, - 16, - 18, - 19 - ], - [ - 17, - 16, - 18, - 19 - ], - [ - 14, - 16, - 18, - 20 - ], - [ - 17, - 16, - 18, - 20 - ], - [ - 14, - 16, - 18, - 21 - ], - [ - 17, - 16, - 18, - 21 - ] - ], - "impropers": [ - [ - 1, - 7, - 5, - 6 - ], - [ - 7, - 6, - 5, - 1 - ], - [ - 6, - 1, - 5, - 7 - ], - [ - 5, - 9, - 7, - 8 - ], - [ - 9, - 8, - 7, - 5 - ], - [ - 8, - 5, - 7, - 9 - ], - [ - 7, - 10, - 9, - 14 - ], - [ - 10, - 14, - 9, - 7 - ], - [ - 14, - 7, - 9, - 10 - ], - [ - 9, - 16, - 14, - 15 - ], - [ - 16, - 15, - 14, - 9 - ], - [ - 15, - 9, - 14, - 16 - ], - [ - 14, - 18, - 16, - 17 - ], - [ - 18, - 17, - 16, - 14 - ], - [ - 17, - 14, - 16, - 18 - ] - ], - "atomic_numbers": [ - 6, - 1, - 1, - 1, - 6, - 8, - 7, - 1, - 6, - 6, - 1, - 1, - 1, - 6, - 8, - 7, - 1, - 6, - 1, - 1, - 1 - ], - "partial_charges": [ - -0.3662000000476837, - 0.11230000108480453, - 0.11230000108480453, - 0.11230000108480453, - 0.5971999764442444, - -0.5679000020027161, - -0.4156999886035919, - 0.2718999981880188, - 0.11599999666213989, - -0.18250000476837158, - 0.06030000001192093, - 0.06030000001192093, - 0.06030000001192093, - 0.5972999930381775, - -0.5679000020027161, - -0.4156999886035919, - 0.2718999981880188, - -0.14900000393390656, - 0.09759999811649323, - 0.09759999811649323, - 0.09759999811649323 - ], - "sigma": [ - 0.339967, - 0.264953, - 0.264953, - 0.264953, - 0.339967, - 0.295992, - 0.325, - 0.106908, - 0.339967, - 0.339967, - 0.264953, - 0.264953, - 0.264953, - 0.339967, - 0.295992, - 0.325, - 0.106908, - 0.339967, - 0.247135, - 0.247135, - 0.247135 - ], - "epsilon": [ - 0.45773, - 0.0656888, - 0.0656888, - 0.0656888, - 0.359824, - 0.87864, - 0.71128, - 0.0656888, - 0.45773, - 0.45773, - 0.0656888, - 0.0656888, - 0.0656888, - 0.359824, - 0.87864, - 0.71128, - 0.0656888, - 0.45773, - 0.0656888, - 0.0656888, - 0.0656888 - ], - "is_radical": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "ring_encoding": [ - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ] - ] -} \ No newline at end of file diff --git a/out_converted.json b/out_converted.json deleted file mode 100644 index 290608c..0000000 --- a/out_converted.json +++ /dev/null @@ -1,1388 +0,0 @@ -{ - "atoms": [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "20", - "21" - ], - "bonds": [ - [ - "1", - "2" - ], - [ - "1", - "3" - ], - [ - "1", - "4" - ], - [ - "1", - "5" - ], - [ - "5", - "6" - ], - [ - "5", - "7" - ], - [ - "7", - "8" - ], - [ - "7", - "9" - ], - [ - "9", - "10" - ], - [ - "9", - "14" - ], - [ - "10", - "11" - ], - [ - "10", - "12" - ], - [ - "10", - "13" - ], - [ - "14", - "15" - ], - [ - "14", - "16" - ], - [ - "16", - "17" - ], - [ - "16", - "18" - ], - [ - "18", - "19" - ], - [ - "18", - "20" - ], - [ - "18", - "21" - ] - ], - "bond_k": [ - "315945.8067", - "315945.8067", - "315945.8067", - "223856.8196", - "620877.6113", - "238725.3419", - "409606.7816", - "159153.2668", - "213063.1007", - "81753.6209", - "314854.8869", - "314854.8869", - "314854.8869", - "595271.7050", - "328862.3745", - "404914.9762", - "273226.4874", - "315059.3881", - "315059.3881", - "315059.3881" - ], - "bond_eq": [ - "0.1094", - "0.1094", - "0.1094", - "0.1527", - "0.1217", - "0.1381", - "0.1018", - "0.1349", - "0.1494", - "0.1411", - "0.1095", - "0.1095", - "0.1095", - "0.1217", - "0.1355", - "0.1012", - "0.1446", - "0.1093", - "0.1093", - "0.1093" - ], - "angles": [ - [ - "1", - "5", - "6" - ], - [ - "1", - "5", - "7" - ], - [ - "2", - "1", - "3" - ], - [ - "2", - "1", - "4" - ], - [ - "2", - "1", - "5" - ], - [ - "3", - "1", - "4" - ], - [ - "3", - "1", - "5" - ], - [ - "4", - "1", - "5" - ], - [ - "5", - "7", - "8" - ], - [ - "5", - "7", - "9" - ], - [ - "6", - "5", - "7" - ], - [ - "7", - "9", - "10" - ], - [ - "7", - "9", - "14" - ], - [ - "8", - "7", - "9" - ], - [ - "9", - "10", - "11" - ], - [ - "9", - "10", - "12" - ], - [ - "9", - "10", - "13" - ], - [ - "9", - "14", - "15" - ], - [ - "9", - "14", - "16" - ], - [ - "10", - "9", - "14" - ], - [ - "14", - "16", - "17" - ], - [ - "14", - "16", - "18" - ], - [ - "11", - "10", - "12" - ], - [ - "11", - "10", - "13" - ], - [ - "12", - "10", - "13" - ], - [ - "15", - "14", - "16" - ], - [ - "16", - "18", - "19" - ], - [ - "16", - "18", - "20" - ], - [ - "16", - "18", - "21" - ], - [ - "17", - "16", - "18" - ], - [ - "19", - "18", - "20" - ], - [ - "19", - "18", - "21" - ], - [ - "20", - "18", - "21" - ] - ], - "angle_k": [ - "501.9412", - "447.3940", - "340.6539", - "340.6539", - "433.5625", - "340.6539", - "433.5625", - "433.5625", - "326.2912", - "352.9718", - "691.8903", - "489.0848", - "326.8016", - "339.0491", - "413.6513", - "413.6513", - "413.6513", - "435.6668", - "379.4164", - "286.4854", - "416.5870", - "235.9870", - "329.9621", - "329.9621", - "329.9621", - "638.2252", - "508.9698", - "508.9698", - "508.9698", - "361.0943", - "351.7994", - "351.7994", - "351.7994" - ], - "angle_eq": [ - "147.6662", - "141.2754", - "103.3643", - "103.3643", - "105.2882", - "103.3643", - "105.2882", - "105.2882", - "114.9818", - "114.1798", - "139.9348", - "125.2240", - "120.1065", - "112.1479", - "104.6645", - "104.6645", - "104.6645", - "141.9027", - "138.8595", - "127.8208", - "114.0763", - "106.9759", - "102.5684", - "102.5684", - "102.5684", - "140.0279", - "105.5001", - "105.5001", - "105.5001", - "111.1294", - "103.3665", - "103.3665", - "103.3665" - ], - "propers": [ - [ - "2", - "1", - "5", - "6" - ], - [ - "3", - "1", - "5", - "6" - ], - [ - "4", - "1", - "5", - "6" - ], - [ - "2", - "1", - "5", - "7" - ], - [ - "3", - "1", - "5", - "7" - ], - [ - "4", - "1", - "5", - "7" - ], - [ - "1", - "5", - "7", - "8" - ], - [ - "6", - "5", - "7", - "8" - ], - [ - "1", - "5", - "7", - "9" - ], - [ - "6", - "5", - "7", - "9" - ], - [ - "5", - "7", - "9", - "10" - ], - [ - "8", - "7", - "9", - "10" - ], - [ - "5", - "7", - "9", - "14" - ], - [ - "8", - "7", - "9", - "14" - ], - [ - "14", - "9", - "10", - "11" - ], - [ - "14", - "9", - "10", - "12" - ], - [ - "14", - "9", - "10", - "13" - ], - [ - "7", - "9", - "10", - "11" - ], - [ - "7", - "9", - "10", - "12" - ], - [ - "7", - "9", - "10", - "13" - ], - [ - "7", - "9", - "14", - "15" - ], - [ - "10", - "9", - "14", - "15" - ], - [ - "7", - "9", - "14", - "16" - ], - [ - "10", - "9", - "14", - "16" - ], - [ - "9", - "14", - "16", - "17" - ], - [ - "15", - "14", - "16", - "17" - ], - [ - "9", - "14", - "16", - "18" - ], - [ - "15", - "14", - "16", - "18" - ], - [ - "14", - "16", - "18", - "19" - ], - [ - "17", - "16", - "18", - "19" - ], - [ - "14", - "16", - "18", - "20" - ], - [ - "17", - "16", - "18", - "20" - ], - [ - "14", - "16", - "18", - "21" - ], - [ - "17", - "16", - "18", - "21" - ] - ], - "proper_ks": [ - [ - "0.1880", - "2.8235", - "0.2748", - "0.0079", - "0.0246", - "0.0006" - ], - [ - "0.1880", - "2.8235", - "0.2748", - "0.0079", - "0.0246", - "0.0006" - ], - [ - "0.1880", - "2.8235", - "0.2748", - "0.0079", - "0.0246", - "0.0006" - ], - [ - "0.1764", - "3.2621", - "0.4171", - "0.0103", - "0.0575", - "0.0045" - ], - [ - "0.1764", - "3.2621", - "0.4171", - "0.0103", - "0.0575", - "0.0045" - ], - [ - "0.1764", - "3.2621", - "0.4171", - "0.0103", - "0.0575", - "0.0045" - ], - [ - "1.7931", - "9.6984", - "0.6622", - "0.2991", - "0.0097", - "0.1326" - ], - [ - "7.3992", - "14.8666", - "0.2974", - "0.0871", - "0.0240", - "0.1531" - ], - [ - "1.7415", - "12.9853", - "0.5074", - "0.2668", - "0.0356", - "0.0285" - ], - [ - "6.0148", - "18.2605", - "0.1417", - "0.8047", - "0.0455", - "0.0153" - ], - [ - "0.3902", - "11.0027", - "0.7300", - "0.3757", - "0.0288", - "0.0102" - ], - [ - "3.6074", - "6.0950", - "1.1335", - "0.1172", - "0.0250", - "0.0647" - ], - [ - "3.2324", - "6.5537", - "0.7782", - "0.0273", - "0.0029", - "0.0055" - ], - [ - "0.0351", - "4.9404", - "0.0838", - "0.1089", - "0.0117", - "0.0598" - ], - [ - "1.5012", - "2.7971", - "0.7349", - "0.3854", - "0.0534", - "0.0592" - ], - [ - "1.5012", - "2.7971", - "0.7349", - "0.3854", - "0.0534", - "0.0592" - ], - [ - "1.5012", - "2.7971", - "0.7349", - "0.3854", - "0.0534", - "0.0592" - ], - [ - "0.3769", - "2.5366", - "0.8548", - "0.0055", - "0.0325", - "0.0136" - ], - [ - "0.3769", - "2.5366", - "0.8548", - "0.0055", - "0.0325", - "0.0136" - ], - [ - "0.3769", - "2.5366", - "0.8548", - "0.0055", - "0.0325", - "0.0136" - ], - [ - "4.7216", - "4.4144", - "0.3480", - "0.3173", - "0.0027", - "0.0981" - ], - [ - "5.6503", - "4.1278", - "0.2307", - "0.2222", - "0.0280", - "0.1189" - ], - [ - "7.6452", - "8.6446", - "0.3095", - "0.1632", - "0.0233", - "0.1571" - ], - [ - "8.2641", - "8.7774", - "0.3183", - "0.4378", - "0.0258", - "0.1407" - ], - [ - "5.0360", - "9.2646", - "1.2911", - "0.0552", - "0.0416", - "0.0350" - ], - [ - "10.5685", - "14.4833", - "0.3155", - "0.1779", - "0.0888", - "0.0304" - ], - [ - "4.2301", - "13.4323", - "1.2454", - "0.0755", - "0.0403", - "0.0552" - ], - [ - "2.5828", - "22.7140", - "0.0880", - "1.0765", - "0.0505", - "0.0159" - ], - [ - "0.3064", - "0.6640", - "0.2691", - "0.4435", - "0.0293", - "0.0015" - ], - [ - "0.7291", - "1.0519", - "0.1107", - "0.0357", - "0.0008", - "0.0032" - ], - [ - "0.3064", - "0.6640", - "0.2691", - "0.4435", - "0.0293", - "0.0015" - ], - [ - "0.7291", - "1.0519", - "0.1107", - "0.0357", - "0.0008", - "0.0032" - ], - [ - "0.3064", - "0.6640", - "0.2691", - "0.4435", - "0.0293", - "0.0015" - ], - [ - "0.7291", - "1.0519", - "0.1107", - "0.0357", - "0.0008", - "0.0032" - ] - ], - "proper_phases": [ - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "0.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "0.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "0.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "0.0000", - "0.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "180.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000", - "0.0000" - ], - [ - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000", - "0.0000" - ], - [ - "180.0000", - "0.0000", - "0.0000", - "180.0000", - "0.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000", - "180.0000", - "180.0000", - "0.0000" - ] - ], - "impropers": [ - [ - "1", - "7", - "5", - "6" - ], - [ - "7", - "6", - "5", - "1" - ], - [ - "6", - "1", - "5", - "7" - ], - [ - "5", - "9", - "7", - "8" - ], - [ - "9", - "8", - "7", - "5" - ], - [ - "8", - "5", - "7", - "9" - ], - [ - "7", - "10", - "9", - "14" - ], - [ - "10", - "14", - "9", - "7" - ], - [ - "14", - "7", - "9", - "10" - ], - [ - "9", - "16", - "14", - "15" - ], - [ - "16", - "15", - "14", - "9" - ], - [ - "15", - "9", - "14", - "16" - ], - [ - "14", - "18", - "16", - "17" - ], - [ - "18", - "17", - "16", - "14" - ], - [ - "17", - "14", - "16", - "18" - ] - ], - "improper_ks": [ - [ - "0.0003", - "29.4530", - "0.0000" - ], - [ - "0.0000", - "49.4767", - "0.0003" - ], - [ - "0.0002", - "21.0667", - "0.0000" - ], - [ - "0.0001", - "6.9972", - "0.0000" - ], - [ - "0.0000", - "21.8583", - "0.0001" - ], - [ - "0.0002", - "13.0353", - "0.0000" - ], - [ - "0.0000", - "1.9672", - "0.0001" - ], - [ - "0.0000", - "5.0084", - "0.0001" - ], - [ - "0.0000", - "11.0318", - "0.0002" - ], - [ - "0.0002", - "23.1931", - "0.0000" - ], - [ - "0.0000", - "33.2880", - "0.0003" - ], - [ - "0.0002", - "19.2299", - "0.0000" - ], - [ - "0.0002", - "15.9088", - "0.0000" - ], - [ - "0.0000", - "48.5030", - "0.0003" - ], - [ - "0.0002", - "14.7781", - "0.0000" - ] - ], - "improper_phases": [ - [ - "0.0000", - "0.0000", - "0.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000" - ], - [ - "180.0000", - "180.0000", - "180.0000" - ], - [ - "0.0000", - "0.0000", - "0.0000" - ] - ] -} \ No newline at end of file diff --git a/run_kimmdy-grappa.py b/run_kimmdy-grappa.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index ccee96a..fd1f202 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -58,7 +58,7 @@ def grappa_output_converted(): def test_generate_input(): top = Topology(read_top(Path(__file__).parent / "Ala_out.top")) mol = build_molecule(top) - mol.to_json("in.json") + mol.to_json( Path(__file__).parents[0] / "tmp" / "in.json") assert len(mol.atoms) == 21 assert len(mol.bonds) == 20 @@ -78,8 +78,8 @@ def test_predict_parameters(grappa_input,grappa_output_raw): grappa = Grappa(model,device='cpu') parameters = grappa.predict(grappa_input) - # parameters_dict = parameters.to_dict() - # write_json(parameters_dict, "out_raw.json") + parameters_dict = parameters.to_dict() + write_json(parameters_dict, Path(__file__).parents[0] / "tmp" / "out_raw.json") # check for equality per attribute for k in grappa_output_raw.__annotations__.keys(): @@ -90,7 +90,7 @@ def test_convert_parameters(grappa_output_raw, grappa_output_converted): parameters = convert_parameters(grappa_output_raw) parameters_dict = parameters.to_dict() - write_json(parameters_dict, "out_converted.json") + write_json(parameters_dict, Path(__file__).parents[0] / "tmp" / "out_converted.json") assert parameters == grappa_output_converted @@ -100,7 +100,7 @@ def test_apply_parameters(grappa_output_converted): partial_charges = np.zeros_like(grappa_output_converted.atoms,dtype=float).tolist() apply_parameters(top, grappa_output_converted, partial_charges) - write_top(top.to_dict(),Path(__file__).parents[0] / "out_parameterized.top") + write_top(top.to_dict(), Path(__file__).parents[0] / "tmp" / "out_parameterized.top") def test_parameterize_topology(tmp_path): From 1026c96ec673f1a5bfbd386b7f54b72247a215a6 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Tue, 19 Dec 2023 14:16:09 +0100 Subject: [PATCH 05/12] remove partial charge treatment --- src/grappa_interface.py | 31 +++------------------ tests/GrAPPa_input_alanine.json | 1 - tests/GrAPPa_output_alanine.json | 1 - tests/out_parameterized.top | 48 ++++++++++++++------------------ tests/test_parameterizers.py | 3 +- 5 files changed, 26 insertions(+), 58 deletions(-) delete mode 100644 tests/GrAPPa_input_alanine.json delete mode 100644 tests/GrAPPa_output_alanine.json diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 5122042..293fe50 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -5,7 +5,7 @@ from typing import Union from kimmdy.topology.topology import Topology -from kimmdy.topology.atomic import Bond, Angle, Dihedral, MultipleDihedrals +from kimmdy.topology.atomic import Atom, Bond, Angle, Dihedral, MultipleDihedrals from kimmdy.topology.utils import get_by_permutations from kimmdy.plugins import Parameterizer from kimmdy.parsing import write_json @@ -104,33 +104,13 @@ def convert_parameters(parameters: Parameters) -> Parameters: return parameters - -def move_residual_charge_to_radical(partial_charges:list[float],radical_idx:int, total_charge:float): - partial_charges[radical_idx] += total_charge - sum(partial_charges) - return partial_charges - - -def treat_radical_partial_charges(partial_charges: list[float]) -> list[float]: - return partial_charges - - - -def apply_parameters(top: Topology, parameters: Parameters, partial_charges: list[float]): +def apply_parameters(top: Topology, parameters: Parameters): # parameter structure is defined in grappa.data.Parameters.Parameters # assume units are according to https://manual.gromacs.org/current/reference-manual/definitions.html # namely: length [nm], mass [kg], time [ps], energy [kJ/mol], force [kJ mol-1 nm-1], angle [deg] ## atoms - for i, idx in enumerate(parameters.atoms): - if not (atom := top.atoms.get(idx)): - # raise KeyError(f"bad index {idx} in {list(top.atoms.keys())}") - logging.warning( - f"Ignored parameters with invalid ids: {idx} for atoms" - ) # this can happen when removing a hydrogen in kimmdy-remove-hydrogen - continue - # can anything but charge change?? - atom.charge = f"{partial_charges[i]:7.4f}" - atom.chargeB = None + # Nothing to do here because partial charges are dealt with elsewhere ## bonds for i, idx in enumerate(parameters.bonds): @@ -240,9 +220,6 @@ def parameterize_topology( # convert units et cetera parameters = convert_parameters(parameters) - # check for changes to partial charges - partial_charges = treat_radical_partial_charges(mol.partial_charges) - # apply parameters - apply_parameters(current_topology, parameters, partial_charges) + apply_parameters(current_topology, parameters) return current_topology \ No newline at end of file diff --git a/tests/GrAPPa_input_alanine.json b/tests/GrAPPa_input_alanine.json deleted file mode 100644 index a5c1bbe..0000000 --- a/tests/GrAPPa_input_alanine.json +++ /dev/null @@ -1 +0,0 @@ -{"atoms": [[1, "CH3", "ACE", 1, [0.339967, 0.45773], 6], [2, "HH31", "ACE", 1, [0.264953, 0.0656888], 1], [3, "HH32", "ACE", 1, [0.264953, 0.0656888], 1], [4, "HH33", "ACE", 1, [0.264953, 0.0656888], 1], [5, "C", "ACE", 1, [0.339967, 0.359824], 6], [6, "O", "ACE", 1, [0.295992, 0.87864], 8], [7, "N", "ALA", 2, [0.325, 0.71128], 7], [8, "H", "ALA", 2, [0.106908, 0.0656888], 1], [9, "CA", "ALA", 2, [0.339967, 0.45773], 6], [10, "CB", "ALA", 2, [0.339967, 0.45773], 6], [11, "HB1", "ALA", 2, [0.264953, 0.0656888], 1], [12, "HB2", "ALA", 2, [0.264953, 0.0656888], 1], [13, "HB3", "ALA", 2, [0.264953, 0.0656888], 1], [14, "C", "ALA", 2, [0.339967, 0.359824], 6], [15, "O", "ALA", 2, [0.295992, 0.87864], 8], [16, "N", "NME", 3, [0.325, 0.71128], 7], [17, "H", "NME", 3, [0.106908, 0.0656888], 1], [18, "CH3", "NME", 3, [0.339967, 0.45773], 6], [19, "HH31", "NME", 3, [0.247135, 0.0656888], 1], [20, "HH32", "NME", 3, [0.247135, 0.0656888], 1], [21, "HH33", "NME", 3, [0.247135, 0.0656888], 1]], "bonds": [[1, 2], [1, 3], [1, 4], [1, 5], [5, 6], [5, 7], [7, 8], [7, 9], [9, 10], [9, 14], [10, 11], [10, 12], [10, 13], [14, 15], [14, 16], [16, 17], [16, 18], [18, 19], [18, 20], [18, 21]], "radicals": [9]} \ No newline at end of file diff --git a/tests/GrAPPa_output_alanine.json b/tests/GrAPPa_output_alanine.json deleted file mode 100644 index 0b6b295..0000000 --- a/tests/GrAPPa_output_alanine.json +++ /dev/null @@ -1 +0,0 @@ -{"atom_q": [-0.366, 0.112, 0.112, 0.112, 0.597, -0.568, -0.416, 0.272, 0.116, -0.183, 0.06, 0.06, 0.06, 0.597, -0.568, -0.416, 0.272, -0.149, 0.098, 0.098, 0.098], "atom_sigma": [0.34, 0.265, 0.265, 0.265, 0.34, 0.296, 0.325, 0.107, 0.34, 0.34, 0.265, 0.265, 0.265, 0.34, 0.296, 0.325, 0.107, 0.34, 0.247, 0.247, 0.247], "atoms_epsilon": [0.458, 0.066, 0.066, 0.066, 0.36, 0.879, 0.711, 0.066, 0.458, 0.458, 0.066, 0.066, 0.066, 0.36, 0.879, 0.711, 0.066, 0.458, 0.066, 0.066, 0.066], "atom_idxs": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21], "bond_eq": [0.109, 0.109, 0.109, 0.153, 0.122, 0.138, 0.102, 0.135, 0.148, 0.146, 0.11, 0.11, 0.11, 0.122, 0.135, 0.101, 0.143, 0.109, 0.109, 0.109], "bond_k": [316118.969, 314502.688, 317365.781, 189027.781, 468259.812, 159723.734, 341827.656, 137221.641, 149891.875, 138248.109, 303609.219, 304906.375, 300468.344, 302499.125, 167533.422, 402220.219, 245321.672, 314369.719, 312399.938, 314199.0], "bond_idxs": [[1, 2], [1, 3], [1, 4], [1, 5], [5, 6], [5, 7], [7, 8], [7, 9], [9, 10], [9, 14], [10, 11], [10, 12], [10, 13], [14, 15], [14, 16], [16, 17], [16, 18], [18, 19], [18, 20], [18, 21]], "angle_eq": [134.994, 126.34, 103.24, 103.274, 104.849, 103.181, 105.181, 104.753, 109.427, 110.757, 131.03, 125.361, 119.769, 105.002, 105.298, 105.445, 105.168, 124.79, 117.307, 134.032, 104.307, 104.246, 104.393, 104.894, 100.311, 126.297, 106.137, 106.227, 106.004, 101.825, 104.856, 104.876, 104.746], "angle_k": [0.142, 0.124, 0.096, 0.096, 0.099, 0.095, 0.1, 0.099, 0.088, 0.098, 0.15, 0.104, 0.073, 0.069, 0.079, 0.075, 0.075, 0.056, 0.069, 0.057, 0.082, 0.084, 0.079, 0.082, 0.093, 0.086, 0.135, 0.137, 0.136, 0.085, 0.098, 0.098, 0.097], "angle_idxs": [[1, 5, 6], [1, 5, 7], [2, 1, 3], [2, 1, 4], [2, 1, 5], [3, 1, 4], [3, 1, 5], [4, 1, 5], [5, 7, 8], [5, 7, 9], [6, 5, 7], [7, 9, 10], [7, 9, 14], [8, 7, 9], [9, 10, 11], [9, 10, 12], [9, 10, 13], [9, 14, 15], [9, 14, 16], [10, 9, 14], [11, 10, 12], [11, 10, 13], [12, 10, 13], [14, 16, 17], [14, 16, 18], [15, 14, 16], [16, 18, 19], [16, 18, 20], [16, 18, 21], [17, 16, 18], [19, 18, 20], [19, 18, 21], [20, 18, 21]], "proper_ns": [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], "proper_phases": [[0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [180.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 0.0, 180.0, 0.0, 180.0], [0.0, 180.0, 0.0, 180.0, 0.0, 180.0], [0.0, 180.0, 0.0, 180.0, 0.0, 180.0], [180.0, 180.0, 0.0, 0.0, 180.0, 180.0], [0.0, 180.0, 0.0, 0.0, 180.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 180.0, 180.0, 0.0, 0.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 180.0, 180.0, 0.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 180.0, 180.0, 0.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 0.0, 0.0, 0.0, 180.0], [0.0, 180.0, 0.0, 180.0, 0.0, 180.0], [180.0, 180.0, 180.0, 180.0, 0.0, 0.0]], "proper_ks": [[4.704, 2.763, 2.064, 0.234, 0.0, 0.0], [1.747, 9.611, 1.321, 0.2, 0.0, 0.0], [5.633, 5.186, 0.341, 0.017, 0.0, 0.0], [5.512, 5.229, 0.347, 0.018, 0.0, 0.0], [5.047, 4.791, 0.44, 0.0, 0.0, 0.0], [2.718, 10.575, 1.227, 0.228, 0.0, 0.0], [4.774, 9.83, 0.898, 0.181, 0.0, 0.0], [5.388, 10.888, 1.002, 0.098, 0.0, 0.0], [1.049, 13.63, 0.743, 0.035, 0.0, 0.0], [0.451, 2.895, 0.964, 0.123, 0.0, 0.0], [0.681, 3.129, 1.018, 0.121, 0.0, 0.0], [0.497, 3.033, 1.012, 0.134, 0.0, 0.0], [8.282, 11.034, 0.157, 0.097, 0.0, 0.0], [5.422, 11.22, 1.085, 0.004, 0.0, 0.0], [2.454, 13.18, 0.95, 0.062, 0.0, 0.0], [9.442, 9.406, 0.068, 0.086, 0.0, 0.0], [2.196, 2.774, 0.696, 0.089, 0.0, 0.0], [1.935, 2.635, 0.669, 0.095, 0.0, 0.0], [1.879, 2.829, 0.631, 0.103, 0.0, 0.0], [5.748, 0.92, 1.336, 0.013, 0.0, 0.0], [0.186, 11.828, 0.345, 0.052, 0.0, 0.0]], "proper_idxs": [[1, 5, 7, 8], [1, 5, 7, 9], [2, 1, 5, 6], [3, 1, 5, 6], [4, 1, 5, 6], [5, 7, 9, 10], [5, 7, 9, 14], [6, 5, 7, 8], [6, 5, 7, 9], [7, 9, 10, 11], [7, 9, 10, 12], [7, 9, 10, 13], [7, 9, 14, 16], [9, 14, 16, 17], [9, 14, 16, 18], [10, 9, 14, 16], [11, 10, 9, 14], [12, 10, 9, 14], [13, 10, 9, 14], [15, 14, 16, 17], [15, 14, 16, 18]], "improper_ns": [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]], "improper_phases": [[180.0, 180.0, 0.0], [0.0, 180.0, 0.0], [180.0, 180.0, 0.0], [180.0, 180.0, 0.0], [180.0, 0.0, 180.0], [0.0, 0.0, 0.0], [180.0, 180.0, 0.0], [180.0, 180.0, 180.0], [180.0, 0.0, 0.0], [180.0, 180.0, 0.0], [180.0, 180.0, 180.0], [0.0, 180.0, 180.0]], "improper_ks": [[0.0, 18.668, 0.0], [0.0, 4.566, 0.0], [0.0, 14.324, 0.0], [0.0, 12.173, 0.0], [0.0, 4.006, 0.0], [0.0, 4.452, 0.0], [0.0, 8.777, 0.0], [0.0, 12.234, 0.0], [0.0, 3.593, 0.0], [0.0, 4.697, 0.0], [0.0, 0.327, 0.0], [0.0, 4.697, 0.0]], "improper_idxs": [[1, 7, 5, 6], [7, 6, 5, 1], [6, 1, 5, 7], [5, 9, 7, 8], [9, 8, 7, 5], [8, 5, 7, 9], [9, 16, 14, 15], [16, 15, 14, 9], [15, 9, 14, 16], [14, 18, 16, 17], [18, 17, 16, 14], [17, 14, 16, 18]]} \ No newline at end of file diff --git a/tests/out_parameterized.top b/tests/out_parameterized.top index e17428f..9d6069e 100644 --- a/tests/out_parameterized.top +++ b/tests/out_parameterized.top @@ -729,7 +729,6 @@ SOL 2 #endif #ifndef FLEXIBLE -[ bonds ] #else [ bonds ] 1 2 1 0.09572 502416.0 0.09572 502416.0 @@ -737,7 +736,6 @@ SOL 2 #endif #ifndef FLEXIBLE -[ angles ] #else [ angles ] 2 1 3 1 104.52 628.02 104.52 628.02 @@ -823,27 +821,27 @@ ZN 1 Reactive 3 [ atoms ] -1 CT 1 ACE CH3 1 0.0000 12.01 -2 HC 1 ACE HH31 2 0.0000 1.008 -3 HC 1 ACE HH32 3 0.0000 1.008 -4 HC 1 ACE HH33 4 0.0000 1.008 -5 C 1 ACE C 5 0.0000 12.01 -6 O 1 ACE O 6 0.0000 16.0 -7 N 2 ALA N 7 0.0000 14.01 -8 H 2 ALA H 8 0.0000 1.008 -9 CT 2 ALA CA 9 0.0000 12.01 -10 CT 2 ALA CB 10 0.0000 12.01 -11 HC 2 ALA HB1 11 0.0000 1.008 -12 HC 2 ALA HB2 12 0.0000 1.008 -13 HC 2 ALA HB3 13 0.0000 1.008 -14 C 2 ALA C 14 0.0000 12.01 -15 O 2 ALA O 15 0.0000 16.0 -16 N 3 NME N 16 0.0000 14.01 -17 H 3 NME H 17 0.0000 1.008 -18 CT 3 NME CH3 18 0.0000 12.01 -19 H1 3 NME HH31 19 0.0000 1.008 -20 H1 3 NME HH32 20 0.0000 1.008 -21 H1 3 NME HH33 21 0.0000 1.008 +1 CT 1 ACE CH3 1 -0.3662 12.01 +2 HC 1 ACE HH31 2 0.1123 1.008 +3 HC 1 ACE HH32 3 0.1123 1.008 +4 HC 1 ACE HH33 4 0.1123 1.008 +5 C 1 ACE C 5 0.5972 12.01 +6 O 1 ACE O 6 -0.5679 16.0 +7 N 2 ALA N 7 -0.4157 14.01 +8 H 2 ALA H 8 0.2719 1.008 +9 CT 2 ALA CA 9 0.1160 12.01 +10 CT 2 ALA CB 10 -0.1825 12.01 +11 HC 2 ALA HB1 11 0.0603 1.008 +12 HC 2 ALA HB2 12 0.0603 1.008 +13 HC 2 ALA HB3 13 0.0603 1.008 +14 C 2 ALA C 14 0.5973 12.01 +15 O 2 ALA O 15 -0.5679 16.0 +16 N 3 NME N 16 -0.4157 14.01 +17 H 3 NME H 17 0.2719 1.008 +18 CT 3 NME CH3 18 -0.149 12.01 +19 H1 3 NME HH31 19 0.0976 1.008 +20 H1 3 NME HH32 20 0.0976 1.008 +21 H1 3 NME HH33 21 0.0976 1.008 [ bonds ] 1 2 1 0.1094 315945.8067 @@ -1150,13 +1148,9 @@ Reactive 3 9 16 14 15 4 14 18 16 17 4 -[ position_restraints ] -[ dihedral_restraints ] -[ settles ] -[ exclusions ] [ system ] diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index fd1f202..8ff7c8a 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -97,8 +97,7 @@ def test_convert_parameters(grappa_output_raw, grappa_output_converted): def test_apply_parameters(grappa_output_converted): top = Topology(read_top(Path(__file__).parent / "Ala_out.top")) - partial_charges = np.zeros_like(grappa_output_converted.atoms,dtype=float).tolist() - apply_parameters(top, grappa_output_converted, partial_charges) + apply_parameters(top, grappa_output_converted) write_top(top.to_dict(), Path(__file__).parents[0] / "tmp" / "out_parameterized.top") From 81d598083f0d59b616364f938ce770e2eb6c4357 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Tue, 19 Dec 2023 14:17:55 +0100 Subject: [PATCH 06/12] remove leftover files --- out_raw.json | 1388 -------------------------------------------------- 1 file changed, 1388 deletions(-) delete mode 100644 out_raw.json diff --git a/out_raw.json b/out_raw.json deleted file mode 100644 index 02caea0..0000000 --- a/out_raw.json +++ /dev/null @@ -1,1388 +0,0 @@ -{ - "atoms": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21 - ], - "bonds": [ - [ - 1, - 2 - ], - [ - 1, - 3 - ], - [ - 1, - 4 - ], - [ - 1, - 5 - ], - [ - 5, - 6 - ], - [ - 5, - 7 - ], - [ - 7, - 8 - ], - [ - 7, - 9 - ], - [ - 9, - 10 - ], - [ - 9, - 14 - ], - [ - 10, - 11 - ], - [ - 10, - 12 - ], - [ - 10, - 13 - ], - [ - 14, - 15 - ], - [ - 14, - 16 - ], - [ - 16, - 17 - ], - [ - 16, - 18 - ], - [ - 18, - 19 - ], - [ - 18, - 20 - ], - [ - 18, - 21 - ] - ], - "bond_k": [ - 755.1286010742188, - 755.1286010742188, - 755.1286010742188, - 535.0306396484375, - 1483.93310546875, - 570.5672607421875, - 978.9837036132812, - 380.38543701171875, - 509.2330322265625, - 195.39584350585938, - 752.521240234375, - 752.521240234375, - 752.521240234375, - 1422.7335205078125, - 785.9999389648438, - 967.77001953125, - 653.0269775390625, - 753.010009765625, - 753.010009765625, - 753.010009765625 - ], - "bond_eq": [ - 1.0938714742660522, - 1.0938714742660522, - 1.0938714742660522, - 1.5267786979675293, - 1.2169218063354492, - 1.381420373916626, - 1.018121361732483, - 1.3490225076675415, - 1.49397873878479, - 1.410969614982605, - 1.09508216381073, - 1.09508216381073, - 1.09508216381073, - 1.2173930406570435, - 1.3548707962036133, - 1.012398600578308, - 1.446398377418518, - 1.0925675630569458, - 1.0925675630569458, - 1.0925675630569458 - ], - "angles": [ - [ - 1, - 5, - 6 - ], - [ - 1, - 5, - 7 - ], - [ - 2, - 1, - 3 - ], - [ - 2, - 1, - 4 - ], - [ - 2, - 1, - 5 - ], - [ - 3, - 1, - 4 - ], - [ - 3, - 1, - 5 - ], - [ - 4, - 1, - 5 - ], - [ - 5, - 7, - 8 - ], - [ - 5, - 7, - 9 - ], - [ - 6, - 5, - 7 - ], - [ - 7, - 9, - 10 - ], - [ - 7, - 9, - 14 - ], - [ - 8, - 7, - 9 - ], - [ - 9, - 10, - 11 - ], - [ - 9, - 10, - 12 - ], - [ - 9, - 10, - 13 - ], - [ - 9, - 14, - 15 - ], - [ - 9, - 14, - 16 - ], - [ - 10, - 9, - 14 - ], - [ - 14, - 16, - 17 - ], - [ - 14, - 16, - 18 - ], - [ - 11, - 10, - 12 - ], - [ - 11, - 10, - 13 - ], - [ - 12, - 10, - 13 - ], - [ - 15, - 14, - 16 - ], - [ - 16, - 18, - 19 - ], - [ - 16, - 18, - 20 - ], - [ - 16, - 18, - 21 - ], - [ - 17, - 16, - 18 - ], - [ - 19, - 18, - 20 - ], - [ - 19, - 18, - 21 - ], - [ - 20, - 18, - 21 - ] - ], - "angle_k": [ - 119.9668197631836, - 106.92973327636719, - 81.41822814941406, - 81.41822814941406, - 103.62391662597656, - 81.41822814941406, - 103.62391662597656, - 103.62391662597656, - 77.98545837402344, - 84.3622817993164, - 165.36575317382812, - 116.89408111572266, - 78.10746765136719, - 81.03467559814453, - 98.86503601074219, - 98.86503601074219, - 98.86503601074219, - 104.12686157226562, - 90.68270111083984, - 68.47164916992188, - 99.56668853759766, - 56.40223693847656, - 78.86282348632812, - 78.86282348632812, - 78.86282348632812, - 152.5394744873047, - 121.64669036865234, - 121.64669036865234, - 121.64669036865234, - 86.3036117553711, - 84.08207702636719, - 84.08207702636719, - 84.08207702636719 - ], - "angle_eq": [ - 2.577260732650757, - 2.4657208919525146, - 1.8040478229522705, - 1.8040478229522705, - 1.837625503540039, - 1.8040478229522705, - 1.837625503540039, - 1.837625503540039, - 2.0068106651306152, - 1.9928127527236938, - 2.4423227310180664, - 2.185570240020752, - 2.096254348754883, - 1.9573496580123901, - 1.8267408609390259, - 1.8267408609390259, - 1.8267408609390259, - 2.4766693115234375, - 2.4235546588897705, - 2.230893611907959, - 1.9910074472427368, - 1.8670819997787476, - 1.7901557683944702, - 1.7901557683944702, - 1.7901557683944702, - 2.4439475536346436, - 1.8413236141204834, - 1.8413236141204834, - 1.8413236141204834, - 1.9395732879638672, - 1.8040862083435059, - 1.8040862083435059, - 1.8040862083435059 - ], - "propers": [ - [ - 2, - 1, - 5, - 6 - ], - [ - 3, - 1, - 5, - 6 - ], - [ - 4, - 1, - 5, - 6 - ], - [ - 2, - 1, - 5, - 7 - ], - [ - 3, - 1, - 5, - 7 - ], - [ - 4, - 1, - 5, - 7 - ], - [ - 1, - 5, - 7, - 8 - ], - [ - 6, - 5, - 7, - 8 - ], - [ - 1, - 5, - 7, - 9 - ], - [ - 6, - 5, - 7, - 9 - ], - [ - 5, - 7, - 9, - 10 - ], - [ - 8, - 7, - 9, - 10 - ], - [ - 5, - 7, - 9, - 14 - ], - [ - 8, - 7, - 9, - 14 - ], - [ - 11, - 10, - 9, - 14 - ], - [ - 12, - 10, - 9, - 14 - ], - [ - 13, - 10, - 9, - 14 - ], - [ - 7, - 9, - 10, - 11 - ], - [ - 7, - 9, - 10, - 12 - ], - [ - 7, - 9, - 10, - 13 - ], - [ - 7, - 9, - 14, - 15 - ], - [ - 10, - 9, - 14, - 15 - ], - [ - 7, - 9, - 14, - 16 - ], - [ - 10, - 9, - 14, - 16 - ], - [ - 9, - 14, - 16, - 17 - ], - [ - 15, - 14, - 16, - 17 - ], - [ - 9, - 14, - 16, - 18 - ], - [ - 15, - 14, - 16, - 18 - ], - [ - 14, - 16, - 18, - 19 - ], - [ - 17, - 16, - 18, - 19 - ], - [ - 14, - 16, - 18, - 20 - ], - [ - 17, - 16, - 18, - 20 - ], - [ - 14, - 16, - 18, - 21 - ], - [ - 17, - 16, - 18, - 21 - ] - ], - "proper_ks": [ - [ - 0.04494260251522064, - 0.6748359203338623, - 0.06567462533712387, - 0.0018822925630956888, - 0.005876102019101381, - 0.0001455173478461802 - ], - [ - 0.04494260251522064, - 0.6748359203338623, - 0.06567462533712387, - 0.0018822925630956888, - 0.005876102019101381, - 0.0001455173478461802 - ], - [ - 0.04494260251522064, - 0.6748359203338623, - 0.06567462533712387, - 0.0018822925630956888, - 0.005876102019101381, - 0.0001455173478461802 - ], - [ - 0.04216618090867996, - 0.779660701751709, - 0.0996779352426529, - 0.0024542033206671476, - 0.013731980696320534, - 0.0010647684102877975 - ], - [ - 0.04216618090867996, - 0.779660701751709, - 0.0996779352426529, - 0.0024542033206671476, - 0.013731980696320534, - 0.0010647684102877975 - ], - [ - 0.04216618090867996, - 0.779660701751709, - 0.0996779352426529, - 0.0024542033206671476, - 0.013731980696320534, - 0.0010647684102877975 - ], - [ - 0.4285593032836914, - 2.317983865737915, - 0.15826106071472168, - 0.07149321585893631, - 0.002321923151612282, - 0.03168807923793793 - ], - [ - 1.76844322681427, - 3.553204298019409, - 0.0710846558213234, - 0.020816639065742493, - 0.005745828617364168, - 0.03658169507980347 - ], - [ - 0.41623467206954956, - 3.1035726070404053, - 0.12127675116062164, - 0.06377430260181427, - 0.008512343280017376, - 0.006807954050600529 - ], - [ - 1.437559962272644, - 4.364359378814697, - 0.03386424109339714, - 0.192324697971344, - 0.01088003907352686, - 0.0036552846431732178 - ], - [ - 0.09326191246509552, - 2.629699230194092, - 0.17447513341903687, - 0.08979395031929016, - 0.006880050990730524, - 0.002431943081319332 - ], - [ - 0.8621795177459717, - 1.4567458629608154, - 0.27090883255004883, - 0.028016723692417145, - 0.005979370325803757, - 0.01546785794198513 - ], - [ - 0.7725563049316406, - 1.566367745399475, - 0.18599750101566315, - 0.006534155923873186, - 0.0006819289992563426, - 0.001302878255955875 - ], - [ - 0.008390707895159721, - 1.1807739734649658, - 0.02002820000052452, - 0.026027575135231018, - 0.00280350586399436, - 0.014300660230219364 - ], - [ - 0.35878416895866394, - 0.6685130596160889, - 0.1756485253572464, - 0.09212284535169601, - 0.012770860455930233, - 0.014153237454593182 - ], - [ - 0.35878416895866394, - 0.6685130596160889, - 0.1756485253572464, - 0.09212284535169601, - 0.012770860455930233, - 0.014153237454593182 - ], - [ - 0.35878416895866394, - 0.6685130596160889, - 0.1756485253572464, - 0.09212284535169601, - 0.012770860455930233, - 0.014153237454593182 - ], - [ - 0.09008254110813141, - 0.60626620054245, - 0.20429131388664246, - 0.0013158542569726706, - 0.007764535024762154, - 0.0032613291405141354 - ], - [ - 0.09008254110813141, - 0.60626620054245, - 0.20429131388664246, - 0.0013158542569726706, - 0.007764535024762154, - 0.0032613291405141354 - ], - [ - 0.09008254110813141, - 0.60626620054245, - 0.20429131388664246, - 0.0013158542569726706, - 0.007764535024762154, - 0.0032613291405141354 - ], - [ - 1.1284929513931274, - 1.0550589561462402, - 0.08317933976650238, - 0.0758308470249176, - 0.0006398173281922936, - 0.023438507691025734 - ], - [ - 1.3504596948623657, - 0.9865561723709106, - 0.0551498718559742, - 0.053106434643268585, - 0.006684677675366402, - 0.028416384011507034 - ], - [ - 1.827253818511963, - 2.06610369682312, - 0.07396615296602249, - 0.039012253284454346, - 0.0055722338147461414, - 0.0375509038567543 - ], - [ - 1.9751782417297363, - 2.097846031188965, - 0.07606945186853409, - 0.10462893545627594, - 0.006167523562908173, - 0.03363082930445671 - ], - [ - 1.2036311626434326, - 2.2142984867095947, - 0.3085859417915344, - 0.013190153054893017, - 0.009937243536114693, - 0.008372116833925247 - ], - [ - 2.525923252105713, - 3.4615910053253174, - 0.07541729509830475, - 0.042516548186540604, - 0.021215463057160378, - 0.007254273165017366 - ], - [ - 1.0110245943069458, - 3.2103850841522217, - 0.29765740036964417, - 0.01805623434484005, - 0.009621884673833847, - 0.013184653595089912 - ], - [ - 0.6173112988471985, - 5.428781509399414, - 0.021032366901636124, - 0.25730106234550476, - 0.012070788070559502, - 0.0038080583326518536 - ], - [ - 0.07324298471212387, - 0.15870366990566254, - 0.06431722640991211, - 0.10600262880325317, - 0.007004760205745697, - 0.0003594254667405039 - ], - [ - 0.17425981163978577, - 0.25140509009361267, - 0.02646039053797722, - 0.008538116700947285, - 0.00018829142209142447, - 0.0007575735216960311 - ], - [ - 0.07324298471212387, - 0.15870366990566254, - 0.06431722640991211, - 0.10600262880325317, - 0.007004760205745697, - 0.0003594254667405039 - ], - [ - 0.17425981163978577, - 0.25140509009361267, - 0.02646039053797722, - 0.008538116700947285, - 0.00018829142209142447, - 0.0007575735216960311 - ], - [ - 0.0732429102063179, - 0.15870371460914612, - 0.06431721150875092, - 0.10600259900093079, - 0.007004757411777973, - 0.0003594244481064379 - ], - [ - 0.17425979673862457, - 0.2514052391052246, - 0.026460394263267517, - 0.008538112975656986, - 0.00018829276086762547, - 0.0007575732888653874 - ] - ], - "proper_phases": [ - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 0.0, - 0.0, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0 - ], - [ - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0 - ], - [ - 3.1415927410125732, - 0.0, - 0.0, - 3.1415927410125732, - 0.0, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0, - 3.1415927410125732, - 3.1415927410125732, - 0.0 - ] - ], - "impropers": [ - [ - 1, - 7, - 5, - 6 - ], - [ - 7, - 6, - 5, - 1 - ], - [ - 6, - 1, - 5, - 7 - ], - [ - 5, - 9, - 7, - 8 - ], - [ - 9, - 8, - 7, - 5 - ], - [ - 8, - 5, - 7, - 9 - ], - [ - 7, - 10, - 9, - 14 - ], - [ - 10, - 14, - 9, - 7 - ], - [ - 14, - 7, - 9, - 10 - ], - [ - 9, - 16, - 14, - 15 - ], - [ - 16, - 15, - 14, - 9 - ], - [ - 15, - 9, - 14, - 16 - ], - [ - 14, - 18, - 16, - 17 - ], - [ - 18, - 17, - 16, - 14 - ], - [ - 17, - 14, - 16, - 18 - ] - ], - "improper_ks": [ - [ - 7.061033829813823e-05, - 7.039442539215088, - 2.5443000570973817e-12 - ], - [ - 1.6675303715976697e-12, - 11.82522201538086, - 6.906843191245571e-05 - ], - [ - 4.957116470905021e-05, - 5.035053253173828, - 1.3721930258725479e-09 - ], - [ - 1.612351661606226e-05, - 1.6723710298538208, - 1.6308449630741961e-06 - ], - [ - 3.572121443085052e-08, - 5.224257469177246, - 2.798713649099227e-05 - ], - [ - 4.1046303522307426e-05, - 3.115514039993286, - 7.626833053997473e-10 - ], - [ - 1.3283370208228007e-06, - 0.4701811969280243, - 1.7553611542098224e-05 - ], - [ - 1.8493884113013337e-07, - 1.1970317363739014, - 3.0034112569410354e-05 - ], - [ - 2.4897314432337225e-08, - 2.636653423309326, - 3.9613834815099835e-05 - ], - [ - 5.474128920468502e-05, - 5.543274402618408, - 1.225876483657018e-10 - ], - [ - 3.510047461019461e-11, - 7.956034183502197, - 6.594436126761138e-05 - ], - [ - 4.4454209273681045e-05, - 4.596062183380127, - 9.936862443993277e-10 - ], - [ - 3.990923869423568e-05, - 3.8023033142089844, - 5.639988920336236e-09 - ], - [ - 9.445317791789698e-12, - 11.592504501342773, - 6.293354817898944e-05 - ], - [ - 4.342288229963742e-05, - 3.532057762145996, - 2.5205488807245047e-09 - ] - ], - "improper_phases": [ - [ - 0.0, - 0.0, - 0.0 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0 - ], - [ - 0.0, - 0.0, - 0.0 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 - ], - [ - 0.0, - 0.0, - 0.0 - ] - ] -} \ No newline at end of file From 8096848b21c61dc82ee1de2690fc34e046c436e5 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Tue, 19 Dec 2023 14:20:19 +0100 Subject: [PATCH 07/12] black --- src/grappa_interface.py | 79 ++++++++++++++++++++++++------------ tests/test_parameterizers.py | 50 +++++++++++++---------- 2 files changed, 83 insertions(+), 46 deletions(-) diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 293fe50..7f8a6ef 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -1,6 +1,7 @@ import logging import numpy as np -np.set_printoptions(suppress=True,precision=6) #prevent numpy exponential + +np.set_printoptions(suppress=True, precision=6) # prevent numpy exponential import math from typing import Union @@ -21,6 +22,7 @@ logger = logging.getLogger("kimmdy.grappa_interface") + # helper functions def check_equal_length(d: dict, name: str): lengths = [len(y) for y in d.values()] @@ -28,6 +30,7 @@ def check_equal_length(d: dict, name: str): len(set(lengths)) == 1 ), f"Different length of {name} parameters: { {k:len(v) for k, v in d.items()} }" + # unused? def convert_to_python_types(array: Union[list, np.ndarray]) -> list: return getattr(array, "tolist", lambda: array)() @@ -41,6 +44,7 @@ def order_proper(idxs: np.ndarray) -> np.ndarray: else: return np.flip(idxs) + # unused? def elements_to_string(l: list): for i, e in enumerate(l): @@ -49,38 +53,62 @@ def elements_to_string(l: list): else: l[i] = str(e) + # workflow functions def build_molecule(top: Topology) -> Molecule: at_map = top.ff.atomtypes - atom_info = {'nr':[],'atomic_number':[],'partial_charges':[],'sigma':[],'epsilon':[],'is_radical':[]} + atom_info = { + "nr": [], + "atomic_number": [], + "partial_charges": [], + "sigma": [], + "epsilon": [], + "is_radical": [], + } for atom in top.atoms.values(): - atom_info['nr'].append(int(atom.nr)) - atom_info['atomic_number'].append(int(at_map[atom.type].at_num)) - atom_info['partial_charges'].append(float(atom.charge)) - atom_info['sigma'].append(float(at_map[atom.type].sigma)) - atom_info['epsilon'].append(float(at_map[atom.type].epsilon)) - atom_info['is_radical'].append(int(atom.is_radical)) + atom_info["nr"].append(int(atom.nr)) + atom_info["atomic_number"].append(int(at_map[atom.type].at_num)) + atom_info["partial_charges"].append(float(atom.charge)) + atom_info["sigma"].append(float(at_map[atom.type].sigma)) + atom_info["epsilon"].append(float(at_map[atom.type].epsilon)) + atom_info["is_radical"].append(int(atom.is_radical)) bonds = [(int(bond.ai), int(bond.aj)) for bond in top.bonds.values()] - impropers = [(int(improper.ai), int(improper.aj),int(improper.ak),int(improper.al)) for improper in top.improper_dihedrals.values()] - - mol = Molecule(atoms=atom_info["nr"],bonds=bonds,impropers=impropers,atomic_numbers=atom_info["atomic_number"],partial_charges=atom_info["partial_charges"],additional_features={k:np.asarray(v) for k,v in atom_info.items() if k not in ['nr','atomic_number','partial_charges']}) + impropers = [ + (int(improper.ai), int(improper.aj), int(improper.ak), int(improper.al)) + for improper in top.improper_dihedrals.values() + ] + + mol = Molecule( + atoms=atom_info["nr"], + bonds=bonds, + impropers=impropers, + atomic_numbers=atom_info["atomic_number"], + partial_charges=atom_info["partial_charges"], + additional_features={ + k: np.asarray(v) + for k, v in atom_info.items() + if k not in ["nr", "atomic_number", "partial_charges"] + }, + ) return mol def convert_parameters(parameters: Parameters) -> Parameters: # parameters are in kcal/mol, Angstrom und rad # convert to kJ/mol, nm and degree(mostly) - distance_factor = convert(1,openmm_unit.angstrom,openmm_unit.nanometer) - degree_factor = convert(1,openmm_unit.radian, openmm_unit.degree) - energy_factor = convert(1,openmm_unit.kilocalorie_per_mole,openmm_unit.kilojoule_per_mole) + distance_factor = convert(1, openmm_unit.angstrom, openmm_unit.nanometer) + degree_factor = convert(1, openmm_unit.radian, openmm_unit.degree) + energy_factor = convert( + 1, openmm_unit.kilocalorie_per_mole, openmm_unit.kilojoule_per_mole + ) # convert parameters parameters.bond_eq = parameters.bond_eq * distance_factor - parameters.bond_k = parameters.bond_k * energy_factor / np.power(distance_factor,2) + parameters.bond_k = parameters.bond_k * energy_factor / np.power(distance_factor, 2) # angles are given in degrees and force constants in kJ/mol/rad**2. parameters.angle_eq = parameters.angle_eq * degree_factor - parameters.angle_k = parameters.angle_k * energy_factor + parameters.angle_k = parameters.angle_k * energy_factor parameters.propers = np.array([order_proper(x) for x in parameters.propers]) parameters.proper_phases = parameters.proper_phases * degree_factor @@ -91,19 +119,20 @@ def convert_parameters(parameters: Parameters) -> Parameters: # convert to list of strings for k in parameters.__annotations__.keys(): - v = getattr(parameters,k) - if isinstance(v[0],float): + v = getattr(parameters, k) + if isinstance(v[0], float): v_list = [f"{i:11.4f}".strip() for i in v] - elif isinstance(v[0],np.ndarray) and isinstance(v[0,0],float): + elif isinstance(v[0], np.ndarray) and isinstance(v[0, 0], float): v_list = [] for sub_list in v: v_list.append([f"{i:11.4f}".strip() for i in sub_list]) else: v_list = v.astype(str).tolist() - setattr(parameters,k,v_list) + setattr(parameters, k, v_list) return parameters + def apply_parameters(top: Topology, parameters: Parameters): # parameter structure is defined in grappa.data.Parameters.Parameters # assume units are according to https://manual.gromacs.org/current/reference-manual/definitions.html @@ -151,7 +180,7 @@ def apply_parameters(top: Topology, parameters: Parameters): continue dihedral_dict = {} for ii in range(len(parameters.proper_ks[i])): - n = str(ii+1) + n = str(ii + 1) dihedral_dict[n] = Dihedral( *tup, funct="9", @@ -168,7 +197,7 @@ def apply_parameters(top: Topology, parameters: Parameters): for i, idx in enumerate(parameters.impropers): tup = tuple(idx) for ii in range(len(parameters.improper_ks[i])): - n = str(ii+1) + n = str(ii + 1) if not math.isclose( float(parameters.improper_ks[i][ii]), 0.0, abs_tol=1e-3 ): @@ -210,11 +239,11 @@ def parameterize_topology( mol.to_json("in.json") # load model, tag will be changed to be more permanent - model_tag = 'https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth' + model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" model = load_model(model_tag) # initialize class that handles ML part - grappa = Grappa(model,device='cpu') + grappa = Grappa(model, device="cpu") parameters = grappa.predict(mol) # convert units et cetera @@ -222,4 +251,4 @@ def parameterize_topology( # apply parameters apply_parameters(current_topology, parameters) - return current_topology \ No newline at end of file + return current_topology diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index 8ff7c8a..3413a32 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -28,10 +28,12 @@ # generic functions def array_eq(arr1, arr2): - return (isinstance(arr1, np.ndarray) and - isinstance(arr2, np.ndarray) and - arr1.shape == arr2.shape and - (arr1 == arr2).all()) + return ( + isinstance(arr1, np.ndarray) + and isinstance(arr2, np.ndarray) + and arr1.shape == arr2.shape + and (arr1 == arr2).all() + ) ## fixtures ## @@ -43,63 +45,69 @@ def grappa_input(): @pytest.fixture def grappa_output_raw(): ref_dict = read_json(Path(__file__).parents[0] / "out_raw_alanine.json") - for k,v in ref_dict.items(): + for k, v in ref_dict.items(): ref_dict[k] = np.asarray(v) - output_raw= Parameters.from_dict(ref_dict) + output_raw = Parameters.from_dict(ref_dict) return output_raw + @pytest.fixture def grappa_output_converted(): ref_dict = read_json(Path(__file__).parents[0] / "out_converted_alanine.json") - output_converted= Parameters.from_dict(ref_dict) + output_converted = Parameters.from_dict(ref_dict) return output_converted + ## test scripts ## def test_generate_input(): top = Topology(read_top(Path(__file__).parent / "Ala_out.top")) mol = build_molecule(top) - mol.to_json( Path(__file__).parents[0] / "tmp" / "in.json") + mol.to_json(Path(__file__).parents[0] / "tmp" / "in.json") assert len(mol.atoms) == 21 assert len(mol.bonds) == 20 assert len(mol.impropers) == 15 feature_keys = list(mol.additional_features.keys()) - assert all(x in feature_keys for x in ['is_radical','ring_encoding']) + assert all(x in feature_keys for x in ["is_radical", "ring_encoding"]) assert mol.atomic_numbers[8] == 6 - assert mol.additional_features['is_radical'][8] == 1 + assert mol.additional_features["is_radical"][8] == 1 -def test_predict_parameters(grappa_input,grappa_output_raw): +def test_predict_parameters(grappa_input, grappa_output_raw): # load model, tag will be changed to be more permanent - model_tag = 'https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth' + model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" model = load_model(model_tag) # initialize class that handles ML part - grappa = Grappa(model,device='cpu') + grappa = Grappa(model, device="cpu") parameters = grappa.predict(grappa_input) parameters_dict = parameters.to_dict() - write_json(parameters_dict, Path(__file__).parents[0] / "tmp" / "out_raw.json") - + write_json(parameters_dict, Path(__file__).parents[0] / "tmp" / "out_raw.json") + # check for equality per attribute for k in grappa_output_raw.__annotations__.keys(): - assert array_eq(getattr(grappa_output_raw,k),getattr(parameters,k)) - - + assert array_eq(getattr(grappa_output_raw, k), getattr(parameters, k)) + + def test_convert_parameters(grappa_output_raw, grappa_output_converted): parameters = convert_parameters(grappa_output_raw) parameters_dict = parameters.to_dict() - write_json(parameters_dict, Path(__file__).parents[0] / "tmp" / "out_converted.json") + write_json( + parameters_dict, Path(__file__).parents[0] / "tmp" / "out_converted.json" + ) - assert parameters == grappa_output_converted + assert parameters == grappa_output_converted def test_apply_parameters(grappa_output_converted): top = Topology(read_top(Path(__file__).parent / "Ala_out.top")) apply_parameters(top, grappa_output_converted) - write_top(top.to_dict(), Path(__file__).parents[0] / "tmp" / "out_parameterized.top") + write_top( + top.to_dict(), Path(__file__).parents[0] / "tmp" / "out_parameterized.top" + ) def test_parameterize_topology(tmp_path): From 29fa11ff19b7d080dd28c42e99181cedd26fd4e7 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Tue, 19 Dec 2023 19:15:32 +0100 Subject: [PATCH 08/12] add debug message --- src/grappa_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 7f8a6ef..015bcb3 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -236,7 +236,7 @@ def parameterize_topology( ) -> Topology: ## get atoms, bonds, radicals in required format mol = build_molecule(current_topology) - mol.to_json("in.json") + logger.debug(mol.to_dict()) # load model, tag will be changed to be more permanent model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" From d66c338ea2664667e25771b9c609780ae120a6a9 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Fri, 26 Jan 2024 16:12:17 +0100 Subject: [PATCH 09/12] update to new grappa release --- src/grappa_interface.py | 7 +- tests/out_converted_alanine.json | 804 ++++++++++++++-------------- tests/out_parameterized.top | 514 +++++++++--------- tests/out_raw_alanine.json | 862 +++++++++++++++---------------- tests/test_parameterizers.py | 9 +- 5 files changed, 1099 insertions(+), 1097 deletions(-) diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 015bcb3..616163c 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -14,7 +14,7 @@ from grappa.data import Molecule from grappa.data import Parameters -from grappa.utils.loading_utils import load_model +from grappa.utils.loading_utils import model_from_url from grappa.grappa import Grappa from openmm import unit as openmm_unit @@ -239,8 +239,9 @@ def parameterize_topology( logger.debug(mol.to_dict()) # load model, tag will be changed to be more permanent - model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" - model = load_model(model_tag) + #model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" # older model + model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/model_release/grappa-1.0-01-26-2024.pth" + model = model_from_url(model_tag) # initialize class that handles ML part grappa = Grappa(model, device="cpu") diff --git a/tests/out_converted_alanine.json b/tests/out_converted_alanine.json index 290608c..e392e06 100644 --- a/tests/out_converted_alanine.json +++ b/tests/out_converted_alanine.json @@ -105,48 +105,48 @@ ] ], "bond_k": [ - "315945.8067", - "315945.8067", - "315945.8067", - "223856.8196", - "620877.6113", - "238725.3419", - "409606.7816", - "159153.2668", - "213063.1007", - "81753.6209", - "314854.8869", - "314854.8869", - "314854.8869", - "595271.7050", - "328862.3745", - "404914.9762", - "273226.4874", - "315059.3881", - "315059.3881", - "315059.3881" + "324667.0104", + "324667.0104", + "324667.0104", + "250115.2757", + "712427.1780", + "328328.5978", + "418910.2059", + "301759.0486", + "238041.8156", + "203470.4558", + "322838.9875", + "322838.9875", + "322838.9875", + "672627.4398", + "320493.9403", + "419935.6996", + "260742.5949", + "320849.5446", + "320849.5446", + "320849.5446" ], "bond_eq": [ - "0.1094", - "0.1094", - "0.1094", - "0.1527", - "0.1217", - "0.1381", - "0.1018", - "0.1349", - "0.1494", - "0.1411", + "0.1096", + "0.1096", + "0.1096", + "0.1536", + "0.1235", + "0.1393", + "0.1019", + "0.1353", + "0.1484", + "0.1445", + "0.1096", + "0.1096", + "0.1096", + "0.1236", + "0.1359", + "0.1014", + "0.1445", "0.1095", "0.1095", - "0.1095", - "0.1217", - "0.1355", - "0.1012", - "0.1446", - "0.1093", - "0.1093", - "0.1093" + "0.1095" ], "angles": [ [ @@ -316,74 +316,74 @@ ] ], "angle_k": [ - "501.9412", - "447.3940", - "340.6539", - "340.6539", - "433.5625", - "340.6539", - "433.5625", - "433.5625", - "326.2912", - "352.9718", - "691.8903", - "489.0848", - "326.8016", - "339.0491", - "413.6513", - "413.6513", - "413.6513", - "435.6668", - "379.4164", - "286.4854", - "416.5870", - "235.9870", - "329.9621", - "329.9621", - "329.9621", - "638.2252", - "508.9698", - "508.9698", - "508.9698", - "361.0943", - "351.7994", - "351.7994", - "351.7994" + "595.7744", + "505.9435", + "319.7542", + "319.7542", + "365.7937", + "319.7542", + "365.7937", + "365.7937", + "338.4011", + "391.4897", + "768.2620", + "504.9881", + "394.7721", + "318.6095", + "380.5293", + "380.5293", + "380.5293", + "473.2717", + "443.9995", + "333.7617", + "338.3853", + "403.4996", + "327.7598", + "327.7598", + "327.7598", + "882.2322", + "460.6060", + "460.6060", + "460.6060", + "333.1540", + "331.3626", + "331.3626", + "331.3626" ], "angle_eq": [ - "147.6662", - "141.2754", - "103.3643", - "103.3643", - "105.2882", - "103.3643", - "105.2882", - "105.2882", - "114.9818", - "114.1798", - "139.9348", - "125.2240", - "120.1065", - "112.1479", - "104.6645", - "104.6645", - "104.6645", - "141.9027", - "138.8595", - "127.8208", - "114.0763", - "106.9759", - "102.5684", - "102.5684", - "102.5684", - "140.0279", - "105.5001", - "105.5001", - "105.5001", - "111.1294", - "103.3665", - "103.3665", - "103.3665" + "131.9380", + "120.9924", + "106.9751", + "106.9751", + "108.5067", + "106.9751", + "108.5067", + "108.5067", + "111.6350", + "110.1122", + "127.5476", + "120.5822", + "111.2578", + "108.9447", + "107.5699", + "107.5699", + "107.5699", + "123.6507", + "113.8283", + "118.4645", + "110.9031", + "108.4205", + "106.9917", + "106.9917", + "106.9917", + "127.5355", + "107.5742", + "107.5742", + "107.5742", + "107.6207", + "106.9106", + "106.9106", + "106.9106" ], "propers": [ [ @@ -593,276 +593,276 @@ ], "proper_ks": [ [ - "0.1880", - "2.8235", - "0.2748", - "0.0079", - "0.0246", - "0.0006" + "1.7246", + "3.7732", + "0.6644", + "0.0549", + "0.0002", + "0.0155" ], [ - "0.1880", - "2.8235", - "0.2748", - "0.0079", - "0.0246", - "0.0006" + "1.7246", + "3.7732", + "0.6644", + "0.0549", + "0.0002", + "0.0155" ], [ - "0.1880", - "2.8235", - "0.2748", - "0.0079", - "0.0246", - "0.0006" + "1.7246", + "3.7732", + "0.6644", + "0.0549", + "0.0002", + "0.0155" ], [ - "0.1764", - "3.2621", - "0.4171", - "0.0103", - "0.0575", - "0.0045" + "0.8163", + "1.8835", + "0.4764", + "0.1380", + "0.0000", + "0.0212" ], [ - "0.1764", - "3.2621", - "0.4171", - "0.0103", - "0.0575", - "0.0045" + "0.8163", + "1.8835", + "0.4764", + "0.1380", + "0.0000", + "0.0212" ], [ - "0.1764", - "3.2621", - "0.4171", - "0.0103", - "0.0575", - "0.0045" + "0.8163", + "1.8835", + "0.4764", + "0.1380", + "0.0000", + "0.0212" ], [ - "1.7931", - "9.6984", - "0.6622", - "0.2991", - "0.0097", - "0.1326" + "3.1644", + "6.9589", + "1.5065", + "0.0322", + "0.0002", + "0.0281" ], [ - "7.3992", - "14.8666", - "0.2974", - "0.0871", - "0.0240", - "0.1531" + "7.8393", + "11.4053", + "1.3335", + "0.0323", + "0.0002", + "0.0112" ], [ - "1.7415", - "12.9853", - "0.5074", - "0.2668", - "0.0356", - "0.0285" + "1.7356", + "7.7215", + "1.3028", + "0.0178", + "0.0009", + "0.0187" ], [ - "6.0148", - "18.2605", - "0.1417", - "0.8047", - "0.0455", - "0.0153" + "3.0678", + "12.8896", + "0.6774", + "0.0463", + "0.0009", + "0.0084" ], [ - "0.3902", - "11.0027", - "0.7300", - "0.3757", - "0.0288", - "0.0102" + "1.0446", + "6.6140", + "1.2147", + "0.0504", + "0.0002", + "0.0231" ], [ - "3.6074", - "6.0950", - "1.1335", - "0.1172", - "0.0250", - "0.0647" + "3.3777", + "5.8757", + "1.0924", + "0.0808", + "0.0003", + "0.0249" ], [ - "3.2324", - "6.5537", - "0.7782", - "0.0273", - "0.0029", - "0.0055" + "2.3954", + "5.9429", + "0.0178", + "0.1556", + "0.0005", + "0.0153" ], [ - "0.0351", - "4.9404", - "0.0838", - "0.1089", - "0.0117", - "0.0598" + "3.4351", + "4.4778", + "0.4157", + "0.1573", + "0.0008", + "0.0190" ], [ - "1.5012", - "2.7971", - "0.7349", - "0.3854", - "0.0534", - "0.0592" + "0.3392", + "2.3059", + "0.2874", + "0.1789", + "0.0005", + "0.0218" ], [ - "1.5012", - "2.7971", - "0.7349", - "0.3854", - "0.0534", - "0.0592" + "0.3392", + "2.3059", + "0.2874", + "0.1789", + "0.0005", + "0.0218" ], [ - "1.5012", - "2.7971", - "0.7349", - "0.3854", - "0.0534", - "0.0592" + "0.3392", + "2.3059", + "0.2874", + "0.1789", + "0.0005", + "0.0218" ], [ - "0.3769", - "2.5366", - "0.8548", - "0.0055", - "0.0325", - "0.0136" + "1.0623", + "2.0556", + "0.7400", + "0.1436", + "0.0002", + "0.0236" ], [ - "0.3769", - "2.5366", - "0.8548", - "0.0055", - "0.0325", - "0.0136" + "1.0623", + "2.0556", + "0.7400", + "0.1436", + "0.0002", + "0.0236" ], [ - "0.3769", - "2.5366", - "0.8548", - "0.0055", - "0.0325", - "0.0136" + "1.0623", + "2.0556", + "0.7400", + "0.1436", + "0.0002", + "0.0236" ], [ - "4.7216", - "4.4144", - "0.3480", - "0.3173", - "0.0027", - "0.0981" + "2.6277", + "4.9729", + "0.2485", + "0.0188", + "0.0006", + "0.0191" ], [ - "5.6503", - "4.1278", - "0.2307", - "0.2222", - "0.0280", - "0.1189" + "1.3812", + "4.2909", + "0.3130", + "0.0092", + "0.0005", + "0.0214" ], [ - "7.6452", - "8.6446", - "0.3095", - "0.1632", - "0.0233", - "0.1571" + "3.4681", + "2.7058", + "0.4912", + "0.0715", + "0.0005", + "0.0338" ], [ - "8.2641", - "8.7774", - "0.3183", - "0.4378", - "0.0258", - "0.1407" + "2.6307", + "3.4448", + "0.8543", + "0.0425", + "0.0003", + "0.0362" ], [ - "5.0360", - "9.2646", - "1.2911", - "0.0552", - "0.0416", - "0.0350" + "3.5235", + "5.2202", + "1.0389", + "0.1057", + "0.0002", + "0.0214" ], [ - "10.5685", - "14.4833", - "0.3155", - "0.1779", - "0.0888", - "0.0304" + "7.4223", + "13.9050", + "1.3670", + "0.0237", + "0.0002", + "0.0118" ], [ - "4.2301", - "13.4323", - "1.2454", - "0.0755", - "0.0403", - "0.0552" + "2.3017", + "9.6756", + "1.2988", + "0.0046", + "0.0001", + "0.0234" ], [ - "2.5828", - "22.7140", - "0.0880", - "1.0765", - "0.0505", - "0.0159" + "3.0081", + "18.0705", + "0.3089", + "0.0458", + "0.0006", + "0.0113" ], [ - "0.3064", - "0.6640", - "0.2691", - "0.4435", - "0.0293", - "0.0015" + "0.2398", + "0.1573", + "0.0813", + "0.1690", + "0.0003", + "0.0099" ], [ - "0.7291", - "1.0519", - "0.1107", - "0.0357", - "0.0008", - "0.0032" + "0.5137", + "1.2966", + "0.4005", + "0.1747", + "0.0000", + "0.0108" ], [ - "0.3064", - "0.6640", - "0.2691", - "0.4435", - "0.0293", - "0.0015" + "0.2398", + "0.1573", + "0.0813", + "0.1690", + "0.0003", + "0.0099" ], [ - "0.7291", - "1.0519", - "0.1107", - "0.0357", - "0.0008", - "0.0032" + "0.5137", + "1.2966", + "0.4005", + "0.1747", + "0.0000", + "0.0108" ], [ - "0.3064", - "0.6640", - "0.2691", - "0.4435", - "0.0293", - "0.0015" + "0.2398", + "0.1573", + "0.0813", + "0.1690", + "0.0003", + "0.0099" ], [ - "0.7291", - "1.0519", - "0.1107", - "0.0357", - "0.0008", - "0.0032" + "0.5137", + "1.2966", + "0.4005", + "0.1747", + "0.0000", + "0.0108" ] ], "proper_phases": [ @@ -872,7 +872,7 @@ "0.0000", "180.0000", "180.0000", - "0.0000" + "180.0000" ], [ "0.0000", @@ -880,7 +880,7 @@ "0.0000", "180.0000", "180.0000", - "0.0000" + "180.0000" ], [ "0.0000", @@ -888,30 +888,22 @@ "0.0000", "180.0000", "180.0000", - "0.0000" - ], - [ - "180.0000", - "180.0000", - "0.0000", - "180.0000", - "180.0000", "180.0000" ], [ - "180.0000", - "180.0000", "0.0000", "180.0000", + "0.0000", "180.0000", + "0.0000", "180.0000" ], [ - "180.0000", - "180.0000", "0.0000", "180.0000", + "0.0000", "180.0000", + "0.0000", "180.0000" ], [ @@ -941,13 +933,13 @@ [ "0.0000", "180.0000", - "180.0000", + "0.0000", "0.0000", "180.0000", "180.0000" ], [ - "180.0000", + "0.0000", "180.0000", "0.0000", "0.0000", @@ -966,20 +958,28 @@ "0.0000", "180.0000", "0.0000", + "180.0000", "0.0000", + "180.0000" + ], + [ "180.0000", + "180.0000", + "180.0000", + "180.0000", + "0.0000", "180.0000" ], [ "0.0000", "180.0000", "0.0000", - "0.0000", + "180.0000", "0.0000", "180.0000" ], [ - "180.0000", + "0.0000", "180.0000", "0.0000", "180.0000", @@ -987,7 +987,7 @@ "180.0000" ], [ - "180.0000", + "0.0000", "180.0000", "0.0000", "180.0000", @@ -995,7 +995,7 @@ "180.0000" ], [ - "180.0000", + "0.0000", "180.0000", "0.0000", "180.0000", @@ -1003,49 +1003,49 @@ "180.0000" ], [ - "180.0000", - "180.0000", "0.0000", + "180.0000", "0.0000", "180.0000", + "0.0000", "180.0000" ], [ - "180.0000", - "180.0000", "0.0000", + "180.0000", "0.0000", "180.0000", + "0.0000", "180.0000" ], [ - "180.0000", - "180.0000", "0.0000", + "180.0000", "0.0000", "180.0000", + "0.0000", "180.0000" ], [ + "0.0000", "180.0000", + "0.0000", "180.0000", "180.0000", - "180.0000", - "0.0000", "180.0000" ], [ - "180.0000", - "180.0000", "0.0000", "180.0000", "0.0000", + "180.0000", + "180.0000", "180.0000" ], [ "0.0000", "180.0000", - "180.0000", + "0.0000", "180.0000", "180.0000", "180.0000" @@ -1062,8 +1062,8 @@ "0.0000", "180.0000", "0.0000", - "0.0000", "180.0000", + "0.0000", "180.0000" ], [ @@ -1085,13 +1085,13 @@ [ "0.0000", "180.0000", - "180.0000", + "0.0000", "0.0000", "180.0000", "180.0000" ], [ - "180.0000", + "0.0000", "0.0000", "0.0000", "180.0000", @@ -1103,11 +1103,11 @@ "0.0000", "0.0000", "180.0000", - "180.0000", - "0.0000" + "0.0000", + "180.0000" ], [ - "180.0000", + "0.0000", "0.0000", "0.0000", "180.0000", @@ -1119,11 +1119,11 @@ "0.0000", "0.0000", "180.0000", - "180.0000", - "0.0000" + "0.0000", + "180.0000" ], [ - "180.0000", + "0.0000", "0.0000", "0.0000", "180.0000", @@ -1135,8 +1135,8 @@ "0.0000", "0.0000", "180.0000", - "180.0000", - "0.0000" + "0.0000", + "180.0000" ] ], "impropers": [ @@ -1233,100 +1233,100 @@ ], "improper_ks": [ [ - "0.0003", - "29.4530", + "0.0000", + "15.8191", "0.0000" ], [ "0.0000", - "49.4767", - "0.0003" + "15.8190", + "0.0000" ], [ - "0.0002", - "21.0667", + "0.0000", + "13.5371", "0.0000" ], [ - "0.0001", - "6.9972", + "0.0000", + "3.6528", "0.0000" ], [ "0.0000", - "21.8583", - "0.0001" + "2.6672", + "0.0000" ], [ - "0.0002", - "13.0353", + "0.0000", + "2.6948", "0.0000" ], [ "0.0000", - "1.9672", - "0.0001" + "5.2360", + "0.0000" ], [ "0.0000", - "5.0084", - "0.0001" + "4.4746", + "0.0000" ], [ "0.0000", - "11.0318", - "0.0002" + "7.8188", + "0.0000" ], [ - "0.0002", - "23.1931", + "0.0000", + "15.8662", "0.0000" ], [ "0.0000", - "33.2880", - "0.0003" + "15.9436", + "0.0000" ], [ - "0.0002", - "19.2299", + "0.0000", + "14.2512", "0.0000" ], [ - "0.0002", - "15.9088", + "0.0000", + "2.1750", "0.0000" ], [ "0.0000", - "48.5030", - "0.0003" + "2.1524", + "0.0000" ], [ - "0.0002", - "14.7781", + "0.0000", + "2.0550", "0.0000" ] ], "improper_phases": [ [ "0.0000", - "0.0000", + "180.0000", "0.0000" ], [ + "0.0000", "180.0000", - "180.0000", - "180.0000" + "0.0000" ], [ "0.0000", - "0.0000", + "180.0000", "0.0000" ], [ "0.0000", - "0.0000", + "180.0000", "0.0000" ], [ @@ -1334,44 +1334,39 @@ "180.0000", "180.0000" ], - [ - "0.0000", - "0.0000", - "0.0000" - ], [ "180.0000", "180.0000", "180.0000" ], [ + "0.0000", "180.0000", - "180.0000", - "180.0000" + "0.0000" ], [ + "0.0000", "180.0000", - "180.0000", - "180.0000" + "0.0000" ], [ "0.0000", - "0.0000", + "180.0000", "0.0000" ], [ + "0.0000", "180.0000", - "180.0000", - "180.0000" + "0.0000" ], [ "0.0000", - "0.0000", + "180.0000", "0.0000" ], [ "0.0000", - "0.0000", + "180.0000", "0.0000" ], [ @@ -1380,9 +1375,14 @@ "180.0000" ], [ - "0.0000", - "0.0000", - "0.0000" + "180.0000", + "180.0000", + "180.0000" + ], + [ + "180.0000", + "180.0000", + "180.0000" ] ] } \ No newline at end of file diff --git a/tests/out_parameterized.top b/tests/out_parameterized.top index 9d6069e..ae1f871 100644 --- a/tests/out_parameterized.top +++ b/tests/out_parameterized.top @@ -844,26 +844,26 @@ Reactive 3 21 H1 3 NME HH33 21 0.0976 1.008 [ bonds ] -1 2 1 0.1094 315945.8067 -1 3 1 0.1094 315945.8067 -1 4 1 0.1094 315945.8067 -1 5 1 0.1527 223856.8196 -5 6 1 0.1217 620877.6113 -5 7 1 0.1381 238725.3419 -7 8 1 0.1018 409606.7816 -7 9 1 0.1349 159153.2668 -9 10 1 0.1494 213063.1007 -9 14 1 0.1411 81753.6209 -10 11 1 0.1095 314854.8869 -10 12 1 0.1095 314854.8869 -10 13 1 0.1095 314854.8869 -14 15 1 0.1217 595271.7050 -14 16 1 0.1355 328862.3745 -16 17 1 0.1012 404914.9762 -16 18 1 0.1446 273226.4874 -18 19 1 0.1093 315059.3881 -18 20 1 0.1093 315059.3881 -18 21 1 0.1093 315059.3881 +1 2 1 0.1096 324667.0104 +1 3 1 0.1096 324667.0104 +1 4 1 0.1096 324667.0104 +1 5 1 0.1536 250115.2757 +5 6 1 0.1235 712427.1780 +5 7 1 0.1393 328328.5978 +7 8 1 0.1019 418910.2059 +7 9 1 0.1353 301759.0486 +9 10 1 0.1484 238041.8156 +9 14 1 0.1445 203470.4558 +10 11 1 0.1096 322838.9875 +10 12 1 0.1096 322838.9875 +10 13 1 0.1096 322838.9875 +14 15 1 0.1236 672627.4398 +14 16 1 0.1359 320493.9403 +16 17 1 0.1014 419935.6996 +16 18 1 0.1445 260742.5949 +18 19 1 0.1095 320849.5446 +18 20 1 0.1095 320849.5446 +18 21 1 0.1095 320849.5446 [ pairs ] 1 8 1 @@ -902,245 +902,245 @@ Reactive 3 17 21 1 [ angles ] -2 1 3 1 103.3643 340.6539 -2 1 4 1 103.3643 340.6539 -2 1 5 1 105.2882 433.5625 -3 1 4 1 103.3643 340.6539 -3 1 5 1 105.2882 433.5625 -4 1 5 1 105.2882 433.5625 -1 5 6 1 147.6662 501.9412 -1 5 7 1 141.2754 447.3940 -6 5 7 1 139.9348 691.8903 -5 7 8 1 114.9818 326.2912 -5 7 9 1 114.1798 352.9718 -8 7 9 1 112.1479 339.0491 -7 9 10 1 125.2240 489.0848 -7 9 14 1 120.1065 326.8016 -10 9 14 1 127.8208 286.4854 -9 10 11 1 104.6645 413.6513 -9 10 12 1 104.6645 413.6513 -9 10 13 1 104.6645 413.6513 -11 10 12 1 102.5684 329.9621 -11 10 13 1 102.5684 329.9621 -12 10 13 1 102.5684 329.9621 -9 14 15 1 141.9027 435.6668 -9 14 16 1 138.8595 379.4164 -15 14 16 1 140.0279 638.2252 -14 16 17 1 114.0763 416.5870 -14 16 18 1 106.9759 235.9870 -17 16 18 1 111.1294 361.0943 -16 18 19 1 105.5001 508.9698 -16 18 20 1 105.5001 508.9698 -16 18 21 1 105.5001 508.9698 -19 18 20 1 103.3665 351.7994 -19 18 21 1 103.3665 351.7994 -20 18 21 1 103.3665 351.7994 +2 1 3 1 106.9751 319.7542 +2 1 4 1 106.9751 319.7542 +2 1 5 1 108.5067 365.7937 +3 1 4 1 106.9751 319.7542 +3 1 5 1 108.5067 365.7937 +4 1 5 1 108.5067 365.7937 +1 5 6 1 131.9380 595.7744 +1 5 7 1 120.9924 505.9435 +6 5 7 1 127.5476 768.2620 +5 7 8 1 111.6350 338.4011 +5 7 9 1 110.1122 391.4897 +8 7 9 1 108.9447 318.6095 +7 9 10 1 120.5822 504.9881 +7 9 14 1 111.2578 394.7721 +10 9 14 1 118.4645 333.7617 +9 10 11 1 107.5699 380.5293 +9 10 12 1 107.5699 380.5293 +9 10 13 1 107.5699 380.5293 +11 10 12 1 106.9917 327.7598 +11 10 13 1 106.9917 327.7598 +12 10 13 1 106.9917 327.7598 +9 14 15 1 123.6507 473.2717 +9 14 16 1 113.8283 443.9995 +15 14 16 1 127.5355 882.2322 +14 16 17 1 110.9031 338.3853 +14 16 18 1 108.4205 403.4996 +17 16 18 1 107.6207 333.1540 +16 18 19 1 107.5742 460.6060 +16 18 20 1 107.5742 460.6060 +16 18 21 1 107.5742 460.6060 +19 18 20 1 106.9106 331.3626 +19 18 21 1 106.9106 331.3626 +20 18 21 1 106.9106 331.3626 [ dihedrals ] -2 1 5 6 9 0.0000 0.1880 1 -2 1 5 6 9 180.0000 2.8235 2 -2 1 5 6 9 0.0000 0.2748 3 -2 1 5 6 9 180.0000 0.0079 4 -2 1 5 6 9 180.0000 0.0246 5 -2 1 5 6 9 0.0000 0.0006 6 -2 1 5 7 9 180.0000 0.1764 1 -2 1 5 7 9 180.0000 3.2621 2 -2 1 5 7 9 0.0000 0.4171 3 -2 1 5 7 9 180.0000 0.0103 4 -2 1 5 7 9 180.0000 0.0575 5 -2 1 5 7 9 180.0000 0.0045 6 -3 1 5 6 9 0.0000 0.1880 1 -3 1 5 6 9 180.0000 2.8235 2 -3 1 5 6 9 0.0000 0.2748 3 -3 1 5 6 9 180.0000 0.0079 4 -3 1 5 6 9 180.0000 0.0246 5 -3 1 5 6 9 0.0000 0.0006 6 -3 1 5 7 9 180.0000 0.1764 1 -3 1 5 7 9 180.0000 3.2621 2 -3 1 5 7 9 0.0000 0.4171 3 -3 1 5 7 9 180.0000 0.0103 4 -3 1 5 7 9 180.0000 0.0575 5 -3 1 5 7 9 180.0000 0.0045 6 -4 1 5 6 9 0.0000 0.1880 1 -4 1 5 6 9 180.0000 2.8235 2 -4 1 5 6 9 0.0000 0.2748 3 -4 1 5 6 9 180.0000 0.0079 4 -4 1 5 6 9 180.0000 0.0246 5 -4 1 5 6 9 0.0000 0.0006 6 -4 1 5 7 9 180.0000 0.1764 1 -4 1 5 7 9 180.0000 3.2621 2 -4 1 5 7 9 0.0000 0.4171 3 -4 1 5 7 9 180.0000 0.0103 4 -4 1 5 7 9 180.0000 0.0575 5 -4 1 5 7 9 180.0000 0.0045 6 -1 5 7 8 9 0.0000 1.7931 1 -1 5 7 8 9 180.0000 9.6984 2 -1 5 7 8 9 0.0000 0.6622 3 -1 5 7 8 9 180.0000 0.2991 4 -1 5 7 8 9 0.0000 0.0097 5 -1 5 7 8 9 180.0000 0.1326 6 -1 5 7 9 9 0.0000 1.7415 1 -1 5 7 9 9 180.0000 12.9853 2 -1 5 7 9 9 0.0000 0.5074 3 -1 5 7 9 9 0.0000 0.2668 4 -1 5 7 9 9 180.0000 0.0356 5 -1 5 7 9 9 180.0000 0.0285 6 -6 5 7 8 9 0.0000 7.3992 1 -6 5 7 8 9 180.0000 14.8666 2 -6 5 7 8 9 0.0000 0.2974 3 -6 5 7 8 9 180.0000 0.0871 4 -6 5 7 8 9 180.0000 0.0240 5 -6 5 7 8 9 180.0000 0.1531 6 -6 5 7 9 9 0.0000 6.0148 1 -6 5 7 9 9 180.0000 18.2605 2 -6 5 7 9 9 180.0000 0.1417 3 -6 5 7 9 9 0.0000 0.8047 4 -6 5 7 9 9 180.0000 0.0455 5 -6 5 7 9 9 180.0000 0.0153 6 -5 7 9 10 9 180.0000 0.3902 1 -5 7 9 10 9 180.0000 11.0027 2 -5 7 9 10 9 0.0000 0.7300 3 -5 7 9 10 9 0.0000 0.3757 4 -5 7 9 10 9 180.0000 0.0288 5 -5 7 9 10 9 180.0000 0.0102 6 -5 7 9 14 9 0.0000 3.2324 1 -5 7 9 14 9 180.0000 6.5537 2 -5 7 9 14 9 0.0000 0.7782 3 -5 7 9 14 9 0.0000 0.0273 4 -5 7 9 14 9 180.0000 0.0029 5 -5 7 9 14 9 180.0000 0.0055 6 -8 7 9 10 9 0.0000 3.6074 1 -8 7 9 10 9 180.0000 6.0950 2 -8 7 9 10 9 0.0000 1.1335 3 -8 7 9 10 9 180.0000 0.1172 4 -8 7 9 10 9 180.0000 0.0250 5 -8 7 9 10 9 180.0000 0.0647 6 -8 7 9 14 9 0.0000 0.0351 1 -8 7 9 14 9 180.0000 4.9404 2 -8 7 9 14 9 0.0000 0.0838 3 -8 7 9 14 9 0.0000 0.1089 4 -8 7 9 14 9 0.0000 0.0117 5 -8 7 9 14 9 180.0000 0.0598 6 -7 9 10 11 9 180.0000 0.3769 1 -7 9 10 11 9 180.0000 2.5366 2 -7 9 10 11 9 0.0000 0.8548 3 -7 9 10 11 9 0.0000 0.0055 4 -7 9 10 11 9 180.0000 0.0325 5 -7 9 10 11 9 180.0000 0.0136 6 -7 9 10 12 9 180.0000 0.3769 1 -7 9 10 12 9 180.0000 2.5366 2 -7 9 10 12 9 0.0000 0.8548 3 -7 9 10 12 9 0.0000 0.0055 4 -7 9 10 12 9 180.0000 0.0325 5 -7 9 10 12 9 180.0000 0.0136 6 -7 9 10 13 9 180.0000 0.3769 1 -7 9 10 13 9 180.0000 2.5366 2 -7 9 10 13 9 0.0000 0.8548 3 -7 9 10 13 9 0.0000 0.0055 4 -7 9 10 13 9 180.0000 0.0325 5 -7 9 10 13 9 180.0000 0.0136 6 -14 9 10 11 9 180.0000 1.5012 1 -14 9 10 11 9 180.0000 2.7971 2 -14 9 10 11 9 0.0000 0.7349 3 -14 9 10 11 9 180.0000 0.3854 4 -14 9 10 11 9 0.0000 0.0534 5 -14 9 10 11 9 180.0000 0.0592 6 -14 9 10 12 9 180.0000 1.5012 1 -14 9 10 12 9 180.0000 2.7971 2 -14 9 10 12 9 0.0000 0.7349 3 -14 9 10 12 9 180.0000 0.3854 4 -14 9 10 12 9 0.0000 0.0534 5 -14 9 10 12 9 180.0000 0.0592 6 -14 9 10 13 9 180.0000 1.5012 1 -14 9 10 13 9 180.0000 2.7971 2 -14 9 10 13 9 0.0000 0.7349 3 -14 9 10 13 9 180.0000 0.3854 4 -14 9 10 13 9 0.0000 0.0534 5 -14 9 10 13 9 180.0000 0.0592 6 -7 9 14 15 9 180.0000 4.7216 1 -7 9 14 15 9 180.0000 4.4144 2 -7 9 14 15 9 180.0000 0.3480 3 -7 9 14 15 9 180.0000 0.3173 4 -7 9 14 15 9 0.0000 0.0027 5 -7 9 14 15 9 180.0000 0.0981 6 -7 9 14 16 9 0.0000 7.6452 1 -7 9 14 16 9 180.0000 8.6446 2 -7 9 14 16 9 180.0000 0.3095 3 -7 9 14 16 9 180.0000 0.1632 4 -7 9 14 16 9 180.0000 0.0233 5 -7 9 14 16 9 180.0000 0.1571 6 -10 9 14 15 9 180.0000 5.6503 1 -10 9 14 15 9 180.0000 4.1278 2 -10 9 14 15 9 0.0000 0.2307 3 -10 9 14 15 9 180.0000 0.2222 4 -10 9 14 15 9 0.0000 0.0280 5 -10 9 14 15 9 180.0000 0.1189 6 -10 9 14 16 9 0.0000 8.2641 1 -10 9 14 16 9 180.0000 8.7774 2 -10 9 14 16 9 0.0000 0.3183 3 -10 9 14 16 9 180.0000 0.4378 4 -10 9 14 16 9 180.0000 0.0258 5 -10 9 14 16 9 180.0000 0.1407 6 -9 14 16 17 9 0.0000 5.0360 1 -9 14 16 17 9 180.0000 9.2646 2 -9 14 16 17 9 0.0000 1.2911 3 -9 14 16 17 9 0.0000 0.0552 4 -9 14 16 17 9 180.0000 0.0416 5 -9 14 16 17 9 180.0000 0.0350 6 -9 14 16 18 9 0.0000 4.2301 1 -9 14 16 18 9 180.0000 13.4323 2 -9 14 16 18 9 0.0000 1.2454 3 -9 14 16 18 9 180.0000 0.0755 4 -9 14 16 18 9 180.0000 0.0403 5 -9 14 16 18 9 180.0000 0.0552 6 -15 14 16 17 9 0.0000 10.5685 1 -15 14 16 17 9 180.0000 14.4833 2 -15 14 16 17 9 0.0000 0.3155 3 -15 14 16 17 9 0.0000 0.1779 4 -15 14 16 17 9 180.0000 0.0888 5 -15 14 16 17 9 180.0000 0.0304 6 -15 14 16 18 9 0.0000 2.5828 1 -15 14 16 18 9 180.0000 22.7140 2 -15 14 16 18 9 180.0000 0.0880 3 -15 14 16 18 9 0.0000 1.0765 4 -15 14 16 18 9 180.0000 0.0505 5 -15 14 16 18 9 180.0000 0.0159 6 -14 16 18 19 9 180.0000 0.3064 1 -14 16 18 19 9 0.0000 0.6640 2 -14 16 18 19 9 0.0000 0.2691 3 -14 16 18 19 9 180.0000 0.4435 4 -14 16 18 19 9 0.0000 0.0293 5 -14 16 18 19 9 180.0000 0.0015 6 -14 16 18 20 9 180.0000 0.3064 1 -14 16 18 20 9 0.0000 0.6640 2 -14 16 18 20 9 0.0000 0.2691 3 -14 16 18 20 9 180.0000 0.4435 4 -14 16 18 20 9 0.0000 0.0293 5 -14 16 18 20 9 180.0000 0.0015 6 -14 16 18 21 9 180.0000 0.3064 1 -14 16 18 21 9 0.0000 0.6640 2 -14 16 18 21 9 0.0000 0.2691 3 -14 16 18 21 9 180.0000 0.4435 4 -14 16 18 21 9 0.0000 0.0293 5 -14 16 18 21 9 180.0000 0.0015 6 -17 16 18 19 9 0.0000 0.7291 1 -17 16 18 19 9 0.0000 1.0519 2 -17 16 18 19 9 0.0000 0.1107 3 -17 16 18 19 9 180.0000 0.0357 4 -17 16 18 19 9 180.0000 0.0008 5 -17 16 18 19 9 0.0000 0.0032 6 -17 16 18 20 9 0.0000 0.7291 1 -17 16 18 20 9 0.0000 1.0519 2 -17 16 18 20 9 0.0000 0.1107 3 -17 16 18 20 9 180.0000 0.0357 4 -17 16 18 20 9 180.0000 0.0008 5 -17 16 18 20 9 0.0000 0.0032 6 -17 16 18 21 9 0.0000 0.7291 1 -17 16 18 21 9 0.0000 1.0519 2 -17 16 18 21 9 0.0000 0.1107 3 -17 16 18 21 9 180.0000 0.0357 4 -17 16 18 21 9 180.0000 0.0008 5 -17 16 18 21 9 0.0000 0.0032 6 +2 1 5 6 9 0.0000 1.7246 1 +2 1 5 6 9 180.0000 3.7732 2 +2 1 5 6 9 0.0000 0.6644 3 +2 1 5 6 9 180.0000 0.0549 4 +2 1 5 6 9 180.0000 0.0002 5 +2 1 5 6 9 180.0000 0.0155 6 +2 1 5 7 9 0.0000 0.8163 1 +2 1 5 7 9 180.0000 1.8835 2 +2 1 5 7 9 0.0000 0.4764 3 +2 1 5 7 9 180.0000 0.1380 4 +2 1 5 7 9 0.0000 0.0000 5 +2 1 5 7 9 180.0000 0.0212 6 +3 1 5 6 9 0.0000 1.7246 1 +3 1 5 6 9 180.0000 3.7732 2 +3 1 5 6 9 0.0000 0.6644 3 +3 1 5 6 9 180.0000 0.0549 4 +3 1 5 6 9 180.0000 0.0002 5 +3 1 5 6 9 180.0000 0.0155 6 +3 1 5 7 9 0.0000 0.8163 1 +3 1 5 7 9 180.0000 1.8835 2 +3 1 5 7 9 0.0000 0.4764 3 +3 1 5 7 9 180.0000 0.1380 4 +3 1 5 7 9 0.0000 0.0000 5 +3 1 5 7 9 180.0000 0.0212 6 +4 1 5 6 9 0.0000 1.7246 1 +4 1 5 6 9 180.0000 3.7732 2 +4 1 5 6 9 0.0000 0.6644 3 +4 1 5 6 9 180.0000 0.0549 4 +4 1 5 6 9 180.0000 0.0002 5 +4 1 5 6 9 180.0000 0.0155 6 +4 1 5 7 9 0.0000 0.8163 1 +4 1 5 7 9 180.0000 1.8835 2 +4 1 5 7 9 0.0000 0.4764 3 +4 1 5 7 9 180.0000 0.1380 4 +4 1 5 7 9 0.0000 0.0000 5 +4 1 5 7 9 180.0000 0.0212 6 +1 5 7 8 9 0.0000 3.1644 1 +1 5 7 8 9 180.0000 6.9589 2 +1 5 7 8 9 0.0000 1.5065 3 +1 5 7 8 9 180.0000 0.0322 4 +1 5 7 8 9 180.0000 0.0002 5 +1 5 7 8 9 180.0000 0.0281 6 +1 5 7 9 9 0.0000 1.7356 1 +1 5 7 9 9 180.0000 7.7215 2 +1 5 7 9 9 0.0000 1.3028 3 +1 5 7 9 9 0.0000 0.0178 4 +1 5 7 9 9 180.0000 0.0009 5 +1 5 7 9 9 180.0000 0.0187 6 +6 5 7 8 9 0.0000 7.8393 1 +6 5 7 8 9 180.0000 11.4053 2 +6 5 7 8 9 0.0000 1.3335 3 +6 5 7 8 9 0.0000 0.0323 4 +6 5 7 8 9 180.0000 0.0002 5 +6 5 7 8 9 180.0000 0.0112 6 +6 5 7 9 9 0.0000 3.0678 1 +6 5 7 9 9 180.0000 12.8896 2 +6 5 7 9 9 0.0000 0.6774 3 +6 5 7 9 9 0.0000 0.0463 4 +6 5 7 9 9 180.0000 0.0009 5 +6 5 7 9 9 180.0000 0.0084 6 +5 7 9 10 9 0.0000 1.0446 1 +5 7 9 10 9 180.0000 6.6140 2 +5 7 9 10 9 0.0000 1.2147 3 +5 7 9 10 9 180.0000 0.0504 4 +5 7 9 10 9 180.0000 0.0002 5 +5 7 9 10 9 180.0000 0.0231 6 +5 7 9 14 9 180.0000 2.3954 1 +5 7 9 14 9 180.0000 5.9429 2 +5 7 9 14 9 180.0000 0.0178 3 +5 7 9 14 9 180.0000 0.1556 4 +5 7 9 14 9 0.0000 0.0005 5 +5 7 9 14 9 180.0000 0.0153 6 +8 7 9 10 9 0.0000 3.3777 1 +8 7 9 10 9 180.0000 5.8757 2 +8 7 9 10 9 0.0000 1.0924 3 +8 7 9 10 9 180.0000 0.0808 4 +8 7 9 10 9 0.0000 0.0003 5 +8 7 9 10 9 180.0000 0.0249 6 +8 7 9 14 9 0.0000 3.4351 1 +8 7 9 14 9 180.0000 4.4778 2 +8 7 9 14 9 0.0000 0.4157 3 +8 7 9 14 9 180.0000 0.1573 4 +8 7 9 14 9 0.0000 0.0008 5 +8 7 9 14 9 180.0000 0.0190 6 +7 9 10 11 9 0.0000 1.0623 1 +7 9 10 11 9 180.0000 2.0556 2 +7 9 10 11 9 0.0000 0.7400 3 +7 9 10 11 9 180.0000 0.1436 4 +7 9 10 11 9 0.0000 0.0002 5 +7 9 10 11 9 180.0000 0.0236 6 +7 9 10 12 9 0.0000 1.0623 1 +7 9 10 12 9 180.0000 2.0556 2 +7 9 10 12 9 0.0000 0.7400 3 +7 9 10 12 9 180.0000 0.1436 4 +7 9 10 12 9 0.0000 0.0002 5 +7 9 10 12 9 180.0000 0.0236 6 +7 9 10 13 9 0.0000 1.0623 1 +7 9 10 13 9 180.0000 2.0556 2 +7 9 10 13 9 0.0000 0.7400 3 +7 9 10 13 9 180.0000 0.1436 4 +7 9 10 13 9 0.0000 0.0002 5 +7 9 10 13 9 180.0000 0.0236 6 +14 9 10 11 9 0.0000 0.3392 1 +14 9 10 11 9 180.0000 2.3059 2 +14 9 10 11 9 0.0000 0.2874 3 +14 9 10 11 9 180.0000 0.1789 4 +14 9 10 11 9 0.0000 0.0005 5 +14 9 10 11 9 180.0000 0.0218 6 +14 9 10 12 9 0.0000 0.3392 1 +14 9 10 12 9 180.0000 2.3059 2 +14 9 10 12 9 0.0000 0.2874 3 +14 9 10 12 9 180.0000 0.1789 4 +14 9 10 12 9 0.0000 0.0005 5 +14 9 10 12 9 180.0000 0.0218 6 +14 9 10 13 9 0.0000 0.3392 1 +14 9 10 13 9 180.0000 2.3059 2 +14 9 10 13 9 0.0000 0.2874 3 +14 9 10 13 9 180.0000 0.1789 4 +14 9 10 13 9 0.0000 0.0005 5 +14 9 10 13 9 180.0000 0.0218 6 +7 9 14 15 9 0.0000 2.6277 1 +7 9 14 15 9 180.0000 4.9729 2 +7 9 14 15 9 0.0000 0.2485 3 +7 9 14 15 9 180.0000 0.0188 4 +7 9 14 15 9 180.0000 0.0006 5 +7 9 14 15 9 180.0000 0.0191 6 +7 9 14 16 9 0.0000 3.4681 1 +7 9 14 16 9 180.0000 2.7058 2 +7 9 14 16 9 0.0000 0.4912 3 +7 9 14 16 9 180.0000 0.0715 4 +7 9 14 16 9 180.0000 0.0005 5 +7 9 14 16 9 180.0000 0.0338 6 +10 9 14 15 9 0.0000 1.3812 1 +10 9 14 15 9 180.0000 4.2909 2 +10 9 14 15 9 0.0000 0.3130 3 +10 9 14 15 9 180.0000 0.0092 4 +10 9 14 15 9 180.0000 0.0005 5 +10 9 14 15 9 180.0000 0.0214 6 +10 9 14 16 9 0.0000 2.6307 1 +10 9 14 16 9 180.0000 3.4448 2 +10 9 14 16 9 0.0000 0.8543 3 +10 9 14 16 9 180.0000 0.0425 4 +10 9 14 16 9 180.0000 0.0003 5 +10 9 14 16 9 180.0000 0.0362 6 +9 14 16 17 9 0.0000 3.5235 1 +9 14 16 17 9 180.0000 5.2202 2 +9 14 16 17 9 0.0000 1.0389 3 +9 14 16 17 9 180.0000 0.1057 4 +9 14 16 17 9 0.0000 0.0002 5 +9 14 16 17 9 180.0000 0.0214 6 +9 14 16 18 9 0.0000 2.3017 1 +9 14 16 18 9 180.0000 9.6756 2 +9 14 16 18 9 0.0000 1.2988 3 +9 14 16 18 9 180.0000 0.0046 4 +9 14 16 18 9 180.0000 0.0001 5 +9 14 16 18 9 180.0000 0.0234 6 +15 14 16 17 9 0.0000 7.4223 1 +15 14 16 17 9 180.0000 13.9050 2 +15 14 16 17 9 0.0000 1.3670 3 +15 14 16 17 9 0.0000 0.0237 4 +15 14 16 17 9 180.0000 0.0002 5 +15 14 16 17 9 180.0000 0.0118 6 +15 14 16 18 9 0.0000 3.0081 1 +15 14 16 18 9 180.0000 18.0705 2 +15 14 16 18 9 0.0000 0.3089 3 +15 14 16 18 9 0.0000 0.0458 4 +15 14 16 18 9 180.0000 0.0006 5 +15 14 16 18 9 180.0000 0.0113 6 +14 16 18 19 9 0.0000 0.2398 1 +14 16 18 19 9 0.0000 0.1573 2 +14 16 18 19 9 0.0000 0.0813 3 +14 16 18 19 9 180.0000 0.1690 4 +14 16 18 19 9 0.0000 0.0003 5 +14 16 18 19 9 180.0000 0.0099 6 +14 16 18 20 9 0.0000 0.2398 1 +14 16 18 20 9 0.0000 0.1573 2 +14 16 18 20 9 0.0000 0.0813 3 +14 16 18 20 9 180.0000 0.1690 4 +14 16 18 20 9 0.0000 0.0003 5 +14 16 18 20 9 180.0000 0.0099 6 +14 16 18 21 9 0.0000 0.2398 1 +14 16 18 21 9 0.0000 0.1573 2 +14 16 18 21 9 0.0000 0.0813 3 +14 16 18 21 9 180.0000 0.1690 4 +14 16 18 21 9 0.0000 0.0003 5 +14 16 18 21 9 180.0000 0.0099 6 +17 16 18 19 9 0.0000 0.5137 1 +17 16 18 19 9 0.0000 1.2966 2 +17 16 18 19 9 0.0000 0.4005 3 +17 16 18 19 9 180.0000 0.1747 4 +17 16 18 19 9 0.0000 0.0000 5 +17 16 18 19 9 180.0000 0.0108 6 +17 16 18 20 9 0.0000 0.5137 1 +17 16 18 20 9 0.0000 1.2966 2 +17 16 18 20 9 0.0000 0.4005 3 +17 16 18 20 9 180.0000 0.1747 4 +17 16 18 20 9 0.0000 0.0000 5 +17 16 18 20 9 180.0000 0.0108 6 +17 16 18 21 9 0.0000 0.5137 1 +17 16 18 21 9 0.0000 1.2966 2 +17 16 18 21 9 0.0000 0.4005 3 +17 16 18 21 9 180.0000 0.1747 4 +17 16 18 21 9 0.0000 0.0000 5 +17 16 18 21 9 180.0000 0.0108 6 1 7 5 6 4 5 9 7 8 4 7 10 9 14 4 180.0000000 43.93200 2 diff --git a/tests/out_raw_alanine.json b/tests/out_raw_alanine.json index 02caea0..cc01e9c 100644 --- a/tests/out_raw_alanine.json +++ b/tests/out_raw_alanine.json @@ -105,48 +105,48 @@ ] ], "bond_k": [ - 755.1286010742188, - 755.1286010742188, - 755.1286010742188, - 535.0306396484375, - 1483.93310546875, - 570.5672607421875, - 978.9837036132812, - 380.38543701171875, - 509.2330322265625, - 195.39584350585938, - 752.521240234375, - 752.521240234375, - 752.521240234375, - 1422.7335205078125, - 785.9999389648438, - 967.77001953125, - 653.0269775390625, - 753.010009765625, - 753.010009765625, - 753.010009765625 + 775.9727783203125, + 775.9727783203125, + 775.9727783203125, + 597.7898559570312, + 1702.7418212890625, + 784.7241821289062, + 1001.2194213867188, + 721.221435546875, + 568.93359375, + 486.3060607910156, + 771.6036987304688, + 771.6036987304688, + 771.6036987304688, + 1607.6181640625, + 765.9989013671875, + 1003.67041015625, + 623.1897583007812, + 766.8488159179688, + 766.8488159179688, + 766.8488159179688 ], "bond_eq": [ - 1.0938714742660522, - 1.0938714742660522, - 1.0938714742660522, - 1.5267786979675293, - 1.2169218063354492, - 1.381420373916626, - 1.018121361732483, - 1.3490225076675415, - 1.49397873878479, - 1.410969614982605, - 1.09508216381073, - 1.09508216381073, - 1.09508216381073, - 1.2173930406570435, - 1.3548707962036133, - 1.012398600578308, - 1.446398377418518, - 1.0925675630569458, - 1.0925675630569458, - 1.0925675630569458 + 1.0961111783981323, + 1.0961111783981323, + 1.0961111783981323, + 1.5361863374710083, + 1.2351515293121338, + 1.3928743600845337, + 1.0186575651168823, + 1.352648377418518, + 1.484218955039978, + 1.4450442790985107, + 1.0955955982208252, + 1.0955955982208252, + 1.0955955982208252, + 1.235933542251587, + 1.3594306707382202, + 1.0143845081329346, + 1.444519281387329, + 1.0948830842971802, + 1.0948830842971802, + 1.0948830842971802 ], "angles": [ [ @@ -316,74 +316,74 @@ ] ], "angle_k": [ - 119.9668197631836, - 106.92973327636719, - 81.41822814941406, - 81.41822814941406, - 103.62391662597656, - 81.41822814941406, - 103.62391662597656, - 103.62391662597656, - 77.98545837402344, - 84.3622817993164, - 165.36575317382812, - 116.89408111572266, - 78.10746765136719, - 81.03467559814453, - 98.86503601074219, - 98.86503601074219, - 98.86503601074219, - 104.12686157226562, - 90.68270111083984, - 68.47164916992188, - 99.56668853759766, - 56.40223693847656, - 78.86282348632812, - 78.86282348632812, - 78.86282348632812, - 152.5394744873047, - 121.64669036865234, - 121.64669036865234, - 121.64669036865234, - 86.3036117553711, - 84.08207702636719, - 84.08207702636719, - 84.08207702636719 + 142.3935089111328, + 120.92340087890625, + 76.42308807373047, + 76.42308807373047, + 87.42680358886719, + 76.42308807373047, + 87.42680358886719, + 87.42680358886719, + 80.87981414794922, + 93.56827545166016, + 183.61903381347656, + 120.69506072998047, + 94.3528060913086, + 76.14950561523438, + 90.94869232177734, + 90.94869232177734, + 90.94869232177734, + 113.11466217041016, + 106.11842346191406, + 79.77095031738281, + 80.87602996826172, + 96.43872833251953, + 78.33647155761719, + 78.33647155761719, + 78.33647155761719, + 210.8585662841797, + 110.08747863769531, + 110.08747863769531, + 110.08747863769531, + 79.62571716308594, + 79.19757080078125, + 79.19757080078125, + 79.19757080078125 ], "angle_eq": [ - 2.577260732650757, - 2.4657208919525146, - 1.8040478229522705, - 1.8040478229522705, - 1.837625503540039, - 1.8040478229522705, - 1.837625503540039, - 1.837625503540039, - 2.0068106651306152, - 1.9928127527236938, - 2.4423227310180664, - 2.185570240020752, - 2.096254348754883, - 1.9573496580123901, - 1.8267408609390259, - 1.8267408609390259, - 1.8267408609390259, - 2.4766693115234375, - 2.4235546588897705, - 2.230893611907959, - 1.9910074472427368, - 1.8670819997787476, - 1.7901557683944702, - 1.7901557683944702, - 1.7901557683944702, - 2.4439475536346436, - 1.8413236141204834, - 1.8413236141204834, - 1.8413236141204834, - 1.9395732879638672, - 1.8040862083435059, - 1.8040862083435059, - 1.8040862083435059 + 2.3027522563934326, + 2.11171555519104, + 1.867067813873291, + 1.867067813873291, + 1.8937993049621582, + 1.867067813873291, + 1.8937993049621582, + 1.8937993049621582, + 1.9483990669250488, + 1.9218195676803589, + 2.2261247634887695, + 2.1045567989349365, + 1.9418145418167114, + 1.9014441967010498, + 1.877448558807373, + 1.877448558807373, + 1.877448558807373, + 2.158111572265625, + 1.9866786003112793, + 2.0675952434539795, + 1.9356237649917603, + 1.8922945261001587, + 1.8673568964004517, + 1.8673568964004517, + 1.8673568964004517, + 2.225914716720581, + 1.8775237798690796, + 1.8775237798690796, + 1.8775237798690796, + 1.8783363103866577, + 1.8659412860870361, + 1.8659412860870361, + 1.8659412860870361 ], "propers": [ [ @@ -593,276 +593,276 @@ ], "proper_ks": [ [ - 0.04494260251522064, - 0.6748359203338623, - 0.06567462533712387, - 0.0018822925630956888, - 0.005876102019101381, - 0.0001455173478461802 + 0.41217947006225586, + 0.9018146991729736, + 0.1587890386581421, + 0.013120288029313087, + 5.785319081041962e-05, + 0.003712196834385395 ], [ - 0.04494260251522064, - 0.6748359203338623, - 0.06567462533712387, - 0.0018822925630956888, - 0.005876102019101381, - 0.0001455173478461802 + 0.41217947006225586, + 0.9018146991729736, + 0.1587890386581421, + 0.013120288029313087, + 5.785319081041962e-05, + 0.003712196834385395 ], [ - 0.04494260251522064, - 0.6748359203338623, - 0.06567462533712387, - 0.0018822925630956888, - 0.005876102019101381, - 0.0001455173478461802 + 0.41217947006225586, + 0.9018146991729736, + 0.1587890386581421, + 0.013120288029313087, + 5.785319081041962e-05, + 0.003712196834385395 ], [ - 0.04216618090867996, - 0.779660701751709, - 0.0996779352426529, - 0.0024542033206671476, - 0.013731980696320534, - 0.0010647684102877975 + 0.19510528445243835, + 0.45016998052597046, + 0.11386900395154953, + 0.03298567980527878, + 9.015756404551212e-06, + 0.005077563226222992 ], [ - 0.04216618090867996, - 0.779660701751709, - 0.0996779352426529, - 0.0024542033206671476, - 0.013731980696320534, - 0.0010647684102877975 + 0.19510528445243835, + 0.45016998052597046, + 0.11386900395154953, + 0.03298567980527878, + 9.015756404551212e-06, + 0.005077563226222992 ], [ - 0.04216618090867996, - 0.779660701751709, - 0.0996779352426529, - 0.0024542033206671476, - 0.013731980696320534, - 0.0010647684102877975 + 0.19510528445243835, + 0.45016998052597046, + 0.11386900395154953, + 0.03298567980527878, + 9.015756404551212e-06, + 0.005077563226222992 ], [ - 0.4285593032836914, - 2.317983865737915, - 0.15826106071472168, - 0.07149321585893631, - 0.002321923151612282, - 0.03168807923793793 + 0.7563043832778931, + 1.6632193326950073, + 0.36007264256477356, + 0.007696202956140041, + 4.570625242195092e-05, + 0.006719433702528477 ], [ - 1.76844322681427, - 3.553204298019409, - 0.0710846558213234, - 0.020816639065742493, - 0.005745828617364168, - 0.03658169507980347 + 1.873628854751587, + 2.7259366512298584, + 0.3187156915664673, + 0.007718333974480629, + 4.8331439757021144e-05, + 0.002676009200513363 ], [ - 0.41623467206954956, - 3.1035726070404053, - 0.12127675116062164, - 0.06377430260181427, - 0.008512343280017376, - 0.006807954050600529 + 0.4148237109184265, + 1.8454790115356445, + 0.3113655745983124, + 0.004248962737619877, + 0.00021023764566052705, + 0.004464965313673019 ], [ - 1.437559962272644, - 4.364359378814697, - 0.03386424109339714, - 0.192324697971344, - 0.01088003907352686, - 0.0036552846431732178 + 0.7332146763801575, + 3.0806987285614014, + 0.1619049310684204, + 0.011056794784963131, + 0.0002052202180493623, + 0.0020039514638483524 ], [ - 0.09326191246509552, - 2.629699230194092, - 0.17447513341903687, - 0.08979395031929016, - 0.006880050990730524, - 0.002431943081319332 + 0.24966876208782196, + 1.5807801485061646, + 0.29030841588974, + 0.012034334242343903, + 3.7538640754064545e-05, + 0.0055302223190665245 ], [ - 0.8621795177459717, - 1.4567458629608154, - 0.27090883255004883, - 0.028016723692417145, - 0.005979370325803757, - 0.01546785794198513 + 0.8072841763496399, + 1.4043214321136475, + 0.2610936462879181, + 0.01930384710431099, + 7.326362538151443e-05, + 0.005960849113762379 ], [ - 0.7725563049316406, - 1.566367745399475, - 0.18599750101566315, - 0.006534155923873186, - 0.0006819289992563426, - 0.001302878255955875 + 0.5725110173225403, + 1.4203903675079346, + 0.004246971104294062, + 0.03719732165336609, + 0.00011081546836066991, + 0.003660948947072029 ], [ - 0.008390707895159721, - 1.1807739734649658, - 0.02002820000052452, - 0.026027575135231018, - 0.00280350586399436, - 0.014300660230219364 + 0.8210101127624512, + 1.0702087879180908, + 0.09934575855731964, + 0.03758859261870384, + 0.00019134979811497033, + 0.004546967800706625 ], [ - 0.35878416895866394, - 0.6685130596160889, - 0.1756485253572464, - 0.09212284535169601, - 0.012770860455930233, - 0.014153237454593182 + 0.08106812089681625, + 0.5511115789413452, + 0.06870164722204208, + 0.042749565094709396, + 0.0001265050668735057, + 0.005218987353146076 ], [ - 0.35878416895866394, - 0.6685130596160889, - 0.1756485253572464, - 0.09212284535169601, - 0.012770860455930233, - 0.014153237454593182 + 0.08106812089681625, + 0.5511115789413452, + 0.06870164722204208, + 0.042749565094709396, + 0.0001265050668735057, + 0.005218987353146076 ], [ - 0.35878416895866394, - 0.6685130596160889, - 0.1756485253572464, - 0.09212284535169601, - 0.012770860455930233, - 0.014153237454593182 + 0.08106812089681625, + 0.5511115789413452, + 0.06870164722204208, + 0.042749565094709396, + 0.0001265050668735057, + 0.005218987353146076 ], [ - 0.09008254110813141, - 0.60626620054245, - 0.20429131388664246, - 0.0013158542569726706, - 0.007764535024762154, - 0.0032613291405141354 + 0.25390753149986267, + 0.4912942349910736, + 0.1768752932548523, + 0.03431440517306328, + 5.8296391216572374e-05, + 0.005649258848279715 ], [ - 0.09008254110813141, - 0.60626620054245, - 0.20429131388664246, - 0.0013158542569726706, - 0.007764535024762154, - 0.0032613291405141354 + 0.25390753149986267, + 0.4912942349910736, + 0.1768752932548523, + 0.03431440517306328, + 5.8296391216572374e-05, + 0.005649258848279715 ], [ - 0.09008254110813141, - 0.60626620054245, - 0.20429131388664246, - 0.0013158542569726706, - 0.007764535024762154, - 0.0032613291405141354 + 0.25390753149986267, + 0.4912942349910736, + 0.1768752932548523, + 0.03431440517306328, + 5.8296391216572374e-05, + 0.005649258848279715 ], [ - 1.1284929513931274, - 1.0550589561462402, - 0.08317933976650238, - 0.0758308470249176, - 0.0006398173281922936, - 0.023438507691025734 + 0.6280430555343628, + 1.1885454654693604, + 0.05939658731222153, + 0.004502684343606234, + 0.00013408430095296353, + 0.00457677710801363 ], [ - 1.3504596948623657, - 0.9865561723709106, - 0.0551498718559742, - 0.053106434643268585, - 0.006684677675366402, - 0.028416384011507034 - ], + 0.33010363578796387, + 1.0255433320999146, + 0.0748109295964241, + 0.0022105704993009567, + 0.00010895430023083463, + 0.005120925605297089 + ], [ - 1.827253818511963, - 2.06610369682312, - 0.07396615296602249, - 0.039012253284454346, - 0.0055722338147461414, - 0.0375509038567543 - ], + 0.8288858532905579, + 0.646700918674469, + 0.11739594489336014, + 0.017085803672671318, + 0.00010980531806126237, + 0.008083240129053593 + ], [ - 1.9751782417297363, - 2.097846031188965, - 0.07606945186853409, - 0.10462893545627594, - 0.006167523562908173, - 0.03363082930445671 - ], + 0.6287522912025452, + 0.8233378529548645, + 0.2041923850774765, + 0.010166805237531662, + 6.365468289004639e-05, + 0.008640768937766552 + ], [ - 1.2036311626434326, - 2.2142984867095947, - 0.3085859417915344, - 0.013190153054893017, - 0.009937243536114693, - 0.008372116833925247 - ], + 0.842130184173584, + 1.2476558685302734, + 0.24831277132034302, + 0.025272702798247337, + 4.4718748540617526e-05, + 0.005121973808854818 + ], [ - 2.525923252105713, - 3.4615910053253174, - 0.07541729509830475, - 0.042516548186540604, - 0.021215463057160378, - 0.007254273165017366 - ], + 1.773972988128662, + 3.3233673572540283, + 0.32673200964927673, + 0.005653270985931158, + 3.781466148211621e-05, + 0.0028305326122790575 + ], [ - 1.0110245943069458, - 3.2103850841522217, - 0.29765740036964417, - 0.01805623434484005, - 0.009621884673833847, - 0.013184653595089912 - ], + 0.5501279234886169, + 2.312528133392334, + 0.3104115128517151, + 0.001105909119360149, + 1.525913285149727e-05, + 0.005587743129581213 + ], [ - 0.6173112988471985, - 5.428781509399414, - 0.021032366901636124, - 0.25730106234550476, - 0.012070788070559502, - 0.0038080583326518536 - ], + 0.7189420461654663, + 4.318949222564697, + 0.07383934408426285, + 0.010935939848423004, + 0.00013444454816635698, + 0.0027083419263362885 + ], [ - 0.07324298471212387, - 0.15870366990566254, - 0.06431722640991211, - 0.10600262880325317, - 0.007004760205745697, - 0.0003594254667405039 - ], + 0.05731870234012604, + 0.03759496286511421, + 0.019440816715359688, + 0.04038272798061371, + 6.019958163960837e-05, + 0.002370309317484498 + ], [ - 0.17425981163978577, - 0.25140509009361267, - 0.02646039053797722, - 0.008538116700947285, - 0.00018829142209142447, - 0.0007575735216960311 - ], + 0.12278163433074951, + 0.3098858892917633, + 0.095712810754776, + 0.0417526438832283, + 7.9597084550187e-06, + 0.002592370379716158 + ], [ - 0.07324298471212387, - 0.15870366990566254, - 0.06431722640991211, - 0.10600262880325317, - 0.007004760205745697, - 0.0003594254667405039 - ], + 0.05731870234012604, + 0.03759496286511421, + 0.019440816715359688, + 0.04038272798061371, + 6.019958163960837e-05, + 0.002370309317484498 + ], [ - 0.17425981163978577, - 0.25140509009361267, - 0.02646039053797722, - 0.008538116700947285, - 0.00018829142209142447, - 0.0007575735216960311 - ], + 0.12278163433074951, + 0.3098858892917633, + 0.095712810754776, + 0.0417526438832283, + 7.9597084550187e-06, + 0.002592370379716158 + ], [ - 0.0732429102063179, - 0.15870371460914612, - 0.06431721150875092, - 0.10600259900093079, - 0.007004757411777973, - 0.0003594244481064379 - ], + 0.05731871351599693, + 0.03759497031569481, + 0.019440827891230583, + 0.04038273170590401, + 6.019957800162956e-05, + 0.0023703097831457853 + ], [ - 0.17425979673862457, - 0.2514052391052246, - 0.026460394263267517, - 0.008538112975656986, - 0.00018829276086762547, - 0.0007575732888653874 + 0.12278163433074951, + 0.3098859488964081, + 0.0957128182053566, + 0.0417526476085186, + 7.959637514431961e-06, + 0.0025923699140548706 ] ], "proper_phases": [ @@ -872,7 +872,7 @@ 0.0, 3.1415927410125732, 3.1415927410125732, - 0.0 + 3.1415927410125732 ], [ 0.0, @@ -880,7 +880,7 @@ 0.0, 3.1415927410125732, 3.1415927410125732, - 0.0 + 3.1415927410125732 ], [ 0.0, @@ -888,30 +888,22 @@ 0.0, 3.1415927410125732, 3.1415927410125732, - 0.0 - ], - [ - 3.1415927410125732, - 3.1415927410125732, - 0.0, - 3.1415927410125732, - 3.1415927410125732, 3.1415927410125732 ], [ - 3.1415927410125732, - 3.1415927410125732, 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732 ], [ - 3.1415927410125732, - 3.1415927410125732, 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732 ], [ @@ -941,13 +933,13 @@ [ 0.0, 3.1415927410125732, - 3.1415927410125732, + 0.0, 0.0, 3.1415927410125732, 3.1415927410125732 ], [ - 3.1415927410125732, + 0.0, 3.1415927410125732, 0.0, 0.0, @@ -966,20 +958,28 @@ 0.0, 3.1415927410125732, 0.0, + 3.1415927410125732, 0.0, + 3.1415927410125732 + ], + [ 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732, + 0.0, 3.1415927410125732 ], [ 0.0, 3.1415927410125732, 0.0, - 0.0, + 3.1415927410125732, 0.0, 3.1415927410125732 ], [ - 3.1415927410125732, + 0.0, 3.1415927410125732, 0.0, 3.1415927410125732, @@ -987,7 +987,7 @@ 3.1415927410125732 ], [ - 3.1415927410125732, + 0.0, 3.1415927410125732, 0.0, 3.1415927410125732, @@ -995,7 +995,7 @@ 3.1415927410125732 ], [ - 3.1415927410125732, + 0.0, 3.1415927410125732, 0.0, 3.1415927410125732, @@ -1003,49 +1003,49 @@ 3.1415927410125732 ], [ - 3.1415927410125732, - 3.1415927410125732, 0.0, + 3.1415927410125732, 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732 ], [ - 3.1415927410125732, - 3.1415927410125732, 0.0, + 3.1415927410125732, 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732 ], [ - 3.1415927410125732, - 3.1415927410125732, 0.0, + 3.1415927410125732, 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732 ], [ + 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732, 3.1415927410125732, - 3.1415927410125732, - 0.0, 3.1415927410125732 ], [ - 3.1415927410125732, - 3.1415927410125732, 0.0, 3.1415927410125732, 0.0, + 3.1415927410125732, + 3.1415927410125732, 3.1415927410125732 ], [ 0.0, 3.1415927410125732, - 3.1415927410125732, + 0.0, 3.1415927410125732, 3.1415927410125732, 3.1415927410125732 @@ -1062,8 +1062,8 @@ 0.0, 3.1415927410125732, 0.0, - 0.0, 3.1415927410125732, + 0.0, 3.1415927410125732 ], [ @@ -1085,13 +1085,13 @@ [ 0.0, 3.1415927410125732, - 3.1415927410125732, + 0.0, 0.0, 3.1415927410125732, 3.1415927410125732 ], [ - 3.1415927410125732, + 0.0, 0.0, 0.0, 3.1415927410125732, @@ -1103,11 +1103,11 @@ 0.0, 0.0, 3.1415927410125732, - 3.1415927410125732, - 0.0 + 0.0, + 3.1415927410125732 ], [ - 3.1415927410125732, + 0.0, 0.0, 0.0, 3.1415927410125732, @@ -1119,11 +1119,11 @@ 0.0, 0.0, 3.1415927410125732, - 3.1415927410125732, - 0.0 + 0.0, + 3.1415927410125732 ], [ - 3.1415927410125732, + 0.0, 0.0, 0.0, 3.1415927410125732, @@ -1135,8 +1135,8 @@ 0.0, 0.0, 3.1415927410125732, - 3.1415927410125732, - 0.0 + 0.0, + 3.1415927410125732 ] ], "impropers": [ @@ -1233,100 +1233,100 @@ ], "improper_ks": [ [ - 7.061033829813823e-05, - 7.039442539215088, - 2.5443000570973817e-12 + 3.3358264772687107e-06, + 3.780853271484375, + 2.7443995804787846e-06 ], [ - 1.6675303715976697e-12, - 11.82522201538086, - 6.906843191245571e-05 + 3.388375716895098e-06, + 3.780829668045044, + 2.729932475631358e-06 ], [ - 4.957116470905021e-05, - 5.035053253173828, - 1.3721930258725479e-09 + 2.5735143935889937e-06, + 3.2354495525360107, + 2.0971192498109303e-06 ], [ - 1.612351661606226e-05, - 1.6723710298538208, - 1.6308449630741961e-06 + 6.417660358692956e-08, + 0.8730481863021851, + 1.9453455513129825e-10 ], [ - 3.572121443085052e-08, - 5.224257469177246, - 2.798713649099227e-05 + 1.90196924876318e-08, + 0.6374849081039429, + 1.4351039112625585e-07 ], [ - 4.1046303522307426e-05, - 3.115514039993286, - 7.626833053997473e-10 + 6.312465661295619e-09, + 0.6440827250480652, + 7.63106413614878e-08 ], [ - 1.3283370208228007e-06, - 0.4701811969280243, - 1.7553611542098224e-05 + 3.29952371203035e-07, + 1.2514389753341675, + 2.822451676820492e-07 ], [ - 1.8493884113013337e-07, - 1.1970317363739014, - 3.0034112569410354e-05 + 2.307779851662417e-07, + 1.0694583654403687, + 1.9456379618532083e-07 ], [ - 2.4897314432337225e-08, - 2.636653423309326, - 3.9613834815099835e-05 + 6.701166057609953e-07, + 1.8687416315078735, + 6.954975901862781e-07 ], [ - 5.474128920468502e-05, - 5.543274402618408, - 1.225876483657018e-10 + 3.3573430755495792e-06, + 3.792102575302124, + 2.7615913040790474e-06 ], [ - 3.510047461019461e-11, - 7.956034183502197, - 6.594436126761138e-05 + 3.3797048217820702e-06, + 3.810605049133301, + 2.8170306904939935e-06 ], [ - 4.4454209273681045e-05, - 4.596062183380127, - 9.936862443993277e-10 + 2.6179936867265496e-06, + 3.4061203002929688, + 2.3151396817411296e-06 ], [ - 3.990923869423568e-05, - 3.8023033142089844, - 5.639988920336236e-09 + 8.062767165029072e-08, + 0.5198490619659424, + 1.5722241641924484e-07 ], [ - 9.445317791789698e-12, - 11.592504501342773, - 6.293354817898944e-05 + 8.889512059795379e-08, + 0.5144280195236206, + 1.840100622985119e-07 ], [ - 4.342288229963742e-05, - 3.532057762145996, - 2.5205488807245047e-09 + 8.443217325293517e-08, + 0.4911586344242096, + 1.3918480590291438e-07 ] ], "improper_phases": [ [ 0.0, - 0.0, + 3.1415927410125732, 0.0 ], [ + 0.0, 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 + 0.0 ], [ 0.0, - 0.0, + 3.1415927410125732, 0.0 ], [ 0.0, - 0.0, + 3.1415927410125732, 0.0 ], [ @@ -1334,44 +1334,39 @@ 3.1415927410125732, 3.1415927410125732 ], - [ - 0.0, - 0.0, - 0.0 - ], [ 3.1415927410125732, 3.1415927410125732, 3.1415927410125732 ], [ + 0.0, 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 + 0.0 ], [ + 0.0, 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 + 0.0 ], [ 0.0, - 0.0, + 3.1415927410125732, 0.0 ], [ + 0.0, 3.1415927410125732, - 3.1415927410125732, - 3.1415927410125732 + 0.0 ], [ 0.0, - 0.0, + 3.1415927410125732, 0.0 ], [ 0.0, - 0.0, + 3.1415927410125732, 0.0 ], [ @@ -1380,9 +1375,14 @@ 3.1415927410125732 ], [ - 0.0, - 0.0, - 0.0 + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 + ], + [ + 3.1415927410125732, + 3.1415927410125732, + 3.1415927410125732 ] ] } \ No newline at end of file diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index 3413a32..64f619b 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -1,6 +1,6 @@ import pytest -pytest.importorskip("grappa_interface") +#pytest.importorskip("kimmdy-grappa") pytest.importorskip("grappa") import os @@ -19,7 +19,7 @@ from grappa.grappa import Grappa from grappa.data.Molecule import Molecule from grappa.data.Parameters import Parameters -from grappa.utils.loading_utils import load_model +from grappa.utils.loading_utils import model_from_url from kimmdy.topology.topology import Topology from kimmdy.constants import AA3 @@ -75,8 +75,9 @@ def test_generate_input(): def test_predict_parameters(grappa_input, grappa_output_raw): # load model, tag will be changed to be more permanent - model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" - model = load_model(model_tag) + #model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" + model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/model_release/grappa-1.0-01-26-2024.pth" + model = model_from_url(model_tag) # initialize class that handles ML part grappa = Grappa(model, device="cpu") From 27de85d9baefe9883e596f34ddd313de8df36621 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Fri, 26 Jan 2024 16:18:22 +0100 Subject: [PATCH 10/12] fix: fail for molecule without a certain type of parameters --- src/grappa_interface.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 616163c..5c4ce53 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -120,15 +120,18 @@ def convert_parameters(parameters: Parameters) -> Parameters: # convert to list of strings for k in parameters.__annotations__.keys(): v = getattr(parameters, k) - if isinstance(v[0], float): - v_list = [f"{i:11.4f}".strip() for i in v] - elif isinstance(v[0], np.ndarray) and isinstance(v[0, 0], float): - v_list = [] - for sub_list in v: - v_list.append([f"{i:11.4f}".strip() for i in sub_list]) + if len(v) == 0: + logger.info(f"Parameter list {k} is empty.") else: - v_list = v.astype(str).tolist() - setattr(parameters, k, v_list) + if isinstance(v[0], float): + v_list = [f"{i:11.4f}".strip() for i in v] + elif isinstance(v[0], np.ndarray) and isinstance(v[0, 0], float): + v_list = [] + for sub_list in v: + v_list.append([f"{i:11.4f}".strip() for i in sub_list]) + else: + v_list = v.astype(str).tolist() + setattr(parameters, k, v_list) return parameters From 23b0dd5fc3fd7c38de8826f05ff662534a60d02f Mon Sep 17 00:00:00 2001 From: KRiedmiller Date: Wed, 31 Jan 2024 10:35:57 +0100 Subject: [PATCH 11/12] encapsulate model loading --- src/grappa_interface.py | 30 +++++++++++++++++++++--------- tests/test_parameterizers.py | 6 ++---- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/grappa_interface.py b/src/grappa_interface.py index 5c4ce53..e61e8f3 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -95,8 +95,11 @@ def build_molecule(top: Topology) -> Molecule: def convert_parameters(parameters: Parameters) -> Parameters: - # parameters are in kcal/mol, Angstrom und rad - # convert to kJ/mol, nm and degree(mostly) + """Converts parameters to gromacs units + Assumes input parameters to be in kcal/mol, Angstrom und rad + Gromac units mostly kJ/mol, nm and degree + """ + distance_factor = convert(1, openmm_unit.angstrom, openmm_unit.nanometer) degree_factor = convert(1, openmm_unit.radian, openmm_unit.degree) energy_factor = convert( @@ -137,9 +140,12 @@ def convert_parameters(parameters: Parameters) -> Parameters: def apply_parameters(top: Topology, parameters: Parameters): - # parameter structure is defined in grappa.data.Parameters.Parameters - # assume units are according to https://manual.gromacs.org/current/reference-manual/definitions.html - # namely: length [nm], mass [kg], time [ps], energy [kJ/mol], force [kJ mol-1 nm-1], angle [deg] + """ Applies parameters to topology + + parameter structure is defined in grappa.data.Parameters.Parameters + assume units are according to https://manual.gromacs.org/current/reference-manual/definitions.html + namely: length [nm], mass [kg], time [ps], energy [kJ/mol], force [kJ mol-1 nm-1], angle [deg] + """ ## atoms # Nothing to do here because partial charges are dealt with elsewhere @@ -233,6 +239,15 @@ def apply_parameters(top: Topology, parameters: Parameters): return +def load_model(): + """Loads grappa model""" + # load model, tag will be changed to be more permanent + #model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" # older model + model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/model_release/grappa-1.0-01-26-2024.pth" + model = model_from_url(model_tag) + return model + + class GrappaInterface(Parameterizer): def parameterize_topology( self, current_topology: Topology, focus_nr: list[str] = [] @@ -241,10 +256,7 @@ def parameterize_topology( mol = build_molecule(current_topology) logger.debug(mol.to_dict()) - # load model, tag will be changed to be more permanent - #model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" # older model - model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/model_release/grappa-1.0-01-26-2024.pth" - model = model_from_url(model_tag) + model = load_model() # initialize class that handles ML part grappa = Grappa(model, device="cpu") diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index 64f619b..ec7878c 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -14,6 +14,7 @@ build_molecule, apply_parameters, GrappaInterface, + load_model ) from grappa.grappa import Grappa @@ -74,10 +75,7 @@ def test_generate_input(): def test_predict_parameters(grappa_input, grappa_output_raw): - # load model, tag will be changed to be more permanent - #model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" - model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/model_release/grappa-1.0-01-26-2024.pth" - model = model_from_url(model_tag) + model = load_model() # initialize class that handles ML part grappa = Grappa(model, device="cpu") From faf7d0c87a6a72d1d31d41fcf0259c3c3e82abf1 Mon Sep 17 00:00:00 2001 From: KRiedmiller Date: Wed, 31 Jan 2024 10:48:16 +0100 Subject: [PATCH 12/12] black --- src/grappa_interface.py | 6 +++--- tests/test_parameterizers.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/grappa_interface.py b/src/grappa_interface.py index e61e8f3..c1f5632 100644 --- a/src/grappa_interface.py +++ b/src/grappa_interface.py @@ -140,8 +140,8 @@ def convert_parameters(parameters: Parameters) -> Parameters: def apply_parameters(top: Topology, parameters: Parameters): - """ Applies parameters to topology - + """Applies parameters to topology + parameter structure is defined in grappa.data.Parameters.Parameters assume units are according to https://manual.gromacs.org/current/reference-manual/definitions.html namely: length [nm], mass [kg], time [ps], energy [kJ/mol], force [kJ mol-1 nm-1], angle [deg] @@ -242,7 +242,7 @@ def apply_parameters(top: Topology, parameters: Parameters): def load_model(): """Loads grappa model""" # load model, tag will be changed to be more permanent - #model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" # older model + # model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/test_release_radicals/radical_model_12142023.pth" # older model model_tag = "https://github.com/LeifSeute/test_torchhub/releases/download/model_release/grappa-1.0-01-26-2024.pth" model = model_from_url(model_tag) return model diff --git a/tests/test_parameterizers.py b/tests/test_parameterizers.py index ec7878c..0c18a84 100644 --- a/tests/test_parameterizers.py +++ b/tests/test_parameterizers.py @@ -1,6 +1,6 @@ import pytest -#pytest.importorskip("kimmdy-grappa") +# pytest.importorskip("kimmdy-grappa") pytest.importorskip("grappa") import os @@ -14,7 +14,7 @@ build_molecule, apply_parameters, GrappaInterface, - load_model + load_model, ) from grappa.grappa import Grappa