3

Biopython の NcbiblastxCommandline ツールを使用して「nr」データベースで blastx をローカルで実行しようとしていますが、タンパク質データベースの検索パスに関して常に次のエラーが発生します。

>>> from Bio.Blast.Applications import NcbiblastxCommandline
>>> nr = "/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr.pal"
>>> infile = "/Users/Priya/Documents/Python/Tutorials/opuntia.txt"
>>> blastx = "/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/blastx"
>>> outfile = "/Users/Priya/Documents/Python/Tutorials/opuntia_python_local.xml"
>>> blastx_cline = NcbiblastxCommandline(blastx, query = infile, db = nr, evalue = 0.001, out = outfile)
>>> stdout, stderr = blastx_cline()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File     "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Application/__init__.py", line 443, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Command '/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/blastx -out /Users/Priya/Documents/Python/Tutorials/opuntia_python_local.xml -query /Users/Priya/Documents/Python/Tutorials/opuntia.txt -db /Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr.pal -evalue 0.001' returned non-zero exit status 2, 'BLAST Database error: No alias or index file found for protein database [/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr.pal] in search path [/Users/Priya::]'

ダウンロードした nr データベースを指すようにパスを変更する方法がわかりませんが、このコードをコマンドラインから問題なく実行できるため、パスを正しく指していると思いました。

Priyas-iMac:~ Priya$ /Users/priya/Documents/Python/ncbi-blast-2.2.26+/bin/blastx -query /Users/priya/Documents/Python/Tutorials/opuntia.txt -db /Users/priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr -out /Users/priya/Documents/Python/Tutorials/opuntia_local.xml -evalue 0.001 -outfmt 5

上記のコマンド ライン コードは、予想どおり、ブラスト結果の xml ファイルを作成します。

Biopython NCBI コマンド ライン ツールを使用してこの問題を解決するための助けをいただければ幸いです。

4

2 に答える 2

5

変数nrはで終わりますnr.palnr(なしで.pal)問題ないはずです。削除palが機能しない場合。.ncbirc次のようなファイルをホームディレクトリに設定してみてください。

[BLAST]
BLASTDB=/directory/path/to/blast/databases

基本的に、ブラストデータベースルックアップ用の環境変数を設定します。nrその後、変数で(パスは不要)単純に使用できnrます。

ちなみに、をNcbiblastxCommandline使用して作成されたコマンドラインを確認できますprint blastx_cline。私の推測では、手動で入力したものと同じではありません。

編集: StackExchangeのフォーマットに類似したバイオインフォマティクス固有の質問については、http ://www.biostars.org/をチェックしてください。

于 2012-05-21T05:36:23.327 に答える
1

動作するコマンドは、コードサンプル内から呼び出されたものとは異なるデータベースをリストしているようです。

# In the code
-db /Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr.pal

対。

# From the command line
-db /Users/priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr

2行目のnrへのパスの割り当てを変更して、コマンドラインから使用する「.pal」のないパスを反映するようにしてください。

于 2012-05-21T05:31:30.863 に答える