Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何根据GenBank对biopython的注册代码获得学名?_Python_Bioinformatics_Biopython_Genbank - Fatal编程技术网

如何根据GenBank对biopython的注册代码获得学名?

如何根据GenBank对biopython的注册代码获得学名?,python,bioinformatics,biopython,genbank,Python,Bioinformatics,Biopython,Genbank,有人知道我如何仅使用GenBank代码和biopython从GenBank中的数据中获取学名(或所有功能)。例如: >>> From Bio import Entrez >>> Entrez.email = someuser@mail.com >>> Input = Entrez.someFunction(db="nucleotide", term="AY851612") >>> output = Entrez.read(I

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

>>> From Bio import Entrez
>>> Entrez.email = someuser@mail.com
>>> 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.'

请注意,
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.'

你读过关于访问Entrez资源的Biopython教程吗?是的,我读过第9章,其中涉及“访问NCBI的Entrez数据库”,但它关注的是GI代码,而不是GB代码(或加入代码)=(你读过关于访问Entrez资源的Biopython教程吗?是的,我读了第9章,其中涉及“访问NCBI的Entrez数据库”,但它关注的是GI代码,而不是GB代码(或登录代码)。=(太棒了!我只需要做:x.annotations['organism']为了得到学名。谢谢!太棒了!我只需要做:x.annotations['organic']来得到学名。谢谢!