Skip to content

Commit

Permalink
Set box vectors for GROMACS example
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Nov 4, 2024
1 parent cec2532 commit e211978
Showing 1 changed file with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"metadata": {},
"outputs": [],
"source": [
"from openff.toolkit import ForceField, Molecule, Topology"
"from openff.toolkit import ForceField, Molecule, Quantity, Topology"
]
},
{
Expand Down Expand Up @@ -74,10 +74,22 @@
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Support for writing out LAMMPS data files will be removed\n",
"in mbuild 1.0.\n",
"See GMSO (https://github.com/mosdef-hub/gmso/tree/main/gmso/formats/lammpsdata) for\n",
"continued support for LAMMPS.\n",
"\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2f3b86c392c24705b86721395cf43ea4",
"model_id": "3ead8bf62c2d49f1b6776a59e34a7a1d",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -90,8 +102,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/jeffreywagner/projects/OpenForceField/openff-interchange/openff/interchange/_experimental.py:35: UserWarning: Interchange object combination is experimental and likely to produce strange results. Any workflow using this method is not guaranteed to be suitable for production. Use with extreme caution and thoroughly validate results!\n",
" return func(*args, **kwargs)\n"
"/Users/mattthompson/software/openff-interchange/openff/interchange/operations/_combine.py:52: InterchangeCombinationWarning: Interchange object combination is complex and likely to produce strange results outside of a limited set of use cases it has been tested in. Any workflow using this method is not guaranteed to be suitable for production or stable between versions. Use with extreme caution and thoroughly validate results!\n",
" warnings.warn(\n"
]
}
],
Expand All @@ -109,9 +121,8 @@
"\n",
"complex_system = receptor.combine(ligand)\n",
"\n",
"# TODO\n",
"# complex.box = pdbfile box vectors ...\n",
"# complex.positions = np.vstack([receptor.positions, ligand.positions])"
"# Pseudo-vacuum\n",
"complex_system.box = Quantity([5, 5, 5], \"nanometer\")"
]
},
{
Expand All @@ -129,7 +140,7 @@
{
"data": {
"text/plain": [
"<openmm.openmm.System; proxy of <Swig Object of type 'OpenMM::System *' at 0x14380adf0> >"
"<openmm.openmm.System; proxy of <Swig Object of type 'OpenMM::System *' at 0x3442730f0> >"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -175,16 +186,7 @@
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/jeffreywagner/projects/OpenForceField/openff-interchange/openff/interchange/interop/gromacs/export/_export.py:48: UserWarning: WARNING: System defined with no box vectors, which GROMACS does not offically support in versions 2020 or newer (see https://gitlab.com/gromacs/gromacs/-/issues/3526). Setting box vectors to a 5 nm cube.\n",
" self._write_gro(gro, decimal)\n"
]
}
],
"outputs": [],
"source": [
"complex_system.to_gro(\"complex.gro\")\n",
"complex_system.to_top(\"complex.top\")"
Expand All @@ -194,7 +196,7 @@
"metadata": {
"category": "force_field_interop",
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -208,7 +210,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
"version": "3.10.15"
}
},
"nbformat": 4,
Expand Down

0 comments on commit e211978

Please sign in to comment.