This is a test version of Biostars. For the public version, visit https://www.biostars.org.
biopython: Bio.motifs : 'Motif' has no attribute 'parse'

Hi,

I am trying to parse MEME formatted motif using Bio.motifs object.

>>> list(Motif.parse(open("test.meme"),"MEME"))
...
AttributeError: type object 'Motif' has no attribute 'parse'

Does anyone know if there is a replacement function for this?

Thanks. J.

software error biopython

1 answer

Looking at the docs, your usage looks off

>>> from Bio import motifs
>>> with open("Motif/alignace.out") as handle:
...     for m in motifs.parse(handle, "AlignAce"):
...         print(m.consensus)

So motifs, not Motif?

Thank you Philipp. I used Motif because i imported the object as

from Bio.motifs import Motif

J.

Log in to answer this question.