[BioPython] plain txt blast output - xml instead
Rohini Damle
rohini.damle at gmail.com
Thu Jun 15 16:36:27 UTC 2006
Hi,
I am using BioPython 1.41 on windows I have also updated
NcbIstandalone.pyfor the link u gave. here is my code.
from Bio.Blast import NCBIStandalone
from Bio.Blast import NCBIXML
blast_out = open("4proteinblast.xml","r")
b_iterator = NCBIStandalone.Iterator(blast_out, NCBIXML.BlastParser())
for b_record in b_iterator :
query_name = b_record.query
print query_name
for alignment in b_record.alignments:
print '****Alignment****'
print 'sequence:', alignment.title
This code gives "sequences producing significant alignments for all the 4
proteins
#but printing querry name as P1
I mean I am getting all the information I want but I have 4 protein querries
and this code is giving only P1 as a query (not P2, P3, P4 but giving
information about them) I ma attachin the xml file of 4 protein blast
results.
_thank you for your help.
On 6/14/06, Peter <biopython at maubp.freeserve.co.uk> wrote:
>
> Rohini Damle wrote:
> > Thank you very much for your help.
> > I have 55-56 proteins & I am using Blast to find out short, nearly exact
> > matches. The xml parser works fine for first record but even if I used
> the
> > iterator, I CAN NOT ITERATE through the records, I have used the same
> code
> > as u have given, what might be wrong?
> > Rohini.
>
> If you you send us a short be of example code, and the error message
> that would help. Also, what version of BioPython are you using, and do
> you have Windows or Linux or MacOS...
>
> One guess is that you will need to update the NCBIStandalone.py file to
> include a recent fix for iterating XML files.
>
> Assuming you are using BioPython 1.41 on Windows, the click on this link
> and pick "download" near the top of the page to get the latest verion:
>
>
> http://cvs.biopython.org/cgi-bin/viewcvs/viewcvs.cgi/biopython/Bio/Blast/NCBIStandalone.py?cvsroot=biopython
>
> Save it here:
>
> c:\python24\lib\site-packages\Bio\Blast\NCBIStandalone.py
>
> (Make a copy of the old file first, just in case)
>
> Peter
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4proteinblast.xml
Type: text/xml
Size: 98271 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biopython/attachments/20060615/722b8845/attachment-0002.xml>
More information about the Biopython
mailing list