문제

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 명령줄 도구를 사용하여 이 문제를 해결하는 데 도움을 주시면 대단히 감사하겠습니다!

도움이 되었습니까?

해결책

당신의 nr 변수는 다음으로 끝납니다 nr.pal. nr (없이 .pal) 괜찮을거야.제거하는 경우 pal 작동하지 않습니다.당신은 설정을 시도할 수 있습니다 .ncbirc 다음 내용을 포함하는 홈 디렉터리에 파일을 저장하세요.

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

기본적으로 폭발 데이터베이스 조회를 위한 환경 변수를 설정합니다.그 후에는 간단히 사용할 수 있습니다 nr (경로가 필요하지 않음) nr 변하기 쉬운.

그런데 다음으로 구성된 명령줄을 확인할 수 있습니다. NcbiblastxCommandline 사용하여 print blastx_cline.제 생각에는 수동으로 입력한 것과 같지 않은 것 같습니다.

편집하다:확인해 보세요 http://www.biostars.org/ StackExchange의 형식과 유사한 생물정보학 관련 질문의 경우.

다른 팁

코드 샘플 내에서 호출되는 것과 다른 DB가 나열하는 것으로 보입니다.

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

vs.

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

명령 줄에서 사용하는 '.pal'없이 경로를 반영하도록 2 행 2에서 해당 경로 할당을 NR로 변경하십시오.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top