[Biopython-dev] Jython DB

Peter Cock p.j.a.cock at googlemail.com
Sun Nov 4 16:47:20 EST 2012


Hi Tiago,

On Sun, Nov 4, 2012 at 8:49 PM, Tiago Antão wrote:
> Howdy,
>
> On Sun, Nov 4, 2012 at 2:01 PM, Peter Cock wrote:
>>
>> Retitling thread
>
>
> Again ;)
>
>
>>
>> while using library Y under C Python makes sense. Database access
>> would be a perfect example - things like Python's sqlite3 don't yet exist
>> under Jython.
>>
>
> I noticed that there is 1 reference to sqlite3:
> Bio.SeqIO._index
>
> Other stuff on BioSQL is just really related to database configuration and
> does not impair functionality (exception to a test case that really depends
> on sqlite3).
>
> I suppose that a "default" DB with Jython would probably be JavaDB (aka
> Apache Derby)? It is available as a default on the Sun/Oracle JDK (though
> not the JRE).
>
> I could go ahead and have a try at evaluating the portability costs for
> sqlite3->javadb. In theory it should be easy
> (http://www.jython.org/jythonbook/en/1.0/DatabasesAndJython.html)

The database stuff in Biopython currently is BioSQL (which under
C Python supports a MySQL, PostgreSQL or SQLite back end)
and things like SeqIO.index which use SQLite3 directly. None of
this currently works under Jython :(

I was hoping Jython would implement an sqlite3 module which we
(and any other Python library) could just use - there seems to be
no progress on that: http://bugs.jython.org/issue1682864

Likewise the MySQLdb and PostgreSQL modules. Failing a port
allowing our current code to "just work", someone could write
alternative code for Biopython to all an appropriate Java DB
interface directly. For our BioSQL we already have a structure
to cope with a range of backends, so this should be quite clean.

In the case of Bio.SeqIO.index_db, we probably only use a fraction
of the full sqlite3 module's capabilities, so special casing this
under Jython to call JavaDB might not be too complicated...
(for anyone who knows there way round Jython and JavaDB)?

If you fancy exploring SQLite3 under Jython, go for it :)

Peter



More information about the Biopython-dev mailing list