[Biopython] Bio.motifs raising Exceptions using pypy

Marco Galardini marco.galardini at unifi.it
Thu Jul 11 11:05:31 UTC 2013


Dear Biopython team,

I am using the Bio.motifs package to perform a motif search inside DNA 
sequences; the motif is retrieved from a MEME file.

When using python 2.7 the search works just fine (biopython 1.61), even 
though a bit slow; when using pypy (2.0.2, biopython 1.61+) to speed 
things up the same script raises an exception, complaining about the 
presence of "N" chars inside the sequence.

Here's the traceback:

Traceback (most recent call last):
   File "app_main.py", line 72, in run_toplevel
   File "test.py", line 20, in <module>
     for position, score in pssm.search(s.seq, threshold=score_t):
   File "/usr/local/lib/pypy2.7/dist-packages/Bio/motifs/matrix.py", 
line 354, in search
     score = self.calculate(s)
   File "/usr/local/lib/pypy2.7/dist-packages/Bio/motifs/matrix.py", 
line 331, in calculate
     score += self[letter][position]
   File "/usr/local/lib/pypy2.7/dist-packages/Bio/motifs/matrix.py", 
line 113, in __getitem__
     return dict.__getitem__(self, letter)
KeyError: 'N'

If needed, I can provide you with the input files and a sample script.

Thanks for the help, and keep up with the great work.

Marco

-- 
-------------------------------------------------
Marco Galardini, PhD
Dipartimento di Biologia
Via Madonna del Piano, 6 - 50019 Sesto Fiorentino (FI)

e-mail: marco.galardini at unifi.it
www: http://www.unifi.it/dblage/CMpro-v-p-51.html
phone:  +39 055 4574737
mobile: +39 340 2808041
-------------------------------------------------




More information about the Biopython mailing list