MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Manuale Utente Pagina 19

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 22
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 18
2. Under Programming Libraries in the right column, click the
zip link for the MATLAB library.
3. Download the zip file and unzip it into your
MATLAB7/toolboxes directory. If you do not have permission to
put files in that directory, unzip into any other directory.
4. After downloading and unzipping the files, add the directories to your MATLAB path:
1. At a MATLAB prompt, open the pathtool:
>>pathtool
2. Use the MATLAB pathtool to add the GenePatternServer and GenePatternFileSupport
directories, with subfolders, to the MATLAB search path.
Running a Program
This section explores a simple MATLAB program that runs a task, displays the resulting output, and loads it into a
MATLAB matrix for further analysis. The included code can be copied and pasted into your MATLAB client so that
you can try it out, modify it, and create your own solutions.
The first statements in the application initialize various settings, which you must do once in every application that
accesses GenePattern. You will need to customize the italicized GenePattern server URL and GenePattern user
name (typically, your e-mail address) with values appropriate for your GenePattern server.
% Create a GenePattern server proxy instance
gp = GenePatternServer('http://localhost:8080','[email protected]');
After initializing the required settings, the application runs the TransposeDataset task to transpose a dataset. This
example references the dataset using a publicly-accessible URL, but a filename would be equally valid. As shown
below, you can call the GenePattern methods directly or by calling the
runAnalysis method. When you call a
GenePattern method, such as
TransposeDataset, the GenePattern library invokes the task on the server,
passing all of the input parameters and input files. Control returns to your application when the task completes. (To
run a task asynchronously, invoke the method in a separate thread.)
% input dataset for transpose operation
params.output_file_name = 'transposed.out'
params.input_filename='http://www.broad.mit.edu/mpr/publications/projects/Leuk
emia/
ALL_vs_AML_train_set_38_sorted.res'
% transpose the dataset
transposeResult = gp.TransposeDataset(params)
% alternate call to transpose the dataset
transposeResult = runAnalysis(gp, 'TransposeDataset', params)
When the task completes, it returns a MATLAB structure that contains a list of filenames that are the output from the
task. In this example,
transposeResult is a structure with a list of filenames (of length 1, in this case). The
application displays the results in a file viewer window and also loads them into a matrix so that further manipulation
can be performed:
% display the transposed results
edit 'transposed.out.odf'
% now read the output into a matrix
% so we can do further manipulation in MATLAB
myData = loadGenePatternExpressionFile('transposed.out.odf')
You can combine GenePattern analyses with all of the rich functionality of MATLAB. For example, you can use
MATLAB's plotting methods to create graphic output, save modified matrices to files using save, or summarize and
report on the data using your own code. The basic idea to remember is that GenePattern tasks create result files and
those files are available to the MATLAB client for processing.
For a list of the GenePattern modules available on your server, run the
listMethods function on your
GenePatternServer object. To view the names of the input parameters for a module, use the
describeMethod function on your GenePatternServer object, passing it the module name.
% display the available GenePattern modules
listMethods(gp)
% now look at the parameters for the TransposeDataset module
describeMethod(gp, 'TransposeDataset')
19
Vedere la pagina 18
1 2 ... 14 15 16 17 18 19 20 21 22

Commenti su questo manuale

Nessun commento