michellab / Sire

Sire Molecular Simulations Framework
http://siremol.org
GNU General Public License v3.0
95 stars 26 forks source link

UserWarning: SireError::incomplete_code error in tutorial #396

Open spadavec opened 2 years ago

spadavec commented 2 years ago

When I run the FM1 tutorial example with the following execution:

(sire) spadavec@Crandall:~/itx/sire_example/ligandswap$ ligandswap -t0 rec_fmc.top -c0 fmc.30.crd -l0 FM1 -t1 rec_cti.top -c1 cti.30.crd -l1 CTI -C config

Using the files available on the sire website, the calculation seems to proceed fine until the LSRC system constraints are created...

Creating LSRC system constraints...

Adding system monitors...
Creating the Monte Carlo moves to sample the LSRC system...
Using generated random number seed 961626

Energies of this system at lambda == 0...
Traceback (most recent call last):
  File "/home/spadavec/miniconda3/envs/sire/share/Sire/scripts/ligandswap.py", line 254, in <module>
    LSRC.run(params)
  File "/home/spadavec/miniconda3/envs/sire/lib/python3.9/site-packages/sire/legacy/Tools/__init__.py", line 175, in inner
    retval = func()
  File "/home/spadavec/miniconda3/envs/sire/lib/python3.9/site-packages/sire/legacy/Tools/LSRC.py", line 2062, in run
    (lsrc_system,lsrc_moves) = loadInput()
  File "/home/spadavec/miniconda3/envs/sire/lib/python3.9/site-packages/sire/legacy/Tools/LSRC.py", line 1895, in loadInput
    (lsrc_system,lsrc_moves) = mergeLSRC(sys0,ligand0_mol, sys1,ligand1_mol, watersys)
  File "/home/spadavec/miniconda3/envs/sire/lib/python3.9/site-packages/sire/legacy/Tools/LSRC.py", line 1763, in mergeLSRC
    (lsrc_sys,lsrc_moves) = createStage(lsrc_sys, sys0, ligand0_mol, ligand1_mol, watersys, AtomResultMatcher(mapping), "lsrc")
  File "/home/spadavec/miniconda3/envs/sire/lib/python3.9/site-packages/sire/legacy/Tools/LSRC.py", line 1643, in createStage
    printEnergies(system.energies(), sys.stdout)
UserWarning: SireError::incomplete_code: NEED TO WRITE THE CODE FOR NON_STRICT SELECTION OF 1-4 PAIRS (call sire.error.get_last_error_details() for more info)

Any idea what the problem is?

chryswoods commented 2 years ago

Hi - thanks for reporting this problem. I confirm that I also see this when I run ligandswap using the example input files. This error occurs for sire 2023.0.0, but not for sire 2022.3.0 (this version has another error, which relates to this issue #381).

The problem is a regression error that we have introduced in 2023.0.0 as part of 2023.X refurbishment project we are undertaking. This is a program to modernise Sire. The 2023.0.0 version is a pre-release, so not completely stable. We will make sure to fix this problem for the proper release, which will be 2023.1.0 (likely available early in 2023).

Until then, we recommend that sire < 2023.0 is used for production. This can be installed using;

conda uninstall sire
conda install -c michellab "sire<2023.0"

However, in your case, this will install sire 2022.3.0, which suffers from the error described in #381. To solve this, apply the fix as described in that issue. You would just need to edit the LSRC.py file as described in that fix.

Sorry that this is a problem for you and that the fix isn't great. As far as we know, there are very few people using waterswap or ligandswap now, and so this code has been allowed to bitrot while we concentrated on the parts of Sire needed to support BioSimSpace.

chryswoods commented 2 years ago

p.s. I forget to say that ligandswap may not be the best method to calculate relative binding free energies (it is quite an old method now). You may have more success calculating relative free energies using molecular dynamics simulations. BioSimSpace provides wrappers that make it easier to set up and run molecular dynamics free energy calculations using Amber, Gromacs or SOMD. You can find instructions on how to do this on the BioSimSpace website. You want the "advanced/alchemistry" workshop that is on the notebook server.