apollo.dataadapter.ensj19
Class EnsJAdapter

java.lang.Object
  extended by org.bdgp.io.AbstractDataAdapter
      extended by apollo.dataadapter.AbstractApolloAdapter
          extended by apollo.dataadapter.ensj19.EnsJAdapter
All Implemented Interfaces:
ApolloDataAdapterI, org.bdgp.io.DataAdapter, org.bdgp.io.VisualDataAdapter
Direct Known Subclasses:
AnnotationEnsJAdapter

public abstract class EnsJAdapter
extends AbstractApolloAdapter

Adaptor providing access to the ensembl database via the ensj-core library.

Originally based on EnsCGIAdaptor.


Field Summary
static java.lang.String STABLE_ID_PREFIX
           
protected  java.util.Properties stateInformation
           
 long tend
           
 long tstart
           
 
Fields inherited from class apollo.dataadapter.AbstractApolloAdapter
curation_set, style
 
Fields inherited from class org.bdgp.io.AbstractDataAdapter
listeners
 
Fields inherited from interface apollo.dataadapter.ApolloDataAdapterI
OP_APPEND_DATA, OP_READ_DATA, OP_READ_RAW_ANALYSIS, OP_READ_SEQUENCE, OP_WRITE_DATA
 
Constructor Summary
EnsJAdapter()
           
 
Method Summary
 void clearStateInformation()
          This SHOULD reset all the contents of the stateInformation being held by an adapter: with setStateInformation, this is not guaranteed.
 void commitChanges(CurationSet curationSet)
          writes the changes from a featureChangeLog to a writeable datasource.
protected  StrandedFeatureSetI getAnnotatedRegion(CurationSet curationSet)
           
 CurationSet getCurationSet()
          returns a saved CurationSet.
protected  CurationSet getCurationSetWithoutClearingData()
           
protected  org.ensembl19.driver.Driver getDriver()
           
 java.util.Properties getDriverConf()
          Get the value of driverConf.
 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?
 DataInputType getInputType()
          Returns the type of input data (gene,file,band...)
protected  org.ensembl19.datamodel.LinearLocation getLocation()
           
 java.lang.String getLoggingFile()
          Get the value of loggingFile.
protected  int getMode()
           
 java.lang.String getName()
          Name label for use in Data Adapter Chooser.
protected  java.lang.String getOrganism()
          An ugly hack to tease the organism name from the database name Ignore it if this doesn't parse out
 java.lang.String getRawAnalysisResults(java.lang.String id)
           
protected  SequenceI getReferenceSequence()
           
protected  java.lang.String getRegion()
           
 SequenceI getSequence(DbXref dbxref, int start, int end)
           
 SequenceI getSequence(java.lang.String id)
          Strings for input types
 java.util.Vector getSequences(DbXref[] dbxref)
           
 java.util.Vector getSequences(DbXref[] dbxref, int[] start, int[] end)
           
 java.util.Properties getStateInformation()
          State info Properties carries all the info needed for the adapter to do its query This is an alternative to setDataInput.
 org.bdgp.io.IOOperation[] getSupportedOperations()
          Returns a list of all operations supported by this data adapter
 java.lang.String getType()
          From org.bdgp.io.DataAdapter.
 void init()
          From org.bdgp.io.DataAdapter interface.
static void main(java.lang.String[] args)
           
 void printTime(java.lang.String message)
           
 void setDriverConf(java.util.Properties v)
          Set the value of driverConf.
 void setLoggingFile(java.lang.String v)
          Set the value of loggingFile.
 void setRegion(java.lang.String region)
          Set the region to be retrieved by subsequent calls to getCurrationSet().
 void setStateInformation(java.util.Properties props)
          This should set StateInformation object! see StateInformation for Strings to use for keys.
protected  void validateRegionSpecified(java.util.Properties properties)
           
 
Methods inherited from class apollo.dataadapter.AbstractApolloAdapter
addToCurationSet, cacheUI, canWriteData, clearOldData, commitChanges, commitChanges, commitChanges, commitChanges, commitChanges, getAdapters, getCachedUI, getChildAdapter, getChildAdapter, getCurationState, getDatabase, getDataInput, getDefaultStyle, getFilename, getNameAdapter, getNumberOfChildAdapters, getSequence, getSpecies, getStyle, hasLinkData, isComposite, loadNewSpeciesFromLink, operationIsSupported, rollbackAnnotations, rollbackAnnotations, setCuration, setCurationNumber, setCurationState, setDatabase, setDataInput, setDataLoadListener, setInput, setInputType, setLocation, setName, setPadLeft, setPadRight, setSpecies, setStyle
 
Methods inherited from class org.bdgp.io.AbstractDataAdapter
addProgressListener, fireProgressEvent, removeProgressListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.bdgp.io.VisualDataAdapter
addProgressListener, fireProgressEvent, getUI, removeProgressListener
 

Field Detail

tstart

public long tstart

tend

public long tend

STABLE_ID_PREFIX

public static final java.lang.String STABLE_ID_PREFIX
See Also:
Constant Field Values

stateInformation

protected java.util.Properties stateInformation
Constructor Detail

EnsJAdapter

public EnsJAdapter()
Method Detail

init

public void init()
Description copied from class: AbstractApolloAdapter
From org.bdgp.io.DataAdapter interface. no-op default implementation. A data adapter should override this if it needs to do some initialization.

Specified by:
init in interface org.bdgp.io.DataAdapter
Overrides:
init in class AbstractApolloAdapter

printTime

public void printTime(java.lang.String message)

getName

public java.lang.String getName()
Description copied from class: AbstractApolloAdapter
Name label for use in Data Adapter Chooser. Don't override this method--call setName from your constructor.

Specified by:
getName in interface org.bdgp.io.DataAdapter
Overrides:
getName in class AbstractApolloAdapter

getType

public java.lang.String getType()
Description copied from class: AbstractApolloAdapter
From org.bdgp.io.DataAdapter. Default implementation returns "". Override this to return a string describing the data adapter. The reason for the default implementation is that as far as I can tell getType is not used by apollo nor org.bdgp, so seems silly to require it. Am i missing something?

Specified by:
getType in interface org.bdgp.io.DataAdapter
Overrides:
getType in class AbstractApolloAdapter

getInputType

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

Specified by:
getInputType in interface ApolloDataAdapterI
Overrides:
getInputType in class AbstractApolloAdapter
See Also:
Should this go into org.bdgp.io.DataAdapter?

getInput

public java.lang.String getInput()
Description copied from class: 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?

Specified by:
getInput in interface ApolloDataAdapterI
Overrides:
getInput in class AbstractApolloAdapter

getSupportedOperations

public org.bdgp.io.IOOperation[] getSupportedOperations()
Description copied from interface: org.bdgp.io.DataAdapter
Returns a list of all operations supported by this data adapter


setRegion

public void setRegion(java.lang.String region)
               throws ApolloAdapterException
Set the region to be retrieved by subsequent calls to getCurrationSet().

Specified by:
setRegion in interface ApolloDataAdapterI
Overrides:
setRegion in class AbstractApolloAdapter
Parameters:
region - region to be retrieved. Region is encoded as parameters separated by spaces "CHR START END".
Throws:
ApolloAdapterException

getStateInformation

public java.util.Properties getStateInformation()
Description copied from interface: ApolloDataAdapterI
State info Properties carries all the info needed for the adapter to do its query This is an alternative to setDataInput. For most cases setDataInput should be sufficient. This should return StateInformation

Specified by:
getStateInformation in interface ApolloDataAdapterI
Overrides:
getStateInformation in class AbstractApolloAdapter

setStateInformation

public void setStateInformation(java.util.Properties props)
Description copied from interface: ApolloDataAdapterI
This should set StateInformation object! see StateInformation for Strings to use for keys.

Specified by:
setStateInformation in interface ApolloDataAdapterI
Overrides:
setStateInformation in class AbstractApolloAdapter

getCurationSetWithoutClearingData

protected CurationSet getCurationSetWithoutClearingData()
                                                 throws ApolloAdapterException
Throws:
ApolloAdapterException

getCurationSet

public CurationSet getCurationSet()
                           throws ApolloAdapterException
Description copied from interface: ApolloDataAdapterI
returns a saved CurationSet.

Specified by:
getCurationSet in interface ApolloDataAdapterI
Overrides:
getCurationSet in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getOrganism

protected java.lang.String getOrganism()
An ugly hack to tease the organism name from the database name Ignore it if this doesn't parse out


getLocation

protected org.ensembl19.datamodel.LinearLocation getLocation()
                                                      throws org.ensembl19.driver.AdaptorException,
                                                             org.ensembl19.driver.ConfigurationException
Returns:
ensj location corresponding to region, or null if no match exists.
Throws:
org.ensembl19.driver.AdaptorException
org.ensembl19.driver.ConfigurationException

getAnnotatedRegion

protected StrandedFeatureSetI getAnnotatedRegion(CurationSet curationSet)
                                          throws ApolloAdapterException
Returns:
object graph containing genes, transcripts and exons from the currently specified region as apollo annotation objects. Reads otter source (server or file) for annotations. Converts those annotations into Apollo objects. ONLY if the adapter has been specified an input server/file name. THAT will only happen if EditingEnabled has been marked as "true" on the style file for the adapter.
Throws:
ApolloAdapterException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getSequence

public SequenceI getSequence(java.lang.String id)
                      throws ApolloAdapterException
Description copied from interface: ApolloDataAdapterI
Strings for input types

Specified by:
getSequence in interface ApolloDataAdapterI
Overrides:
getSequence in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getSequence

public SequenceI getSequence(DbXref dbxref,
                             int start,
                             int end)
                      throws ApolloAdapterException
Specified by:
getSequence in interface ApolloDataAdapterI
Overrides:
getSequence in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getSequences

public java.util.Vector getSequences(DbXref[] dbxref)
                              throws ApolloAdapterException
Specified by:
getSequences in interface ApolloDataAdapterI
Overrides:
getSequences in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getSequences

public java.util.Vector getSequences(DbXref[] dbxref,
                                     int[] start,
                                     int[] end)
                              throws ApolloAdapterException
Specified by:
getSequences in interface ApolloDataAdapterI
Overrides:
getSequences in class AbstractApolloAdapter
Throws:
ApolloAdapterException

commitChanges

public void commitChanges(CurationSet curationSet)
                   throws ApolloAdapterException
Description copied from interface: ApolloDataAdapterI
writes the changes from a featureChangeLog to a writeable datasource. Not just a featureChangeLog - this writes out the whole curationSet

Specified by:
commitChanges in interface ApolloDataAdapterI
Overrides:
commitChanges in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getRawAnalysisResults

public java.lang.String getRawAnalysisResults(java.lang.String id)
                                       throws ApolloAdapterException
Specified by:
getRawAnalysisResults in interface ApolloDataAdapterI
Overrides:
getRawAnalysisResults in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getLoggingFile

public java.lang.String getLoggingFile()
Get the value of loggingFile.

Returns:
value of loggingFile.

setLoggingFile

public void setLoggingFile(java.lang.String v)
Set the value of loggingFile.

Parameters:
v - Value to assign to loggingFile.

getDriverConf

public java.util.Properties getDriverConf()
Get the value of driverConf.

Returns:
value of driverConf.

getDriver

protected org.ensembl19.driver.Driver getDriver()

getMode

protected int getMode()

setDriverConf

public void setDriverConf(java.util.Properties v)
Set the value of driverConf.

Parameters:
v - Value to assign to driverConf.

getRegion

protected java.lang.String getRegion()

getReferenceSequence

protected SequenceI getReferenceSequence()

clearStateInformation

public void clearStateInformation()
Description copied from class: AbstractApolloAdapter
This SHOULD reset all the contents of the stateInformation being held by an adapter: with setStateInformation, this is not guaranteed.

Overrides:
clearStateInformation in class AbstractApolloAdapter

validateRegionSpecified

protected void validateRegionSpecified(java.util.Properties properties)
                                throws ApolloAdapterException
Throws:
ApolloAdapterException