What'S Wrong With The Trial Example For Handling Maf Files?
1
0
Entering edit mode
12.9 years ago
KCC ★ 4.1k

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 • 3.4k views
ADD COMMENT
1
Entering edit mode
12.9 years ago
Peter 6.0k

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?

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Ask on the Biopython mailing list for more details, but you'll need to install Biopython from Andrew's branch - currently https://github.com/polyatail/biopython/tree/alignio-maf I think.

ADD REPLY

Login before adding your answer.

Traffic: 2080 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