BioPython meme.read MEME output
1
0
Entering edit mode
8.7 years ago
gable91794 • 0

I am having trouble reading/parsing a meme output file with Biopython. Here is the code I am using:

>>> from Bio import motifs
>>> with open('meme.txt') as f:
    record = motifs.parse(f, 'MEME')

I receive this ValueError:

Traceback (most recent call last):
  File "<pyshell#55>", line 2, in <module>
    record = motifs.parse(f, 'MEME')
  File "C:\Python34\Scripts\Bio\motifs\__init__.py", line 77, in parse
    record = meme.read(handle)
  File "C:\Python34\Scripts\Bio\motifs\meme.py", line 41, in read
    length, num_occurrences, evalue = __read_motif_statistics(line)
  File "C:\Python34\Scripts\Bio\motifs\meme.py", line 219, in __read_motif_statistics
    length = int(ls[3])
ValueError: invalid literal for int() with base 10: '='

How can I fix this so the ValueError does not occur?

BioPython • 4.2k views
ADD COMMENT
0
Entering edit mode

which version of biopython are you using ?

ADD REPLY
0
Entering edit mode

the newest version: 1.65

ADD REPLY
0
Entering edit mode

can you post first few lines of the "meme.txt" file ?

ADD REPLY
0
Entering edit mode

I believe the output format is the same as all other meme runs I have used.

********************************************************************************
MEME - Motif discovery tool
********************************************************************************
MEME version 4.10.1 (Release date: Wed Mar 25 11:40:43 2015 +1000)

For further information on how to interpret these results or to get
a copy of the MEME software please access http://meme-suite.org .

This file may be used as input to the MAST algorithm for searching
sequence databases for matches to groups of motifs.  MAST is available
for interactive use and downloading at http://meme-suite.org .
********************************************************************************

The run was of 4000 peptide sequences.

ADD REPLY
1
Entering edit mode

See discussions here: https://github.com/biopython/biopython/issues/461

This may be due to format of meme.txt. Whether your file has "MEME" in it like:

MOTIF  1 MEME    width =  19  sites =   3  llr = 43  E-value = 6.9e-002

or just

MOTIF  1        width =  19  sites =   3  llr = 43  E-value = 6.9e-002

?

ADD REPLY
0
Entering edit mode
8.7 years ago

I think the length in the file is float,which is supposed to be integer.

int('55063.000000')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '55063.000000'
ADD COMMENT
0
Entering edit mode

Do you know of a solution for this?

ADD REPLY

Login before adding your answer.

Traffic: 2870 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6