我正在尝试使用 NCBIWWW 爆炸核苷酸序列
from Bio.Blast import NCBIWWW
my_query = "TGCGTGCCGTGCAATGTGCGT"
result_handle = NCBIWWW.qblast("blastn", "nt", my_query)
blast_result = open("my_blast.xml", "w")
blast_result.write(result_handle.read())
blast_result.close()
result_handle.close()
这是第一次运行良好,但是几天后我尝试运行它时出现错误:
> result_handle = NCBIWWW.qblast("blastn", "nt", my_query) File "/usr/local/lib/python2.7/dist-packages/biopython-1.63-py2.7-linux-x86_64.egg/Bio/Blast/NCBIWWW.py", line 123, in qblast
> handle = _urlopen(request) File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
> return _opener.open(url, data, timeout) File "/usr/lib/python2.7/urllib2.py", line 410, in open
> response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
> 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.7/urllib2.py", line 448, in error
> return self._call_chain(*args) File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
> result = func(*args) File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
> raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 403: Forbidden
我没有更改代码中的任何内容,所以我不明白发生了什么。可能是什么问题?
谢谢!