apollo.dataadapter.chado.jdbc
Interface ChadoInstance

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
FlybaseChadoInstance, ParameciumDBChadoInstance, RiceChadoInstance, TigrChadoInstance, TigrSybilChadoInstance

public interface ChadoInstance
extends java.lang.Cloneable

An interface whose goal is to capture all the observed differences between disparate sites' (e.g., FlyBase, TIGR) chado database usage.

Version:
$Revision: 1.49 $ $Date: 2008-10-03 16:50:26 $ $Author: gk_fan $

Method Summary
 boolean cacheAnalysisTable()
           
 void checkForLocation(DataInput dataInput)
          If dataInput is a location, change its SO type to be getLocationSeqType()
 ChadoInstance cloneInstance()
           
 java.lang.String getAnalysisType(long analysisId, java.lang.String program, java.lang.String programversion, java.lang.String sourcename)
          Return the Apollo analysis type for a chado analysis.
 StrandedFeatureSet getAnnotStrandedFeatSet()
           
 java.lang.String getCdsSql(apollo.dataadapter.chado.jdbc.FeatureLocImplementation featLocImp)
          Return an SQL query that will retrieve all CDS features within a specified range.
 java.lang.String getCdsTransRelationTerm()
           
 JdbcChadoAdapter getChadoAdapter()
           
 java.util.List getChadoTransMacros()
          This is the beginning of trying to get chado-adapter.xml and transactionXMLTemplate non-redundant, so you dont have to configure the same things twice.
 java.lang.String getCommentPropertyTerm()
           
 boolean getCopyGeneModelsIntoResultTier()
           
 CurationSet getCurationSet(ChadoAdapter adapter, java.lang.String seqType, java.lang.String seqId)
          Retrieve all the curation data (gene models, gene predictions, search results, etc.) for a single chado feature/sequence.
 CurationSet getCurationSetInRange(ChadoAdapter adapter, java.lang.String seqType, Region location)
          Retrieve all the curation data (gene models, gene predictions, search results, etc.) for a given region on a single chado feature/sequence.
 java.lang.String getExonTransRelationTerm()
           
 java.lang.String getFeatureCreateDatePropertyTerm()
           
 java.lang.String getFeatureCVName()
           
 java.lang.String getFeatureOwnerPropertyTerm()
           
 java.lang.String getFeatureType(java.lang.String alignType, java.lang.String program, java.lang.String programversion, java.lang.String targetSp, java.lang.String sourcename, java.lang.String featProp)
          Return the Apollo type for a search hit feature.
 java.lang.String getGeneNameField()
          Return the column in the chado feature table where the gene name can be found.
 ChadoProgram[] getGenePredictionPrograms()
           
 SeqType getLocationSeqType()
          Returns seq type that has location
 java.lang.String getLogDirectory()
           
 java.util.List getOneLevelAnnotTypes()
          Get a list of annotation types that are saved in the Chado database as one-level features.
 ChadoProgram[] getOneLevelResultPrograms()
          for simple results that are only 1 level deep
 java.lang.String getPartOfCvTerm()
          return string for "part_of" relationship (tigr part_of, fb partof)
 java.lang.String getPolypeptideCdsRelationTerm()
           
 java.lang.String getPolypeptideTransRelationTerm()
           
 java.lang.String getPolypeptideType()
          Old SO/SOFA uses "protein", new uses "polypeptide" (default)
 java.lang.String getPredictedCdsSql(apollo.dataadapter.chado.jdbc.FeatureLocImplementation featLocImp, ChadoProgram[] chadoPrgs)
          A variant of getCdsSql that returns an SQL query that only fetches a CDS feature if it was predicted by one of the programs in chadoPrgs for which isRetrieveCDS() is true.
 java.lang.String getPropertyTypeCVName()
           
 boolean getPureJDBCCopyOnWrite()
           
 boolean getPureJDBCNoCommit()
           
 boolean getPureJDBCUseCDS()
           
 boolean getPureJDBCWriteMode()
           
 boolean getQueryFeatureIdWithName()
           
 boolean getQueryFeatureIdWithUniquename()
           
 java.lang.String getRelationshipCVName()
           
 StrandedFeatureSet getResultStrandedFeatSet()
           
 ChadoProgram[] getSearchHitPrograms()
          Set array of strings for all search hit programs.
 java.lang.String getSeqDescriptionCVName()
           
 java.lang.String getSeqDescriptionTerm()
           
 SeqType getSeqType(int i)
          Return ith SeqType
 SeqType getSeqType(java.lang.String name)
          SeqType for name
 int getSeqTypesSize()
          Return number of seq types for instance
 java.lang.String getSynonymPropertyTerm()
           
 java.lang.String getSyntenyRelationshipType()
           
 java.lang.String getTargetName(java.lang.String chadoName, java.lang.String species, java.lang.String alignType)
          Return the name to use for a target sequence in a search hit.
 java.util.List getThreeLevelAnnotTypes()
          Get a list of features that are stored in the chado db as three-level features (gene-namedFeature-exon).
 apollo.dataadapter.chado.jdbc.FeatureLocImplementation getTopFeatLoc()
           
 java.lang.String getTopLevelFeatType()
          Top level feature type is needed for saving back to chado.
 java.lang.Long getTranscriptCvTermId()
           
 java.lang.String getTranscriptName(FeatureSet tfs, java.lang.String program)
           
 java.lang.String getTranscriptNameField()
          Return the column in the chado feature table where the transcript name can be found.
 java.lang.String getTranscriptTerm()
           
 java.lang.String getTransGeneRelationTerm()
           
 java.lang.String getTransProtRelationTerm()
           
 boolean getUseSynonyms()
           
 java.lang.String getWritebackTemplateFile()
           
 boolean searchHitsHaveFeatLocs()
          returns true if search hits have feature locs.
 void setCacheAnalysisTable(boolean cache)
           
 void setCdsTransRelationTerm(java.lang.String term)
           
 void setChadoAdapter(JdbcChadoAdapter jdbcAdapter)
           
 void setCommentPropertyTerm(java.lang.String commentTerm)
           
 void setCopyGeneModelsIntoResultTier(boolean copyModels)
           
 void setExonTransRelationTerm(java.lang.String term)
           
 void setFeatureCreateDatePropertyTerm(java.lang.String term)
           
 void setFeatureCVName(java.lang.String cvname)
           
 void setFeatureOwnerPropertyTerm(java.lang.String term)
           
 void setGenePredictionPrograms(ChadoProgram[] predictionPrograms)
           
 void setId(java.lang.String id)
           
 void setLogDirectory(java.lang.String path)
           
 void setOneLevelAnnotTypes(java.util.List features)
          Set a list of annotation types that are saved in the Chado database as one-level features.
 void setOneLevelResultPrograms(ChadoProgram[] oneLevelResultPrograms)
           
 void setPartOfCvTerm(java.lang.String term)
           
 void setPolypeptideCdsRelationTerm(java.lang.String term)
           
 void setPolypeptideTransRelationTerm(java.lang.String term)
           
 void setPolypeptideType(java.lang.String polypeptideType)
           
 void setPropertyTypeCVName(java.lang.String cv)
           
 void setPureJDBCCopyOnWrite(boolean copyOnWrite)
           
 void setPureJDBCNoCommit(boolean noCommit)
           
 void setPureJDBCUseCDS(boolean useCDS)
           
 void setPureJDBCWriteMode(boolean writeMode)
           
 void setQueryFeatureIdWithName(boolean newVal)
           
 void setQueryFeatureIdWithUniquename(boolean newVal)
           
 void setRelationshipCVName(java.lang.String relCV)
           
 void setRetrieveAnnotations(boolean retrieveAnnots)
           
 void setSearchHitPrograms(ChadoProgram[] searchHitPrograms)
           
 void setSearchHitsHaveFeatLocs(boolean haveFeatLocs)
           
 void setSeqDescriptionCVName(java.lang.String cvName)
           
 void setSeqDescriptionTerm(java.lang.String term)
           
 void setSeqTypeList(java.util.List seqTypes)
           
 void setSynonymPropertyTerm(java.lang.String commentTerm)
           
 void setSyntenyRelationshipType(java.lang.String syntenyRelationshipType)
           
 void setThreeLevelAnnotTypes(java.util.List features)
          Set a list of features that are saved in the chado db as three-level features.
 void setTransGeneRelationTerm(java.lang.String term)
           
 void setTranslationStartAndStop(FeatureSet trans, apollo.dataadapter.chado.jdbc.ChadoCds cds)
          Using ChadoCds set the start and stop of translation for a FeatureSet (i.e.
 void setTranslationStartAndStop(Transcript trans, apollo.dataadapter.chado.jdbc.ChadoCds cds)
          Using ChadoCds set start and stop of transcript.
 void setTransProtRelationTerm(java.lang.String term)
           
 void setUseSynonyms(boolean useSynonyms)
           
 void setWritebackTemplateFile(java.lang.String templateFile)
           
 boolean typeHasStartAndEnd(java.lang.String typeName)
          Does type require start & end data
 

Method Detail

setId

void setId(java.lang.String id)

setChadoAdapter

void setChadoAdapter(JdbcChadoAdapter jdbcAdapter)

getChadoAdapter

JdbcChadoAdapter getChadoAdapter()

getResultStrandedFeatSet

StrandedFeatureSet getResultStrandedFeatSet()

getAnnotStrandedFeatSet

StrandedFeatureSet getAnnotStrandedFeatSet()

getTopFeatLoc

apollo.dataadapter.chado.jdbc.FeatureLocImplementation getTopFeatLoc()

getCurationSet

CurationSet getCurationSet(ChadoAdapter adapter,
                           java.lang.String seqType,
                           java.lang.String seqId)
Retrieve all the curation data (gene models, gene predictions, search results, etc.) for a single chado feature/sequence.

Parameters:
adapter - ChadoAdapter on whose behalf the database accesses are to be performed.
seqType - cvterm.name that corresponds to the sequence identified by seqId
seqId - Chado feature_id of the sequence to be displayed/annotated in Apollo.
Returns:
a CurationSet containing all the features on seqId

getCurationSetInRange

CurationSet getCurationSetInRange(ChadoAdapter adapter,
                                  java.lang.String seqType,
                                  Region location)
Retrieve all the curation data (gene models, gene predictions, search results, etc.) for a given region on a single chado feature/sequence.

Parameters:
adapter - ChadoAdapter on whose behalf the database accesses are to be performed.
seqType - cvterm.name that corresponds to the sequence identified by location
location - The region for which to retrieve data.
conn - JDBC connection to the database
Returns:
a CurationSet containing all the features in the region given by location

getGeneNameField

java.lang.String getGeneNameField()
Return the column in the chado feature table where the gene name can be found. The adapter will call setName() on each new gene using the value in this field.

Returns:
The name of a field/column in the chado "feature" table.

getTranscriptNameField

java.lang.String getTranscriptNameField()
Return the column in the chado feature table where the transcript name can be found. The adapter will call setName() on each new transcript using the value in this field.

Returns:
The name of a field/column in the chado "feature" table.

getCdsSql

java.lang.String getCdsSql(apollo.dataadapter.chado.jdbc.FeatureLocImplementation featLocImp)
                           throws apollo.dataadapter.chado.jdbc.RelationshipCVException
Return an SQL query that will retrieve all CDS features within a specified range. The way that CDS and protein/polypeptide features are stored in different chado instances is sufficiently different that the entire SQL query must be returned. The SQL result set must contain (at least) the following fields:

Parameters:
featLocImp - The region whose CDS features the SQL query should retrieve.
Returns:
A string containing a valid SQL query.
Throws:
apollo.dataadapter.chado.jdbc.RelationshipCVException

getPredictedCdsSql

java.lang.String getPredictedCdsSql(apollo.dataadapter.chado.jdbc.FeatureLocImplementation featLocImp,
                                    ChadoProgram[] chadoPrgs)
                                    throws apollo.dataadapter.chado.jdbc.RelationshipCVException
A variant of getCdsSql that returns an SQL query that only fetches a CDS feature if it was predicted by one of the programs in chadoPrgs for which isRetrieveCDS() is true.

Parameters:
featLocImp - The region whose CDS features the SQL query should retrieve.
chadoPrgs - Fetch only CDS features predicted by one of these programs.
Returns:
A string containing a valid SQL query.
Throws:
RelationshipCVException
See Also:
getCdsSql(FeatureLocImplementation)

setTranslationStartAndStop

void setTranslationStartAndStop(Transcript trans,
                                apollo.dataadapter.chado.jdbc.ChadoCds cds)
Using ChadoCds set start and stop of transcript. Flybase just sets start, lets apollo calculate stop. TIGR sets start and stop explicitly.

Parameters:
trans - Transcript whose start and stop should be set.
cds - CDS used to determine start and stop

setTranslationStartAndStop

void setTranslationStartAndStop(FeatureSet trans,
                                apollo.dataadapter.chado.jdbc.ChadoCds cds)
Using ChadoCds set the start and stop of translation for a FeatureSet (i.e. predicted transcript).

Parameters:
trans - Transcript whose start and stop should be set.
cds - CDS used to determine start and stop

getTargetName

java.lang.String getTargetName(java.lang.String chadoName,
                               java.lang.String species,
                               java.lang.String alignType)
Return the name to use for a target sequence in a search hit. Used in JdbcChadoAdapter.addSearchHits

Parameters:
chadoName - chado feature.uniquename of the feature/sequence
species - organism name generated by JdbcChadoAdapter.getOrganismFullName
alignType - cv.name for the leaf alignment/search hit object
Returns:
The string that will be used to name the target Sequence in the search hit.

getFeatureType

java.lang.String getFeatureType(java.lang.String alignType,
                                java.lang.String program,
                                java.lang.String programversion,
                                java.lang.String targetSp,
                                java.lang.String sourcename,
                                java.lang.String featProp)
Return the Apollo type for a search hit feature.

Parameters:
alignType - cv.name for the leaf alignment/search hit object
program - value from analysis.program for the search hit
programversion - value from analysis.programversion for the searc
targetSp - organism name generated by JdbcChadoAdapter.getOrganismFullName
featProp - optional featureprop value associated with the search hit
Returns:
A string containing the type of the specified search hit feature.

getFeatureCVName

java.lang.String getFeatureCVName()
Returns:
Name of the chado CV from which to draw feature terms.

setFeatureCVName

void setFeatureCVName(java.lang.String cvname)

getRelationshipCVName

java.lang.String getRelationshipCVName()
Returns:
Name of the chado CV from which to draw relationship terms.

setRelationshipCVName

void setRelationshipCVName(java.lang.String relCV)

getPropertyTypeCVName

java.lang.String getPropertyTypeCVName()
Returns:
Name of the chado CV from which to draw property type terms.

setPropertyTypeCVName

void setPropertyTypeCVName(java.lang.String cv)

getPartOfCvTerm

java.lang.String getPartOfCvTerm()
return string for "part_of" relationship (tigr part_of, fb partof)


setPartOfCvTerm

void setPartOfCvTerm(java.lang.String term)

getTranscriptTerm

java.lang.String getTranscriptTerm()

getTranscriptCvTermId

java.lang.Long getTranscriptCvTermId()

getTransProtRelationTerm

java.lang.String getTransProtRelationTerm()

setTransProtRelationTerm

void setTransProtRelationTerm(java.lang.String term)

getTransGeneRelationTerm

java.lang.String getTransGeneRelationTerm()

setTransGeneRelationTerm

void setTransGeneRelationTerm(java.lang.String term)

getExonTransRelationTerm

java.lang.String getExonTransRelationTerm()

setExonTransRelationTerm

void setExonTransRelationTerm(java.lang.String term)

getCdsTransRelationTerm

java.lang.String getCdsTransRelationTerm()

setCdsTransRelationTerm

void setCdsTransRelationTerm(java.lang.String term)

getPolypeptideCdsRelationTerm

java.lang.String getPolypeptideCdsRelationTerm()

setPolypeptideCdsRelationTerm

void setPolypeptideCdsRelationTerm(java.lang.String term)

getPolypeptideTransRelationTerm

java.lang.String getPolypeptideTransRelationTerm()

setPolypeptideTransRelationTerm

void setPolypeptideTransRelationTerm(java.lang.String term)

getPolypeptideType

java.lang.String getPolypeptideType()
Old SO/SOFA uses "protein", new uses "polypeptide" (default)


setPolypeptideType

void setPolypeptideType(java.lang.String polypeptideType)

getSyntenyRelationshipType

java.lang.String getSyntenyRelationshipType()

setSyntenyRelationshipType

void setSyntenyRelationshipType(java.lang.String syntenyRelationshipType)

getFeatureOwnerPropertyTerm

java.lang.String getFeatureOwnerPropertyTerm()

setFeatureOwnerPropertyTerm

void setFeatureOwnerPropertyTerm(java.lang.String term)

getFeatureCreateDatePropertyTerm

java.lang.String getFeatureCreateDatePropertyTerm()

setFeatureCreateDatePropertyTerm

void setFeatureCreateDatePropertyTerm(java.lang.String term)

setCommentPropertyTerm

void setCommentPropertyTerm(java.lang.String commentTerm)

getCommentPropertyTerm

java.lang.String getCommentPropertyTerm()

setSynonymPropertyTerm

void setSynonymPropertyTerm(java.lang.String commentTerm)

getSynonymPropertyTerm

java.lang.String getSynonymPropertyTerm()

getSeqDescriptionCVName

java.lang.String getSeqDescriptionCVName()

setSeqDescriptionCVName

void setSeqDescriptionCVName(java.lang.String cvName)

getSeqDescriptionTerm

java.lang.String getSeqDescriptionTerm()

setSeqDescriptionTerm

void setSeqDescriptionTerm(java.lang.String term)

getOneLevelAnnotTypes

java.util.List getOneLevelAnnotTypes()
Get a list of annotation types that are saved in the Chado database as one-level features. A one-level annotation is a non-analysis feature that is featureloc'ed directly to a sequence of interest, with no additional structure.

Returns:
a list of chado cvterm.name

setOneLevelAnnotTypes

void setOneLevelAnnotTypes(java.util.List features)
Set a list of annotation types that are saved in the Chado database as one-level features.

Parameters:
features - a list of chado cvterm.name

getThreeLevelAnnotTypes

java.util.List getThreeLevelAnnotTypes()
Get a list of features that are stored in the chado db as three-level features (gene-namedFeature-exon).

Returns:
a list of chado cvterm.name (?)

setThreeLevelAnnotTypes

void setThreeLevelAnnotTypes(java.util.List features)
Set a list of features that are saved in the chado db as three-level features. (gene-namedFeature-exon).

Parameters:
features - a list of feature names.

getGenePredictionPrograms

ChadoProgram[] getGenePredictionPrograms()
Returns:
an array of program objects. These objects are created during the xml configuration parsing.

setGenePredictionPrograms

void setGenePredictionPrograms(ChadoProgram[] predictionPrograms)

getTranscriptName

java.lang.String getTranscriptName(FeatureSet tfs,
                                   java.lang.String program)

getSearchHitPrograms

ChadoProgram[] getSearchHitPrograms()
Set array of strings for all search hit programs. This comes from xml configuration. A program string can have % wildcards in them as they are queried with "like" not "=".


setSearchHitPrograms

void setSearchHitPrograms(ChadoProgram[] searchHitPrograms)

searchHitsHaveFeatLocs

boolean searchHitsHaveFeatLocs()
returns true if search hits have feature locs. Hits are the feature sets that hold the leaf/hsps. The leaves always have feat-locs, but the featSet/hits dont always have feat locs, which makes it impractical to retrieve out of range leaves/hsps. Currently rice has hit feat locs, fly & tigr dont


setSearchHitsHaveFeatLocs

void setSearchHitsHaveFeatLocs(boolean haveFeatLocs)

getAnalysisType

java.lang.String getAnalysisType(long analysisId,
                                 java.lang.String program,
                                 java.lang.String programversion,
                                 java.lang.String sourcename)
Return the Apollo analysis type for a chado analysis.

Parameters:
analysisId - chado analysis.analysis_id
program - chado analysis.program
programversion - chado analysis.programversion
sourcename - chado analysis.sourcename
Returns:
The Apollo type to be used for all features from this analysis.

getOneLevelResultPrograms

ChadoProgram[] getOneLevelResultPrograms()
for simple results that are only 1 level deep


setOneLevelResultPrograms

void setOneLevelResultPrograms(ChadoProgram[] oneLevelResultPrograms)

setSeqTypeList

void setSeqTypeList(java.util.List seqTypes)

getSeqTypesSize

int getSeqTypesSize()
Return number of seq types for instance


getSeqType

SeqType getSeqType(int i)
Return ith SeqType


getSeqType

SeqType getSeqType(java.lang.String name)
SeqType for name


getLocationSeqType

SeqType getLocationSeqType()
Returns seq type that has location


typeHasStartAndEnd

boolean typeHasStartAndEnd(java.lang.String typeName)
Does type require start & end data


getTopLevelFeatType

java.lang.String getTopLevelFeatType()
Top level feature type is needed for saving back to chado. Also for querying locations from the command line (where type isn't given). This is configured in chado-adapter cfg file


checkForLocation

void checkForLocation(DataInput dataInput)
If dataInput is a location, change its SO type to be getLocationSeqType()


setCacheAnalysisTable

void setCacheAnalysisTable(boolean cache)

cacheAnalysisTable

boolean cacheAnalysisTable()

setRetrieveAnnotations

void setRetrieveAnnotations(boolean retrieveAnnots)

setCopyGeneModelsIntoResultTier

void setCopyGeneModelsIntoResultTier(boolean copyModels)

getCopyGeneModelsIntoResultTier

boolean getCopyGeneModelsIntoResultTier()

getUseSynonyms

boolean getUseSynonyms()

setUseSynonyms

void setUseSynonyms(boolean useSynonyms)

getChadoTransMacros

java.util.List getChadoTransMacros()
This is the beginning of trying to get chado-adapter.xml and transactionXMLTemplate non-redundant, so you dont have to configure the same things twice. A bunch of the preamble macros can be figured now from chado-adpter.xml config and dont need to be in the template


setWritebackTemplateFile

void setWritebackTemplateFile(java.lang.String templateFile)

getWritebackTemplateFile

java.lang.String getWritebackTemplateFile()

setPureJDBCWriteMode

void setPureJDBCWriteMode(boolean writeMode)

getPureJDBCWriteMode

boolean getPureJDBCWriteMode()

setPureJDBCCopyOnWrite

void setPureJDBCCopyOnWrite(boolean copyOnWrite)

getPureJDBCCopyOnWrite

boolean getPureJDBCCopyOnWrite()

setPureJDBCNoCommit

void setPureJDBCNoCommit(boolean noCommit)

getPureJDBCNoCommit

boolean getPureJDBCNoCommit()

setPureJDBCUseCDS

void setPureJDBCUseCDS(boolean useCDS)

getPureJDBCUseCDS

boolean getPureJDBCUseCDS()

setLogDirectory

void setLogDirectory(java.lang.String path)

getLogDirectory

java.lang.String getLogDirectory()

setQueryFeatureIdWithUniquename

void setQueryFeatureIdWithUniquename(boolean newVal)

getQueryFeatureIdWithUniquename

boolean getQueryFeatureIdWithUniquename()

setQueryFeatureIdWithName

void setQueryFeatureIdWithName(boolean newVal)

getQueryFeatureIdWithName

boolean getQueryFeatureIdWithName()

cloneInstance

ChadoInstance cloneInstance()