[Bioperl-l] Re: testing for valid return from HTMLResultWriter
Jason Stajich
jason at cgt.duhs.duke.edu
Tue Jul 22 18:30:27 EDT 2003
hmm, well using those changes you have to use the writer twice -
my $w = new Bio::SearchIO::Writer::HTMLResultWriter(...filter args here...).
my $out = new Bio::SearchIO(-writer => $w,
-file => '>file');
if( $w->to_string($r) ) {
$out->write_result($r);
}
On Tue, 22 Jul 2003, Charles Hauser wrote:
> J,
>
>
> I added the return '' if line to HTMLResultWriter to abort if cutoffs not met:
>
> while( my $hit = $result->next_hit ) {
> next if( $hitfilter && ! &{$hitfilter}($hit) );
> my @hsps = $hit->hsps;
> return '' if (($hsps[0]->length < 100) && ($hsps[0]->percent_identity < 40));
>
>
>
> In the script I have something looking like:
>
>
> while( my $result = $parser->next_result ) {
> $writer->write_result($result) unless ??????;
> }
>
> Before writing the file ($writer) I want to test that I returned data
> (don't want to print blank reports).
>
> How would I test that I did not return ''?
>
> C
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu
More information about the Bioperl-l
mailing list