从
base_entrez_fetch
读取 NCBI 输出时,不同物种的基因组版本似乎存储方式不同。
例如,在Danio rerio中,可以在以下位置找到:
test = base_entrez_fetch('gene', gene_id, rettype='gb', retmode='xml', max_list_len=3000)
version = test[0][0]['Entrezgene_locus'][0]['Gene-commentary_heading']
但是,相同的索引 (
[0][0]['Entrezgene_locus'][0]['Gene-commentary_heading']
) 不会返回不同物种的基因组版本,例如 Homo sapiens。我正在研究各种物种,我想知道是否有一种方法可以一致地检索这些物种的基因组版本。
base_entrez_fetch
不是 Biopython 的函数。然而,entrez 基因似乎带有 Homo sapiens 基因的组装信息。
# file efetch.py
from Bio import Entrez
Entrez.email = "[email protected]"
gene = next(
Entrez.parse(
Entrez.efetch(
db='gene',
id=11283,
rettype='gb',
retmode='xml',
max_list_len=1
)
)
)
print(
gene['Entrezgene_locus'][0]['Gene-commentary_heading']
)
% python efetch.py
Reference GRCh38.p14 Primary Assembly
% pip show biopython
Name: biopython
Version: 1.83
Summary: Freely available tools for computational molecular biology.
Home-page: https://biopython.org/
Author: The Biopython Contributors
Author-email: [email protected]
License:
Location: /Users/user/venvbiopython/lib/python3.12/site-packages
Requires: numpy
Required-by: