I'm trying to use openpathsampling to simulate the binding of a ligand to my enzyme. I'm using Gromacs for my normal simulation on the HPC system provided by my university. I created an initial trajectory using some pull code for Gromacs. I tried to load this trajectory (in trr format) as described here:
from openpathsampling.engines.openmm.tools import trajectory_from_mdtraj
init_traj = md.load("md_pull_conf2_1st.trr", top="npt_conf2.gro")
trr = md.formats.TRRTrajectoryFile("md_pull_conf2_1st.trr")
vel = trr._read(n_frames=len(init_traj), atom_indices=None, get_velocities=True)[5]
OPS_init_traj = trajectory_from_mdtraj(init_traj, velocities=vel)
However, then I get the following error for the last step:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/[...]/openpathsampling/engines/openmm/tools.py", line 237, in trajectory_from_mdtraj
NameError: name 'MDTrajTopology' is not defined
From what I understand, in the tools.py script MDTrajTopology
is only imported if OpenMM in installed. Since I can't install OpenMM on the HPC system, I tried to add the following import statement outside of if HAS_OPENMM:
from openpathsampling.engines import Topology, MDTrajTopology
If I run the import code like this, I get the following error:
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/[...]openpathsampling/engines/openmm/tools.py", line 244, in trajectory_from_mdtraj
unit.nanometers)
File "/[...]/simtk/unit/quantity.py", line 170, in __init__
if value == None:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I also tried to load trajectory_from_mdtraj
from openpathsampling.engines.openmm
instead of openpathsampling.engines.openmm.tools
. Then I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/[...]/openpathsampling/engines/openmm/__init__.py", line 2, in missing_openmm
raise RuntimeError("Install OpenMM to use this feature")
RuntimeError: Install OpenMM to use this feature
Is OpenMM required just to load the trajectory? Or is there a workaround which is not dependent on OpenMM?