[Biopython-dev] Bio.motifs.parse fails on meme files with version 4.10
Peter Cock
p.j.a.cock at googlemail.com
Tue Jan 13 15:25:14 UTC 2015
Thanks Marco,
I'll let Michael answer on the best way to fix this, but if you
have some small failing examples already which could be
shared for use as Biopython test cases that would be great.
Are you familiar with GitHub? We now use that for our issue
tracker, and while it does not directly support attaching
files to issues, you can post text files to GitHub as "gists":
https://github.com/biopython/biopython/issues
https://gist.github.com
Thanks,
Peter
On Tue, Jan 13, 2015 at 2:53 PM, Marco Galardini <marco at ebi.ac.uk> wrote:
> Hi biopythoneers,
>
> just noticed that the current meme version (4.10.0_2) introduced a change in
> its output file that breaks the biopython parser.
>
> The error is:
>>>>from Bio import motifs
>>>>motifs.read(open('meme.txt'), 'meme')
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/local/lib/python2.7/dist-packages/Bio/motifs/__init__.py", line
> 141, in read
> motifs = parse(handle, format)
> File "/usr/local/lib/python2.7/dist-packages/Bio/motifs/__init__.py", line
> 77, in parse
> record = meme.read(handle)
> File "/usr/local/lib/python2.7/dist-packages/Bio/motifs/meme.py", line 41,
> in read
> length, num_occurrences, evalue = __read_motif_statistics(line)
> File "/usr/local/lib/python2.7/dist-packages/Bio/motifs/meme.py", line
> 219, in __read_motif_statistics
> length = int(ls[3])
> ValueError: invalid literal for int() with base 10: '='
>
> Relevant line before:
> MOTIF 1 width = 19 sites = 3 llr = 43 E-value = 6.9e-002
> Relevant line now:
> MOTIF 1 MEME width = 19 sites = 3 llr = 43 E-value = 6.9e-002
>
> A possible ugly workaround would be to change the way this line is parsed
> (doing splits on 'width' and the other parameters). If you like I can try to
> implement the fix myself and a couple of tests, just let me know.
>
> Marco
>
> --
> Marco Galardini
> Postdoctoral Fellow
> EMBL-EBI - European Bioinformatics Institute
> Wellcome Trust Genome Campus
> Hinxton, Cambridge CB10 1SD, UK
> Phone: +44 (0)1223 49 2547
>
> _______________________________________________
> Biopython-dev mailing list
> Biopython-dev at mailman.open-bio.org
> http://mailman.open-bio.org/mailman/listinfo/biopython-dev
More information about the Biopython-dev
mailing list