Question: Local protein BLAST not working
0
gravatar for lisa96.barel
13 months ago by
lisa96.barel0 wrote:

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 • 575 views
ADD COMMENTlink modified 13 months ago • written 13 months ago by lisa96.barel0

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 REPLYlink modified 13 months ago • written 13 months ago by jaqx00870

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 REPLYlink written 13 months ago by lisa96.barel0

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

ADD REPLYlink written 13 months ago by fishgolden450
0
gravatar for joe
13 months ago by
joe140
joe140 wrote:

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 COMMENTlink written 13 months ago by joe140
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1705 users visited in the last hour