[Bioperl-l] problem with Bio::SearchIO::Writer

David Messina dmessina at wustl.edu
Tue Jan 9 12:29:42 EST 2007


> i am confusing with the output of the blast result
> i use Bio::SearchIO to analysis the blast result

Okay, so you've got the first part.

When you get stuck, the easiest way to learn how to use BioPerl is to  
read the How-Tos:
http://www.bioperl.org/wiki/HOWTOs

If there is a Hot-To on the topic you're interested in, that is the  
first place you should look.

There is a How-to on SearchIO here:
http://www.bioperl.org/wiki/HOWTO:SearchIO

Also, lots of questions have already been answered on the mailing  
list. You can search the mailing list archives here:
http://news.gmane.org/gmane.comp.lang.perl.bio.general


> and i don't know how to use Bio::SearchIO::Writer to output the  
> result i
> want as a Text file

> the document of Bio::SearchIO::Writer is too simple to me

If you go to the documentation for Bio::SearchIO::Writer...
http://doc.bioperl.org/releases/bioperl-1.5.2/Bio/SearchIO/Writer/ 
toc.html

...you'll see a list of output writers, including  
Bio::SearchIO::Writer::TextResultWriter:
http://doc.bioperl.org/releases/bioperl-1.5.2/Bio/SearchIO/Writer/ 
TextResultWriter.html


> can anyone show me some examples for output blast result as text  
> file using
> Bio::SearchIO::Writer or other Module?

Looking on that page, the synopsis shows this example...

   use Bio::SearchIO;
   use Bio::SearchIO::Writer::TextResultWriter;

   my $in = new Bio::SearchIO(-format => 'blast',
			     -file   => shift @ARGV);

   my $writer = new Bio::SearchIO::Writer::TextResultWriter();
   my $out = new Bio::SearchIO(-writer => $writer);
   $out->write_result($in->next_result);


...which I think will do exactly what you want.


Dave


More information about the Bioperl-l mailing list