{this is a test}
Topic: caArray Installation and Upgrade
Release: caArray 2.3.x only
Date entered: 03/19/2010
Developed by Dr. Matthew Eldridge, Head of the Bioinformatics Core facility at Cancer Research UK's Cambridge Research Institute, caArray Importer v1.0.2 is an open-source package that extends the caArray Java API to provide programmatic access to the following functionality:
caArray Importer v1.0.2 can be downloaded from this page.
This version of the caArray API extension is compatible with versions 2.3 and later. It is not compatible with caArray version 2.2.1 or earlier releases.
Please note that, for versions 2.4 and later, some of the source code and build files in the caArray Importer distribution must be modified before they can be compiled and deployed. The modifications, which are described later in this article, are slightly different depending on the exact version of caArray you are running (i.e., 2.4.0.2 versus 2.4.1).
caArray Importer Distribution Contents
Components |
Description |
---|---|
LICENSE.txt |
The Apache License version 2.0 under which the source code in this distribution is released. |
build.xml |
Apache Ant build file for compiling source code, updating the caArray server and client library, and running the example client application. |
build.properties |
Properties file for the Ant build in which the locations of the caArray server ear and client distribution should be set. |
apidocs |
Contains the Javadoc documentation for both server and client classes that constitute the caArray Importer API as well as the example client application. |
caarray-ejb |
Contains source code for the Enterprise JavaBean (EJB) that provides programmatic access to caArray functionality for creating projects, uploading, validating and importing array data files, etc. |
caarray-client |
Contains source code for the modified CaArrayServer class (no longer marked final to enable subclassing) used to connect to and access the caArray server and a subclass that provides access to the interface for the caArray Importer EJB. |
example |
Contains source code for an example client application that demonstrates how to use the caArray Importer API. |
caArray Importer Pre-requisites
Components |
Description |
---|---|
Java 2 Platform Standard Edition 5.0 Update 10 (J2SE 5.0) |
Building and running Java applications |
Apache Ant 1.7.0 |
Building and running Java applications |
Set JAVA_HOME and ANT_HOME environment variables |
Refer to the caArray installation guide for further details |
caArray legacy client distribution |
Download from caArray GForge site |
For the parameters below, in most cases a user only needs to update the server.base.dir property.
caArray Importer Initial Configuration
Parameters |
Description |
|
---|---|---|
client.legacy.zip=caarray-client-legacy.zip |
The location of the caArray Java client distribution zip file. By default it is assumed to be in the current working directory and named caarray-client-legacy.zip. |
|
server.base.dir=C:/programs/caarray/caarray2_3_0 |
The base directory in which the caArray server was installed. The directory provided is an example. |
|
|
The actual deployment directory. Normally this does not need to be changed. This can be left empty if you don't have write access to the deployment directory. In that case, you need to manually copy it over after the caarray.ear file is updated. |
|
|
The target caarray server ear file. Normally this does not need to be changed. |
If you are running caArray v2.4 or higher, you must perform the steps outlined below before proceeding to repackage and redeploy the caArray server enterprise archive. (Note that some of the steps varying depending on the exact version of caArray you are running.)
The build.xml file included in the stock caArray Importer distribution does not wok work with caArray v2.4 and higher. You must either download this modified build.xml file or manually edit the stock build.xml as described below:
In the property declarations towards the top of the file, add a new property called "client.libs.grid":
<property name="client.libs" value="*/lib/java/.jar"/>
<property name="client.libs.grid" value="*/lib/grid/.jar"/>
Then add the new property to this section (replace all square brackets in the code snippet with curly braces):
<path id="example.classpath"> <pathelement location="$\[example.classes.dir\]"/> <pathelement location="$\[updated.client.jar\]"/> <fileset dir="$\[client.dist.dir\]"> <include name="$\[client.libs\]"/> <include name="$\[client.libs.grid\]"/> </fileset> </path> |
You must revise a single line of code in the server-side Enterprise Java Bean (EJB) source file 'CaArrayImporterServiceBean.java' as described below (this file is located at the following path within the caArray Importer distribution archive: \caarray-ejb\src\main\java\org\cruk\cri\caarray\services):
_Replace line 401 in the original source file:\_ (file:_)
Project project = projectManagementService.getProject(projectId);
With the following line of code:
Project project = projectManagementService.getProjectByPublicId("EXP-"+projectId.toString());
You must revise three different lines of code in the server-side Enterprise Java Bean (EJB) source file 'CaArrayImporterServiceBean.java' as described below (this file is located at the following path within the caArray Importer distribution archive: \caarray-ejb\src\main\java\org\cruk\cri\caarray\services):
_First, replace the following line in the original source file:\_ (file:_)
import gov.nih.nci.caarray.util.UsernameHolder;
with this one:
import gov.nih.nci.caarray.util.CaArrayUsernameHolder;
_Then, replace line 188 in the original source file:\_ (file:_)
Person person = new Person(UsernameHolder.getCsmUser());
With this one:
Person person = new Person(CaArrayUsernameHolder.getCsmUser());
_Finally, replace line 401 in the original source file:\_ (file:_)
Project project = projectManagementService.getProject(projectId);
With the following line of code:
Project project = projectManagementService.getProjectByPublicId("EXP-"+projectId.toString());
The following steps repackage the caArray server enterprise archive, caarray.ear, with the additional EJB and associated classes that constitute the caArray Importer API extension.
$ ant update-ear |
Note that '$' represents the command prompt and may differ depending on your operating system or shell.
There are four steps involved in this process:
$ ant deploy-ear |
This step will not work unless you have write access to the caArray JBoss server deployment directory (see initial Configuration). In that case, you should manually copy the caarray.ear file to the ${server.base.dir}/jboss-4.0.5.GA/server/default/deploy directory on which the caArray server is running.
There is no need to restart the caArray JBoss server. This step should recognize the newly deployed archive and automatically redeploy it. Redeployment may take a few minutes to complete. You can check progress in the server log, ${server.base.dir}/jboss-4.0.5.GA/server/default/log/server.log
This step repackages the client library with additional classes required to make use of the caArray Importer API.
$ ant update-client-jar |
This unpacks the legacy client distribution zip file, compiles the modified CaArray Server class and its subclass (see content description for caarray-client above), and repackages the client library jar file with these classes and some additional classes from the caArray server required by the caArray Importer.
An example client-side program is provided to demonstrate the creation of a new project and the upload, validation and import of array data files. The source code can be found in the following file:
example/src/main/java/org/cruk/cri/caarray/client/CaArrayImporterExample.java |
The example client program creates a new project and uploads all files in the arraydata directory.
To run the example client program, follow the steps below:
$ ant compile-example $ ant run-example |
To upload Affymetrix expression files, following steps below:
private static final String SERVER_HOST = "yourCaArrayServerHost"; private static final int SERVER_JNDI_PORT = 31099; private static final String USERNAME = "yourUsername"; private static final String PASSWORD = "yourPswd"; public static String TITLE = "Test Affymetrix Expression Project"; public static String PROVIDER = "Affymetrix"; public static String ASSAY_TYPE = "Gene Expression"; public static String[) ARRAY_DESIGNS = new String(] \{ "HG-U133_Plus_2" \}; |
client.uploadFiles(project, "C:/data/caarray/MAGEdataFiles"); |
$ ant compile-example $ ant run-example |
Please leave your comment in caArray End User Forum