Skip to content
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

Using Ewald electrostatics in a system with net charge Warning #32

Open
avnikonenko opened this issue Feb 13, 2025 · 6 comments
Open

Using Ewald electrostatics in a system with net charge Warning #32

avnikonenko opened this issue Feb 13, 2025 · 6 comments

Comments

@avnikonenko
Copy link

avnikonenko commented Feb 13, 2025

Hi!
I got this issue:


│ ckages/BioSimSpace/Sandpit/Exscientia/Process/_gromacs.py:727 in addToConfig │
│                                                                              │
│    724 │   │   super().addToConfig(config)                                   │
│    725 │   │                                                                 │
│    726 │   │   # Use grompp to generate the portable binary run input file.  │
│ ❱  727 │   │   self._generate_binary_run_file(                               │
│    728 │   │   │   self._config_file,                                        │
│    729 │   │   │   self._gro_file,                                           │
│    730 │   │   │   self._top_file,                                           │
│                                                                              │
│ Miniconda3/envs/a3fe/lib/python3.12/site-pa │
│ ckages/BioSimSpace/Sandpit/Exscientia/Process/_gromacs.py:703 in             │
│ _generate_binary_run_file                                                    │
│                                                                              │
│    700 │   │   │   │   │   │   + "\nUse 'ignore_warnings' to ignore warnings │
│    701 │   │   │   │   │   )                                                 │
│    702 │   │   │   │                                                         │
│ ❱  703 │   │   │   │   raise RuntimeError(exception_string)                  │
│    704 │   │   │                                                             │
│    705 │   │   │   else:                                                     │
│    706 │   │   │   │   raise RuntimeError(                                   │
╰──────────────────────────────────────────────────────────────────────────────╯
RuntimeError: Unable to generate GROMACS binary run input file.

'gmx grompp' reported the following warnings:
WARNING 1 [file gromacs.top, line 140477]:
  You are using Ewald electrostatics in a system with net charge. This can
  lead to severe artifacts, such as ions moving into regions with low
  dielectric, due to the uniform background charge. We suggest to
  neutralize your system with counter ions, possibly in combination with a
  physiological salt concentration.

Use 'ignore_warnings' to ignore warnings.
Loading solvated system...
Minimising input structure with 1000 steps...

Could you help me please?
Thank you!

@fjclark
Copy link
Collaborator

fjclark commented Feb 13, 2025

Hi!

Did you solvate this system yourself (outside of a3fe)? If so, could you please check that you neutralised it.

If you solvated within a3fe, please could you share the input files and I'll debug?

Thanks!

@avnikonenko
Copy link
Author

avnikonenko commented Feb 13, 2025

I haven't solvated it, but there is GTP molecule and Mg2+ ion in my protein system.
I checked the ligand and protein files, there are no water or other ions, but Mg2+ ion in the protein, I guess it can be a reason?

LOC_ligand.zip

@fjclark
Copy link
Collaborator

fjclark commented Feb 14, 2025

Thanks for sharing!

Looking at the charge of the solvated system, with

import BioSimSpace as BSS
sys = BSS.IO.readMolecules(["bound_solv.prm7", "bound_solv.rst7"])
sys.charge()

gives

>>> -0.0050 |e|

So the issue is probably that the charge isn't close enough to zero. This fractional charge is due to your cofactor, which has a net charge of -4.0050 |e|. Could you try and reparameterise your cofactor so that it has negligible total charge?

@avnikonenko
Copy link
Author

avnikonenko commented Feb 15, 2025

Thank you for the tip!
I got this exact parameters from Antechamber, but now I reparameterized gtp molecule by BioSimSpace and still get -4 charge.

>>> import BioSimSpace as BSS
>>> BSS.setVerbose(True)
>>> lig = BSS.IO.readMolecules('gtp.mol')[0]
>>> lig.charge()
-4.0000 |e|

I guess in this case I can just add Process.Gromacs(..., ignore_warnings=True) into a3fe/run/system_prep.py: line 722?

@fjclark
Copy link
Collaborator

fjclark commented Feb 17, 2025

No problem!

Great, I've confirmed that I no longer get that error for your system with the reparameterised GTP with integer charge. The issue was that the GTP charge was -4.0050, rather than -4.0000 - this meant that it couldn't be completely neutralised to 0 during the solvation stage (only -0.0050), and GROMACS was unhappy.

So no need to ignore warnings - just rerun with the reparameterised input.

You've probably already seen, but BioSimSpace has some helpful functions for updating your system, so you can do something like

system.updateMolecule(4, cfr_reparam)

with the reparameterised GTP.

@avnikonenko
Copy link
Author

Thank you very much! I will try this solution soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants