如何使用Efetch下载_full_ RefSeq记录?

问题描述 投票:1回答:1

我从Nucleotide db下载完整记录时遇到问题。我用:

from Bio import Entrez
from Bio import SeqIO

with Entrez.efetch(db="nuccore", rettype="gb", retmode="full", id="NC_007384") as handle:
    seq_record = SeqIO.read(handle, "gb") 

print(seq_record)

这给了我一个简短版本的gb文件所以命令:

seq_record.features

不返回功能。

相比之下,当我使用GenBank ID做同样的事情时没有问题:

with Entrez.efetch(db="nuccore", rettype="gb", retmode="full", id="CP014768.1") as handle:
    seq_record = SeqIO.read(handle, "gb") 

print(seq_record)

之后,我可以从列表seq_record.features中提取每个带注释的特征。

有没有办法使用Efetch下载完整的RefSeq记录?

biopython ncbi genbank
1个回答
1
投票

您需要使用style="withparts"或将rettype更改为gbwithparts以获取所有功能。这个table有一些信息。

>>> from Bio import Entrez
>>> from Bio import SeqIO
>>> Entrez.email = '[email protected]'
>>> with Entrez.efetch(db="nuccore", rettype="gb", retmode="full", id="NC_007384") as handle:
...     seq_record = SeqIO.read(handle, "gb") 
... 
>>> len(seq_record.features)
1
>>> with Entrez.efetch(db="nuccore", rettype="gbwithparts", retmode="full", id="NC_007384") as handle:
...     seq_record = SeqIO.read(handle, "gb") 
... 
>>> len(seq_record.features)
10616
>>> with Entrez.efetch(db="nuccore", rettype="gb", style="withparts", retmode="full", id="NC_007384") as handle:
...     seq_record = SeqIO.read(handle, "gb")
... 
>>> len(seq_record.features)
10616
© www.soinside.com 2019 - 2024. All rights reserved.