3

biopython 内で blast を使用するのは初めてで、問題が発生しています。

以下を使用して、20 シーケンスを含む fasta ファイルからカスタム blast データベースを作成しました。

os.system('makeblastdb -in newtest.fasta -dbtype nucl -out newtest.db')

これにより、現在作業している現在のディレクトリ内にいくつかのファイル (newtest.db.nhr、newtest.db.nin、newtest.db.nsq) が生成されました: ( /home/User/Documents/python/fasta-files)

そして今、次を使用してbiopython内でこのデータベースにクエリを実行しようとしています:

blastx_cline = NcbiblastxCommandline(query="queryfile.fas", db="newtest.db", evalue=0.00000001, outfmt=5, out="opuntia.xml")

しかし、私はこのエラーが発生しています:

> Bio.Application.ApplicationError: Command 'blastx -out opuntia.xml
> -outfmt 5 -query queryfile.fas -db newtest.db -evalue 1e-08' returned non-zero exit status 2, 'BLAST Database error: No alias or
> index file found for protein database [newtest.db] in search path
> [/home/User/Documents/python/fasta-files:/usr/share/ncbi/blastdb:]'

から生成されたファイルをコピーしようとしました/home/User/Documents/python/fasta-files/usr/share/ncbi/blastdb、権限がないと表示されます。

*編集*

私が使用する場合:os.system("blastn -db newtest.db -query "fastafile.fas" + " -out test.txt") 正常に動作し、出力ファイルを生成します。しかし、その逆ではありません**

だから私はここで立ち往生しており、これを解決する方法がわかりません。

任意の助けをいただければ幸いです

4

1 に答える 1

6

newtest.db は nucl データベースですが、エラー メッセージ内のフレーズタンパク質 データベースに注意してください。

検索パスでタンパク質データベース[newtest.db]のインデックス ファイルが見つかりました

したがって、blastx はタンパク質データベースを期待しています。それは明白ではありませんか?:-)

意図的に行っていない場合は、"cmd='blastn'" を追加して、使用する BLAST プログラムを指定する必要があります。したがって、これはより良いです:

blastx_cline = NcbiblastxCommandline(cmd='blastn', query="queryfile.fas", db="newtest.db", evalue=0.00000001, outfmt=5, out="opuntia.xml")
于 2012-12-02T23:24:12.740 に答える