[Bioperl-l] SearchIO: write/read database

Chu, Roy RChu at coh.org
Tue May 20 13:22:50 EDT 2008

I've never really explored using pipes beyond the shell envrionment and
writing images w/ the bioperl GD module but always a good time to learn!
If I can't get it to work, then I'll just parse the xml output.


From: dave at davemessina.com [mailto:dave at davemessina.com] On Behalf Of
Dave Messina
Sent: Tuesday, May 20, 2008 10:10 AM
To: Chu, Roy
Cc: Sendu Bala; bioperl-l at bioperl.org
Subject: Re: [Bioperl-l] SearchIO: write/read database

Echoing what Sendu said, the most straightforward way to read output
from a program without writing to a file first is to open a pipe from
the program as a filehandle.

my @args = ('/usr/bin/blastp', '/path/to/my/blastdb',
open (my $blast_fh, '-|', @args) or die "couldn't open blast stream";

Now you can use that filehandle to read in data and manipulate just as
if you had read it in from a file (except of course since it's a stream
you can't rewind).


This message and any attachments are intended solely for the individual or entity to which they are addressed. This communication may contain information that is privileged, confidential, or exempt from disclosure under applicable law (e.g., personal health information, research data, financial information). Because this e-mail has been sent without encryption, individuals other than the intended recipient may be able to view the information, forward it to others or tamper with the information without the knowledge or consent of the sender. If you are not the intended recipient, or the employee or person responsible for delivering the message to the intended recipient, any dissemination, distribution or copying of the communication is strictly prohibited. If you received the communication in error, please notify the sender immediately by replying to this message and deleting the message and any accompanying files from your system. If, due to the security risks, you do not wish to receive further communications via e-mail, please reply to this message and inform the sender that you do not wish to receive further e-mail from the sender.  


More information about the Bioperl-l mailing list