Local protein BLAST not working
1
0
Entering edit mode
4.6 years ago

I am trying to run a pblast locally. I have downloaded all the nr files from NCBI in a file with the following directory: '/home/lisa/Documents/nr' The first code is giving the error code 'Command line argument error: Argument "query". File is not accessible: and the function is returning ERROR right away

nr ='/home/lisa/Documents/nr'
BLAST_output = NcbiblastpCommandline(cmd='blastp', query='MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQAPILSRVGDGTQDNLSGAEKAVQVKVKALPDAQFEVVHSLAKWKRQTLGQHDFSAGEGLYTHMKALRPDEDRLSPLHSVYVDQWDWERVMGDGERQFSTLKSTVEAIWAGIKATEAAVSEEFGLAPFLPDQIHFVHSQELLSRYPDLDAKGRERAIAKDLGAVFLVGIGGKLSDGHRHDVRAPDYDDWSTPSELGHAGLNGDILVWNPVLEDAFELSSMGIRVDADTLKHQLALTGDEDRLELEWHQALLRGEMPQTIGGGIGQSRLTMLLLQLPHIGQVQAGVWPAAVRESVPSLL', db=nr,  evalue=0.001, out='.xml', outfmt=5)
stdout, stderr = BLAST_output()
print(BLAST_output)

OR

def BLAST_local(id, seq):
    d = {}
    try:
        BLAST_output = NcbiblastpCommandline(cmd='blastp', query=seq, db='/home/lisa/Documents/nr', evalue=0.001, out='.xml',outfmt=5)
        stdout, stderr = BLAST_output()
        d.update({(Most_likely_PDB): BLAST_output})
        print("ADDED:", id)

    except:
        print("ERROR:", id)
alignment • 1.8k views
ADD COMMENT
0
Entering edit mode

Why dont you use blastp from the command line?

make db with

makeblastdb -in file.fasta -dbtype prot -out yourdbresult

blast -db yourdbresult -query linktoyouprotein.fasta -out blastp.txt

ADD REPLY
0
Entering edit mode

The db is a list of file downloaded from NCBI. It contains non-redundant sequences from GenBank translations and sequences from other databanks (Refseq, PDB, SwissProt, PIR and PRF)

ADD REPLY
0
Entering edit mode

Isn't it that you should give <filename> to "query=" arg, instead of raw amino acid sequence?

ADD REPLY
0
Entering edit mode
4.6 years ago
joe ▴ 500

This sounds more like a file permissions issue. Look up chmod and check the permissions granted to your file(s) with regards to read/write/execute...Also, depending on your OS, stdout and stderr may not do what you want. To be on page with most everyone, I recommend to use a Unix terminal cmd or R/Python package to do this.

ADD COMMENT

Login before adding your answer.

Traffic: 1952 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6