Closed jrjhealey closed 7 years ago
Hi Joe!
I don't know if you are running this from a Mac. I've run through several issues with Macs during the development so, as of now, is currently unsupported. I can only guarantee success when running from Linux...
That said, we can try! A few things:
1 - If you're running the script with the pychimera
binary, you don't need to call pychimera.patch_environ()
nor pychimera.enable_chimera()
. That's handled by the binary! However, you do need them if you're using the standard python
binary. Bottomline:
$ python yourscript.py # This requires the pychimera calls inside the script
$ pychimera yourscript.py # PyChimera must NOT be called now!
Since you are using argparse for your own needs, I recommend using the python call. This is, don't change anything in your script, but call it with python
(2.7).
2 - The envvar should point to the main chimera directory. This is, the one you get when running chimera --root
. Just remove the bin/
out of it and it will be fine.
3 - The error you are getting means that the module chimeraInit.py could not be found in the path. This is most probably due to the previous point. Anyway, if that's not the case, pychimera.patch_environ()
deals with this, and should include the CHIMERADIR/share
location in it. To check if that's right, please, include the following line before AND after the pychimera calls:
print(sys.path)
Thanks Jaime, this is a huge help! You're saving a considerable chunk of one of my thesis chapters ;)
I am running a Mac but all of the script execution is actually on a Linux (Ubuntu) server I'm SSHd to, so everything will work I hope?!
I see the distinction! I'll make the amendments you suggest when I'm back at my computer and see how I get on.
Yep, as long as the host running the script is Linux, you're fine. I've checked several Ubuntu installations and they all run fine. I think that the main issue you have is the CHIMERADIR envvar. Once that's solved, I think it will run OK ;)
I am also doing a PhD, so I know how you feel. Let me know if you need anything else, especially Python related! If you host it in a gist, I can fork it and PR the changes, since I am seeing a couple of issues at first sight.
Hi Jaime,
Thanks once again for your help here and over on Chimera users. I finished the script (though there are certainly still some bugs in it!). I may do as you say and put together a gist if I get around to it (I've posted a pastebin link over on the users forum in the meantime anyway if you're interested).
Pychimera is excellent (and I followed your suggestion of installing everything inside a miniconda environment which worked flawlessly).
Feel free to close this as I'm aware it's not really an 'issue'!
Thanks again,
Joe
It's a pleasure to see my coding efforts being helpful to others, so thanks to you!
Hi Jaime, thanks for your help so far over on the Chimera users forum. I've decided to try and implement what I wished to do via pychimera as you suggested but I think I might be in need of some help to get it going!
I'm trying to load the modules and patch the environment as you say but at coming up against the above. I'm guessing my syntax for the import or the patch is wrong somewhere.
I've exported the environment variable for the headless chimera bin already.
export CHIMERADIR="/home/wms_joe/Applications/CHIMERAHL1.11/bin/"
The script I'm working on is below, I'm pretty new to python and it's still very rough (and mostly probably non functional), but I include it in case you can point out the exact issue...