[Biopython] Bio.motifs raising Exceptions using pypy

Peter Cock p.j.a.cock at googlemail.com
Fri Jul 12 10:00:04 UTC 2013


On Fri, Jul 12, 2013 at 10:40 AM, Marco Galardini
<marco.galardini at unifi.it> wrote:
> Hi,
>
> i've arranged a sample script and sample data to replicate the issue:
>
> python test.py test.fa test.txt
> 551 20.9172
> -5389 21.0426
>
> pypy test.py test.fa test.txt
> 551 20.9172
> -5389 21.0426
>
> 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'
>
> Hope this helps, my guess is that it may be something related to the
> implementation of dictionaries in pypy, since the object raising the
> exception inherits dict.
>
> Thanks a lot for the help,
> Marco

Great - I can reproduce that here using PyPy 1.9 as well...

Peter



More information about the Biopython mailing list