pnnl / isicle

In silico chemical library engine for high-accuracy chemical property prediction
BSD 3-Clause "New" or "Revised" License
58 stars 19 forks source link

Request for guidance on running ISiCLE locally without Cascade and obtaining NMR chemical shifts #7

Open zaid-shekhani opened 1 year ago

zaid-shekhani commented 1 year ago

I am seeking assistance in using ISiCLE on a local server without relying on Cascade and obtaining NMR chemical shifts directly. My goal is to provide molecular structures to ISiCLE and retrieve the corresponding chemical shifts. While exploring the examples folder, I noticed the following comment in the nmr_chemical_shifts.py file:

Convert to shifts TODO: implement shielding to shifts conversion

I have the following queries and requests:

Running ISiCLE Locally: I would like guidance on how to use ISiCLE on a local server without needing to utilize Cascade. This would involve bypassing the Cascade credentials prompt and resolving the host name error mentioned in my previous issue.

Obtaining NMR Chemical Shifts: Could you please provide instructions or tutorials on how to use ISiCLE to obtain NMR chemical shifts directly from molecular structures? If possible, I would appreciate guidance on how to do it.

OBrink commented 1 year ago

I second this. It would be great if you could provide some documentation on how to obtain the chemical shifts using ISiCLE.

JHlozek commented 1 year ago

I also hope for this please. The examples seem very out of date and it is otherwise unclear how to use this package to obtain NMR chemical shifts

smcolby commented 1 year ago

Thank you all for your interest in ISiCLE. As you've intuited, the NMR workflow from Yesiltepe et al. was the first ISiCLE prototype, which indeed was tailored to our institutional computing resource Cascade. We have since created a CCS workflow that is resource-agnostic, but the NMR code was not updated. More recently, we have been working on "ISiCLE 2.0", a much improved Python API and collection of workflows that will unify all currently supported property prediction functionality (NMR, CCS, and infrared). This version, while very much in a beta state, currently resides on the master branch.

Our resident NMR workflow expert will be providing the necessary updates to make the latest NMR workflow more accessible. I believe is almost ready to push to GitHub. Your patience is appreciated!

amyjystad commented 1 year ago

Hi all, thanks for your patience. I have updated our ReadTheDocs with a how-to on shift calculations https://isicle.readthedocs.io/en/latest/user_guide/NMR.html. If you're interested in a a couple small molecules this should be enough for you to run via jupyter notebook or python script on your local machine. I've also added workflows for automating the process, both on your local machine or on your slurm scheduler. Pull the new changes from the github and find them at workflows/shielding/nextflow-*. These require NextFlow which must be installed separately but its fairly simple to do. https://www.nextflow.io/docs/latest/getstarted.html

Let us know if you have more questions!

zaid-shekhani commented 1 year ago

Hi @amyjystad ,

Thanks a lot for updating and the instructions. When I try to run the NMR notebook with a given molecule I am getting the following error, could you kindly let me know what is going wrong here?

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[2], line 1
----> 1 conformer = geom.md(forcefield='gff',
      2                     ewin = 3,
      3                     task = 'conformer',
      4                     charge = geom.get_formal_charge(),
      5                     solvation = 'water',
      6                     processes = 4)

File ~/isicle/isicle/geometry.py:146, in XYZGeometry.md(self, program, **kwargs)
    141 def md(self, program="xtb", **kwargs):
    142     """
    143     Optimize geometry or generate conformers or adducts from XYZ using stated forcefield.
    144     Additional inputs can be energy window, optimization criteria level, charge, or ion.
    145     """
--> 146     geom = isicle.md.md(self.__copy__(), program=program, **kwargs)
    148     return geom

File ~/isicle/isicle/md.py:60, in md(geom, program, **kwargs)
     43 '''
     44 Optimize geometry via molecular dyanmics using supplied forcefield
     45 and basis set.
   (...)
     56 
     57 '''
     59 # Select program
---> 60 return _program_selector(program).run(geom, **kwargs)

File ~/isicle/isicle/md.py:417, in XTBWrapper.run(self, geom, **kwargs)
    414 self.submit()
    416 # Finish/clean up
--> 417 self.finish()
    419 return self

File ~/isicle/isicle/md.py:367, in XTBWrapper.finish(self)
    363 parser.load(os.path.join(self.temp_dir, self.basename + '.out'))
    364 self.output = parser.load(os.path.join(
    365     self.temp_dir, self.basename + '.out'))
--> 367 result = parser.parse()
    369 self.__dict__.update(result)
    371 for i in self.geom:

File ~/isicle/isicle/parse.py:740, in XTBParser.parse(self)
    738 # Check that the file is valid first
    739 if len(self.contents) == 0:
--> 740     raise RuntimeError('No contents to parse: {}'.format(self.path))
    741 if "terminated normally" not in self.contents[-1]:
    742     if "ratio" not in self.contents[-2]:

RuntimeError: No contents to parse: /tmp/isicle/tmpe69f9qt8/dimethylglycine.out
amyjystad commented 1 year ago

Per the last line RuntimeError, the output file either could not be found or is empty. Check to see if the file exists at all by opening up /tmp/isicle/tmpe69f9qt8/dimethylglycine.out from a terminal line. If it does exist, open it up and see if theres an error at the end, report back and we can try to resolve it together. If the file doesn't exist or the file is empty, its likely there's a failure to execute the CREST command. Open up a terminal, activate the isicle conda environment, and check that crest can be executed with crest --help. If this fails, try uninstalling and reinstalling the conda environment. Check those two items and let me know what you find.

zaid-shekhani commented 1 year ago

I investigated the dimethylglycine.out file and found it to be empty. Additionally, I checked the crest --help command in the isicle conda environment, and it seems that CREST is installed correctly:

       ==============================================
       |                                            |
       |                 C R E S T                  |
       |                                            |
       |  Conformer-Rotamer Ensemble Sampling Tool  |
       |          based on the GFN methods          |
       |             P.Pracht, S.Grimme             |
       |          Universitaet Bonn, MCTC           |
       ==============================================
       Version 2.12,   Thu 19. Mai 16:32:32 CEST 2022
  Using the xTB program. Compatible with xTB version 6.4.0

   Cite work conducted with this code as

   • P.Pracht, F.Bohle, S.Grimme, PCCP, 2020, 22, 7169-7192.
   • S.Grimme, JCTC, 2019, 15, 2847-2862.

   and for works involving QCG as

   • S.Spicher, C.Plett, P.Pracht, A.Hansen, S.Grimme,
     JCTC, 2022, 18 (5), 3174-3189.

   with help from:
   C.Bannwarth, F.Bohle, S.Ehlert, S.Grimme,
   C.Plett, P.Pracht, S.Spicher

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I've performed the following steps to troubleshoot the issue:

  1. Deleted and reinstalled everything from scratch.

  2. Deleted only the CREST dependency and reinstalled it using: https://anaconda.org/conda-forge/crest.

However, despite these efforts, the problem persists. The dimethylglycine.out file remains empty. Please advise on further steps for resolution.

amyjystad commented 1 year ago

Hi Zaid, thanks for the additional information. We are working on trying to reproduce your error and will get back to you as soon as we can.