I have found a blog post with a script that I would like to use for my current research project: link
The script is incredibly fast and produces a smooth conservation plot. In the blog post, the author mentions that it would be totally possible to change the remote blast function to a local database. Instead of making a local database, I have opted to try to change the function to still use a remote blast, but with different parameters.
I found the following resource for learning about the NCBIWWW module: link
Using this, I rewrote the line in the script:
blast_handle = NCBIWWW.qblast(blast_method, "nr", search_gi)
to:
blast_handle = NCBIWWW.qblast(program="blastp",
database="refseq_protein",
sequence=search_gi,
entrez_query=" txid2 [ORGN] OR txid4751 [ORGN] ",
expect=20000.0,
alignments=10000,
descriptions=10000)
Strangely, I get the exact same graph as an output even with the different parameters. Am I doing something about this search incorrectly?
Thanks.
Update:
I got my BLAST to match the webpage. my current parameters are:
blast_handle = NCBIWWW.qblast(program="blastp", database="refseq_protein", sequence="P02686.3", word_size=6, expect=20000.0, hitlist_size=10000, gapcosts="11 1", matrix_name="BLOSUM62", filter="F", genetic_code=1, threshold=21, composition_based_statistics=2, alignments=10000, descriptions=10000, entrez_query=" txid2 [ORGN] OR txid4751 [ORGN] ")
With this new blast_handle, the script no longer works. I get the following error codes:
line 191, in main(sys.argv[1])
line 27, in main blast_rec = ncbi_manager.remote_blast(protein_gi, "blastp")
line 184, in remote_blast return rec_it.next()
line 575, in parse raise ValueError("Your XML file was empty")
ValueError: Your XML file was empty