This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What'S Wrong With The Trial Example For Handling Maf Files?

I installed biopython 1.58 on my MAC Pro.

Then I tried running the following code from here:

from Bio import AlignIO

for multiple_alignment in AlignIO.parse("chr10.maf", "maf"):
    print "printing a new multiple alignment"

    for seqrec in multiple_alignment:
        print "starts at %s on the %s strand of a sequence %s in length, and runs for %s bp" % \
              (seqrec.annotations["start"],
               seqrec.annotations["strand"],
               seqrec.annotations["srcSize"],
               seqrec.annotations["size"])

(I changed "chr10.maf" to "chrI.maf" so it would match the file I have.)

My result was:

Traceback (most recent call last):
  File "program.py", line 3, in <module>
    for multiple_alignment in AlignIO.parse("chrI.maf","maf"):
  File "/Library/Python/2.7/site-packages/Bio/AlignIO/__init__.py", line 368, in parse
    raise ValueError("Unknown format '%s'" % format)
ValueError: Unknown format 'maf'

Can anyone help?

maf biopython

1 answer

That wiki page was misleading, the MAF code isn't in the main Biopython distribution yet,just on GitHub. Would you be interested in helping test it - especially the MAF specific indexing ideas?

I would definitely like to help test this code. How can I do it?

Log in to answer this question.