jvermaas / LigninBuilder

VMD Plugin and associated scripts to build lignin structures from topological specifications
13 stars 4 forks source link

Issue running VMD .tcl from lignin-kmc and LigninBuilder from LigninKMCdemo directory #3

Closed k0ryphae closed 3 years ago

k0ryphae commented 3 years ago

I've encountered another issue which I am hoping you could help with. I ran LigninKMC and managed to get output file .tcl for further minimizations in vmd/namd. Contents of the file are as follows:

package require psfgen topology /home/koryphae/LigninBuilder/smilesdemo/toppar/top_all36_cgenff.rtf topology /home/koryphae/LigninBuilder/smilesdemo/toppar/top_lignin.top segment L { residue 1 S residue 2 S residue 3 S residue 4 S residue 5 S residue 6 S residue 7 S residue 8 S residue 9 G residue 10 S residue 11 G residue 12 S residue 13 S residue 14 G residue 15 G } patch BB L:3 L:5 patch BB L:1 L:2 patch BO4 L:4 L:1 patch BO4 L:6 L:5 patch BO4 L:7 L:2 patch BO4 L:8 L:6 patch BO4 L:9 L:3 patch 4O4 L:7 L:9 patch BO4 L:10 L:9 patch BO4 L:11 L:4 patch BO4 L:12 L:11 patch BO4 L:13 L:12 patch BO4 L:14 L:10 patch B5G L:15 L:14 regenerate angles dihedrals writepsf lignin.psf

I named the file 'psfgen.tcl' so the scripts (step1 etc) would recognize them. I moved the file into LigninKMCdemo folder so in the folder are 4 files: psfgen.tcl, step1.py, step2.tcl and step3.tcl Unfortunately, I am running into a problem when executing the first step. When I am in a conda environment where i have dont have ligninkmc package available (checked by running 'conda list'), but running "python3 step1.py" yields this:

Traceback (most recent call last): File "step1.py", line 4, in from ligninkmc.Visualization import generatePsfgen ModuleNotFoundError: No module named 'ligninkmc'

Now when I enter to conda environment which has ligninkmc package available and run step1.py:

Traceback (most recent call last): File "/home/koryphae/LigninBuilder/LigninKMCdemo/step1.py", line 4, in from ligninkmc.Visualization import generatePsfgen ModuleNotFoundError: No module named 'ligninkmc.Visualization'

Would you know why is this happening?

jvermaas commented 3 years ago

Ugh. Yeah, I do. It looks like they changed the API for ligninKMC sometime after I left NREL. There used to be a ligninkmc.Visualization submodule. @hmayes , do you have any insight as to what I should be using instead?

jvermaas commented 3 years ago

Nevermind, this wasn't too bad to fix myself. step1.py now uses the new ligninkmc APIs, rather than the old ones from the beginning of 2019. I also have a pull request outstanding with the ligninkmc main repo, but for now you can use my foked version of ligninkmc.

k0ryphae commented 3 years ago

Nevermind, this wasn't too bad to fix myself. step1.py now uses the new ligninkmc APIs, rather than the old ones from the beginning of 2019. I also have a pull request outstanding with the ligninkmc main repo, but for now you can use my foked version of ligninkmc.

I got it working but now for some reason it is not recognizing the residues since in ligninkmc they are named S and G residues, but for LigninBuilder, they are SYR, etc. which are available in top_lignin.top file for the force field to acquire. Right now the workaround is to take the SMILES code from ligninkmc and use smilesdemo to get the right .tcl file with the correct residue names.

k0ryphae commented 3 years ago

Nevermind, this wasn't too bad to fix myself. step1.py now uses the new ligninkmc APIs, rather than the old ones from the beginning of 2019. I also have a pull request outstanding with the ligninkmc main repo, but for now you can use my foked version of ligninkmc.

I got it working but now for some reason it is not recognizing the residues since in ligninkmc they are named S and G residues, but for LigninBuilder, they are SYR, etc. which are available in top_lignin.top file for the force field to acquire. Right now the workaround is to take the SMILES code from ligninkmc and use smilesdemo to get the right .tcl file with the correct residue names.

Now when I do that, I get error message from vmd that:

Unable to load file 'startingstructure/syr.js' using file type 'js'.

jvermaas commented 3 years ago

Where are you running it from? startingstructure/syr.js is in the ligninbuilder directory, and so long as ligninbuilder is installed, the paths should be set by default accordingly. What commands are you running?