Skip to content

training set absent from MEME.txt file #1871

Open

Description

@smsaladi

It looks like MEME now skips over providing sequences from the training set when the number of sequence is greater than the argument to -brief (1000 by default), which is documented to do the following:

-brief | nbrief
If there are more than nbrief (primary) sequences, the size of MEME's output will be reduced by suppressing the inclusion of the sequence names, motif sites and scanned sites in MEME's HTML and XML outputs, and by suppressing the tables of sequence lengths, sites and block diagrams in MEME's text output.

I am also not sure if this option is new (see below for how it affects the meme.txt output).

MEME documentation: http://meme-suite.org/doc/meme.html

I am happy to try contributing a fix, if someone could point me in the right direction.

Setup

I am reporting a problem with

  • Biopython version: 17.2
  • Python version: 3.5.6 (Anaconda 64 bit)
  • Operating system: RedHat 6.10
  • Using the output of MEME version 5.0.2 (Release date: Thu Aug 30 14:26:08 2018 -0700)
from Bio import motifs
with open("./tcruzi_lasttmd/meme.txt", "r") as handle:
    motifs = motifs.parse(handle, "meme")

Expected behaviour

Continue to read the motifs, skipping over the lack of training set information information

Actual behaviour

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-55-fa64ff49a289> in <module>()
      1 from Bio import motifs
      2 with open("./tcruzi_lasttmd/meme.txt", "r") as handle:
----> 3     motifs = motifs.parse(handle, "meme")
      4 
      5 motifs

~/anaconda3/envs/tfgpu35/lib/python3.5/site-packages/Bio/motifs/__init__.py in parse(handle, format)
     71     elif format == "meme":
     72         from Bio.motifs import meme
---> 73         record = meme.read(handle)
     74         return record
     75     elif format == "mast":

~/anaconda3/envs/tfgpu35/lib/python3.5/site-packages/Bio/motifs/meme.py in read(handle)
     27     record = Record()
     28     __read_version(record, handle)
---> 29     __read_datafile(record, handle)
     30     __read_alphabet(record, handle)
     31     __read_sequences(record, handle)

~/anaconda3/envs/tfgpu35/lib/python3.5/site-packages/Bio/motifs/meme.py in __read_datafile(record, handle)
    162         raise ValueError("Unexpected end of stream: Expected to find line starting with 'DATAFILE'")
    163     if not line.startswith('DATAFILE'):
--> 164         raise ValueError("Line does not start with 'DATAFILE':\n%s" % line)
    165     line = line.strip()
    166     line = line.replace('DATAFILE= ', '')

ValueError: Line does not start with 'DATAFILE':
PRIMARY SEQUENCES= tcruzi_lasttmd.faa

Steps to reproduce (try reading this file with the code above):

********************************************************************************
MEME - Motif discovery tool
********************************************************************************
MEME version 5.0.2 (Release date: Thu Aug 30 14:26:08 2018 -0700)

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

********************************************************************************


********************************************************************************
REFERENCE
********************************************************************************
If you use this program in your research, please cite:

Timothy L. Bailey and Charles Elkan,
"Fitting a mixture model by expectation maximization to discover
motifs in biopolymers", Proceedings of the Second International
Conference on Intelligent Systems for Molecular Biology, pp. 28-36,
AAAI Press, Menlo Park, California, 1994.
********************************************************************************


********************************************************************************
TRAINING SET
********************************************************************************
PRIMARY SEQUENCES= tcruzi_lasttmd.faa
CONTROL SEQUENCES= --none--
ALPHABET= ACDEFGHIKLMNPQRSTVWY

********************************************************************************

********************************************************************************
COMMAND LINE SUMMARY
********************************************************************************
This information can also be useful in the event you wish to report a
problem with the MEME software.

command: meme tcruzi_lasttmd.faa -oc tcruzi_lasttmd -protein -mod zoops -nmotifs 10 -evt 1 -minw 15 -maxw 30 -bfile all_tmds.nr.bg -maxsize 1000000

Here is the actual file: meme.txt

Activity

  1. smsaladi commented on Dec 9, 2018

    @smsaladi
    ContributorAuthor

    Update: Does look like it has to do with -brief, although even if the sequences are listed, the error is still present -- perhaps the format is more different than expected:

    ---------------------------------------------------------------------------
    ValueError                                Traceback (most recent call last)
    <ipython-input-3-7ee097240706> in <module>()
          1 from Bio import motifs
          2 with open("./tcruzi_lasttmd/motifs/meme.txt", "r") as handle:
    ----> 3     motifs = motifs.parse(handle, "meme")
          4 
          5 motifs
    
    ~/anaconda3/envs/tfgpu35/lib/python3.5/site-packages/Bio/motifs/__init__.py in parse(handle, format)
         71     elif format == "meme":
         72         from Bio.motifs import meme
    ---> 73         record = meme.read(handle)
         74         return record
         75     elif format == "mast":
    
    ~/anaconda3/envs/tfgpu35/lib/python3.5/site-packages/Bio/motifs/meme.py in read(handle)
         27     record = Record()
         28     __read_version(record, handle)
    ---> 29     __read_datafile(record, handle)
         30     __read_alphabet(record, handle)
         31     __read_sequences(record, handle)
    
    ~/anaconda3/envs/tfgpu35/lib/python3.5/site-packages/Bio/motifs/meme.py in __read_datafile(record, handle)
        162         raise ValueError("Unexpected end of stream: Expected to find line starting with 'DATAFILE'")
        163     if not line.startswith('DATAFILE'):
    --> 164         raise ValueError("Line does not start with 'DATAFILE':\n%s" % line)
        165     line = line.strip()
        166     line = line.replace('DATAFILE= ', '')
    
    ValueError: Line does not start with 'DATAFILE':
    PRIMARY SEQUENCES= tcruzi_lasttmd.faa

    Except of MEME output (link to full file below):

    ********************************************************************************
    MEME - Motif discovery tool
    ********************************************************************************
    MEME version 5.0.2 (Release date: Thu Aug 30 14:26:08 2018 -0700)
    
    For further information on how to interpret please access http://meme-suite.org.
    To get a copy of the MEME software please access http://meme-suite.org.
    
    ********************************************************************************
    
    
    ********************************************************************************
    REFERENCE
    ********************************************************************************
    If you use this program in your research, please cite:
    
    Timothy L. Bailey and Charles Elkan,
    "Fitting a mixture model by expectation maximization to discover
    motifs in biopolymers", Proceedings of the Second International
    Conference on Intelligent Systems for Molecular Biology, pp. 28-36,
    AAAI Press, Menlo Park, California, 1994.
    ********************************************************************************
    
    
    ********************************************************************************
    TRAINING SET
    ********************************************************************************
    PRIMARY SEQUENCES= tcruzi_lasttmd.faa
    CONTROL SEQUENCES= --none--
    ALPHABET= ACDEFGHIKLMNPQRSTVWY
    Sequence name            Weight Length  Sequence name            Weight Length  
    -------------            ------ ------  -------------            ------ ------  
    XP_802135.1              1.0000     24  XP_802137.1              1.0000     19  
    XP_802140.1              1.0000     19  XP_802159.1              1.0000     20  
    XP_802162.1              1.0000     21  XP_802163.1              1.0000     18  
    XP_802166.1              1.0000     22  XP_802171.1              1.0000     26  
    XP_802175.1              1.0000     23  XP_802177.1              1.0000     19  
    XP_802178.1              1.0000     20  XP_802182.1              1.0000     19  
    

    ...

    
    ********************************************************************************
    COMMAND LINE SUMMARY
    ********************************************************************************
    This information can also be useful in the event you wish to report a
    problem with the MEME software.
    
    command: meme tcruzi_lasttmd.faa -oc tcruzi_lasttmd/motifs -protein -mod zoops -nmotifs 10 -evt 1 -minw 15 -maxw 30 -brief 100000 -bfile all_tmds.nr.bg -maxsize 1000000 
    
    model:  mod=         zoops    nmotifs=        10    evt=             1
    

    meme.txt

  2. AvantiShri commented on Jan 10, 2019

    @AvantiShri

    I also get a similar error when attempting to parse a MEME file:

    "ValueError: Line does not start with 'DATAFILE':
    PRIMARY SEQUENCES= all_positives.fa
    

    The file I am trying to parse is attached
    NFE2_meme_results.txt

  3. jclachance commented on Mar 14, 2019

    @jclachance

    It doesn't seem like this issue has been solved? I run into the same issue when running MEME (MEME version 5.0.4 (Release date: Wed Jan 23 14:05:40 2019 -0800) on my sequences on the online platform and then attempting to read the output using the most recent BioPython version (1.73). The same error message shows up:

    ValueError: Line does not start with 'DATAFILE':
    PRIMARY SEQUENCES= promoter_sequences.faa

  4. peterjc commented on Mar 14, 2019

    @peterjc
    Member

    @jclachance I'm guessing grihabor#3 was meant to be a pull requests on the main Biopython repository? If so, can you try that again (the pull request creation step, the same code branch should be fine).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions