apollo.dataadapter.genbank
Class GenbankAdapter

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

public class GenbankAdapter
extends AbstractApolloAdapter


Field Summary
protected static org.apache.log4j.Logger logger
           
 
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
GenbankAdapter()
           
GenbankAdapter(DataInputType inputType, java.lang.String input)
           
GenbankAdapter(DataInputType inputType, java.lang.String input, boolean noGUI)
           
 
Method Summary
 void commitAccessions(boolean commit_acc)
           
 void commitChanges(CurationSet curation, boolean wantTabular)
          Write GenBank report in tabular or human-readable format, as requested
static java.lang.String get3primeStop(AnnotatedFeatureI sf)
           
static java.lang.String get5primeStart(AnnotatedFeatureI sf)
           
 CurationSet getCurationSet()
          from ApolloDataAdapterI interface.
static java.lang.String getDbXref(SequenceI seq)
           
protected static java.lang.String getGenbankType(java.lang.String type)
           
protected  java.lang.String getGeneProduct(AnnotatedFeatureI gene, Transcript transcript, java.lang.String CDS_start, java.lang.String CDS_stop, java.lang.String except, int na_except_pos)
           
protected  java.lang.String getIds(AnnotatedFeatureI gene, Transcript transcript)
           
protected  java.lang.String getLocus(AnnotatedFeatureI gene, java.lang.String tag)
          Change the flag that is passed if Genbank decides that some feature does/doesn't get the locus_tag field
static java.lang.String getProteinDesc(AnnotatedFeatureI gene, Transcript transcript)
           
 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
static java.lang.String getSequenceName(AnnotatedFeatureI gene, SequenceI seq, Transcript transcript)
           
 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()
          Doesn't seem to be used
 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.
protected  boolean knownToGenbank(Transcript transcript)
           
 void setInput(java.lang.String input)
          Input string that corresponds with the input type (e.g.
 void setRegion(SequenceI seq)
           
 void setRegion(java.lang.String region)
          This region doesnt seem to be used anywhere?
 void setStateInformation(java.util.Properties props)
          DataLoader calls this
 void setValidationFile(java.lang.String valid_filename)
           
protected  java.lang.String writeAccession(FeatureSetI fs)
           
protected  java.lang.String writeFasta(CurationSet curation)
           
protected  java.lang.String writeGene(AnnotatedFeatureI gene, java.util.Vector omit)
           
protected  java.lang.String writePeptide(AnnotatedFeatureI gene, java.io.File dir, java.util.Vector omit)
           
protected  java.lang.String writeTranscript(AnnotatedFeatureI gene, java.io.File dir, java.util.Vector omit)
           
 
Methods inherited from class apollo.dataadapter.AbstractApolloAdapter
addToCurationSet, cacheUI, canWriteData, clearOldData, clearStateInformation, commitChanges, commitChanges, commitChanges, commitChanges, commitChanges, commitChanges, getAdapters, getCachedUI, getChildAdapter, getChildAdapter, getCurationState, getDatabase, getDataInput, getDefaultStyle, getFilename, getInput, getInputType, getName, getNameAdapter, getNumberOfChildAdapters, getSpecies, getStyle, hasLinkData, isComposite, loadNewSpeciesFromLink, operationIsSupported, rollbackAnnotations, rollbackAnnotations, setCuration, setCurationNumber, setCurationState, setDatabase, setDataInput, setDataLoadListener, 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

GenbankAdapter

public GenbankAdapter()

GenbankAdapter

public GenbankAdapter(DataInputType inputType,
                      java.lang.String input)

GenbankAdapter

public GenbankAdapter(DataInputType inputType,
                      java.lang.String input,
                      boolean noGUI)
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()
Doesn't seem to be used

Specified by:
getType in interface org.bdgp.io.DataAdapter
Overrides:
getType 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.


setInput

public void setInput(java.lang.String input)
Input string that corresponds with the input type (e.g. gene name for gene input type)

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

commitAccessions

public void commitAccessions(boolean commit_acc)

setValidationFile

public void setValidationFile(java.lang.String valid_filename)

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)
DataLoader calls this

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

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

setRegion

public void setRegion(SequenceI seq)
               throws ApolloAdapterException
Throws:
ApolloAdapterException

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

commitChanges

public void commitChanges(CurationSet curation,
                          boolean wantTabular)
Write GenBank report in tabular or human-readable format, as requested


writeFasta

protected java.lang.String writeFasta(CurationSet curation)

getGenbankType

protected static java.lang.String getGenbankType(java.lang.String type)

getIds

protected java.lang.String getIds(AnnotatedFeatureI gene,
                                  Transcript transcript)

getGeneProduct

protected java.lang.String getGeneProduct(AnnotatedFeatureI gene,
                                          Transcript transcript,
                                          java.lang.String CDS_start,
                                          java.lang.String CDS_stop,
                                          java.lang.String except,
                                          int na_except_pos)

getLocus

protected java.lang.String getLocus(AnnotatedFeatureI gene,
                                    java.lang.String tag)
Change the flag that is passed if Genbank decides that some feature does/doesn't get the locus_tag field


writeGene

protected java.lang.String writeGene(AnnotatedFeatureI gene,
                                     java.util.Vector omit)

writeTranscript

protected java.lang.String writeTranscript(AnnotatedFeatureI gene,
                                           java.io.File dir,
                                           java.util.Vector omit)

writePeptide

protected java.lang.String writePeptide(AnnotatedFeatureI gene,
                                        java.io.File dir,
                                        java.util.Vector omit)

writeAccession

protected java.lang.String writeAccession(FeatureSetI fs)

get5primeStart

public static java.lang.String get5primeStart(AnnotatedFeatureI sf)

get3primeStop

public static java.lang.String get3primeStop(AnnotatedFeatureI sf)

getDbXref

public static java.lang.String getDbXref(SequenceI seq)

getProteinDesc

public static java.lang.String getProteinDesc(AnnotatedFeatureI gene,
                                              Transcript transcript)

getSequenceName

public static java.lang.String getSequenceName(AnnotatedFeatureI gene,
                                               SequenceI seq,
                                               Transcript transcript)

knownToGenbank

protected boolean knownToGenbank(Transcript transcript)

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

getCurationSet

public CurationSet getCurationSet()
                           throws ApolloAdapterException
from ApolloDataAdapterI interface. input type and input should be set previous to this

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