apollo.dataadapter.das2
Class DAS2Request

java.lang.Object
  extended by apollo.dataadapter.das2.DAS2Request
All Implemented Interfaces:
DASServerI

public class DAS2Request
extends java.lang.Object
implements DASServerI

Adapted from das/simple/SimpleDASServer I don't understand why that class was called "server", since it's client-side. Updating to handle DAS/2. $PREFIX/sequence - a "sources" request This is the top-level entry point to a DAS 2 server. It returns a list of the available genomic sequence and their versions. $PREFIX/sequence/$SOURCE - a "source" request Returns the available versions of the given genomic sequence. $PREFIX/sequence/$SOURCE/$VERSION - a "versioned source" request Returns information about a given version of a genomic sequence. Clients may assume that the sequence and assembly are constant for a given version of a source. Note that annotation data on a server with curational write-back support may change without changing the version. In DAS1, the "dsn" request was equivalent to $PREFIX/sequence/$SOURCE/$VERSION - it gave you a complete list of versioned genome dbs, e.g., "ensembl_Anopheles_gambiae_core_28_2c", "ensembl_Anopheles_gambiae_core_29", etc.


Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
DAS2Request(java.lang.String url)
          You must pass in the URL of a DAS-reference server, used in all further requests.
 
Method Summary
 DASDsn getDSN(java.lang.String uri)
          Given a URI, return the DSN (if any) for that URI.
 java.util.List getDSNs()
          Gets a list of versioned sources from the server.
 java.util.List getEntryPoints(DASDsn dsn)
          I return all entry-points from the input SimpleDASDsn instance passed in.
 java.util.List getFeatures(DASDsn dsn, DASSegment[] segmentSelection)
           I am the call used by apollo to fetch annotations (features) from the input dsn, for the entry-points and ranges given by the input segments
 java.util.List getFeatures(DASDsn dsn, java.util.HashMap segmentSelection, java.util.HashMap parentFeatures, long globalStart, long globalEnd)
           
 java.util.List getSequences(DASDsn dsn, DASSegment[] segmentSelection)
           I am the call used by apollo to fetch dna (sequence) from the input dsn, for the entry-points and ranges given by the input segments
 java.lang.String getURL()
           
 java.util.List getVersionedSources()
           
static void main(java.lang.String[] args)
          For testing--supply server URL on command line
 org.xml.sax.XMLReader setupXMLReader(org.xml.sax.helpers.DefaultHandler parser)
           
 void setURL(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

DAS2Request

public DAS2Request(java.lang.String url)
You must pass in the URL of a DAS-reference server, used in all further requests. e.g. http://das.biopackages.net/codesprint

Method Detail

setURL

public void setURL(java.lang.String url)
Specified by:
setURL in interface DASServerI

setupXMLReader

public org.xml.sax.XMLReader setupXMLReader(org.xml.sax.helpers.DefaultHandler parser)

getURL

public java.lang.String getURL()
Specified by:
getURL in interface DASServerI

getDSNs

public java.util.List getDSNs()
Gets a list of versioned sources from the server. This actually flattens the tree that is the result of two queries: URL/sequence/ returns a list of the available genomes and their versions, e.g. ... I populate the returned list with instances of SimpleDASDsn. I wanted to call this getVersionedSources, but it needs to be called getDSNs for now for compatibility with DASServerI

Specified by:
getDSNs in interface DASServerI

getVersionedSources

public java.util.List getVersionedSources()

getDSN

public DASDsn getDSN(java.lang.String uri)
Given a URI, return the DSN (if any) for that URI. (If it can't find it, should it make a new one??)


getEntryPoints

public java.util.List getEntryPoints(DASDsn dsn)
I return all entry-points from the input SimpleDASDsn instance passed in. The list consists of objects implementing the apollo.dataadapter.das.DASSegment interface. In this case, I populate the returned list with instances of SimpleDASSegment.

Specified by:
getEntryPoints in interface DASServerI

getFeatures

public java.util.List getFeatures(DASDsn dsn,
                                  DASSegment[] segmentSelection)

I am the call used by apollo to fetch annotations (features) from the input dsn, for the entry-points and ranges given by the input segments

The return list consists of objects implementing the apollo.dataadapter.das.DASFeature interface. In this case, I populate the returned list with instances of SimpleDASFeature.

NOT CURRENTLY USED (but required by interface)

Specified by:
getFeatures in interface DASServerI

getFeatures

public java.util.List getFeatures(DASDsn dsn,
                                  java.util.HashMap segmentSelection,
                                  java.util.HashMap parentFeatures,
                                  long globalStart,
                                  long globalEnd)

getSequences

public java.util.List getSequences(DASDsn dsn,
                                   DASSegment[] segmentSelection)

I am the call used by apollo to fetch dna (sequence) from the input dsn, for the entry-points and ranges given by the input segments

The return list consists of objects implementing the apollo.dataadapter.das.DASSequence interface. In this case, I populate the returned list with instances of SimpleDASSequence.

Specified by:
getSequences in interface DASServerI
Parameters:
segmentSelection - A list of segments containing entry points and ranges of interest. NOTE: I only pay attention to the FIRST element of the list - all subsequence elements are IGNORED!!! Therefore, my return value is a list of size 1 under all circumstances. NOT CURRENTLY USED

main

public static void main(java.lang.String[] args)
For testing--supply server URL on command line