[BioPython] problems when parsing blast output

Alessandro S. Nascimento as_nascimento at yahoo.com.br
Wed Apr 5 20:35:35 UTC 2006


Hi Peter

I had some troubles when parsing some results from a blastpgp output 
file. My initial script used to work but isn't working this time. My 
blast output file is very, very large.
When I try to run it, I can see my processor working in 99% for some 
minutes than is returns to prompt with no results or information. Any 
idea of what may be happening?

Thanks in advance,


Alessandro




#!/usr/bin/python

import os
from Bio.Blast import NCBIStandalone
from string import *

blast_out = open('blast.output', 'r')

b_parser = NCBIStandalone.PSIBlastParser()

b_record = b_parser.parse(blast_out)

n=0
for round in b_record.rounds:
    for alignment in round.alignments:
        for hsp in alignment.hsps:
            if hsp.identities < 90:
                if hsp.identities > 30:
                        if alignment.length > 200:
                                print "Retrieving sequence query"
                                os.system ("fastacmd -d ..//db/nr -s 
\'%s\' > test.bl2.%d" % (query, n, ))
                                n=n+1

blast_out.close()




More information about the Biopython mailing list