【发布时间】:2016-11-25 19:10:26
【问题描述】:
我正在尝试使用 Biopython 从 NCBI 获取登录号的 fasta 序列。通常序列已成功下载。但偶尔我会收到以下错误:
http.client.IncompleteRead: IncompleteRead(61808640字节读取)
我已经搜索了答案How to handle IncompleteRead: in python
我已经尝试过最佳答案https://stackoverflow.com/a/14442358/4037275。这是工作。但是,问题是,它会下载部分序列。有没有其他办法。谁能指出我正确的方向?
from Bio import Entrez
from Bio import SeqIO
Entrez.email = "my email id"
def extract_fasta_sequence(NC_accession):
"This takes the NC_accession number and fetches their fasta sequence"
print("Extracting the fasta sequence for the NC_accession:", NC_accession)
handle = Entrez.efetch(db="nucleotide", id=NC_accession, rettype="fasta", retmode="text")
record = handle.read()
【问题讨论】:
标签: python biopython http.client