0

染色体の Genbank 識別子を指定して NCBI にクエリを実行し、Biopython を使用して位置を開始および停止するにはどうすればよいですか?

CP001665    NAPP    TILE    6373    6422    .   +   .   cluster=9; 
CP001665    NAPP    TILE    6398    6447    .   +   .   cluster=3; 
CP001665    NAPP    TILE    6423    6472    .   +   .   cluster=3; 
CP001665    NAPP    TILE    6448    6497    .   +   .   cluster=3;
CP001665    NAPP    TILE    7036    7085    .   +   .   cluster=10; 
CP001665    NAPP    TILE    7061    7110    .   +   .   cluster=3; 
CP001665    NAPP    TILE    7073    7122    .   +   .   cluster=3;
4

3 に答える 3

1
from Bio import Entrez
from Bio import SeqIO

Entrez.email = "sample@example.org"

handle = Entrez.efetch(db="nuccore",
                       id="CP001665",
                       rettype="gb",
                       retmode="text")

whole_sequence = SeqIO.read(handle, "genbank")

print whole_sequence[6373:6422]

idとフェッチ元のデータベースがわかったら、 を使用Entrez.efetchしてそのファイルへのハンドルを取得します。ファイル形式のデータへのハンドラーを取得するには、戻り値の型 ( rettype="gb") とモード ( ) を指定する必要があります。retmode="text"

次に、このハンドラを に渡します。これはオブジェクトSeqIOを返す必要があります。SeqRecords の優れた機能の 1 つSeqRecordは、リストとしてきれいにスライスできることです。開始点と終了点をどこかから取得できる場合、上記のprintステートメントは次を返します。

ID: CP001665.1
Name: CP001665
Description: Escherichia coli 'BL21-Gold(DE3)pLysS AG', complete genome.
Number of features: 0
Seq('GCGCTAACCATGCGAGCGTGCCTGATGCGCTACGCTTATCAGGCCTACG', IUPACAmbiguousDNA())
于 2014-07-01T12:35:48.650 に答える
0

ヌクレオチド/タンパク質配列をダウンロードするには、Biopython を使用する必要はありません。代わりに urllib2 を使用するか、Biopython または Bioperl を使用できます。リストには NCBI GI ID が含まれています。

import urllib2
List = ['440906003','440909279','440901052']
for gi in List:
    url = 'https://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?    tool=portal&sendto=on&log$=seqview&db=protein&dopt=fasta&sort=&val='+gi+'&from=begin&to=end&maxplex=1'
    resp = urllib2.urlopen(url)
    page = resp.read()
    print (page),
于 2016-08-26T04:37:08.203 に答える