Image: Salvatore Vuono / FreeDigitalPhotos.net

DAS registry help - scripting

The DAS registration server provides two mechanisms to access its content programmatically:

  • (1)a simple http - XML web services
  • (2)a SOAP - web services

You can choose one of these methods. (the simple http-XML web service is quicker, so we would recommend that one).

(1) Simple http - XML web service (DAS style)

There are several URL commands available that allow to access the registry data via XML:

sources

This is a simple request that lists all DAS sources. It is a back-port from the corresponding DAS/2 command. To get the listing of all available DAS sources follow this link:
http://www.dasregistry.org/das/sources/ or http://www.dasregistry.org/das1/sources/ or for 1.5 sources only http://www.dasregistry.org/das1.5/sources/ or for 1.6 sources only http://www.dasregistry.org/das1.6/sources/

To view the response in your browser click here: view-source:http://www.dasregistry.org/das1/sources/ It is simple to open a http connection to this url and parse the returned XML file in most programming languages. A Java library that provides access using this is e.g. Dasobert

The sources command so far accepts several (optional) arguments. It is also possible to combine these.

It is possible to access information for a single DAS source, if its unique ID is known. e.g. http://www.dasregistry.org/das1/sources/DS_109



organism

The URL http://www.dasregistry.org/das1/organism provides you with a list of the organisms as they are currently known by the registration server.



coordinatesystem

The URL http://www.dasregistry.org/das1/coordinatesystem gives a list of all coordinate systems as they are know to the registry. Each coordinate system has a unique URI. This can be resolved to a short description of it, e.g. the description page of the UniProt,Protein sequence coordinate system. See the help page for coordinate systems for more information.



lastModified

The URL http://www.dasregistry.org/das1/lastModified provides the time stamp when the DAS registry has been creating/modifing/deleting a DAS source the last time.

The same is available via the getLastModified HTTP header from the URL http://www.dasregistry.org/das1/ . The result is the number of milliseconds (a long integer) since January 1, 1970 GMT. e.g. try a:

curl -I http://www.dasregistry.org/das1/lastModified


Validate

The registry runs an autovalidate on all registered servers about every 3 hours - however you can request that the registry validate a DAS source if it is publically accessible using this url. The URL http://www.dasregistry.org/validate/ with a minimum set of parameters url and testcode for example http://www.dasregistry.org/validate/?url=http://das.sanger.ac.uk/das/otter_das/&testcode=22:19173435,19372173 provides a sources response which lists the possible capabilities and whether they are invalid or valid.

Other parameters available are:

(2) SOAP web service

The wsdl that describes this SOAP web service is available from here .

For Java clients there is a library available that can be used for communication. The class DasRegistryAxisClient does all the SOAP communication. So a typical call to the Registry looks like:

	
import org.biojava.services.das.registry.*;
...
URL url = new URL("http://www.dasregistry.org" +
	  "/services/das_registry/");
DasRegistry client = new DasRegistryAxisClient(url);
DasSource[] services = client.listServices();	

Example script how to contact the registry using Perl:
#!/usr/bin/perl -Tw

use strict;
use warnings;

use SOAP::Lite;

print "Connecting to DAS registry\n";

my $sources =
  SOAP::Lite->service(
        'http://www.dasregistry.org/services/das'
      . ':das_directory?wsdl' )->listServices();

foreach my $source ( @{$sources} ) {

    while ( my ( $key, $value ) = each( %{$source} ) ) {

        if ( ref $value eq 'ARRAY' ) {
            if ( $key eq 'coordinateSystem' ) {

                foreach my $coords ( @{$value} ) {
                    print "coordinate system:\n";
                    while ( my ( $dcskey, $dcsvalue ) =
                        each( %{$coords} ) )
                    {
                        printf "\t%-16s => %s\n", $dcskey, $dcsvalue;
                    }
                }

            } else {
                printf "%-16s => %s\n", $key, join( ', ', @{$value} );
            }

        } else {
            $value =~ s/\s+/ /gs;
            printf "%-16s => %s\n", $key, $value;
        }
    }
}