Java utilities for the Synergizer Service

Requirements

The Java SE 6 (or later) environment. While the supplied code may work in earlier Java environments, it has only been tested with Java 6, and thus it is recommended to use Java SE 6 (or later).

For MATLAB integration, MATLAB R2007b (or later). Earlier MATLAB versions use Java 5, and the class loaders fail to recognize the class signatures for the supplied classes. It may be possible to recompile the (provided) source code under the Java 5 (1.5) environment such that earlier MATLAB versions can use the classes, although this has not been tested by us (the authors).

Download

Download our Synergizer Java Client.

Documentation and Examples

API documentation (javadoc)

Example code for Java programs

Using the Synergizer is easy and requires only the synergizer.SynergizerClient and synergizer.SynergizerClient.TranslateResult classes. For details on using all the available public methods, refer to the
javadocs. The following code excerpt is from the src/SynergizerClientTest.java file.
SynergizerClient client = new synergizer.SynergizerClient();

Set<source_ids> = new java.util.HashSet<String<();
source_ids.add("snph");
source_ids.add("chac1");
source_ids.add("actn3");
source_ids.add("maybe_a_typo");
source_ids.add("almost certainly a typo");
source_ids.add("pja1");
source_ids.add("prkdc");
source_ids.add("RAD21L1");
source_ids.add("Rorc");
source_ids.add("kcnk16");

SynergizerClient.TranslateResult res =
  client.translate("ensembl", "Homo sapiens", "hgnc_symbol",
                   "entrezgene", source_ids);

System.out.println(res.translationMap());
System.out.println(res.translationMap().get("kcnk16"));
System.out.println(res.unfoundSourceIDs());
System.out.println(res.foundSourceIDsWithUnfoundTargetIDs());
System.out.println(res.foundSourceIDsWithFoundTargetIDs());

The small demonstration program src/SynergizerClientTest.java uses the above code. (Note that to run this program you will need the synergizer.jar file available with the distribution.)

Example code for MATLAB usage

Once having set the classpath to point to the JAR file, using the Synergizer is easy with MATLAB. The following code illustrates the same steps as above from within the MATLAB environment.
javaaddpath('pathtojarfile/synergizer.jar');

client = synergizer.SynergizerClient;

source_ids = java.util.HashSet;
source_ids.add('snph');
source_ids.add('chac1');
source_ids.add('actn3');
source_ids.add('maybe_a_typo');
source_ids.add('almost certainly a typo');
source_ids.add('pja1');
source_ids.add('prkdc');
source_ids.add('RAD21L1');
source_ids.add('Rorc');
source_ids.add('kcnk16');

res = client.translate('ensembl', 'Homo sapiens',
                       'hgnc_symbol', 'entrezgene', source_ids);

res.translationMap()
res.translationMap().get('kcnk16')
res.unfoundSourceIDs()
res.foundSourceIDsWithUnfoundTargetIDs()
res.foundSourceIDsWithFoundTargetIDs()

Contact Information

For questions about the Synergizer translation service, contact the Roth Lab.
For specific questions about the Java utilities, contact murat[dot]tasan[at]hms[dot]harvard[dot]edu.