michellab / Sire

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

no lead parsers #397

Closed quantaosun closed 2 years ago

quantaosun commented 2 years ago

Hi all, I try to run the following command in google colab. It worked previously, but for quite some time, maybe several months, I can't repeat the calculation successfully. Help is appreciated.

!waterswap -l LIG  -t SYS_gaff2.prmtop -c SYS_gaff2.crd -n 500
Exception 'SireError::program_bug' thrown by the thread 'master:main'.
There are no lead parsers!
Thrown from FILE: /usr/share/miniconda/envs/sire_build/conda-bld/sire_1648126912766/work/corelib/src/libs/SireIO/moleculeparser.cpp, LINE: 1645, FUNCTION: void SireIO::MoleculeParser::sortParsers(QList<SireBase::PropPtr<SireIO::MoleculeParser> >&, QList<SireBase::PropPtr<SireIO::MoleculeParser> >&) const
chryswoods commented 2 years ago

Hi - thanks for letting us know about this problem. The "no lead parsers" error is thrown when Sire can't load the input file with any of its in-built parsers. It is not a very helpful error message...

Would it be possible for you to share the SYS_gaff2.prmtop and SYS_gaff2.crd files with me so that I can debug further? If not, then I will write a couple of scripts that I will send you that can debug things further.

quantaosun commented 2 years ago

Thanks for replying. Yes, the files are attached. I don't know why the browser does not allow me to upload the .prmtop and .crd format, but I just changed to text format, change them back if you need.

Also, after I installed sire with Conda, I noticed that the optimse_openmm is not in the path by default, so this command was not run after installation. I don't know if this contributes to this error or not.

SYS_gaff2.crd.txt are the files. SYS_gaff2.prmtop.txt

chryswoods commented 2 years ago

Hi - I've found the problem. Your SYS_gaff2.prmtop file contains %COMMENT lines. We hadn't added support for these into our Amber prmtop parser. This meant that our parser was failing to read those lines properly, which confused it.

Thanks for sharing this as it highlighted a problem with our parser :-)

I've now added support for %COMMENT lines in the development code that will become Sire 2023.1.0 (all of our spare development time is now focussed on getting this version out in time for the new year).

This doesn't help you today. To solve your problem today, you can manually delete all of the %COMMENT lines from the prmtop file. Deleting the %COMMENT lines will allow waterswap to read the file.

However, there are two deeper problems;

  1. The %COMMENT lines are for the various CMAP lines in the file. Sire/waterswap can't yet read or understand CMAP lines. This means that these parameters are ignored and their energies aren't calculated. This isn't too big a problem for your calculations. CMAP corrections are additional energy terms used for the protein backbone, so that its dynamics better represents experiment. Waterswap uses a (pretty-much) fixed protein backbone, and uses Monte Carlo rather than molecular dynamics sampling. The lack of CMAP corrections, while not ideal, is not likely to have any impact on the simulation or on the free energy result.

  2. Since you last ran, we have updated Sire as part of a large effort to completely refresh and update the API. This effort, which we call 2023.X is targeting a functioning complete release in early 2023 (ideally 2023.1.0). Because of development dependencies with BioSimSpace, the latest version of Sire that you download from conda is Sire 2023.0.0. While we have made every effort to keep this functional, it is not really a production-quality release, and has known issues for waterswap, ligandswap and protein swap calculations (e.g. see issue #396).

You will need to install a 2022 version of Sire (which is production-quality). To do this, type;

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

An additional issue is that Intel's Threading Building Blocks has changed significantly, which forced us to rewrite a lot of the underpinning parallelisation code. As we didn't know how many people still use waterswap/ligandswap/proteinswap, we did not update the RepExMove2 code on which these simulations rely. If you run waterswap, you will get the error described in #381, i.e.

Exception 'SireError::incomplete_code' thrown by the thread 'master:main'.
tbb has removed tbb::task, so we now need to rewrite RepExMove2. If this affects you, please switch to RepExMove, and then raise a GitHub issue asking

To fix this, you will need to edit the file WSRC.py in miniconda_dir/libs/python3.8/site-packages/Sire/Tools/WSRC.py and add in the line

RepExMove2 = RepExMove

This switches waterswap to use the older (but still working) RepExMove class. More details on how to do this are in the thread with issue #381.

quantaosun commented 2 years ago

Hi Christopher,

Thanks a lot, As you suggested, I installed the older version of Sire. I removed the %COMMENT lines from my file and also modified WSRC.py. Waterswap works now.

This helps me a lot in my research project. This also explained my observation that it worked pretty good in 2021 with the same SYS_gaff2.prmtop but not working since some point maybe early 2022, and that caused me some self-doubt about what I might be doing wrong with my files.

I would like to digest more on the deeper reasons when I can understand (I need to read more), but at the moment I am happy it is running.

Looking forward to the 2023.0 version. :)

Quantao