openmmtools
openmmtools copied to clipboard
create_alchemical_system complains about virtual sites that I haven't defined (used parmed to create system)
Hello, the problem is probably more my fault than an openmmtools problem, but I don't really know how to deal with it.
I am using a script that uses create_alchemical_system
inside alchemy.py
, I have the pdb of a solvated protein ligand system and a prmtop file that was built with amber 19SB, OPC water and gaff2.
I am using parmed to create the system, topology and positions, and transform the topology in a yank Topography
prmtop = parmed.load_file('custom_complex.prmtop', xyz='custom_complex.pdb')
system = prmtop.createSystem(nonbondedMethod=app.PME, nonbondedCutoff=1.0*unit.nanometer,
constraints=app.HBonds, rigidWater=True, implicitSolvent=None,
implicitSolventKappa=None, temperature=298.15*unit.kelvin,
soluteDielectric=1.0, solventDielectric=78.5,
removeCMMotion=True, hydrogenMass=None, ewaldErrorTolerance=0.0005,
switchDistance=0.0*unit.nanometer)
topology = Topography(prmtop.topology, ligand_atoms='resname UNK')
positions = prmtop.positions
(I am using parmed and not openmm's AmberPrmtopFile
because the latter was complaining that I can not use PME
on a non periodic system, even though a prmtop file contains no information about unit cell vectors or similar)
And I get this error
File "/my/env/path/lib/python3.7/site-packages/openmmtools/alchemy.py", line 703, in create_alchemical_system
raise ValueError(f'Virtual atoms in region {alchemical_region.name}. '
ValueError: Virtual atoms in region None. Alchemically modified virtual sites are not supported
I haven't defined any virtual site and I used this script in the past with systems that I created with openmm's Forcefield
class and amber 14 and everything worked perfectly.
Do you have any suggestion on how to resolve this problem?
Hi, I figured out that the virtual sites are there because of OPC water (should have thought about it)
In any case the problem therefore becomes the same of #509 would it be possible to implement virtual sites in the achemical region? (if it isn't excessively complex and you give me the right hints I have no problem in helping you implement whatever needs to be changed in the code once the exception is removed)