Sections
OpenTox Blog
 
You are here: Home » Data » Blogentries » Public » Knowledge Fair Table F - Techie Table

Knowledge Fair Table F - Techie Table

Posted by Sopasakis Pantelis at Sep 14, 2010 01:15 AM |

A description of the discussions and activities that will take place on the "Techie Table" during the OpenTox workshop in Rhodes (19 Sept. 2010).

OpenTox facilitators: Pantelis Sopasakis (NTUA), Fabian Buchwald (TUM)

Duration: 3 hours

Description of Activity:   The discussion will be organized in two parts: In the first part we are going to show how a developer can consume OpenTox web services from inside a Java application using some of our tools (like ToxOtis [5]), and including A&A (Authorization and Authentication). Using web clients and parsers, the participants will download and parse OpenTox resources such as compounds, features, datasets and models and inspect them from within their Java application. Exercises will include parsing of datasets and conversion into weka data objects (Instances), training of various models using NTUA, TUM and AMBIT algorithms (where necessary using also the A&A API). This will familiarize the participants with the direct consumption of OT web services on a more advanced level than using web interfaces and a more programmatic way than using plain curl. This will take about 45 minutes including discussion and questions.

In the second part of the activity, the group will build an OpenTox web service with our guidance. A clustering algorithm will be deployed for the sake of getting in touch with web services and having a better insight into the OpenTox API. First we will study the requirements of the OpenTox API and will formulate hypothetical curl commands for how a request would look like (in a top-down approach). Then we will proceed formulating an RDF representation of the algorithm discussing at the same time the structure of such a document and the information that should be found therein. Jena will be used as an RDF editor/parser, which will be quite useful to developers that want to get involved in a contemporary project involving web semantics. We will briefly detail the storing of models and present the underlying database tables structure. Weka will be used to materialize the XMeans algorithm. The whole effort will boil down to ca. 500 lines of source code including the use of various Java libraries such as Restlet, Weka and Jena. Participants will also get in touch with the back end of an OpenTox web service. This will take about 75 minutes. During the remaining time we will discuss various challenges a developer can face and how they could be overcome.


Experience Expected:  A moderate acquaintance with Java is needed to join the table. The participant should know how to use some IDE of his/her preference and know how to create a Java application and load libraries. Some acquaintance with HTTP and web services is also helpful.

 

Preparation before joining the table:  We would suggest that participants examine the OpenTox API to gain a better insight into the OpenTox services. The API is available from the OpenTox web site at http://opentox.org/dev/apis/api-1.1. Before joining the table, the participants should have installed the following on their machines:

  1. Java, version 1.6. On a Linux machine, install the packages 'sun-java6-jre' and 'sun-java6-jdk' (For example on an Ubuntu machine type 'sudo apt-get install sun-java6-jre sun-java6-jdk'). For other operating systems, you can download and install Java from http://www.java.com/en/download/manual.jsp . Mac OSX supports its own version of Java.

  2. Java DB (Apache Derby) version 10.6.1. Download the jars from http://wiki.apache.org/db-derby/DerbyTenSixOneRelease. Load it in to your IDE (e.g. Netbeans) as a library.

  3. Install the SSL certificate from opensso.in-silico.ch on your Java VM. This can be accomplished using the Java class found at: http://github.com/alphaville/yaqp-turbo/blob/master/src/org/opentox/config/InstallCert.java. (provided by Sun Microsystems, Inc.)

 

Optional applications the users are suggested to install:

  1. cURL: Install cURL from http://curl.linux-mirror.org or simply type 'sudo apt-get install curl'
  2. An IDE to help you organize your source code and libraries.
  3. Git: Download and install git from http://git-scm.com. Git can be also found in the Linux repositories. For instance, on an Ubuntu machine you can install it typing 'sudo apt-get install git-core'.

  4. Protégé: Download and run Protégé, an ontology editor that will let you examine the ontology used in OpenTox to describe resources such as algorithms, compounds, features etc. Protégé can be found at http://protege.stanford.edu. Use Protégé to view the ontology at http://opentox.org/data/documents/development/RDF%20Files/OpenToxOntology. Installation of Protégé will help developers get a better insight regarding what happens behind the scenes and fathom the very structure of OpenTox.

 

The following Java libraries should be downloaded and loaded in your IDE (All libraries used in our projects are free and open source): [Alternatively you can download exactly what you need from https://opentox.ntua.gr/lib.zip - It is much easier to go this way, but you will get a better insight if you go through the following steps].

  1. Restlet, version 2.0 milestone 7: Download it from the URL: http://www.restlet.org/downloads/2.0/restlet-jse-2.0m7.zip. Read about Restlet at http://www.restlet.org/about/introduction and find some example applications at http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet.html. Restlet is a very useful free and open source tool for creating web services. Note that you will have to include only the following jars in your classpath:

    1. com.sun.grizzly
    2. com.sun.grizzl.util
    3. org.apache.commons.collections
    4. org.apache.commons.io
    5. org.apache.commons.lang
    6. org.apache.commons.logging
    7. org.apache.commons.pool
    8. org.apache.lucene
    9. org.restlet.ext.grizzly
    10. org.restlet.ext.wadl
    11. org.restlet.ext.xml
    12. org.restlet
    All the above jars are included in the distribution of Restlet. Including extra jars in your classpath can cause compilation and/or runtime errors.
  2. Xstream, version 1.3.1: Download Xstream from: http://repository.codehaus.org/com/thoughtworks/xstream/xstream-distribution/1.3.1/xstream-distribution-1.3.1-bin.zip.

  3. JAMA (Jama Matrix Algebra Package): Download Java, version 1.0.2 from http://math.nist.gov/javanumerics/jama/Jama-1.0.1.tar.gz
  4. Jena, version 2.6.2: Download Jena from http://sourceforge.net/projects/jena/files/Jena/Jena-2.6.2/jena-2.6.2.zip/download.

  5. Download Reflections, version 0.9.5. from http://code.google.com/p/reflections/downloads/list.

  6. Weka 3.6.0. can be downloaded from http://sourceforge.net/projects/weka/files/weka-3-6/3.6.0/weka-3-6-0.zip/download. Weka is a well known machine learning library for Java.

  7. Download iText version 5.0.1. from http://sourceforge.net/projects/itext/files/iText/iText5.0.1/iText-5.0.1.jar/download. iText is a PDF editor for Java.

  8. Download and examine the source code of YAQP (Yet Another QSAR Project), from http://github.com/alphaville/yaqp-turbo. Click on the “Download Source” button or using git, type 'git clone git://github.com/alphaville/yaqp-turbo.git'

 

Note:

After installing all of the above on your laptop, you will have to bring it with you on the table ;-)

 

Techincal Support: If you need help installing any of the above software or libraries, please contact Pantelis Sopasakis via email at chvng@mail.ntua.gr or reach him at MSN: aureliacosmetics@yahoo.gr. If you have more general questions about technical developments on the project and wish to participate, you can join the OpenTox development mailing list, available as an option on completing the join registration form on the OpenTox web site.


References:

  1. The OpenTox web site: http://opentox.org

  2. Restful Web Services: http://en.wikipedia.org/wiki/Representational_State_Transfer. Read also this note on our web site: http://opentox.org/dev/framework/restweb.

  3. OWL Validation Online Tool: http://www.mygrid.org.uk/OWL/Validator.

  4. RDF Validation Online service by W3C: http://www.w3.org/RDF/Validator/ (Also produces graphical representations of RDF documents)

  5. ToxOtis: A tool containing web clients, RDF parsers, bridges between the OpenTox ontology and your application, an easy to use authentication interface and much more. ToxOtis is still under development and the source code can be found at http://github.com/alphaville/ToxOtis.
Document Actions