[BioSQL-l] BioSQL&Python&SwissProt

Hegedus, Tamas . Hegedus.Tamas at mayo.edu
Mon May 17 20:39:05 EDT 2004


Dear All,

I tried to load swissprot.dat file into the biosql schema.
It resulted in AttributeError.

(I am using BioPython-1.24; and the most recent biosql.tarball)
It seems for me that the Loader try to find the record.id, but SProt.Record does not have an 'id'.
What is the solution? How can I load the SwissProt into BioSQL (I prefer Python vs. Perl)?

Thanks for your help,
Tamas

#--------------------
#!python

parser   = SProt.RecordParser()
iterator = SProt.Iterator(open("path_to/uniprot_sprot.dat"), parser)

server   = BioSeqDatabase.open_database(driver="psycopg", user="bioroot", passwd="pwd",
                                      host="localhost", database="biosql")
db       = server.new_database("bup")
n_prt    = db.load(iterator)

print "Number of loaded PRT: ", n_prt

---------------
    n_prt = db.load(iterator)
  File "/home/src/biopython-1.24/build/lib.linux-i686-2.3/BioSQL/BioSeqDatabase.py", line 414, in load
    db_loader.load_seqrecord(cur_record)
  File "/home/src/biopython-1.24/build/lib.linux-i686-2.3/BioSQL/Loader.py", line 37, in load_seqrecord
    bioentry_id = self._load_bioentry_table(record)
  File "/home/src/biopython-1.24/build/lib.linux-i686-2.3/BioSQL/Loader.py", line 209, in _load_bioentry_table
    if record.id.find('.') >= 0: # try to get a version from the id
  AttributeError: Record instance has no attribute 'id'


More information about the BioSQL-l mailing list