[BioPython] Loading SwissProt to BioSQL

Jonathan Boulais biosql at hotmail.com
Thu Oct 25 14:52:02 UTC 2007




> Date: Wed, 24 Oct 2007 22:15:10 +0100
> From: biopython at maubp.freeserve.co.uk
> To: biosql at hotmail.com; biopython at lists.open-bio.org
> Subject: Re: [BioPython] Loading SwissProt to BioSQL
> 
> Jonathan Boulais wrote:
> > Hello,
> > 
> > I'm a biologist and quite newb with Biopython. I'm trying to build 
> > locally the Swissprot database with BioSQL and I'm having some 
> > problems. I have installed the latest version from the CVS and I'm 
> > using python 2.5 on a Mac Os 10.4.
> > 
> > First, i get this weird problem. Since I need to connect with MySQL I
> >  started to wrote a simple script (Biosql.py) with only this ( from 
> > BioSQL import BioSeqDatabase). When I run this script in the
> > terminal: python Biosql.py, I get this message **ImportError: cannot
> > import name BioSeqDatabase**. But the weird thing is if I start a
> > python session in the terminal by simply invoking python and then
> > manually import BioSeqDatabase, it's working ! Is there any reason
> > for that ?
> 
> In both cases are you running python from the command prompt?  If so 
> then the same environment variables (e.g. paths) should apply.  Odd.
> 
> My guess is you shouldn't call your script "Biosql.py", call it 
> "Biosql_test.py" or something.  Python thinks the line "from BioSQL 
> import BioSeqDatabase" means importing from the script itself because 
> that is also called BioSQL.
> 
> Peter
> 

Peter you were right about the name of the file. Nice call and thank you !
But I still get the same error as before when I'm running it. 

Traceback (most recent call last):
  File "DB.py", line 14, in <module>
    db.load(s_iterator)
  File "/sw/lib/python2.5/site-packages/BioSQL/BioSeqDatabase.py", line 414, in load
    db_loader.load_seqrecord(cur_record)
  File "/sw/lib/python2.5/site-packages/BioSQL/Loader.py", line 30, in load_seqrecord
    bioentry_id = self._load_bioentry_table(record)
  File "/sw/lib/python2.5/site-packages/BioSQL/Loader.py", line 250, in _load_bioentry_table
    version))
  File "/sw/lib/python2.5/site-packages/BioSQL/BioSeqDatabase.py", line 277, in execute
    self.cursor.execute(sql, args or ())
  File "/sw/lib/python2.5/site-packages/MySQLdb/cursors.py", line 151, in execute
    query = query % db.literal(args)
TypeError: not all arguments converted during string formatting


Is it the MySQLdb driver or a bad arguments that is passed to MySQLdb ?

Again, thank you for your time. 

Jonathan 

_________________________________________________________________
Envoie un sourire, fais rire, amuse-toi! Employez-le maintenant!
http://www.emoticonesgratuites.ca/?icid=EMFRCA120



More information about the Biopython mailing list