I have a script that performs BLAST queries (bl2seq)
The script works like this:
- Get sequence a, sequence b
- write sequence a to filea
- write sequence b to fileb
- run command ‘bl2seq -i filea -j fileb -n blastn’
- get output from STDOUT, parse
- repeat 20 million times
The program bl2seq does not support piping.
Is there any way to do this and avoid writing/reading to the harddrive?
I’m using Python BTW.
How do you know bl2seq does not support piping.? By the way, pipes is an OS feature, not the program. If your bl2seq program outputs something, whether to STDOUT or to a file, you should be able to parse the output. Check the help file of bl2seq for options to output to file as well, eg
-ooption. Then you can parse the file.Also, since you are using Python, an alternative you can use is BioPython module.