zadorlab / KinBot

Automated reaction pathway search for gas-phase molecules
Other
45 stars 15 forks source link

Installation and running kinbot #57

Closed sthakris closed 1 year ago

sthakris commented 1 year ago

Hi,

I was trying to install kinbot locally sourcing from github. Due to python binding requirment or pybel for openbabel, which both did not work in my system. Therefore I installed kinbot and openbabel inside a conda environment.

I made a conda environment and installed kinbot (using pip) and openbabel (conda forge) with python=3.8 When typing kinbot after activating the environment gives as follows To use KinBot, supply one argument being the input file! which looks right.

Now i am trying to run a example case (propanol_homolytic_scissions), just by doing kinbot propanol.json OR submitting the job via SLRUM it gives error as follows,

Traceback (most recent call last): File "/users/test/.conda/envs/test/bin/kinbot", line 8, in sys.exit(main()) File "/users/test/.conda/envs/test/lib/python3.8/site-packages/kinbot/kb.py", line 88, in main qc.qc_opt(well0, well0.geom) File "/users/test/.conda/envs/test/lib/python3.8/site-packages/kinbot/qc.py", line 529, in qc_opt self.submit_qc(job) File "/users/test/.conda/envs/test/lib/python3.8/site-packages/kinbot/qc.py", line 626, in submit_qc process = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) File "/users/test/.conda/envs/test/lib/python3.8/subprocess.py", line 858, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/users/test/.conda/envs/test/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'qsub'

qsub not found

but also produces some files, as below

601842261640800060001_well.pbs clean.sh kinbot.db kinbot.log log.out molpro propanol.json README 601842261640800060001_well.py geometry.xyz kinbotjob.sh localjob.sh me perm propanol.sh scratch

Note: I have a binary Gaussian 16 in my system which can be seperately invoked with g16 from anywhere. Do I need to export Gaussian binary path or so?

Do you know what could be the problem? as in the kinbot wiki it is written kinbot is tested in g09.

Another context, if I install kinbolt and openbabel locally (not in conda environment) without pybel or python binding it says If no pybel use python binding else use structure. I did not see any examples of kinbot with structure (does it mean xyz structure). Only saw with smiles?

cmartia commented 1 year ago

Hi, The error you are mentioning makes me think that you don't have the PBS scheduler installed. You need to adapt the propanol.json file with the settings relevant to your computational environment, eg. PBS/SLURM (we cannot know the details of your computing center). You should check the Computational Environment section of the wiki: https://github.com/zadorlab/KinBot/wiki/Input-and-Keywords#computational-environment and specify the relevant options.

Let me know if you have any specific questions.

sthakris commented 1 year ago

Thanks! Yes with the system I figured out. I have slrum scheduler. Some further questions: 1) I was installing kinbot using pip install . as instructed in git. while submitting the job it says it can not find slrum_python.py in the directory where it points. I was looking at the tpl folder that is available with kinbot. I found that it was not copying all the files from the folder to the installation tpl folder in my system. Therefore, I copied all files from KinBot/tpl manually to the installation folder in my system. Question is, could this be a small bug or so?

2) Due to system settings, Openbabel could not be installed using pip. I complied openbabel locally with python binding. During running Kinbot I get an error : module pybel has no attribute 'ob' . Further I export the openbabel, bin and lib while running kinbot, which gives the same error. Do you know how can it be resolved? As my input is with smiles.
Can you also provide the input file example of how the structure geometry can be used instead of smiles? This is because it gives the message: it says if pybel is required to use the smiles input format. If pybel is unavailabel use geometry as input. Else install openbabel with python binding.

cmartia commented 1 year ago

Hi, Great you figured it out!

  1. Yes, this is a bug that we have recently discovered and have already implemented a solution. Before we release a bug fix, though, some tests are being carried out, but soon enough we'll publish a solution. Installing kinbot via PyPI repo should still work though: pip install kinbot.
  2. An alternative to installing via pip is to do it through conda (conda install -c conda-forge openbabel). I'm not sure you are able to install it with conda. Can you please provide the full traceback of the error so that I can identify exactly where this happens?

Here there is a simple example for the propyl radical.

sthakris commented 1 year ago

Hi, Thank you!

1) I think I was able to run kinbot using openbabel python binding. After the run of example case, in terminal it says DONE, also in kinbot.log it says finished. Please see the attached kinbot.log file, if everthing looks ok. It also generates the pesviewer.inp file. From my impression kinbot job was completed properly.

2) However, when I am using pesviewer to plot using pesviewer.inp file, it gives me error, as follow (note: pesviewer is installed with python 2.7 as instructed) Cannot recognize input line: graph_edge_color black # color of graph edge, if set to 'energy', will be scaled accordingly Traceback (most recent call last): File "/users/test/.conda/envs/PESViewer/bin/pesviewer", line 11, in load_entry_point('PESViewer==1.0', 'console_scripts', 'pesviewer')() File "/users/test/.conda/envs/PESViewer/lib/python2.7/site-packages/pkg_resources/init.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/users/test/.conda/envs/PESViewer/lib/python2.7/site-packages/pkg_resources/init.py", line 2852, in load_entry_point return ep.load() File "/users/test/.conda/envs/PESViewer/lib/python2.7/site-packages/pkg_resources/init.py", line 2443, in load

return self.resolve()

File "/users/test/.conda/envs/PESViewer/lib/python2.7/site-packages/pkg_resources/init.py", line 2449, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "build/bdist.linux-x86_64/egg/pesviewer/pesviewer.py", line 1289, in File "build/bdist.linux-x86_64/egg/pesviewer/pesviewer.py", line 1285, in main File "build/bdist.linux-x86_64/egg/pesviewer/pesviewer.py", line 761, in plot File "build/bdist.linux-x86_64/egg/pesviewer/pesviewer.py", line 692, in get_sizes ValueError: max() arg is an empty sequence

One thing came in my mind. In kinbot installation instruction it is said that "formchk" should also be running in the head node. I have exported the path of gussian directory where formchk executable is available through queue_tempelate file. Just wondering if "formchk" was working or not (not any error received with reagrd to this). Could this be one reason that pesviewer is giving error for plotting? Do you know something what could have happened?

3) In the example propanol_homolytic_scissions there is a README, in which it is written: This example searches for all homolytic scisscions for propanol. The search finds 7 reactions Are there any other ways to extract/see the results. Do you have any other scripts to plot or extract the results from the output files of the kinbot. OR in which output file of kinbot the results are given can you advise please?

Just in case

-----My output files looks like this

601842261640800060001_2d 601842261640800060001_well_mp2.sbatch kinbot.db pesviewer.inp 601842261640800060001_well.chk 601842261640800060001_well.py kinbotjob.sh propanol.json 601842261640800060001_well.com 601842261640800060001_well.sbatch kinbot.log propanol.sh 601842261640800060001_well.log 601842261640800060001_xval.txt me README 601842261640800060001_well_mp2.chk clean.sh ml_input scratch 601842261640800060001_well_mp2.com customSlurm.tpl molpro summary_601842261640800060001.out 601842261640800060001_well_mp2.log fort.7 nohup.out xyz 601842261640800060001_well_mp2.py geometry.xyz perm

kinbot.log pesviewer.txt

sthakris commented 1 year ago

Hi, The above issue/case seems to be particular.

1) I successfully ran the case you had provided me (propyl.jason) and plotted the PES for it. The results were 1 isomerzation (CH3CHCH3) 3 reactions (H+ring, H+CH3CHCH2, CH3+C2H4) I see the reactant, TS and products. How to know which final output file is for reactant, TS and for specific product if I want to visualize them seperately in e.g. Gaussview or other GUI software. Perhaps some infos are in pesviewer_data.txt file produced by kinbot.

2) I was running another example case : propanol_radical_ME, the keywords in the example file is old and kinbot do not recognises. Particulary error was received at Epsilons and Sigmas. After I replace with new keywords as instructed in github. I get error with units which again I used key word provided as in instruction. Still shows error with units of epsilon. If you have the example running case for ME can you please provide me?

3) Most of the time I need to restart due to time limit. I was running pentyl_pes (example case) and ran out of time. I could not follow the restart instruction properly, could you please advise? Can I simply run from where I left as

$kinbot/pes input.jason.

In this case after looking into the specific folder kinbot created (3 folder is formed). Case in one folder says finished in kinbot.log. Second folder says (kinbot.log) INFO:root: Both IRCs lead to the initial well, identical reaction found: 712393072531690850122_intra_H_migration_1_14 INFO:root: No product found for 712393072531690850122_intra_H_migration_1_14

Third says: INFO:root: Starting IRC calculations for 712392962471690960182_Intra_R_Add_ExoTetCyclic_F_4_2_1 which means I ran out of time for this as my calculation was stopped due to time limit.

Thank you!

cmartia commented 1 year ago

Hi!

  1. The reactions are the correct ones. There are two ways to relate chemids (numerical identifiers of species) with the human interpretation of species: In my opinion the best is download the *.html generated by pesviewer and the *_2d directory (they both need to be in the same folder) and open the *.html with a web browser. This contains a graph representation of the PES with a drawing of each species, and the chemids can be retrieved by hovering over the depiction. An alternative way is to manually inspect the pesviewer.inp file: It contains the chemids and energies of each species so you can can relate them by energies with the plot.

  2. Noted Thanks for the heads up!

  3. Aside from stating the obvious (increase the wall time limit in slurm) I am not sure I can help you with the time issues. Usually the calculations needed for kinbot take, at most, few hours to complete.

sthakris commented 1 year ago

Thank you very much for your help and all the suggestions. Just in case, if you updated the ME example case let me know. If you have one running case you can provide me as well. One query: As the overview documentation in wiki indicates that N (beta). Is kinbot in testing phase for N or we can run calculation for CHON as well.