This README file explains how to run the RNA motif code that was
used to produce the results in 
   Rob Knight, Hans De Sterck, Rob Markel, Sandra Smit, Alexander Oshmyansky, and Michael Yarus,
   `Abundance of correctly folded RNA motifs in sequence space, calculated on computational grids',
   Nucleic Acids Research 33, 5924-5935, 2005.

edit the application input file:
---------------------------------------
> cd #/distrJul2006/taskspaces/applications/ilehh
> vi ilehh_inputfile

This file contains the input parameters for the ilehh tasks.
You can use the parameters as they are, except for the
the webserver address in this file, which needs to be changed
to point to your webserver. With the parameters specified,
4 tasks will be performed (4 composition points, with 20%
steps in A, G, C, U composition), with 100 random sequences
per composition point, without GU bounds, and with sequences
of length 100 nucleotides. The motifs used are specified in an
xml format in the file
#/distrJul2006/taskspaces/applications/ilehh/motifs/IleStrictHHMinimal15dec03.xml .

Make sure to copy the file 'ilehh_inputfile' to your webserver.

(on my system, the above commands spelled out read:
cd /Users/desterck/Sites/distrJul2006/taskspaces/applications/ilehh
vi ilehh_inputfile
)

edit and copy the location of the input file:
--------------------------------------------------------
When you run the ilehh tasks (which can be done from
any application machine), the input file ilehh_inputfile
will be read from the webserver. When you start the ilehh
application, you will need to specify the URL of the
input file. This URL is specified in the file ilehh_inputfile_URLlocation,
which needs to be edited (put in the appropriate URL to ilehh_inputfile)
and then copied to the machine where you start the application.

to edit the URL location file:
> cd #/distrJul2006/taskspaces/applications/ilehh
> vi ilehh_inputfile_URLlocation
(change the URL to reflect your webserver).

Then copy the file 'ilehh_inputfile_URLlocation' to the machine
and directory where you will start the application (see below).

(on my system, the above commands spelled out read:
cd /Users/desterck/Sites/distrJul2006/taskspaces/applications/ilehh
vi ilehh_inputfile_URLlocation
)

run the application:
--------------------------
First start the TaskSpaces components as explained in the general
README file (start the task and result bags, and workers).
Then start the application:

> java Runner <webserver>/distrJul2006/taskspaces/properties/properties ilehh < ilehh_inputfile_URLlocation

(Make sure you start this in a directory where Runner.class is available.)
(Make sure the file ilehh_inputfile_URLlocation is available
here too, see above.)
(Make sure the C executable zepto_arg compiled for your
architecture is available on all worker machines; see below.)

After execution, the results are in the 'results' directory, in the file
'waterloo'. The file 'results/waterloo.status' contains the IDs of the tasks
that are received; remove or rename this file if you want to rerun
as only tasks that have not been received yet will be rerun.
(This can be used as a rudimentary fault-tolerance mechanism.)

(on my system, the above command spelled out reads:
java Runner hans-de-stercks-computer.local/~desterck/distrJul2006/taskspaces/properties/properties ilehh < ilehh_inputfile_URLlocation
)

modify and compile the code:
----------------------------------------
compile the ilehh application task:
> cd #/distrJul2006/taskspaces/applications/ilehh
> javac -classpath ../../../:../../xml/xerces-2_6_2/xercesImpl.jar:.: Ilehh.java

compile some additional rna utilities:
> cd #/distrJul2006/taskspaces/rna
> javac -classpath ../../:../xml/xerces-2_6_2/xercesImpl.jar:.: *.java

(on my system, the above commands spelled out read:
cd /Users/desterck/Sites/distrJul2006/taskspaces/applications/ilehh
javac -classpath ../../../:../../xml/xerces-2_6_2/xercesImpl.jar:.: Ilehh.java

cd /Users/desterck/Sites/distrJul2006/taskspaces/rna
javac -classpath ../../:../xml/xerces-2_6_2/xercesImpl.jar:.: *.java
)

compiling the Vienna folding code in C zepto_arg:
--------------------------------------------------------------------
We use the freely available Vienna RNA package
for the folding, which is written in C, see
http://www.tbi.univie.ac.at/RNA .

You need to compile our folding executable
zepto_arg for any architecture you want to run
a worker on, and then copy those zepto_arg
executables to the worker machines.

For your convenience we provide some of the Vienna routines,
and In order to compile zepto_arg, you can try to proceed
as follows:
> cd #/distrJul2006/zepto
> rm -rf *.o
edit the makefile for your system
> make
> gcc -c zepto_arg.c
> gcc -lm -o zepto_arg zepto_arg.o libRNA.a

Precompiled executables for macG5 and linux
are provided in #/distrJul2006/taskspaces/applications/ilehh:
zepto_arg_linux and zepto_arg_macG5 .
