MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Manual do Utilizador Página 5: Creating Tasks

●
Use parameter flags.
When designing the program and its command line, use parameter flags (for example, -f
input_file
) rather than relying on parameter positions. Parameter flags allow users to build command lines with
variable numbers of arguments, which makes it easy to omit optional parameters.
When writing R code, if you have optional input parameters on the command line, you must use named rather
than positional parameters in the command line definition; for example:
input.filename=<input.filename>
. If you name all of the parameters, then you can use ellipses
rather than listing the parameter names in the function definition (for example:
myfunc <-
function(...)
) at the expense of clarity in documenting input parameters.
●
Process all parameters as strings.
All command line parameters are passed to your code as strings, even if a
parameter is apparently numeric. If your code expects a numeric argument, explicitly convert the string argument
to a number; for example, as.integer(arg).
●
Avoid absolute pathnames.
When writing code to be used with GenePattern, avoid absolute pathnames. For
example, in perl, specify the interpreter on the command line rather than embedding the interpreter in the script;
that is, use the command line “
perl myscript
” rather than including ”
#!/usr/bin/perl
” as the first line
of the
myscript.pl
file.
●
Avoid Windows forbidden filenames.
Machines running Windows cannot accept files with the following
names, regardless of the file extension: con, prn, aux, nul, com1, com2, com3, com4, lpt1, lpt2, lpt3. For cross-
platform compatibility, avoid files with these names.
●
Adapting R code.
When you create a task in GenePattern, you specify the command line that invokes the
program that performs the desired function. Generally, the command line includes arguments, such as the
parameters for the algorithm and the data file to analyze. For example, the following command line invokes the
myfunc()
function in the R script named
myscript.R
, passing a single parameter,
input.filename
:
<R> <libdir>myscript.R myfunc <input.filename>
Calling R script from a command line is possible, but generally not useful because you cannot pass arguments to
the script. To pass arguments to your R code, create a function. For example:
myfunc <- function ( input.filename )
... (your R-code here)

Creating Tasks

To create a task that invokes the program that you have written, use the GenePattern Web Client:
1.
Display the Web Client home page. (If you are unfamiliar with the GenePattern Web Client, see the
Web Client
Guide
.)
2.
Open the task definition form in one of the following ways:
▪
Click
Create
in the Tasks pane.
▪
Click
create task
under Tasks and Pipelines in the right column.
▪
View or edit a task and use the
Clone
button to create an identical task.
The Web Client displays the task definition form:
5

Ficheiro PDF · ·

Imprimir

Imprimir documento

Partilha

Perguntas sobre MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE

Ainda não há perguntas sobre este manual. Faça a primeira.

Fazer uma pergunta

Respondemos a partir do manual e indicamos a página. A pergunta é publicada no site depois de verificada.

Todas as perguntas e respostas ›

Manuais e produtos relacionados com Software MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE