Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

apollo.dataadapter.das.simple
Class SimpleDASAdapter  view SimpleDASAdapter download SimpleDASAdapter.java

java.lang.Object
  extended byAbstractDataAdapter
      extended byapollo.dataadapter.AbstractApolloAdapter
          extended byapollo.dataadapter.das.simple.SimpleDASAdapter
All Implemented Interfaces:
apollo.dataadapter.ApolloDataAdapterI

public class SimpleDASAdapter
extends apollo.dataadapter.AbstractApolloAdapter

I implement a AbstractDataAdapter, allowing Apollo to get information from DAS datasources, using 'simple' implementions of DASServerI, DASDsn etc.

My whole reason-for-being is to have a das-reading adapter which doesn't rely on a big external codebase (e.g. omnigene or biojava).


Field Summary
(package private)  apollo.dataadapter.das.DASServerI dasServer
           
(package private)  apollo.dataadapter.das.DASDsn dsn
           
private  apollo.datamodel.SequenceI genomeSeq
           
private static long groupIdInt
           
(package private)  int high
           
(package private)  int low
           
(package private)  apollo.dataadapter.das.DASSegment segment
           
(package private)  java.lang.String server
           
(package private)  IOOperation[] supportedOperations
           
 
Fields inherited from class apollo.dataadapter.AbstractApolloAdapter
 
Fields inherited from interface apollo.dataadapter.ApolloDataAdapterI
OP_READ_DATA, OP_READ_RAW_ANALYSIS, OP_READ_SEQUENCE, OP_WRITE_DATA
 
Constructor Summary
SimpleDASAdapter()
           
 
Method Summary
private  void addFeaturePairToGroupFeatureSet(apollo.datamodel.FeatureSetI groupFeatureSet, apollo.dataadapter.das.DASFeature theFeature)
           
 void commitChanges(apollo.datamodel.CurationSet curationSet)
          writes the changes from a featureChangeLog to a writeable datasource.
 apollo.datamodel.StrandedFeatureSetI getAnalysisRegion(apollo.datamodel.CurationSet curation)
           Make a call to the chosen DSN, passing in the chosen segment/range into a das "features" command.
 apollo.datamodel.FeatureSetI getAnnotatedRegion()
           
 apollo.datamodel.CurationSet getCurationSet()
          returns a saved CurationSet.
 apollo.dataadapter.das.DASServerI getDASServer()
           
 apollo.dataadapter.das.DASDsn getDSN()
           
 int getHigh()
           
 java.lang.String getInput()
          Returns the input String passed to the DataAdapter, the input is of course associated with the input type Should this go into org.bdgp.io.DataAdapter?
 apollo.dataadapter.DataInputType getInputType()
          Returns the type of input data (gene,file,band...)
 int getLow()
           
private  java.lang.String getMethodAndFeatureType(apollo.dataadapter.das.DASFeature theFeature)
          Concatenates a DAS Feature's method label (if not null) and feature type into a string, separated by a colon.
 java.lang.String getName()
           
 java.lang.String getRawAnalysisResults(java.lang.String id)
           
 apollo.dataadapter.das.DASSegment getSegment()
           
 apollo.datamodel.SequenceI getSequence(apollo.datamodel.DbXref dbxref)
          The dbxref passed into this argument is only checked to make sure that the the IdValue it contains is the same as the Id for the DASSegment that this adapter is poised on.
 apollo.datamodel.SequenceI getSequence(apollo.datamodel.DbXref dbxref, int start, int end)
           
 apollo.datamodel.SequenceI getSequence(java.lang.String id)
           
 java.util.Vector getSequences(apollo.datamodel.DbXref[] dbxref)
           
 java.util.Vector getSequences(apollo.datamodel.DbXref[] dbxref, int[] start, int[] end)
           
 java.util.Properties getStateInformation()
          The adapter is characterised by dsn (e.g.
private  int getStrandForOrientation(java.lang.String orientation)
          Direct conversion of a DAS feature orientation +,-,0 into +1, -1, 0.
 IOOperation[] getSupportedOperations()
           
 java.lang.String getType()
           
 DataAdapterUI getUI(IOOperation op)
           
 void init()
           
private  void initializeGroupFeatureSet(apollo.datamodel.FeatureSetI groupFeatureSet, apollo.dataadapter.das.DASFeature theFeature, boolean setIsHolder)
           
private  void initializeMethodNameFeatureTypeFeatureSet(apollo.datamodel.FeatureSetI targetFeatureSet, apollo.dataadapter.das.DASFeature theSourceFeature)
           
private  java.util.List parseFeatureSet()
           
 void setDASServer(apollo.dataadapter.das.DASServerI newValue)
           
 void setDSN(apollo.dataadapter.das.DASDsn dsn)
           
 void setHigh(int high)
           
 void setLow(int low)
           
 void setRegion(java.lang.String region)
          This string is used when the user navigates around the genome - it should contain both the new segment and high/low information.
 void setSegment(apollo.dataadapter.das.DASSegment segment)
           
 void setStateInformation(java.util.Properties props)
          With the following keys in the adapter properties, we can re-create a our internal state and start a new das-call.
 
Methods inherited from class apollo.dataadapter.AbstractApolloAdapter
addDataListener, clearOldData, notifyLoadingDone, rollbackAnnotations, setInput, setInputType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

java.lang.String server

dsn

apollo.dataadapter.das.DASDsn dsn

segment

apollo.dataadapter.das.DASSegment segment

genomeSeq

private apollo.datamodel.SequenceI genomeSeq

low

int low

high

int high

groupIdInt

private static long groupIdInt

dasServer

apollo.dataadapter.das.DASServerI dasServer

supportedOperations

IOOperation[] supportedOperations
Constructor Detail

SimpleDASAdapter

public SimpleDASAdapter()
Method Detail

getDASServer

public apollo.dataadapter.das.DASServerI getDASServer()

setDASServer

public void setDASServer(apollo.dataadapter.das.DASServerI newValue)

init

public void init()

getDSN

public apollo.dataadapter.das.DASDsn getDSN()

getName

public java.lang.String getName()

getType

public java.lang.String getType()

getInputType

public apollo.dataadapter.DataInputType getInputType()
Description copied from class: apollo.dataadapter.AbstractApolloAdapter
Returns the type of input data (gene,file,band...)


getInput

public java.lang.String getInput()
Description copied from class: apollo.dataadapter.AbstractApolloAdapter
Returns the input String passed to the DataAdapter, the input is of course associated with the input type Should this go into org.bdgp.io.DataAdapter?


getSupportedOperations

public IOOperation[] getSupportedOperations()

getUI

public DataAdapterUI getUI(IOOperation op)

setDSN

public void setDSN(apollo.dataadapter.das.DASDsn dsn)

setSegment

public void setSegment(apollo.dataadapter.das.DASSegment segment)

getSegment

public apollo.dataadapter.das.DASSegment getSegment()

setLow

public void setLow(int low)

setHigh

public void setHigh(int high)

getLow

public int getLow()

getHigh

public int getHigh()

setRegion

public void setRegion(java.lang.String region)
               throws apollo.dataadapter.DataAdapterException
This string is used when the user navigates around the genome - it should contain both the new segment and high/low information. Armed with this, we can set the DASSegment in this data adapter. The new data is set into the adapter with two calls: setStateInformation (copying in the "old" state of the adapter and then setRegion (copying in the new choices of region into the adapter).


getStateInformation

public java.util.Properties getStateInformation()
The adapter is characterised by dsn (e.g. http://url/.../entry_point) and segment (e.g. chr=1, start=... stop=....) With this information we can make a das-call. So we write this information out in entirety.


setStateInformation

public void setStateInformation(java.util.Properties props)

With the following keys in the adapter properties, we can re-create a our internal state and start a new das-call.

  • DSN_sourceId
  • DSN_source
  • DSN_sourceVersion
  • DSN_mapMaster
  • Segment_segment
  • Segment_id
  • Segment_start
  • Segment_stop
  • Segment_orientation
  • Segment_subparts
  • Segment_length


getCurationSet

public apollo.datamodel.CurationSet getCurationSet()
                                            throws apollo.dataadapter.DataAdapterException
Description copied from interface: apollo.dataadapter.ApolloDataAdapterI
returns a saved CurationSet.


parseFeatureSet

private java.util.List parseFeatureSet()

initializeMethodNameFeatureTypeFeatureSet

private void initializeMethodNameFeatureTypeFeatureSet(apollo.datamodel.FeatureSetI targetFeatureSet,
                                                       apollo.dataadapter.das.DASFeature theSourceFeature)

initializeGroupFeatureSet

private void initializeGroupFeatureSet(apollo.datamodel.FeatureSetI groupFeatureSet,
                                       apollo.dataadapter.das.DASFeature theFeature,
                                       boolean setIsHolder)

addFeaturePairToGroupFeatureSet

private void addFeaturePairToGroupFeatureSet(apollo.datamodel.FeatureSetI groupFeatureSet,
                                             apollo.dataadapter.das.DASFeature theFeature)

getAnalysisRegion

public apollo.datamodel.StrandedFeatureSetI getAnalysisRegion(apollo.datamodel.CurationSet curation)
                                                       throws apollo.dataadapter.DataAdapterException

Make a call to the chosen DSN, passing in the chosen segment/range into a das "features" command. Parse the result into a nested heirarchy of FeatureSets.

Level 1 - StrandedFeatureSet. Common parent to all lower level sets

Level 2 - FeatureSets keyed by Method Name and Feature Type

Level 3 - FeatureSets for the parent Method and Type, keyed by GroupId, containing max score within group, and having handles to aligned sequences

Level 4 - FeaturePairs for the parent Group, containing start, end, target start, target end.


getAnnotatedRegion

public apollo.datamodel.FeatureSetI getAnnotatedRegion()
                                                throws apollo.dataadapter.DataAdapterException

getSequence

public apollo.datamodel.SequenceI getSequence(java.lang.String id)
                                       throws apollo.dataadapter.DataAdapterException

getSequence

public apollo.datamodel.SequenceI getSequence(apollo.datamodel.DbXref dbxref)
                                       throws apollo.dataadapter.DataAdapterException

The dbxref passed into this argument is only checked to make sure that the the IdValue it contains is the same as the Id for the DASSegment that this adapter is poised on. The range etc passed into the lazy sequence are determined by the Segment that this adapter already has stored on it.

Note carefully: the sequence should NOT be fetched from the DASServer and DASDSN set on this adapter: that Server/DSN may not be a reference server. Instead, we must to go to the server and DSN referenced by the 'MapMaster' - this points to the URL of the reference server, which will have the raw sequence.


getSequence

public apollo.datamodel.SequenceI getSequence(apollo.datamodel.DbXref dbxref,
                                              int start,
                                              int end)
                                       throws apollo.dataadapter.DataAdapterException

getSequences

public java.util.Vector getSequences(apollo.datamodel.DbXref[] dbxref)
                              throws apollo.dataadapter.DataAdapterException

getSequences

public java.util.Vector getSequences(apollo.datamodel.DbXref[] dbxref,
                                     int[] start,
                                     int[] end)
                              throws apollo.dataadapter.DataAdapterException

commitChanges

public void commitChanges(apollo.datamodel.CurationSet curationSet)
                   throws apollo.dataadapter.DataAdapterException
Description copied from interface: apollo.dataadapter.ApolloDataAdapterI
writes the changes from a featureChangeLog to a writeable datasource.


getRawAnalysisResults

public java.lang.String getRawAnalysisResults(java.lang.String id)
                                       throws apollo.dataadapter.DataAdapterException

getStrandForOrientation

private int getStrandForOrientation(java.lang.String orientation)
Direct conversion of a DAS feature orientation +,-,0 into +1, -1, 0.


getMethodAndFeatureType

private java.lang.String getMethodAndFeatureType(apollo.dataadapter.das.DASFeature theFeature)
Concatenates a DAS Feature's method label (if not null) and feature type into a string, separated by a colon.