Hi,
I want to run some blast locally. I have some queries and a lot of fasta files that would be my databases. But I need to convert from fasta to "database" format. I know how to do it with commandline (makeblastdb), but they are several fasta files, so I want to write a script and do it with (bio)python.
I have been looking how to do it, but I haven't find out how. Can any one help me, please?
Thanks!
Using BioPython to makeblastdb a bunch of files is neither a smart learning process nor an efficient way to actually get your task done. Why use anything but the shell?
Well, I know I'm preety late for the topc conversation but. If you're up to UNIX, or to any other system that you can install BLAST local.
#!/usr/bin/env python
import sys
import os
#If you're using nt data in your working dir
blastn_db = "makeblastdb -in <sequence.fasta> -dbtype nucl -input_type fasta -out <database>"
os.system(blastn_db)
Instead of using bioblast or any other module, you'll simply call the os to run in the background of the shell. If found this a little bit more efficient than using bioblast/biopython, however in terms of speed I can't say if it's faster or not. Hope it helps
I agree with this being a much better idea through a standard shell script but if you're adamant about doing it through python (perhaps incorporating it as part of a much longer and more complicated pipeline), you need to do something like this:
Using BioPython to
makeblastdb
a bunch of files is neither a smart learning process nor an efficient way to actually get your task done. Why use anything but the shell?While you could use biopython, why not do that using a simple shell script?
Thanks for your answers!
Do not add an answer unless you're answering the question. This should be a comment reply. I'm moving it to a comment on the top level post now.
Well, I know I'm preety late for the topc conversation but. If you're up to UNIX, or to any other system that you can install BLAST local.
Instead of using bioblast or any other module, you'll simply call the os to run in the background of the shell. If found this a little bit more efficient than using bioblast/biopython, however in terms of speed I can't say if it's faster or not. Hope it helps