[BioPython] FormatIO + Fasta parser + BioDB.

Cristian S. Rocha crocha at dc.uba.ar
Thu Apr 29 17:11:19 EDT 2004


Hello,

I'm writing a procedure to store files in a BioDB but I have the
following error:

"""
...
  File "/usr/lib/python2.2/site-packages/BioSQL/Loader.py", line 209, in
_load_bioentry_table
    if record.id.find('.') >= 0: # try to get a version from the id
AttributeError: 'NoneType' object has no attribute 'find'
"""

and the procedure is:

"""
def SequenceStoreFile(SeqFile, database, format='genbank'):
	server = BioSeqDatabase.open_database(driver='MySQLdb', user='bio',
passwd='bio', host='localhost', db='bio')
	if server[database]:
		db = server[database]
	else:
		db = server.new_database(database)
	formatter = FormatIO.FormatIO("SeqRecord", formats[format])
	itr = formatter.readFile(SeqFile, format=formats[format])
	db.load(itr)
	return

if __name__ == "__main__":
	SequenceStoreFile(open('example.fasta'), 'estC', 'fasta')
"""

I feel that is because I don't define the title2ids function for the
Fasta parser. If I'm right, how can I tell to the FormatIO module to use
a title2ids function?

Thanks,
Cristian.

-- 
Lic. Cristian S. Rocha.
<crocha at dc.uba.ar>
Departamento de Computacin. FCEyN. UBA.
Pabellon I. Cuarto 9.
Ciudad Universitaria.
(1428) Buenos Aires. Argentina.
Tel: +54-11-4576-3390/96 int 714
Tel/Fax: +54-11-4576-3359
Cel: 15-5-607-9192



More information about the BioPython mailing list