== XGAP-DAS connection project == === Background === The Distributed Annotation System (DAS) defines a communication protocol used to exchange annotations on genomic or protein sequences. It is motivated by the idea that such annotations should not be provided by single centralized databases, but should instead be spread over multiple sites. Data distribution, performed by DAS servers, is separated from visualization, which is done by DAS clients. The advantages of this system are that control over the data is retained by data providers, data is freed from the constraints of specific organisations and the normal issues of release cycles, API updates and data duplication are avoided. Taken from, and more information about DAS at: [http://www.biodas.org/wiki/Main_Page BioDAS] === XGAP as a DAS server === The first steps have been done: adding a working example server to the XGAP project. This is how it works: The DAS servlet itself is served directly from the source, it cannot be edited: {{{ DasServlet uk.ac.ebi.mydas.controller.MydasServlet DasServlet /das/* }}} The servlet reads a file named 'MydasServerConfig.xml' located in the WebContent folder. Inside MydasServerConfig.xml, all needed properties for a DAS server are set. For example: * URL of the DAS server (ie. XGAP application running on some IP adress) * XSLT transformation services of the DAS output * Default stylesheet for data sources The important bits are in the datasources section. Here we define what data goes into the DAS service. In the example: * We point to a class file: mydas.examples.[wiki:EnsemblTestDataSource] * A coordinate system is entered, needed to map the data to other DAS sources * The capabilities are defined. We tell DAS what this datasource can provide. What we want is: Phase 1. * New datasource(s) that provide data from an XGAP database in the form of class file(s). * Proper configuration of this source in the config xml. * A working connection to a DAS client Phase 2. * A plugin to 'edit' the config xml. For example, adjust organism and coordinate system. * Smart datasource/config files that serve out the data they can provide, depending on what is in the database. * A client integrated in XGAP that uses our own data as a source * Expanding the client so it uses other sources as well, build a plugin around this to the user can quickly add/remove sources The last two can be done by eg. IFRAMing an existing client and entering our application URL to the list of sources, making use of existing software and source listings. === Older explanation, more technical, outdated locations === In short: 1) Template/example servlet for DAS data in XGAP[[BR]]2) Connecting the servlet to a DAS client[[BR]]3) Querying XGAP data within the servlet[[BR]]4) The data mapping possibilities[[BR]]5) Constructing the complete servlet[[BR]]6) The visualization tool we want to integrate In long: 1) In the xgap_1_3_distro project, go to: handwritten -> java -> mydas -> DasServlet.java We set the MIME type to indicate what we are serving: response.setContentType("application/x-das-features+xml");[[BR]]After that we print data to the output stream: printExample(out); This servlet is mapped to the URL '/xgap_1_3_distro/das', see: WebContent/WEB-INF/web.xml[[BR]]Later on you can parse variables to the servlet like this: URL: xgap_1_3_distro/atted?locus=At4g08470 String gene = req.getString("locus"); For an advanced example, see: handwritten -> java -> plugins -> matrixmanager -> MatrixManagerDownloadServlet.java 2) Go to the Ensembl genome browser: http://www.ensembl.org/index.html [[BR]]To enter the view, select an organism, eg 'Human'[[BR]]Now select: Manage your data -> Custom data -> Attach DAS[[BR]]In the box behind "or other DAS server", input the URL with your IP instead of 'localhost', ie. http://145.39.234.55:8080/xgap_1_3_distro/das 3) XGAP should now serve some example data that can be interpreted by the Ensembl DAS client :) I will test this tomorrow, here at the UMCG the firewalls prevent external computers to reach my IP. If you look at bit closer at the MatrixManager servlet you notice we instantiate the database: db = (JDBCDatabase) this.getDatabase();[[BR]]After which we can run queries using find, eg. this retrieves all markers in the database: db.find(Marker.class); 4) Now the idea is to take a close look at the DAS specifications: (I also took the example data from here) http://www.biodas.org/documents/das2/das2_get.html And identify which parts of DAS and XGAP overlap. (XGAP datamodel basics: http://www.xgap.org/wiki/XgapDataModel) 5) After we know what to serve out, we can build the servlet. I think it should look like this: * Depending on arguments, query a part of the current XGAP database (eg. marker positions and QTL peak data) * Using the mydas-1.6.0 library: * Construct DAS objects from the queried XGAP objects * Create DAS xml format from these objects and serve out 6) That would already be great. Next we can look at different viewers and how to integrate them into an XGAP plugin. Tampering with Freemarker templates can be very tedious so if you have a nice idea I can work this out. A customizable viewer that we should possibly use is Gbrowse: http://gmod.org/wiki/GBrowse And then we can let biologists drool over pictures such as these :) http://gmod.org/w/images/b/b6/Gbrowse_screenshot1.gif