UNAFold 3.8, MFold Utilities 4.5/4.6 And Additional Component Installation (Using XCode Tools 3 And Fink 0.29.21) For OSX 10.6.x

NOTE: The version numbers for everything are given specifically because aspects of the installation process may change with different versions and, in the event, I will not necessarily know the answer to subsequent problems if major version changes include major changes to the below (and that should clear up the “qualifications” section).

The UNAFold (UNified Nucleic Acid Fold(ing)) nucleic acid folding and hybridization prediction program set (here using version 3.8) can by itself be built with few (and not important) errors in OSX with Xcode Tools 3. The actual running of UNAFold.pl produces several errors that do not affect the run but do affect the amount/format of the output. It is my assumption that any OS running a less-than “kitchen sink” installation of Linux/Unix (Ubuntu, gentoo and Damn Small Linux come to mind) will have these errors and will require subsequent installations of programs/libraries that pieces of UNAFold rely on for processing output into, specifically, images and PDF files. OSX has the same issue that is easy to handle using Fink (and less so trying to install otherwise completely unrelated programs to make these “dependencies” (programs and libraries) available to UNAFold). Once Fink is installed, it is a few-step process to build UNAFold, move the Mfold Utilities contents to their proper folders (and there is a small trick here as well), and generate a UNAFold-complete install for all your DNA/RNA needs.

1. UNAFold 3.8 Installation

To begin, download (currently at mfold.rna.albany.edu/?q=DINAMelt/software), extract, open a terminal, cd into the unafold_3.8 directory (likely ~/Downloads/unafold_3.8), and run ./configure.

[prompt]$ cd ~/Downloads/unafold_3.8
[prompt]$ ./configure

On my machine (MacBook Pro, 10.6.x OSX + XCode Tools 3), this produces the output found in the local file 2011june_unafold_configure_output.txt.

You will likely note two sets of errors in the ./configure output:

./configure: line 8579: sort: No such file or directory
./configure: line 8576: sed: No such file or directory
./configure: line 10077: sort: No such file or directory
./configure: line 10074: sed: No such file or directory

The 10077 and 10074 errors are a bit odd because there are only 10039 lines in the configure file.

Are these errors important? No, you can build UNAFold just fine. I have run into these two “sort” and “sed” problems with a few other build attempts in OSX but have no good answer as to how to get around them (in case you’re wondering, sort and sed are most certainly installed on the machine. The “sort” error can be removed by specifying the path explicitly in the configure file (in line 8579, change “sort” the “/usr/bin/sort”), but the sed error persists in the few attempts I tried to work around it. It doesn’t appear to be a simple PATH issue. I’m not yet interested enough in finding a proper solution but, if you know, please post a comment or send a message. Is it just a character issue as discussed at itmercenary.livejournal.com/1585.html?).

running “make” produces the output found in the local file 2011june_unafold_make_output.txt.

[prompt]$ make

No issues. To install UNAFold, which will default to putting components into /usr/local/bin and /usr/local/share/, run sudo make install, which produces the output found in the local file 2011june_unafold_sudo_make_install_output.txt.

[prompt]$ sudo make install

Again, no issues. You will now have a populated /usr/local/bin folder.

2. MFold Utilities 4.5 (and, currently, the source for 4.6)

The next (optional) step is the inclusion of the mfold_util-4.5-Mac binaries (currently available at mfold.rna.albany.edu/?q=mfold/download-mfold), which I’ve also placed into the /usr/local/bin folder by extracting the contents of this file, them performing a cp * /usr/local/bin from within the MacBin directory.

[prompt]$ cd ~/Downloads/MacBin/
[prompt]$ sudo cp * /usr/local/bin

The processing of the data into plots with these programs requires that a set of *.col files be placed in the folder /usr/local/shared/mfold_util. Furthermore, these *.col are NOT provided in the mfold_util-4.5-Mac binary package. To get these files, you need only download the mfold_util-4.6.tar.gz file (currently at mfold.rna.albany.edu/?q=mfold/download-mfold), cd your way into src, make the /usr/local/shared/mfold_util folder, and copy the *.col files to /usr/local/shared/mfold_util.

[prompt]$ sudo mkdir /usr/local/shared/mfold_util
[prompt]$ cd Downloads/mfold_util-4.6/src
[prompt]$ sudo cp *.col /usr/local/shared/mfold_util

3. Fink 0.29.21 Install From Scratch

The first indication that other work was required came from trying to run mutplot randomly, which produced the following error:

dyld: Library not loaded: /sw/lib/libpng12.0.dylib
  Referenced from: /usr/local/bin/mutplot
  Reason: image not found
Trace/BPT trap

As digging around for libraries is not as straightforward as it would be for a Linux distro, I chose instead to solve the many problems by installing dependencies through the Fink program (currently fink-0.29.21). As 10.6.x users will find that there is no available Fink binary, you must build this from the source (which, with Xcode Tools 3 installed, occurs without error. If you don’t have Xcode Tools 3 installed, the new mechanism for buying a copy of XCode Tools 4 is less than ideal (to me, anyway. $4.99?) but now occurs through the App Store).

Download the fink source (fink 0.29.21), extract, cd into the fink-0.29.21 directory, and run bootstrap. Upon completion, you run pathsetup.sh, source your .profile, and update fink.

[prompt]$ cd ~/Downloads/fink-0.29.21
[prompt]$ ./bootstrap
[prompt]$ . /sw/bin/pathsetup.sh 
[prompt]$ cd ~/
[prompt]$ source .profile
[prompt]$ fink selfupdate-rsync
[prompt]$ fink update-all

The output for my installation can be found in 2011june_fink_install_output.txt. The rsync output can be found in 2011june_fink_selfupdate_rsync_output.txt. NOTE: You will be asked several questions about the installation process. Be prepared to blindly select the default settings with [enter], but don’t just walk away from the screen.

This completes the UNAFold install, MacBin install, and Fink install, meaning now we can walk through the dependencies.

4. Installing UNAFold (well, MFold Utils) Dependencies

First dependency-free UNAFold.pl run attempt produces the following error:

[prompt]$ UNAFold.pl seqtest.txt 
Checking for boxplot_ng... dyld: Library not loaded: /sw/lib/libpng12.0.dylib
  Referenced from: /usr/local/bin/boxplot_ng
  Reason: image not found
found, supports Postscript
Checking for hybrid-plot-ng... found, supports Postscript
Checking for sir_graph_ng or sir_graph... dyld: Library not loaded: /sw/lib/libpng12.0.dylib
  Referenced from: /usr/local/bin/sir_graph
  Reason: image not found
found, supports Postscript
Checking for ps2pdfwr... not found
Calculating for seqtest.txt, t = 37

As the UNAFold install page states, you need glut, the GD library, and gnuplot installed (and all of the many libraries therein).

[prompt]$ fink install libjpeg tetex gd2 gnuplot

For gnuplot, you will be required to make a few selections during the build process (blindly hitting the enter key at these questions will do, but this is not just a “type and go” install process. And it took about two hours on a MBP).

A final working error-free run looks as below, leaving you to process the data with the MFold Utilities as you like:

[prompt]$ UNAFold.pl seqtest.txt 
Checking for boxplot_ng... found, supports Postscript
Checking for hybrid-plot-ng... found, supports Postscript
Checking for sir_graph_ng or sir_graph... found, supports Postscript
Checking for ps2pdfwr... found
Calculating for seqtest.txt, t = 37

chown/chmod Your Way To A Backup Free Of The MemeodHelper Error in OSX 10.6.x (Snow Leopard) & A Seagate Vs. Western Digital Experience

UPDATE – 29 September 2010: In my usual policy of *nix-based deference to anything Perry Metzger has to say (other areas, too, but specifically here), I note that my procedure has the potential to mangle whatever is using Memeo (although I’ve not had anything go bump in the night yet). For those less than interested in the surgery below, your most safest bet is to crack open a Terminal window and sudo cp -R /Users/[you] /Volumes/[Your Backup Drive] (assuming you’ve activated the root password in OS X, of course). That is all.

There isn’t too much of this online so I thought I’d provide my fix. As background, I like the idea of having constant capsules of my MacBook Pro (MBP) sitting on a Time Capsule drive, but I am constantly up-and-running with my MBP and am rarely sitting in front of a machine long enough to let full writes be written to some backup drive (and, as any quantum chemist worth their salt is generating scores of files on an hourly basis, my laptop is constantly undergoing changes). Long story short – I want to spend one hour at my choosing to turn off wireless, close all my open programs, copy my User directory, and paste it onto an external drive. That’s it.

Finally upgrading to 10.6.4 (by way of a new 13.3″), my first attempt to backup the first clean copy of the complete migration from my old 15″ went all of 20 minutes before the following error popped up on my screen:

The operation can’t be completed because you don’t have permission to access “MemeodHelper.”

There is ONE other mention of this issue and it’s present on the Apple Support forum at:

discussions.apple.com/thread.jspa?messageID=11237019&tstart=0

I guess the two of us are the oddballs for not sticking to the OSX program suite.

The solution is to simply change the permissions so that you, the user, DOES have access to read + write this file. I tried a Right Click – Get Info – Sharing & Permissions fix only to discover I DID have Read & Write access. Clearly, I am not the owner of this file. Taking the next proper step…

Applications –> Utilities –> Terminal

cd ~/Library/Application\ Support/Memeo
ls -al

…we see that the permissions set for the MemeodHelper file are as follows:

-r-sr-xr-x

r = read
x = execute
s = domain socket

And that the owner is root (not you). The ownership problem explains the inability to read + write this file. And, I have never seen an “s” in all my days digging around in Terminal (had to look it up to see what it meant. Hail Wikipedia).

This “s” and the missing “w” for you, the user, is the problem. The solution is to allow you (the user) to write and execute this file, which I have chosen to do by simply changing the user ownership and the permissions. The steps are as follows (userid = the userid that shows up for the “..” and “.” (shown above this file with an ls –al)):

sudo chown userid MemeodHelper

It will ask for a password – your user password will do.

chmod u+wrx MemeodHelper

This changes the ownership permissions for MemeodHelper.

That’s it. You should now be able to copy + paste your User directory (HOME) to another drive. By Firewire 800, I’m copying 220 GB in about 56 minutes, which I cannot complain about. To date (after a week), I’ve had no machine issues with my change to MemeodHelper and have found no other people having complaints. If you discover something, by all means say something.

And, to continue to discussion, I had the most miserable experience migrating from Seagate FreeAgent USB 2.0 drives used with a Windows XP backup machine to the point that I bought and returned them over 24 hours, with these drives unable to reliably write files larger than 500 MB (and one of the two I bought for my global backup would spontaneously unmount itself. Not cool).

My solution was to spend extra money and pick up Western Digital 2 TB My Book Studio LX (for Mac) USB 2.0/Firewire 800 external drives (and I am using them as Firewire devices). I am presently very happy with this setup.