|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bdgp.io.AbstractDataAdapter
apollo.dataadapter.AbstractApolloAdapter
apollo.dataadapter.chado.ChadoAdapter
public class ChadoAdapter
A data adapter that allows Apollo to communicate with a Chado-compliant relational database. Note that this class is one of two adapter classes required by the Apollo data adapter specification; the other one is ChadoAdapterGUI.
This data adapter was written primarily as an exercise to help me to learn the Chado schema (as it was implemented at TIGR in late 2003.) Therefore there are numerous caveats, of which a few are listed below:
Finally, here are some thoughts on two additional topics; the first is the question of SO-compliance, and the second is the issue of how to refactor the adapter to make it more configurable. 1. SO compliance: the adapter is definitely *not* SO-compliant, although it could probably be made to work with a SO-enabled version of Chado simply by looking up the cvterm_ids for the crucial elements of the central dogma on which the gene representation depends (e.g. exon, transcript, etc.) Handling inheritance properly and dynamically discovering the relationships between SO terms by querying the database, however, is likely to be a more challenging undertaking. In other words, getting it to work should be easy, but getting it to work right is likely to be hard. (Isn't this always the way?) 2. Making the adapter more configurable. Good progress has already been made on this front in terms of setting up the architecture to allow connections to different types of Chado databases (Sybase, PostgresQL, etc.), although this has not been tested. What the adapter really needs is a way for the user (or Apollo "administrator" or application programmer) to configure what annotations should be read from different data sources. One thing that significantly impeded efforts to use Apollo here at TIGR is the fact that Apollo supports only one tiers file for each data adapter. This is fine if you only have a couple of different databases, but we have tens or hundreds, each with different data, and we would really like to be able to configure the display on a finer-grained basis than is allowed by the current setup.
ChadoAdapterGUI| Field Summary | |
|---|---|
static java.lang.String |
CHADO_DB
|
static java.lang.String |
DRIVER_CLASS
|
static java.lang.String |
JDBC_URL
|
protected static org.apache.log4j.Logger |
logger
|
static java.lang.String |
PASSWORD
|
protected java.util.Properties |
stateInfo
The current driver properties set by the GUI in the most recent call to setStateInformation. |
protected org.bdgp.io.IOOperation[] |
SUPPORTED_OPS
Array containing the list of IO operations supported by this adapter; currently the adapter supports read-only access to a Chado database. |
static java.lang.String |
USERNAME
|
| 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 | |
|---|---|
ChadoAdapter()
|
|
| Method Summary | |
|---|---|
java.lang.Boolean |
addToCurationSet()
|
void |
commitChanges(CurationSet curation)
Writes back curation set via jdbc, using the curations sets transactions |
ChadoDatabase |
getActiveDatabase()
Returns active database. |
CurationSet |
getCurationSet()
returns a saved CurationSet. |
java.lang.String |
getGFFSource()
|
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 |
protected void |
getSequenceList(java.lang.String featType,
java.util.Vector uniquenames,
java.util.Vector descriptions)
Read a list of sequence IDs and descriptions into two parallel Vectors. |
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. |
Style |
getStyle()
A chado database can set its own style. |
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. |
boolean |
hasLinkData()
Return true - this means that the features potentially have synteny data associated with them and then can be used in the synteny viewer this follows the game model of embedding links in the features |
void |
init()
From org.bdgp.io.DataAdapter interface. |
void |
setDbLoginForDefaultDb(java.lang.String login)
Created to modify the login/username from the command line |
void |
setDbPassAndActiveForDb(java.lang.String chadoDb,
java.lang.String pass)
Set password to pass for the chadoDB identified by chadoDb and set this DB as active Created to modify the password from the command line |
void |
setDbPassForDb(java.lang.String chadoDb,
java.lang.String pass)
Set password to pass for the chadoDB identified by chadoDb Created to modify the password from the command line |
void |
setDbPassForDefaultDb(java.lang.String pass)
Created to modify the password from the command line |
void |
setFlatFileWriteMode(boolean flatFileWriteMode)
Used to set the flat file write mode flag from the command line. |
void |
setGFFSource(java.lang.String gffSource)
|
void |
setStateInformation(java.util.Properties p)
This should set StateInformation object! see StateInformation for Strings to use for keys. |
| 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 |
|---|
protected static final org.apache.log4j.Logger logger
public static java.lang.String DRIVER_CLASS
public static java.lang.String JDBC_URL
public static java.lang.String CHADO_DB
public static java.lang.String USERNAME
public static java.lang.String PASSWORD
protected java.util.Properties stateInfo
setStateInformation.
protected org.bdgp.io.IOOperation[] SUPPORTED_OPS
| Constructor Detail |
|---|
public ChadoAdapter()
| Method Detail |
|---|
public boolean hasLinkData()
hasLinkData in interface ApolloDataAdapterIhasLinkData in class AbstractApolloAdapterpublic java.util.Properties getStateInformation()
ApolloDataAdapterI
getStateInformation in interface ApolloDataAdapterIgetStateInformation in class AbstractApolloAdapterpublic void setStateInformation(java.util.Properties p)
ApolloDataAdapterI
setStateInformation in interface ApolloDataAdapterIsetStateInformation in class AbstractApolloAdapterpublic Style getStyle()
getStyle in interface ApolloDataAdapterIgetStyle in class AbstractApolloAdapter
public CurationSet getCurationSet()
throws ApolloAdapterException
ApolloDataAdapterI
getCurationSet in interface ApolloDataAdapterIgetCurationSet in class AbstractApolloAdapterApolloAdapterException
public void commitChanges(CurationSet curation)
throws ApolloAdapterException
commitChanges in interface ApolloDataAdapterIcommitChanges in class AbstractApolloAdapterApolloAdapterException
public java.lang.Boolean addToCurationSet()
throws ApolloAdapterException
addToCurationSet in interface ApolloDataAdapterIaddToCurationSet in class AbstractApolloAdapterApolloAdapterException
public SequenceI getSequence(java.lang.String id)
throws ApolloAdapterException
ApolloDataAdapterI
getSequence in interface ApolloDataAdapterIgetSequence in class AbstractApolloAdapterApolloAdapterException
public SequenceI getSequence(DbXref dbxref)
throws ApolloAdapterException
getSequence in interface ApolloDataAdapterIgetSequence in class AbstractApolloAdapterApolloAdapterException
public SequenceI getSequence(DbXref dbxref,
int start,
int end)
throws ApolloAdapterException
getSequence in interface ApolloDataAdapterIgetSequence in class AbstractApolloAdapterApolloAdapterException
public java.util.Vector getSequences(DbXref[] dbxref)
throws ApolloAdapterException
getSequences in interface ApolloDataAdapterIgetSequences in class AbstractApolloAdapterApolloAdapterException
public java.util.Vector getSequences(DbXref[] dbxref,
int[] start,
int[] end)
throws ApolloAdapterException
getSequences in interface ApolloDataAdapterIgetSequences in class AbstractApolloAdapterApolloAdapterException
public java.lang.String getRawAnalysisResults(java.lang.String id)
throws ApolloAdapterException
getRawAnalysisResults in interface ApolloDataAdapterIgetRawAnalysisResults in class AbstractApolloAdapterApolloAdapterExceptionpublic java.lang.String getType()
AbstractApolloAdapter
getType in interface org.bdgp.io.DataAdaptergetType in class AbstractApolloAdapterpublic org.bdgp.io.IOOperation[] getSupportedOperations()
org.bdgp.io.DataAdapter
public void init()
AbstractApolloAdapter
init in interface org.bdgp.io.DataAdapterinit in class AbstractApolloAdapterpublic org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
org.bdgp.io.VisualDataAdapter
protected void getSequenceList(java.lang.String featType,
java.util.Vector uniquenames,
java.util.Vector descriptions)
throws ApolloAdapterException
featType - The type of sequence to retrive from the feature table (e.g., 'assembly', 'super-contig')uniquenames - Vector that will hold the sequence IDs (values from the chado column feature.uniquename)descriptions - Vector that will hold the human-readable descriptions for the sequences named in uniquenames
ApolloAdapterExceptionpublic ChadoDatabase getActiveDatabase()
public void setDbPassForDefaultDb(java.lang.String pass)
pass - : Default Db new passwordpublic void setDbLoginForDefaultDb(java.lang.String login)
login - : Default Db new login/username.public void setFlatFileWriteMode(boolean flatFileWriteMode)
login - : Default Db new login/username.public java.lang.String getGFFSource()
public void setGFFSource(java.lang.String gffSource)
public void setDbPassForDb(java.lang.String chadoDb,
java.lang.String pass)
throws java.lang.Exception
chadoDb - pass -
java.lang.Exception
public void setDbPassAndActiveForDb(java.lang.String chadoDb,
java.lang.String pass)
throws java.lang.Exception
chadoDb - pass -
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||