apollo.dataadapter
Class BaseGFFAdapter

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

public class BaseGFFAdapter
extends AbstractApolloAdapter

I'm a variant of a GFFAdapter that does NO translation of the features I read into sets of features (ie no post-processing of the data). That is, I will read features (or feature pairs) and place them into a StrandedFeatureSet, place those into a curation set, and hand out the curation set.


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
BaseGFFAdapter()
           
BaseGFFAdapter(java.lang.String filename)
           
 
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 curation)
          writes the changes from a featureChangeLog to a writeable datasource.
protected  java.lang.String findFile(java.lang.String name)
           
 StrandedFeatureSetI getAnalysisRegion()
           
 FeatureSetI getAnnotatedRegion()
           
 StrandedFeatureSetI getAnnotRegion()
           
 CurationSet getCurationSet()
          returns a saved CurationSet.
 java.lang.String getFilename()
          Returns null if not file
protected  GFFFile getGFFFile()
           
 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...)
 java.lang.String getRawAnalysisResults(java.lang.String id)
           
 Sequence getSequence()
           
 SequenceI getSequence(DbXref dbxref)
           
 SequenceI getSequence(DbXref dbxref, int start, int end)
           
 SequenceI getSequence(java.lang.String id)
          Strings for input types
 java.lang.String getSequenceFilename()
           
 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.
 org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
          Returns a user interface for the requested IOOperation.
 void init()
          From org.bdgp.io.DataAdapter interface.
static void main(java.lang.String[] args)
           
 void readSequence(java.lang.String file, CurationSet curation)
           
 void saveSequence(SequenceI seq)
           
 void setDataInput(DataInput dataInput)
          This should replace setInput.
 void setFilename(java.lang.String filename)
          determines whether the entered 'filename' is in fact a url.If it is then retrieves the GFF file via HTTP, to a temp file, and sets fileName to this temp file.
 void setSequenceFilename(java.lang.String seqfile)
           
 void setStateInformation(java.util.Properties props)
          This should set StateInformation object! see StateInformation for Strings to use for keys.
 java.lang.String writeAnalyses(CurationSet curation)
           
 java.lang.String writeAnalysis(FeatureSetI sf)
           
 java.lang.String writeAnnotation(AnnotatedFeatureI sf)
           
 java.lang.String writeAnnotations(CurationSet curation)
           
 void writeGFF(CurationSet curation, java.io.OutputStream os)
           
 java.lang.String writeTranscript(Transcript trans, boolean isa_gene)
           
 
Methods inherited from class apollo.dataadapter.AbstractApolloAdapter
addToCurationSet, cacheUI, canWriteData, clearOldData, commitChanges, commitChanges, commitChanges, commitChanges, commitChanges, getAdapters, getCachedUI, getChildAdapter, getChildAdapter, getCurationState, getDatabase, getDataInput, getDefaultStyle, getName, getNameAdapter, getNumberOfChildAdapters, getSpecies, getStyle, hasLinkData, isComposite, loadNewSpeciesFromLink, operationIsSupported, rollbackAnnotations, rollbackAnnotations, setCuration, setCurationNumber, setCurationState, setDatabase, setDataLoadListener, setInput, setInputType, setLocation, setName, setPadLeft, setPadRight, setRegion, 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

BaseGFFAdapter

public BaseGFFAdapter(java.lang.String filename)

BaseGFFAdapter

public BaseGFFAdapter()
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

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


getUI

public org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
Description copied from interface: org.bdgp.io.VisualDataAdapter
Returns a user interface for the requested IOOperation. Most VisualDataAdapters will return a different user interface for each supported IOOperation.


setFilename

public void setFilename(java.lang.String filename)
                 throws ApolloAdapterException
determines whether the entered 'filename' is in fact a url.If it is then retrieves the GFF file via HTTP, to a temp file, and sets fileName to this temp file. Otherwise, simply sets fileName to the entered filename

Throws:
ApolloAdapterException

getFilename

public java.lang.String getFilename()
Description copied from class: AbstractApolloAdapter
Returns null if not file

Overrides:
getFilename in class AbstractApolloAdapter

setDataInput

public void setDataInput(DataInput dataInput)
Description copied from interface: ApolloDataAdapterI
This should replace setInput. setInput is limited to just a String which is awkward for locations where you have to jam several fields into one String. DataInput deals with locations much better. DataInput can complement stateInfo (hopefully?)

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

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
Description copied from interface: ApolloDataAdapterI
returns a saved CurationSet.

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

getGFFFile

protected GFFFile getGFFFile()
                      throws org.bdgp.io.DataAdapterException
Throws:
org.bdgp.io.DataAdapterException

findFile

protected java.lang.String findFile(java.lang.String name)
                             throws org.bdgp.io.DataAdapterException
Throws:
org.bdgp.io.DataAdapterException

getAnalysisRegion

public StrandedFeatureSetI getAnalysisRegion()
                                      throws org.bdgp.io.DataAdapterException
Throws:
org.bdgp.io.DataAdapterException

getAnnotRegion

public StrandedFeatureSetI getAnnotRegion()

main

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

getAnnotatedRegion

public FeatureSetI getAnnotatedRegion()
                               throws org.bdgp.io.DataAdapterException
Throws:
org.bdgp.io.DataAdapterException

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

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

commitChanges

public void commitChanges(CurationSet curation)
                   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

writeGFF

public void writeGFF(CurationSet curation,
                     java.io.OutputStream os)

writeAnnotations

public java.lang.String writeAnnotations(CurationSet curation)

writeAnnotation

public java.lang.String writeAnnotation(AnnotatedFeatureI sf)

writeTranscript

public java.lang.String writeTranscript(Transcript trans,
                                        boolean isa_gene)

writeAnalyses

public java.lang.String writeAnalyses(CurationSet curation)

writeAnalysis

public java.lang.String writeAnalysis(FeatureSetI sf)

getSequence

public Sequence getSequence()

readSequence

public void readSequence(java.lang.String file,
                         CurationSet curation)
                  throws org.bdgp.io.DataAdapterException
Throws:
org.bdgp.io.DataAdapterException

setSequenceFilename

public void setSequenceFilename(java.lang.String seqfile)

getSequenceFilename

public java.lang.String getSequenceFilename()

saveSequence

public void saveSequence(SequenceI seq)
                  throws org.bdgp.io.DataAdapterException
Throws:
org.bdgp.io.DataAdapterException

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