apollo.dataadapter.das.simple
Class SimpleDASServer

java.lang.Object
  extended by apollo.dataadapter.das.simple.SimpleDASServer
All Implemented Interfaces:
DASServerI

public class SimpleDASServer
extends java.lang.Object
implements DASServerI

2/2006: I am a little confused about why this is called *server*, since it is actually client-side--it gets data *from* a DAS server. 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. I think 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.


Constructor Summary
SimpleDASServer(java.lang.String url)
          You must pass in the URL of a DAS-reference server, used in all further requests.
 
Method Summary
 java.util.List getDSNs()
          I return all data-sources from the das server URL passed in when this instance was constructed.
 java.util.List getEntryPoints(DASDsn dsn)
          I return all entry-points from the input DASDsn 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)
           I am the getFeatures signature called internally by the DASFeatureContentHandler.
 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()
           
 void setURL(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDASServer

public SimpleDASServer(java.lang.String url)
You must pass in the URL of a DAS-reference server, used in all further requests.

Method Detail

setURL

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

getURL

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

getDSNs

public java.util.List getDSNs()
I return all data-sources from the das server URL passed in when this instance was constructed. The list consists of objects implementing the apollo.dataadapter.das.DASDsn interface. In this case, I populate the returned list with instances of SimpleDASDsn.

Specified by:
getDSNs in interface DASServerI

getEntryPoints

public java.util.List getEntryPoints(DASDsn dsn)
I return all entry-points from the input DASDsn 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.

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)

I am the getFeatures signature called internally by the DASFeatureContentHandler. Since I exist for the purposes of a recursive-descent (for assembly) in this implementation, I am not a part of a DASServerI interface.

I am invoked directly from DASFeatureContentHandler when the features returned have 'children' - that is, they contain further nested features. In that case, the handler will collect all such features of interest, create a new DASSegment for each such feature, and re-invoke this method (recursion!) passing in both a set of segments corresponding to the parent features, and the parent features themselves.

Parameters:
dsn - The dsn of the das data source (for example 'ensembl729')
segmentSelection - The DAS-segments of interest indexed by segment id
parentFeatures - If any particular segment has a parent feature (i.e. we are invoking the method because we want to find the children of features from a prior invocation) then the parent features for each requested segment are stored here, indexed by segment id (thus each feature corresponds 1-1 to the segments input above). The most important thing contained in each parent is the global start and end of the requested range in the input segments.
globalStart - The global start position of the (very first) requested range
globalEnd - Global end position of the (very first) requested range.

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.