[BioPython] FW: [BioSQL-l] BioSQL&Python&SwissProt

Hilmar Lapp hlapp at gnf.org
Mon May 17 22:22:24 EDT 2004


Tamas, I'm forwarding this to the biopython people who may be able to
help you.

	-hilmar

-----Original Message-----
From: Hegedus, Tamas . [mailto:Hegedus.Tamas at mayo.edu] 
Sent: Monday, May 17, 2004 5:39 PM
To: 'biosql-l at open-bio.org'
Subject: [BioSQL-l] BioSQL&Python&SwissProt


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'
_______________________________________________
BioSQL-l mailing list
BioSQL-l at open-bio.org http://open-bio.org/mailman/listinfo/biosql-l



More information about the BioPython mailing list