The
chmod line sets the executable permission on the executable file; by default, the GenePattern server does not
set this permission for uploaded files.
On Mac OS X, for example, to launch the MATLAB executable
analyzeThis.exe, create a launcher script,
mll
aunch.sh, that contains the following lines:
#!/bin/sh
export MCR_ROOT=/Volumes/os9/gpserv
export LD_LIBRARY_PATH=$1:/Volumes/os9/matlab7.2/sys/os/mac:
/Volumes/os9/matlab7.2/bin/mac/
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
export PATH=$1:$PATH
chmod a+x $1/writeToFile
writeToFile $2 "$3"
The chmod line sets the executable permission on the executable file; by default, the GenePattern server does not
set this permission for uploaded files.
Writing the Module Command Line
On the GenePattern task definition form, write a command line calls the launcher script, passing the <libdir>
parameter as the first argument (so that it can be added to the path).
On Windows, the following command line calls the launcher script,
mllaunch.bat:
<libdir>mllaunch.bat <libdir> <param1> <param2>
On Linux or Mac OS X, the following command line calls the launcher script, mllaunch.sh:
sh <libdir>mllaunch.sh <libdir> <param1> <param2>
In both command lines, the first <libdir> sets the path to the mllaunch script. The second <libdir> is passed as the
first argument to the script so that the script can add this directory to the appropriate environment variables. The
<param1> and <param2> variables are parameters to the MATLAB application, which you define in the task definition
form and specify in the command line as usual.
Adding Support Files
For the compiled approach, you must specify at least two support files for the MATLAB application: the executable file
and .ctf file. If your application requires additional files for its execution, also add those files as support files.
Distribution Licensing
Should you choose to distribute your MATLAB based module to others, you must ensure you are in compliance with
the MATLAB licensing agreement:
http://www.mathworks.com/company/aboutus/policies_statements/agreement.pdf
Following are a few key points for GenePattern developers:
● You may not distribute code that uses MATLAB and that competes with any of The MathWorks products.
● You may not modify or remove any license file included with the MCR Libraries.
● Users of your GenePattern modules must be made aware of the MATLAB license agreement in documentation
and accept it before installing your modules.
● Your MATLAB application must have an about box or equivalent "visible" location that includes the legend
"MATLAB copyright 1984-
yyyy the MathWorks Inc.", where yyyy is the year you released your module.
Please refer to the MATLAB licensing agreement for exact details. You are responsible for reviewing and complying
with the MATLAB software license. The above summary does not exempt you from this responsibility.
Example: Deploying a Compiled MATLAB Application
This section provides a step-by-step example of deploying a simple M-file application as a GenePattern module on a
GenePattern server. Where the instructions are platform specific, the example shows instructions for Windows, Linux,
and Mac OS X.
13
Commenti su questo manuale