Question: What'S Wrong With The Trial Example For Handling Maf Files?
0
gravatar for KCC
7.7 years ago by
KCC3.9k
Cambridge, MA
KCC3.9k wrote:

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 • 2.2k views
ADD COMMENTlink modified 7.7 years ago by Peter5.8k • written 7.7 years ago by KCC3.9k
1
gravatar for Peter
7.7 years ago by
Peter5.8k
Scotland, UK
Peter5.8k wrote:

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 COMMENTlink modified 7.7 years ago • written 7.7 years ago by Peter5.8k

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

ADD REPLYlink written 7.7 years ago by KCC3.9k

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 REPLYlink written 7.7 years ago by Peter5.8k
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: 1151 users visited in the last hour