[Bioperl-l] Print alignments for several HSPs? (not for the
whole report)
Jason Stajich
jason@cgt.mc.duke.edu
Fri, 10 Jan 2003 18:26:30 -0500 (EST)
This and more things are all possible with Bio::SearchIO.
You can trim the subject and hit set and apply a filter in the
Bio::SearchIO::Writer::HTMLResultWriter or TextResultWriter.
You write a filter function that you pass in on initialization or can
set.
Basically you do this.
my $writer = Bio::SearchIO::Writer::HTMLResultWriter(); # (or TextResultWriter)
$writer->filter('hsp', \&hsp_filter_method);
# filter for 100 nt/aa HSPs
sub hsp_filter_method {
return $hsp->length('total') > 100;
}
-jason
On Fri, 10 Jan 2003, Vsevolod (Simon) Ilyushchenko wrote:
> Hi,
>
> I am running a script that does a keyword search on blast hits and then
> prints only the results whose descriptions match. Since I parse the
> blast output with Bio::Tools::Blast, I wind up with an array of
> Bio::Tools::Blast::Sbjct's and a 2-D array of Bio::Tools::Blast::HSPs,
> and I don't know how to produce a regular-looking blast report from
> them. In particular, I don't know how to pretty-print the alignments.
> I suppose I could piece it together from the HSP parameters, but this
> must already have been written...
>
> There is a to_html method in Bio::Tools::Blast, but it refers to the
> whole report, not to a collection of Sbjcts and HSPs.
>
> Thanks in advance for any pointers.
>
> Simon
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu