-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paramaterising with openff issues #389
Comments
Hi @annamherz. I think the issue is that I have forgotten to avoid going via the intermediate PDB file now that we have a native SDF parser. (I had updated this in the network generation code following another issue that you raised, but apparently not in the OpenFF parameterisation wrapper.) The current approach is a hack (recommended by the OpenFF folks) to attempt to recover stereochemistry. I just need to check the file format associated with the molecule, then write directly to SDF if it was loaded from that format in the first place. I'll check with your example to see if it works. For reference, you can safely ignore the OpenEye warning. OpenFF can use functionality from the toolkit if it is installed, but can't specify it as a hard dependency since it is proprietary software that needs a license. If it's not installed, it will just use an alternative backend, e.g. RDKit. (OpenFF is interoperable in many places.) |
Okay, I've fixed the first bit, but ParmEd still seems unhappy. I'll try to figure out if the issue is with the OpenMM System, Topoolgy, or the positions from the PDB file. |
ah okay that makes sense! |
Right, I've now fixed it. I was using positions from the PDB file when creating the ParmEd structure. (This was following an old OpenFF tutorial.) I actually want to use the positions from the first conformer of the OpenFF molecule, which might differ to those in the PDB. I'll tidy up a few things then push a fix. |
thank you so much! |
The paramaterising is working well now, however I'm still getting one error. After running File "/home/anna/BioSimSpace/python/BioSimSpace/Parameters/_process.py", line 227, in getMolecule
raise _ParameterisationError("Parameterisation failed! Last error: '%s'" % str(self._last_error))
BioSimSpace._Exceptions._exceptions.ParameterisationError: Parameterisation failed! Last error: 'Unable to convert OpenMM System to ParmEd structure!: ImportError('You must have at least OpenMM 6.3 installed')' This is a bit strange, as I've checked the openmm version of my conda environment, and also when printing it in the python script for this, the version is 7.7 ? |
Can you try again in a completely clean conda environment? I'm not seeing this locally. I wonder if you have some environment variables set that mean that OpenFF is picking up a different version of OpenMM. Alternatively, it might be failing to extract the version number for some reason. Could you confirm which OS you are using and how you installed BioSImSpace, i.e. source, or via conda? |
For what it's worth, I'm very surprised that it could install an OpenMM version less than 6.3. Assuming it pulls in the dependency via conda-forge (which it should, given our instructions and channel priority), then it only goes back to 7.4. Looking at the Omnia version here, 6.2 was released over 7 years ago! This would be completely incompatible with Sire and there is absolutely no way this could be pulled in via any of our current build or installation methods 🤷♂️ |
The ParmEd function that is failing is here. This has no check of the OpenMM version number, so it's not clear to me where the check is being performed. |
I've also grepped the entire BioSimSpace conda environment for "OpenMM 6.3" and don't see anything, so it doesn't look like the exception is anything that would be raised by the standard packages that should be installed. Perhaps you have some outdated versions of certain packages installed elsewhere. Could you try something like the following in your environment: import openmm
print(openmm.__file__)
/home/lester/.conda/envs/sire-dev/lib/python3.9/site-packages/openmm/__init__.py
import openff.toolkit
print(openff.toolkit.__file__)
/home/lester/.conda/envs/sire-dev/lib/python3.9/site-packages/openff/toolkit/__init__.py
import parmed
print(parmed.__file__)
/home/lester/.conda/envs/sire-dev/lib/python3.9/site-packages/parmed/__init__.py That will check the location of the modules that are required for the functionality that is failing. |
Yes, I'm fairly certain that the openmm version isn't less than 6.3 at all, as I don't think that has ever been installed anywhere on the machine I'm using? I'm running Ubuntu 22. BioSimSpace is installed via source and then used via the PYTHONPATH variable, as I'm changing between the branches, but I was getting this error for both the devel branch and the feature-amber-fep. I'm using Sire from the conda environment. I installed a clean conda environment using this and then updated sire to 2023 using Trying the above:
I think the problem is this, so it is taking parmed from the amber22 install. This does check the version. |
In the conda install, parmed is version 3.4.3, whilst in the amber install it is only 3.4.1. This doesn't happen when I start python from the terminal whilst the conda environment is active. In that case, I get: |
Ah, great sleuthing. That's annoying that non-conda |
Hello! I have had issues with parameterising molecules using openff. I am currently trying to paramaterise the attached molecules with sage ('openff_unconstrained-2.0.0'). I'm not sure if it is partially related to this issue? Currently, for the import openff toolkit part of _openforcefield.py I get the following message:
However I don't think this is causing the issues.
When carrying out the parameterisation with sdf files here in the code, I get the following error message when setting verbose to True for ejm31 (files: ejm31.zip):
Before this, the sdf file is read okay, is saved as a pdb without issue, and then read and saved again as an sdf molecule. For ejm31 this sdf molecule in the tmp file is:
This is different from the sdf file read in, and I think causing the error when it is then read by openff, as the error shows up after this conversion.
When running this without the rdkit step, so just directly using the original input sdf with
_OpenFFMolecule.from_file
this is able to be read. I think during the stage of converting the BSS molecule into an sdf, important structural information is lost which prevents it from being opened by openff. Paramaterisation with openff proceeds okay then following this with the original sdf file.Afterwards, the next issue occurs with loading the molecule into a parmed structure. When I load the original sdf file into BSS and then save it as a pdb (similarly to how is done already), the following error occurs:
cannot reshape array of size 15 into shape (32,3)
And then saving of the actual parametrised molecule is not able to proceed.
When loading the attached pdb for ejm31 (which is the pdb obtained when I initially created the ligand and also saved the sdf), these coordinates were input okay into parmed and the structure could be saved and loaded into BSS again.
I was wondering if there was some better way to convert the file formats past just loading them into BSS as a molecule and then outputting them as sdf / pdbs? As this is the point where the errors seem to originate.
The text was updated successfully, but these errors were encountered: