[BioPython] BioPython and Zope.

Cristian S. Rocha crocha at dc.uba.ar
Mon Apr 19 17:28:52 EDT 2004


Hello everybody,

I'm trying to parse fasta string input using Zope. I made a Zope
external method to interface with BioPython modules. This method work
fine on command line, but It don't work in Zope.

The code is:

----------------
import StringIO
from Bio import SeqRecord
from Bio.SeqIO import FASTA

def SequenceRead(SequenceString):
	input = StringIO.StringIO(SequenceString)
	reader = FASTA.FastaReader(input)   # Error line
	seq = reader.next()
	while seq:
		print "> %s" % seq.id
	 	seq = reader.next()
	return "!"

if __name__ == "__main__":
	print BioTools(
""">123
ATAGGGGATGATAGGAT
>456
GGATGAGGAGCGATGCG
"""
	)
----------------

The error is:

AttributeError: 'module' object has no attribute 'FastaReader'

The traceback is:

"""
Traceback (innermost last):
  Module ZPublisher.Publish, line 98, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module OFS.DTMLMethod, line 127, in __call__
  Module DocumentTemplate.DT_String, line 474, in __call__
  Module DocumentTemplate.DT_Try, line 140, in render
  Module DocumentTemplate.DT_Try, line 183, in render_try_except
  Module DocumentTemplate.DT_Util, line 201, in eval
   - __traceback_info__: SequenceText
  Module <string>, line 1, in <expression>
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 307, in _exec
  Module None, line 15, in Translate
   - <PythonScript at /biodb/TranslateSequence/Translate>
   - Line 15
  Module Products.ExternalMethod.ExternalMethod, line 224, in __call__
   - __traceback_info__: (('> Input.\r\nATGATGA\r\n> Output\r\nATGGGGAT',), {}, None)
  Module /usr/lib/zope/Extensions/BioTools.py, line 9, in SequenceRead
AttributeError: 'module' object has no attribute 'FastaReader'
"""

Do you have any idea why it's happening?

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://portal.open-bio.org/pipermail/biopython/attachments/20040419/cbcc018c/attachment.bin


More information about the BioPython mailing list