[Biopython] Bio.motifs raising Exceptions using pypy
Peter Cock
p.j.a.cock at googlemail.com
Thu Jul 11 11:26:25 UTC 2013
On Thu, Jul 11, 2013 at 12:05 PM, Marco Galardini
<marco.galardini at unifi.it> wrote:
> 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
A short test script (which we maybe can turn into another unit
test for this code) would be great to sort this out. Thanks!
Peter
More information about the Biopython
mailing list