[BioPython] parsing the blastoutput and printing the alingment

Peter biopython at maubp.freeserve.co.uk
Thu Jun 15 15:01:42 UTC 2006


Muthuraman, Manickam wrote:
> Dear peter
> 
> here is the code my_blast.out and the error. My need is to get all the
 > blast hit sequences in fasta format. By parsing and i can extract
 > accession number from it.

I made an example fasta file containing just this one sequence twice:

 >example1
VPKIDVSPLFGDDQAAKMRVAQQIDAASRDTGFFYAVNHGINVQRLSQKTKEFHMSITP
EEKWDLAIRAYNKEHQDQVRAGYYLSIPGKKAVESFCYLNPNFTPDHPRIQAKTPTHEV
NVWPDETKHPGFQDFAEQYYWDVFGLSSALLKGYALALGKEENFFARHFKPDDTLASVV
LIRYPYLDPYPEAAIKTAADGTKLSFEWHEDVSLITVLYQSNVQNLQVETAAGYQDIEA
DDTGYLINCGSYMAHLTNNYYKAPIHRVKWVNAERQSLPFFVNLGYDSVI
 >example2
VPKIDVSPLFGDDQAAKMRVAQQIDAASRDTGFFYAVNHGINVQRLSQKTKEFHMSITP
EEKWDLAIRAYNKEHQDQVRAGYYLSIPGKKAVESFCYLNPNFTPDHPRIQAKTPTHEV
NVWPDETKHPGFQDFAEQYYWDVFGLSSALLKGYALALGKEENFFARHFKPDDTLASVV
LIRYPYLDPYPEAAIKTAADGTKLSFEWHEDVSLITVLYQSNVQNLQVETAAGYQDIEA
DDTGYLINCGSYMAHLTNNYYKAPIHRVKWVNAERQSLPFFVNLGYDSVI

I then edited the filenames in your example, and ran the code.  It 
worked for me using a fresh install of BioPython 1.41 on Linux with 
Python 2.4.2

So the good news is your code seems fine.

Maybe there is something "funny" with your fasta file?  Accented 
characters for example - which would then be in the output XML file?

Could you send me the fasta file and the XML file (in full, as 
attachments), off the mailing list to avoid clogging up everyone's inboxes.

Thanks

Peter




More information about the Biopython mailing list