If you're interested in Python and bioinformatics you've undoubtedly heard of Pymol.
If you're at a place that cares about molecular biology (my institution does not), you may even have a site license. I have a copy that I got for educational use about 3 years ago, and still have some examples that I made for a class I taught. That version has a Cocoa GUI.
There is also an open source version that is up on SourceForge (here). I thought it would be a good challenge to try to build the open source Pymol.
[ Update: I think the Cocoa GUI one is MacPymol here). I just noticed this on the legacy page. ]
The dependencies are listed in the README as:
Most of these are already present in Lion, so I didn't think it would be too difficult. What I failed to realize is that the Tcl/Tk in Lion is apparently messed up (brief SO discussion here).
I downloaded
pymol-v1.4.1.tar.bz2
from the main page at SourceForge, and did the standard distutils
thing:The first error was:
The top Google hit shows it's related to OpenGL and glut.
If present, there should be a file
glew.h
(and likely glut.h
).No glew.
works and we have
and we find "GLEW_OK defined on line 15273 of glew.h. Unfortunately, the build fails with a link error at the end:
So it seems that Homebrew has built x86_64, which can't work with what pymol is building (i386). What I should do is rebuild
libGLEW.dylib
with the correct architecture. I haven't accomplished that yet. Instead, I noticed a page that discusses this very same problem. One answer is in a different thread (here):Kasper, not sure if this will help you, but I think the GLEW stuff was
added recently in V1.4.x and it seems to be still somewhat experimental.
May be to get you started you could switch to v1.3r1 from the repository
and try to embedd that version. V1.3.x should not contain the new GL
stuff.
So let's try 1.3. I grabbed
pymol-1.3r2-src.tar.bz2
from here and it got past the previous problem but then dies with:It's looking in
/usr/X11R6
and can't find freetype which is in /usr/X11 (my post here).So.. I modify the
setup.py
in pymol:And now it builds.
But.. after doing
./pymol
the GUI hangs. I think it's Python (IDLE?), which I never use. However, I can get pymol to run from the command line with no GUI:
I ran a short script and made a figure, it looks fine.
So then, we get wise words from Ned Deily (here), and see (here)
- You should not rely on the Apple-suppled Pythons if you want to use IDLE.
I thought about putting Tcl/Tk 8.4 in a different place, etc.
But finally I said (f*** it) and I reformatted my drive to add a new partition, and then used my USB flash drive with the Lion Installer (post here), and then I installed MacPorts and did
Incredible! Everything but the kitchen sink. Perhaps even more incredible, it worked. An hour or two later, we finish with:
I got 1LMB.pdb from the PDB, and I ran this script with
pymol script.pml
:and I got what's at the top of the post. Pretty cool! More later on this topic.