apollo.dataadapter.synteny
Class SyntenyAdapter

java.lang.Object
  extended by org.bdgp.io.AbstractDataAdapter
      extended by apollo.dataadapter.AbstractApolloAdapter
          extended by apollo.dataadapter.synteny.SyntenyAdapter
All Implemented Interfaces:
ApolloDataAdapterI, org.bdgp.io.DataAdapter, org.bdgp.io.VisualDataAdapter

public class SyntenyAdapter
extends AbstractApolloAdapter

When the user selects "Synteny" from the datachooser menu, I am the adapter that's loaded. Note that all of my hard work is really done by my GUI - SyntenyAdapterGUI. In particular, the data-fetching is run by the doOperation method on the GUI.


Field Summary
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class apollo.dataadapter.AbstractApolloAdapter
curation_set, region, 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
SyntenyAdapter()
           
 
Method Summary
 void clearStateInformation()
          Does nothing yet, because the state info isn't being used on this adapter yet.
 void commitChanges(CompositeDataHolder cdh)
          Write out composite data holder to multiple data adapters - called by DataLoader/FileMenu not SynAdapGUI
 void commitChanges(CurationSet curationSet)
          I think this is now pase and should be deleted - always gets a CompositeDataHolder now - this is actually not called by SyntenyAdapterGUI.doOp(WRITE) - calls child adapter guis doOp this is called by DataLoader though
 java.util.Map getAdapters()
          maps adapter "logical name"/label to the adapter itself
 ApolloDataAdapterI getChildAdapter(int i)
          Throws not implemented exception as by default data adapter dont have species adapter (isComposite()=false).
 CurationSet getCurationSet()
          Visit each child adapter and ask each one for its CurationSet.
 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()
          This is an arcane requirement to get the File->Save menu to light up.
 java.lang.String getName()
          Name label for use in Data Adapter Chooser.
 int getNumberOfChildAdapters()
          From ApolloDataAdapterI
 java.lang.String getRawAnalysisResults(java.lang.String id)
           
 SequenceI getSequence(DbXref dbxref)
           
 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)
           
 ApolloDataAdapterI getSpeciesAdapter(java.lang.String species)
           
 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.
 org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
          gets ui for op from cache.
 void init()
          From org.bdgp.io.DataAdapter interface.
 boolean isComposite()
          By default return false - data adapter is not composite.
 void loadNewSpeciesFromLink(SeqFeatureI link, CompositeDataHolder compData)
          From ApolloDataAdapterI.
 CompositeDataHolder loadSpeciesThatContainLinks(int numberOfSpecies)
          Load data from dataadapters where the link information is embedded in the species data (rather than coming from a separate source).
 void setRegion(java.lang.String region)
          This region doesnt seem to be used anywhere?
 void setStateInformation(java.util.Properties props)
          This should set StateInformation object! see StateInformation for Strings to use for keys.
 
Methods inherited from class apollo.dataadapter.AbstractApolloAdapter
addToCurationSet, cacheUI, canWriteData, clearOldData, commitChanges, commitChanges, commitChanges, commitChanges, getCachedUI, getChildAdapter, getCurationState, getDatabase, getDataInput, getDefaultStyle, getFilename, getNameAdapter, getSpecies, getStyle, hasLinkData, 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, removeProgressListener
 

Field Detail

logger

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

SyntenyAdapter

public SyntenyAdapter()
Method Detail

getAdapters

public java.util.Map getAdapters()
maps adapter "logical name"/label to the adapter itself

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

getSpeciesAdapter

public ApolloDataAdapterI getSpeciesAdapter(java.lang.String species)

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()
This is an arcane requirement to get the File->Save menu to light up.

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


getUI

public org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
gets ui for op from cache. if not there creates new one, adds to cache


setRegion

public void setRegion(java.lang.String region)
               throws ApolloAdapterException
Description copied from class: AbstractApolloAdapter
This region doesnt seem to be used anywhere?

Specified by:
setRegion in interface ApolloDataAdapterI
Overrides:
setRegion in class AbstractApolloAdapter
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

getCurationSet

public CurationSet getCurationSet()
                           throws ApolloAdapterException
Visit each child adapter and ask each one for its CurationSet. combine the results into a composite curation set.

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

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)
                      throws ApolloAdapterException
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(CompositeDataHolder cdh)
                   throws ApolloAdapterException
Write out composite data holder to multiple data adapters - called by DataLoader/FileMenu not SynAdapGUI

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

commitChanges

public void commitChanges(CurationSet curationSet)
                   throws ApolloAdapterException
I think this is now pase and should be deleted - always gets a CompositeDataHolder now - this is actually not called by SyntenyAdapterGUI.doOp(WRITE) - calls child adapter guis doOp this is called by DataLoader though

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

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

getNumberOfChildAdapters

public int getNumberOfChildAdapters()
From ApolloDataAdapterI

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

getChildAdapter

public ApolloDataAdapterI getChildAdapter(int i)
Description copied from class: AbstractApolloAdapter
Throws not implemented exception as by default data adapter dont have species adapter (isComposite()=false). SyntenyAdapter overrides this, and returns its species adapters

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

loadSpeciesThatContainLinks

public CompositeDataHolder loadSpeciesThatContainLinks(int numberOfSpecies)
                                                throws org.bdgp.io.DataAdapterException
Load data from dataadapters where the link information is embedded in the species data (rather than coming from a separate source). Presently only the game adapter does this. This is public because TestApollo uses it.

Throws:
org.bdgp.io.DataAdapterException

loadNewSpeciesFromLink

public void loadNewSpeciesFromLink(SeqFeatureI link,
                                   CompositeDataHolder compData)
                            throws org.bdgp.io.DataAdapterException
From ApolloDataAdapterI. Bring up the link as a species in synteny.

Specified by:
loadNewSpeciesFromLink in interface ApolloDataAdapterI
Overrides:
loadNewSpeciesFromLink in class AbstractApolloAdapter
Throws:
org.bdgp.io.DataAdapterException

clearStateInformation

public void clearStateInformation()
Does nothing yet, because the state info isn't being used on this adapter yet.

Overrides:
clearStateInformation in class AbstractApolloAdapter

isComposite

public boolean isComposite()
Description copied from class: AbstractApolloAdapter
By default return false - data adapter is not composite. SyntenyAdpapter overrides this to return true.

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