有人知道如何仅使用GenBank代码登录名和biopython从GenBank中的数据中获得科学名称(或所有功能)。例如:

>>> From Bio import Entrez
>>> Entrez.email = [email protected]
>>> Input = Entrez.someFunction(db="nucleotide", term="AY851612")
>>> output = Entrez.read(Input)
>>> print output

"Austrocylindropuntia subulata"


还是:

>>> print output

"LOCUS AY851612 892 bp DNA linear PLN 10-APR-2007
DEFINITION Opuntia subulata rpl16 gene, intron; chloroplast.
ACCESSION AY851612
VERSION AY851612.1 GI:57240072
KEYWORDS .
SOURCE chloroplast Austrocylindropuntia subulata
ORGANISM Austrocylindropuntia subulata
Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta;
Spermatophyta; Magnoliophyta; eudicotyledons; core eudicotyledons;
Caryophyllales; Cactaceae; Opuntioideae; Austrocylindropuntia.
REFERENCE 1 (bases 1 to 892)
AUTHORS Butterworth,C.A. and Wallace,R.S.
..."


谢谢大家 ! =)

最佳答案

请注意,output是字典。如果需要,您可以访问任何适当的字段。另外,您将要使用efetch而不是esearch。

In [1]: from Bio import Entrez

In [3]: Entrez.email = '##############'

In [28]: handle = Entrez.efetch(db="nucleotide", id="AY851612", rettype="gb", retmode="text")

In [29]: x = SeqIO.read(handle, 'genbank')

In [30]: print(x)
ID: AY851612.1
Name: AY851612
Description: Opuntia subulata rpl16 gene, intron; chloroplast.
Number of features: 3
/date=10-APR-2007
/sequence_version=1
/taxonomy=['Eukaryota', 'Viridiplantae', 'Streptophyta', 'Embryophyta', 'Tracheophyta', 'Spermatophyta', 'Magnoliophyta', 'eudicotyledons', 'Gunneridae', 'Pentapetalae', 'Caryophyllales', 'Cactineae', 'Cactaceae', 'Opuntioideae', 'Austrocylindropuntia']
/data_file_division=PLN
/references=[Reference(title='Molecular Phylogenetics of the Leafy Cactus Genus Pereskia (Cactaceae)', ...), Reference(title='Direct Submission', ...)]
/keywords=['']
/accessions=['AY851612']
/gi=57240072
/organism=Austrocylindropuntia subulata
/source=chloroplast Austrocylindropuntia subulata
Seq('CATTAAAGAAGGGGGATGCGGATAAATGGAAAGGCGAAAGAAAGAAAAAAATGA...AGA', IUPACAmbiguousDNA())

In [31]: x.description
Out[31]: 'Opuntia subulata rpl16 gene, intron; chloroplast.'

关于python - 将GenBank登录码指定为biopython,如何获得科学名称?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28354817/

10-09 06:32