Introduction
This guide assumes that you are a programmer and familiar with GenePattern. If you are new to GenePattern, work
through the
GenePattern Tutorial before reading the more detailed information in this guide.
As a programmer, you generally work with GenePattern in one of two ways:
● Creating GenePattern tasks. Each GenePattern task invokes a program that executes a desired function. You
can use any language to write a program that can then be invoked as a GenePattern task. For more information,
see:
▪
Writing Modules for GenePattern: This section provides tips for writing code that will be invoked as a
GenePattern task.
▪
Writing MATLAB Modules for GenePattern: This section describes how to address MATLAB licensing and
distribution issues. Read this section if you are writing MATLAB code that will be invoked as a GenePattern
task.
● Accessing GenePattern from Java, MATLAB, or R. GenePattern libraries for these three programming
environments make it easy for your applications to run GenePattern tasks and retrieve analysis results. Each
library supports arbitrary scripting, access to GenePattern modules via function calls, and development of new
methodologies that combine modules in arbitrarily complex combinations. For more information, see:
▪ Using GenePattern from Java
▪
Using GenePattern from MATLAB
▪ Using GenePattern from R
Writing Modules for GenePattern
Creating a GenePattern task is a two-step process:
1. Write a program that executes the desired function. For more information, see Guidelines for Writing Programs
for GenePattern Modules
.
2. Use the GenePattern Web Client to create a GenePattern task that invokes the program that you have written.
For more information, see
Creating Tasks.
Guidelines for Writing Programs for GenePattern Modules
When writing a program that will be run as a GenePattern task, keep in mind the following:
● Use the programming language of your choice. You can write the program in the language of your choice.
You can use a compiled language, such as C, to create an executable or you can use a scripting language, such
as Perl, to create a script that is run by an interpreter.
● Write messages to standard error and standard output. GenePattern tasks are run on the server. The user
provides arguments and retrieves results, but does not interact during task execution. If necessary, write normal
output to standard output (stdout) and error messages to standard error (stderr); avoid writing error messages to
standard output. GenePattern captures stdout and stderr in log files, which can be retrieved by the user.
● Write output files to the current working directory. When a task completes, GenePattern displays the output
files that are in the current working directory. Files written to other locations are not displayed as task output files
(otherwise known as analysis result files).
● Read module data files from <libdir>. If your module needs to read from any data files which are part of the
module (rather than user input), it will need to know the directory where the module lives on the server; that is,
<libdir>.
● Read and write standard GenePattern file formats. When reading and writing data files, you generally want to
use the standard GenePattern file formats, as described in
File Formats. This makes it easier for users to
analyze their data using a combination of GenePattern modules. If you choose to use your own unique file
formats, be aware that other GenePattern modules will not be able to read those files.
For Java, MATLAB, and R, GenePattern provides libraries that include methods for reading and writing
GenePattern files (such as res, gct, and odf files). These libraries are designed for accessing GenePattern from
the Java, MATLAB, and R environments, but are also useful when writing modules to be invoked by
GenePattern. For instructions on downloading the libraries, see
Using GenePattern from Java, Using
GenePattern from MATLAB
, or Using GenePattern from R.
4
Commenti su questo manuale