Question: I am running blast over internet using biopython but its giving connection error but when I am doing same thing on shell its working fine.
gravatar for nadia_ashraf2000
5.0 years ago by
nadia_ashraf20000 wrote:

import Bio
import csv
from Bio.Blast import NCBIXML
from Bio.Blast import NCBIWWW

q_id = []
with open('C:\Users\Nadia\Desktop\imran-sequenceIDs.csv','rb') as f:
    for row in reader:
print 'sequence tags read'

with open('C:\\Users\\Nadia\\Desktop\\01-01A-Unigene.txt','r') as seq_file:
print 'sequence file read'

for i in range(0,len(q_id)):
    if i>=1:
        for j,k in enumerate(seq_file):
            if str(q_id[i])in k:
                print 'tag matched',i
                print start
                while counter==1:
                    for l in range(start+1,len(seq_file)-(start+1)):
                        if not seq_file[l][0]=='>':
    if seq:
        if not blast_record.alignments:
            print q_id[i], 'is novel'
            print q_id[i],'is not novel!'

this is my script and its generating following error

Traceback (most recent call last):
  File "C:\Python27\", line 37, in <module>
  File "C:\Python27\lib\site-packages\Bio\Blast\", line 163, in qblast
    handle = _urlopen(request)
  File "C:\Python27\lib\", line 127, in urlopen
    return, data, timeout)
  File "C:\Python27\lib\", line 404, in open
    response = self._open(req, data)
  File "C:\Python27\lib\", line 422, in _open
    '_open', req)
  File "C:\Python27\lib\", line 382, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\", line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python27\lib\", line 1184, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

any suggestion would be really helpful. 

blast biopython • 2.5k views
ADD COMMENTlink modified 5.0 years ago by Peter5.8k • written 5.0 years ago by nadia_ashraf20000
gravatar for Peter
5.0 years ago by
Scotland, UK
Peter5.8k wrote:

Using any online resource there will be network errors from time to time, or problems at the remote server. This is best dealt with using a try/except to catch the error, pause, and retry (up to some reasonable limit like 3 times).

However, for any large BLAST job, I would recommend installing BLAST and the NT database locally - it even works on Windows but the database is quite big. Your institute might have a local Linux cluster you could use instead?

ADD COMMENTlink written 5.0 years ago by Peter5.8k

Thanks for the suggestion I runned it on linux cluster and its working just fine :)

ADD REPLYlink written 5.0 years ago by nadia_ashraf20000

If this answer solved your question, please "accept" the answer. That's part of how BioStars and similar sites like Stack Exchange work.

ADD REPLYlink written 4.8 years ago by Peter5.8k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 671 users visited in the last hour