at.tugraz.genome.R.carmaweb.axis
Class AxisClient

java.lang.Object
  |
  +--at.tugraz.genome.R.carmaweb.axis.AxisClient
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SSLAxisClient

public class AxisClient
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static java.lang.String FUN_ADDFILE
           
static java.lang.String FUN_ADDSTEP_AFFY_NORMALIZATION
           
static java.lang.String FUN_ADDSTEP_TWOCOLOR_PREPROCESSING
           
static java.lang.String FUN_ERRORMESSAGE
           
static java.lang.String FUN_GENERATEID
           
static java.lang.String FUN_GETFILE
           
static java.lang.String FUN_GETSTATUS
           
static java.lang.String FUN_JUSTAFFYNORMALIZATION
           
static java.lang.String FUN_LISTFILES
           
static java.lang.String FUN_PERFORM_GO_ANALYSIS
           
static java.lang.String FUN_REMOVEFILE
           
static java.lang.String FUN_START_DEFINED_ANALYSIS
           
static java.lang.String FUN_VOIDEVAL
           
static java.lang.String STATUS_ERROR
           
static java.lang.String STATUS_FINISHED
           
static java.lang.String STATUS_RUNNING
           
static java.lang.String STATUS_UNKNOWN
           
 
Constructor Summary
AxisClient()
           
AxisClient(java.util.Properties props)
           
 
Method Summary
 java.lang.String addStepAffyNormalization(java.lang.String id, java.lang.String[] files, java.lang.String method, boolean historaw, boolean histonorm, boolean save, boolean mas5calls)
          Adds a Affymetrix GeneChip preprocessing step to the analysis.
 java.lang.String addStepTwoColorPreprocessing(java.lang.String id, java.lang.String[] files, java.lang.String source, java.lang.String wtfun, boolean createGAL, java.lang.String galfile, java.lang.String averageSignal, java.lang.String bgCorr, java.lang.String withinNorm, java.lang.String betweenNorm, boolean save, boolean plots)
          Adds a two color microarray preprocessing step to an analysis.
 java.lang.String generateID()
          Generated a unique ID for the analysis.
 java.lang.String getErrorMessage(java.lang.String id)
          Returns the specific error message of the analysis if one exists.
 java.io.File getFile(java.lang.String id, java.io.File workspace, java.lang.String filename)
          Downloads a file from the workspace on the server to the local filesystem.
 javax.activation.DataHandler getFile(java.lang.String id, java.lang.String filename)
          Returns a DataHandler of a file that is stored in the workspace on the server.
static AxisClient getInstance()
          Returns an instance of class AxisClient.
static AxisClient getInstance(java.util.Properties props)
          Returns an instance of class AxisClient.
 java.util.Properties getProperties()
          Returns the Properties.
 java.lang.String getStatus(java.lang.String id)
          Returns the status of the analysis.
 java.lang.String[] listFiles(java.lang.String id)
          Lists all files that are stored in the workspace on the server.
 java.lang.String performGOAnalysis(java.lang.String id, java.lang.String goFile, java.lang.String llColumn, java.lang.String allGOFile, java.lang.String allLLColumn, java.lang.String affyChip, boolean drawDAG, java.lang.Float pCut, boolean mf, boolean cc, boolean bp)
          Performs a Gene Ontology analysis using the GO and GOstats packages from BioConductor.
 java.lang.String performJustAffyNormalization(java.lang.String id, java.lang.String method, boolean historaw, boolean histonorm, boolean save, boolean mas5calls)
          Performs just an Affymetrix GeneChip normalization.
 void removeFile(java.lang.String id, java.lang.String filename)
          Delete a file in the workspace.
 java.lang.String sendFile(java.lang.String id, java.io.File file)
          Sends a file to the web service.
 void setProperties(java.util.Properties props)
          Sets the Properties.
 java.lang.String startDefinedAnalysis(java.lang.String id)
          Starts an already defined analysis.
 java.lang.String voidEvalExpression(java.lang.String id, java.lang.String command)
          Evaluates the R command sent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FUN_GENERATEID

public static final java.lang.String FUN_GENERATEID
See Also:
Constant Field Values

FUN_ADDFILE

public static final java.lang.String FUN_ADDFILE
See Also:
Constant Field Values

FUN_GETFILE

public static final java.lang.String FUN_GETFILE
See Also:
Constant Field Values

FUN_LISTFILES

public static final java.lang.String FUN_LISTFILES
See Also:
Constant Field Values

FUN_GETSTATUS

public static final java.lang.String FUN_GETSTATUS
See Also:
Constant Field Values

FUN_ERRORMESSAGE

public static final java.lang.String FUN_ERRORMESSAGE
See Also:
Constant Field Values

FUN_VOIDEVAL

public static final java.lang.String FUN_VOIDEVAL
See Also:
Constant Field Values

STATUS_RUNNING

public static final java.lang.String STATUS_RUNNING
See Also:
Constant Field Values

STATUS_ERROR

public static final java.lang.String STATUS_ERROR
See Also:
Constant Field Values

STATUS_FINISHED

public static final java.lang.String STATUS_FINISHED
See Also:
Constant Field Values

STATUS_UNKNOWN

public static final java.lang.String STATUS_UNKNOWN
See Also:
Constant Field Values

FUN_REMOVEFILE

public static final java.lang.String FUN_REMOVEFILE
See Also:
Constant Field Values

FUN_START_DEFINED_ANALYSIS

public static final java.lang.String FUN_START_DEFINED_ANALYSIS
See Also:
Constant Field Values

FUN_ADDSTEP_AFFY_NORMALIZATION

public static final java.lang.String FUN_ADDSTEP_AFFY_NORMALIZATION
See Also:
Constant Field Values

FUN_JUSTAFFYNORMALIZATION

public static final java.lang.String FUN_JUSTAFFYNORMALIZATION
See Also:
Constant Field Values

FUN_ADDSTEP_TWOCOLOR_PREPROCESSING

public static final java.lang.String FUN_ADDSTEP_TWOCOLOR_PREPROCESSING
See Also:
Constant Field Values

FUN_PERFORM_GO_ANALYSIS

public static final java.lang.String FUN_PERFORM_GO_ANALYSIS
See Also:
Constant Field Values
Constructor Detail

AxisClient

public AxisClient()

AxisClient

public AxisClient(java.util.Properties props)
Method Detail

getInstance

public static AxisClient getInstance()
Returns an instance of class AxisClient. The default properties file packaged in the jar file will be read.

Returns:
an instance of AxisClient.

getInstance

public static AxisClient getInstance(java.util.Properties props)
Returns an instance of class AxisClient.

Parameters:
props - Properties containing properties ws.url and mantain.session where ws.url represents the url to the web service to use and mantain.session should be true or false.
Returns:
an instance of class AxisClient.

sendFile

public java.lang.String sendFile(java.lang.String id,
                                 java.io.File file)
                          throws java.lang.Exception
Sends a file to the web service. Before calling this method, the method generateID should be called to get an ID.

Parameters:
id - the ID for the session / analysis.
file - the file that should be sent to the web service.
Returns:
Returns the ID.
Throws:
java.lang.Exception - any exception that might be thrown.

generateID

public java.lang.String generateID()
                            throws java.lang.Exception
Generated a unique ID for the analysis. Each analysis gets its own workspace on the server where all analysis files and results are stored. Each of this workspaces is only accessible through its ID.

Returns:
An unique ID for each analysis.
Throws:
java.lang.Exception

getFile

public javax.activation.DataHandler getFile(java.lang.String id,
                                            java.lang.String filename)
                                     throws java.lang.Exception
Returns a DataHandler of a file that is stored in the workspace on the server.

Parameters:
id - The ID for the corresponding workspace / analysis.
filename - The name of the file that should be downloaded.
Returns:
The DataHandler of the file that should be downloaded.
Throws:
java.lang.Exception

getFile

public java.io.File getFile(java.lang.String id,
                            java.io.File workspace,
                            java.lang.String filename)
                     throws java.lang.Exception
Downloads a file from the workspace on the server to the local filesystem.

Parameters:
id - The ID of the corresponding analysis / workspace.
workspace - The directory on the local filesystem where the file should be downloaded to.
filename - The name of the file that should be downloaded.
Returns:
The downloaded file.
Throws:
java.lang.Exception

listFiles

public java.lang.String[] listFiles(java.lang.String id)
                             throws java.lang.Exception
Lists all files that are stored in the workspace on the server.

Parameters:
id - The ID of the corresponding analysis / workspace.
Returns:
An array of all filenames.
Throws:
java.lang.Exception

getStatus

public java.lang.String getStatus(java.lang.String id)
                           throws java.lang.Exception
Returns the status of the analysis.

Parameters:
id - The ID of the corresponding analysis.
Returns:
Returns RUNNING, ERROR or FINISHED. Currently the function returns also running if the analysis is not yet started!
Throws:
java.lang.Exception

getErrorMessage

public java.lang.String getErrorMessage(java.lang.String id)
                                 throws java.lang.Exception
Returns the specific error message of the analysis if one exists.

Parameters:
id - The ID of the corresponding analysis.
Returns:
The error message.
Throws:
java.lang.Exception

voidEvalExpression

public java.lang.String voidEvalExpression(java.lang.String id,
                                           java.lang.String command)
                                    throws java.lang.Exception
Evaluates the R command sent.

Parameters:
id - The ID of the corresponding analysis.
command - The command that should be evaluated.
Returns:
The ID.
Throws:
java.lang.Exception

removeFile

public void removeFile(java.lang.String id,
                       java.lang.String filename)
                throws java.lang.Exception
Delete a file in the workspace.

Parameters:
id - The ID of the corresponding analysis / workspace.
filename - The filename of the file that should be deleted.
Throws:
java.lang.Exception

performGOAnalysis

public java.lang.String performGOAnalysis(java.lang.String id,
                                          java.lang.String goFile,
                                          java.lang.String llColumn,
                                          java.lang.String allGOFile,
                                          java.lang.String allLLColumn,
                                          java.lang.String affyChip,
                                          boolean drawDAG,
                                          java.lang.Float pCut,
                                          boolean mf,
                                          boolean cc,
                                          boolean bp)
                                   throws java.lang.Exception
Performs a Gene Ontology analysis using the GO and GOstats packages from BioConductor. The files specified in this call have to be downloaded first to the web service!

Parameters:
id - The ID of the corresponding analysis / workspace.
goFile - The name of the file that contains the EntrezGene (LocusLink) IDs of the genes for which the GO analysis should be performed.
llColumn - The name of the column in the file goFile that contains the IDs.
allGOFile - The file containing the EntrezGene IDs of all genes that can be detected with the microarray used (Affymetrix users can specify the name of the GeneChip instead of this file).
allLLColumn - The name of the column in the allGOFile file that contains the IDs.
affyChip - The name of the Affymetrix GeneChip used (e.g. hgu133plus2, ...).
drawDAG - If a directed acyclic graph of the GO terms should be drawn.
pCut - The p value below which the nodes should be colored in red.
mf - Map the genes to the molecular function ontology.
cc - Map the genes to the cellular component ontology.
bp - Map the genes to the biological process ontology.
Returns:
The ID (the same as submitted). The ID can be used to retrieve the status of the analysis and the results can be downloaded upon completion of the analysis.
Throws:
java.lang.Exception

performJustAffyNormalization

public java.lang.String performJustAffyNormalization(java.lang.String id,
                                                     java.lang.String method,
                                                     boolean historaw,
                                                     boolean histonorm,
                                                     boolean save,
                                                     boolean mas5calls)
                                              throws java.lang.Exception
Performs just an Affymetrix GeneChip normalization.

Parameters:
id - The ID for the corresponding analysis / workspace where the raw data files (CEL files) where uploaded.
method - The method that should be used for the preprocessing (rma, justRMA, justGCRMA, gcrma, mas5 (justRMA and justGCRMA should be used for a large number of CEL files))
historaw - If a histogram of the raw intensities should be drawn.
histonorm - If a histonorm of the normalized data should be drawn.
save - If the normalized expression values should be saved to a file (with the default filename ExpressionValues.txt).
mas5calls - If mas5 present calls should be calculated.
Returns:
The ID (the same as submitted). The ID can be used to retrieve the status of the analysis and the results can be downloaded upon completion of the analysis.
Throws:
java.lang.Exception

addStepAffyNormalization

public java.lang.String addStepAffyNormalization(java.lang.String id,
                                                 java.lang.String[] files,
                                                 java.lang.String method,
                                                 boolean historaw,
                                                 boolean histonorm,
                                                 boolean save,
                                                 boolean mas5calls)
                                          throws java.lang.Exception
Adds a Affymetrix GeneChip preprocessing step to the analysis. An analysis usually can contain more analysis steps (preprocessing, detection of differentially expressed genes..., where one (and only one) preprocessing step is mandatory).

Parameters:
id - The ID of the corresponding analysis / workspace.
files - The names of the CEL files that should be normalized. The CEL files will be processed in the order they are submitted with this argument. Obviously the files have to be uploaded first to the web service / workspace using the addFile method.
method - The preprocessing method. See performJustAffyNormalization for the options.
historaw - If a histogram of the raw data should be drawn.
histonorm - If a histogram of the normalized data should be drawn.
save - If the normalized expression values should be saved to a file (ExpressionValues.txt).
mas5calls - If mas5 present calls should be calculated.
Returns:
The ID (the same as submitted). The ID can be used to retrieve the status of the analysis and the results can be downloaded upon completion of the analysis.
Throws:
java.lang.Exception

addStepTwoColorPreprocessing

public java.lang.String addStepTwoColorPreprocessing(java.lang.String id,
                                                     java.lang.String[] files,
                                                     java.lang.String source,
                                                     java.lang.String wtfun,
                                                     boolean createGAL,
                                                     java.lang.String galfile,
                                                     java.lang.String averageSignal,
                                                     java.lang.String bgCorr,
                                                     java.lang.String withinNorm,
                                                     java.lang.String betweenNorm,
                                                     boolean save,
                                                     boolean plots)
                                              throws java.lang.Exception
Adds a two color microarray preprocessing step to an analysis. Analyses can consist of one or more steps, where one (and only one) preprocessing step is mandatory. All files used and needed by the analysis have to be uploaded to the web service / workspace using the addFile method before the analysis can be started.

Parameters:
id - The ID for the corresponding analysis / workspace.
files - The files. (raw data microarray files, for example GenePix gpr files).
source - The microarray scanning software used. Supported are: agilent, arrayvision, genepix, imagene, quantarray, smd.old, smd, spot.
wtfun - For genepix and spot microarrays. wt fun is a function that can be used to flag or weight bad spots. wtflags(0) will give all flagged spots a weight of 0, and therefore these spots will be excluded from the further analysis.
createGAL - For microarrays scanned with the genepix software. If a GAL (Gene Array List) file should be created. Is sometimes a good decision, the gpr files contain themselfs the information of the GAL file.
galfile - For microarrays scanned with the genepix software. The name of the GAL file. Sometimes it is better to set the createGAL argument to true instead of submitting a GAL file.
averageSignal - For microarrays scanned with the genepix software. If the mean or median signla should be used. (mean or median).
bgCorr - The background correction method. (none, subtract, half, minimum, movingmin, edwards, normexp)
withinNorm - The within microarray normalization method. (none, median, loess, printtiploess, composite, robustspline)
betweenNorm - The between microarrays normalization method. (none, scale, quantile, Aquantile, Gquantile, Rquantile)
save - If the normalized values should be stored to a file.
plots - If plots (histograms and MA plots) should be created.
Returns:
The ID (the same as submitted). The ID can be used to retrieve the status of the analysis and the results can be downloaded upon completion of the analysis.
Throws:
java.lang.Exception

startDefinedAnalysis

public java.lang.String startDefinedAnalysis(java.lang.String id)
                                      throws java.lang.Exception
Starts an already defined analysis. (analyses can be defined by adding different analysis steps to the analysis). After starting the analysis its status can be retrieved using the getStatus method.

Parameters:
id - The ID of the analysis.
Returns:
The ID of the analysis.
Throws:
java.lang.Exception

getProperties

public java.util.Properties getProperties()
Returns the Properties.

Returns:
The Properties.

setProperties

public void setProperties(java.util.Properties props)
Sets the Properties.

Parameters:
props - The Properties.