Archive for August, 2010

Thursday’s new experience

Thursday, August 12th, 2010

Installing the UCSC Genome Browser

At first glance, this looks pretty much idiot-proof, unlike a lot of tools there is a detailed instruction guide, so I thought it would be dead simple.

Hurdle 1, echo $MACHTYPE tells me i386-apple-darwin0.9 The instructions assure me that MACHTYPE will be simple and non-hyphenated. Thinking i’m clever, I type $ export MACHTYPE=i386 then run make libs, and it throws a wobbly about the hyphens in i386-apple-darwin0.9. So off to being more sensible, and editing MACHTYPE in ./profile.

Mistake 1, assuming that MYSQLLIBS and MYSQLINC are set…fix that. Mistake 2, assume you have installed mysql in a standard place, and then fix that.

Mild confusion 1, unzipping does not give ./kent. Ignore this.
make libs works…the next step cd hg
make compile
does not…google time!
First problem here was:

ld: warning in /usr/local/mysql-5.1.49-osx10.5-x86_64/lib/libmysqlclient.a, file is not of required architecture
So I decided to try another version of mysql which gets past that, then I ran into the same problem as this guy. I went for editing to SSL=0, as it seemed the quickest (though I am not sure about suggestion 2, as I downloaded the files today and it was set to SSL=1).

Taming the Python

Wednesday, August 11th, 2010

So, last night with a little help from Dave, I got a little further in the Python adventure. He suggested setting up a Virtual Environment and trying to install the packages there. In the end, I went with numpy 1.2.0, scipy 0.8, matlibplot 1.0 (0.99 seems to have issues on OSX), but hit a brick wall with rpy. The first problem was rpy is old. Very old. The regex used to try and find your R version number only allowed for \d.\d.\d – I am on R 2.11.1, so I fixed the regex and all was well, but I managed to get an awful lot of other warnings/errors. By this time it was 12:20am, and i’d been trying on and off for 12 hours to get this to work.

This morning I took a fresh approach…enter an old windows laptop, no python install, very old R (2.4!). I instaled python 2.5 (from the .msi), numpy 1.1.0 (from .exe), scipy 0.7 (from .exe), matplotlib 0.99 (from .exe), tried importing and scipy claimed it wanted numpy 1.2.0, so installed that (some good version checking there on checking minimum requirements for the script i’m trying to run…). When I tried importing matplotlib it decided it needed win32api, so had a bit of a google and installed PyWin32, which fixed the matplotlib issue. I then installed rpy 1.0.3 (from .exe) which worked!

Had a bit of a faff trying to sort out the paths, it’s been so long since I used windows I had to check where the System Variables thing is, then when I added R and Python they didn’t come up in the path. After some head scratching, I went with path = %PATH%;C:\python26
and then the same for R.

The script is now running…if it works, I might tell you all what it is 😉

Adventure with a Python

Tuesday, August 10th, 2010

No, not the big snakey kind, just my first attempt to get something working in Python. One of the first things I did when I got my laptop back in 2007 was install all the developer tools. The first thing I did was install a shiny new (well, slightly tarnished in the face of Python v3!) copy of 2.7.

This turned out to be mistake number 1. The script I was trying to run requires numpy, scipy, matlibplot and rpy. numpy installs from a binary no probs, I think “ooh this is easy”, I then realise there wasn’t a binary for scipy that worked with 2.7. No problem, i’ll go simpler. Python apparantly has something called easy_install – yay! $ easy_install scipy …all runs through. I ran python, then tried import scipy, oh, it hasn’t found it. Sneaking suspicion sinks in, and I discover Python 2.5 lurking. OK, no problems, just download scipy.gz (not it’s real name ;-)), uncompress, fiddle in the command line, wait a while (the README warns that this can take an hour on a slow computer, and then everything fails. Realise I forgot to “sudo”, wait another 10 mins, fails again. Sulk a bit. Hit google. Apparantly scipy and 2.7 can be a pain.

Give up. Install python 2.6, install numpy, scipy, matlibplot. Feel smug. Decide to update R, as there is a new version (clearly not learning from the Python mistake here).

So i’m still stuck on rpy, it seems to think it has installed, but none of the python family are capable of importing it. Perhaps, after frustrating me for the afternoon, I will head home, try again and it will work first time.