Hello, I am studying the application of blast in biopython. Now a problem is troubling me. I have to create a fasta file to use the function NcbiblastpCommandline( which is similar to blastp in blasp+). But I don't want to do so. I am making a website with Python, in which the user can compare his sequence to my protein database. A 'hard' way to solve the problem is: When the user submits his sequence, the server creates a file and executes the function of NciblastpCommandline.
Analogically, is it possible that it doesn't output as a file, just a string ? Then I can extract the valuable information easily without create (and delete) any files.
There is a similar post in biostarts, but the editor's environment seems to be linux shell. Local Blast: Querying A Single Sequence Without Input File. Possible ?
Thanks.
Blastp can read a query from stdin like "query -" and as I recall it outputs by default to stdout..
I use the python script. can you provide a demo?
In terminal:
Is the same than:
I don't know about python.
I' sorry. It doesn't work. My requirement is "no sequence file(like file.fasta)". The server gets the query of sequence(stored in RAM), and then outputs the result, just as the website of ncbi does.
Well, like your link says, something like:
works too..
It seems that i understand it ! I use cmd in windows "echo XXX | blastp -db -outfmt -5" and it works. next step is how to make python script link to the command. Thank you very much.
Sorry but what make you think the NCBI website doesn't write the input sequence to a temporary file before running blast?
Just in my opinion. Or else the server will create and delete hundreds of thousands of files every day. If I were a member of the website, I would try to store the sequence information in the RAM(as a variable instead of a exist file). It would be faster and beneficial to the hard disk. So I am confused why the Blast+ command support file-input generally.