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)
Why dont you use blastp from the command line?
make db with
blast -db yourdbresult -query linktoyouprotein.fasta -out blastp.txt
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)
Isn't it that you should give <filename> to "query=" arg, instead of raw amino acid sequence?