[BioPython] BioSQL documentation for Biopython

Hilmar Lapp hlapp at gmx.net
Sat Feb 23 19:20:35 UTC 2008


On Feb 23, 2008, at 2:07 PM, Sebastian Bassi wrote:

> Now with the new code, I could reproduce the tutorial, up to here:
>
>>>> from BioSQL import BioSeqDatabase
>>>> server=BioSeqDatabase.open_database(driver = "MySQLdb", user =
> "X",passwd="X", host = "localhost", db = "bioseqdb")
>>>> db = server.new_database("cold")
>>>> from Bio import GenBank
>>>> parser = GenBank.FeatureParser()
>>>> iterator = GenBank.Iterator(open("cor6_6.gb"), parser)
>>>> db.load(iterator)
> 6
>
> But when I look into the mysql, there is no new record!. The "6" is
> supposed to be the number of records loaded into the database. But my
> database is empty (it has the schema, but w/o data).


I.e., there is no error from the db.load() command, just no data?  
Does the Biopython binding enable or disable auto-commit? If the  
latter (which would be the Right Thing(tm) to do), you will have to  
commit the transaction. (Obviously I don't know what the API method  
would be for this, but db.commit() might be a good start.)

BioSQL uses InnoDB on MySQL, and hence will be transactional unless  
you make the language's db driver to auto-commit.

	-hilmar

-- 
===========================================================
: Hilmar Lapp  -:-  Durham, NC  -:-  hlapp at gmx dot net :
===========================================================






More information about the Biopython mailing list