Question: BioPython meme.read MEME output
0
gravatar for gable91794
3.6 years ago by
gable917940
gable917940 wrote:

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 recieve 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 • 2.0k views
ADD COMMENTlink modified 3.6 years ago • written 3.6 years ago by gable917940

which version of biopython are you using ?

ADD REPLYlink written 3.6 years ago by geek_y9.3k

the newest version: 1.65

ADD REPLYlink written 3.6 years ago by gable917940

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

ADD REPLYlink written 3.6 years ago by geek_y9.3k

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 REPLYlink written 3.6 years ago by gable917940
1

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 REPLYlink written 3.6 years ago by geek_y9.3k
0
gravatar for nvijay.1991
3.6 years ago by
India
nvijay.19910 wrote:
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 COMMENTlink written 3.6 years ago by nvijay.19910

Do you know of a solution for this?

ADD REPLYlink written 3.6 years ago by gable917940
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2056 users visited in the last hour