This package is Deprecated!!
This package has been deprecated by the package org.biojavax.bio.db.biosql which uses hibernate to persist objects to biosql and maintain transaction control. We strongly recommend you use that package.
BioSQL is a general-purpose relational database schema for the storage of biological sequence data and annotation. It evolved from the bioperl-db system.
To use BioSQL, you will need:
- A DBMS server (currently, PostgreSQL and MySQL are supported)
- A JDBC driver for connecting to that database (if in doubt, contact your database vendor)
- A BioSQL schema file, suitable for your database. Currently, these can be downloaded here
createdb thomasd_biosql psql thomasd_biosql -f biosqldb-schema-pg.sqlWhen accessing the database from Java programs, you will need to:
- Add the JDBC driver .jar file to your CLASSPATH
- Set the
jdbc.driverssystem property to the class name of the driver (if in doubt, contact your database vendor).
export CLASSPATH=biojava.jar:xerces.jar:bytecode.jar:pgjdbc2.jar java -Djdbc.drivers=org.postgresql.Driver demos.MyProgramYou should now be able to connect to the database by simply constructing a new
BioSQLSequenceDBobject, passing your database connection details to the constructor.
Each physical BioSQL database may contain multiple namespaces (sometimes
called biodatabases). In BioJava, each
reflects a single namespace.
Working with BioSQL sequences
The BioJava-BioSQL objects are transparently persistent. This
means that you don't need to do anything special to write data back to
the database, and that any changes you make to BioSQL sequences will
be immediately reflected in the database. If you don't want this to happen,
consider using a
It is possible to completely remove sequences (and all their annotation) from the database. However, an exception will be thrown if any references still exist to that sequence. The following code will fail:
SequenceDB seqDB = new BioSQLSequenceDB(...); Sequence seq = seqDB.getSequence("AL121903"); // do things with sequence seqDB.removeSequence("AL121903");If, however, the variable
seqis set to
removeSequence, the call will succeed.
In general, the behaviour of BioSQL sequences and features is very similar to that of the standard in-memory interfaces. However, the current version has a few limitations:
StrandedFeatureare currently supported. Other sub-interfaces of
Featureare silently converted to one of these basic types.
- Objects and binary data stored in
Annotationbundles of sequences and feature may be lost -- only Strings and Collections of strings are safe (this may be fixed in the future)
- Currently, only the MySQL amd PostgreSQL databases are supported. Porting to other databases should, however, be quite easy.
Class Summary Class Description BioSQLSequenceDB Deprecated.Use hibernate and org.biojavax.bio.db BioSQLSequenceDBProvider Deprecated.Use hibernate and org.biojavax.bio.db DBHelper Deprecated.Use hibernate and org.biojavax.bio.db DBHelper.BioSequenceStyle DBHelper.DeleteStyle DBHelper.JoinStyle HypersonicDBHelper Deprecated.Use hibernate and org.biojavax.bio.db MySQLDBHelper Deprecated.Use hibernate and org.biojavax.bio.db OracleDBHelper Deprecated.Use hibernate and org.biojavax.bio.db PostgreSQLDBHelper TaxonSQL Deprecated.Use hibernate and org.biojavax.bio.db UnknownDBHelper Deprecated.Use hibernate and org.biojavax.bio.db