I have looked through the manual and it seems to concentrate a lot on using data from an online database, but I could find anything about reading MAF files locally. I suspect it might involve the NLMSA class, but I'm not sure.
I have looked through the manual and it seems to concentrate a lot on using data from an online database, but I could find anything about reading MAF files locally. I suspect it might involve the NLMSA class, but I'm not sure.
I use bx-python for that: https://bitbucket.org/james_taylor/bx-python/wiki/Home
import bx.align.maf
for alignment in bx.align.maf.Reader(open("alignment.maf")):
print alignment.split()
alignment.split() now is a neat list in the "line starting with s"-format (http://genome.ucsc.edu/FAQ/FAQformat.html#format5) where you can parse out all relevant info you might need.
There is a MAF parser in the pygr package: http://biodb.bioinformatics.ucla.edu/pygr_docs/0.8.1/html/epydoc/pygr.apps.maf2VSgraph.MafParser-class.html have you looked at that already?
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
This turned out to be a good option. I will approve it.