[Bioperl-l] SearchIO: write/read database

Sendu Bala bix at sendu.me.uk
Tue May 20 05:52:03 EDT 2008


Chu, Roy wrote:
> Hi,
> 
> I tried a mailing-list and module search, but I couldn't find what I
> was looking for--but I know it's there.
> 
> On the bioperl page
> (http://www.bioperl.org/wiki/HOWTO:SearchIO#Writing_and_formatting_output)
> it says: "If your data is instead stored in a database you could
> build the Bio::Search objects up in memory directly from your
> database and then use the Writer object to output the data."
> 
> I want to write/read BLAST results to a database w/o having to write
> to files or parse any xml.  Can someone direct me to any available
> module(s) that will help me in my endeavor?

I've not used Writer so perhaps someone has a better answer, but...

Bio::Tools::Run::StandAloneBlast always creates a temporary file at 
least, so you may not want to use that to run your blasts. Let's say you 
arrange for the output of your blast executable to be (perhaps 
indirectly) piped into your database. If your question is then how to 
parse that data in your database without creating a file on disc, just 
arrange to pull the data out of your database into memory as a perl 
string, treat that string as a file handle, then supply that FH to a 
SearchIO. Using Bio::SearchIO::blast_pull here may be beneficial.

Alternatively, if you wanted to store parsed results in your db, again 
you could arrange for to run your blast executable but this time pipe 
into blast_pull (which avoids any temp files), and store the desired 
Bio::Search::* objects in your db for later retrieval.


More information about the Bioperl-l mailing list