Quantcast
Channel: Post Feed
Viewing all articles
Browse latest Browse all 41826

Problems With Biopython When Running The Ncbistandalone.Py Program

$
0
0
Hi, I am having problem while running NCBIStandalone library of biopython. i want to retrieve sequence titles from output of blast but it gives error on iterator. Following is the code to retrieve these sequence titles. result_handle= open("foo.txt") blast_parser = NCBIStandalone.BlastParser() blast_iterator = NCBIStandalone.Iterator(result_handle, blast_parser) print blast_iterator for blast_record in blast_iterator: print blast_record E_VALUE_THRESH = 0.0 for alignment in blast_record.alignments: for hsp in alignment.hsps: if hsp.expect < E_VALUE_THRESH: print 'sequence:', alignment.title But it gives following errors. it makes iterator properly but does not loop it. <Bio.Blast.NCBIStandalone.Iterator object at 0x1aa6450> Traceback (most recent call last): File "blast2.py", line 45, in <module> for blast_record in blast_iterator: File "/usr/lib/pymodules/python2.7/Bio/Blast/NCBIStandalone.py", line 1659, in next return self._parser.parse(File.StringHandle(data)) File "/usr/lib/pymodules/python2.7/Bio/Blast/NCBIStandalone.py", line 818, in parse self._scanner.feed(handle, self._consumer) File "/usr/lib/pymodules/python2.7/Bio/Blast/NCBIStandalone.py", line 112, in feed read_and_call_until(uhandle, consumer.noevent, contains='BLAST') File "/usr/lib/pymodules/python2.7/Bio/ParserSupport.py", line 337, in read_and_call_until line = safe_readline(uhandle) File "/usr/lib/py ...

Viewing all articles
Browse latest Browse all 41826

Trending Articles