File Coverage

Bio/SearchIO/Writer/TextResultWriter.pm
Criterion Covered Total %
statement 164 216 75.9
branch 59 124 47.5
condition 21 68 30.8
subroutine 19 22 86.3
pod 13 15 86.6
total 276 445 62.0


line stmt bran cond sub pod time code
1             #
2             # BioPerl module for Bio::SearchIO::Writer::TextResultWriter
3             #
4             # Please direct questions and support issues to
5             #
6             # Cared for by Jason Stajich
7             #
8             # Copyright Jason Stajich
9             #
10             # You may distribute this module under the same terms as perl itself
11              
12             # POD documentation - main docs before the code
13              
14             =head1 NAME
15              
16             Bio::SearchIO::Writer::TextResultWriter - Object to implement writing
17             a Bio::Search::ResultI in Text.
18              
19             =head1 SYNOPSIS
20              
21             use Bio::SearchIO;
22             use Bio::SearchIO::Writer::TextResultWriter;
23              
24             my $in = Bio::SearchIO->new(-format => 'blast',
25             -file => shift @ARGV);
26              
27             my $writer = Bio::SearchIO::Writer::TextResultWriter->new();
28             my $out = Bio::SearchIO->new(-writer => $writer);
29             $out->write_result($in->next_result);
30              
31             =head1 DESCRIPTION
32              
33             This object implements the SearchWriterI interface which will produce
34             a set of Text for a specific Bio::Search::Report::ReportI interface.
35              
36             You can also provide the argument -filters =E \%hash to filter the at
37             the hsp, hit, or result level. %hash is an associative array which
38             contains any or all of the keys (HSP, HIT, RESULT). The values
39             pointed to by these keys would be references to a subroutine which
40             expects to be passed an object - one of Bio::Search::HSP::HSPI,
41             Bio::Search::Hit::HitI, and Bio::Search::Result::ResultI respectively.
42             Each function needs to return a boolean value as to whether or not the
43             passed element should be included in the output report - true if it is
44             to be included, false if it to be omitted.
45              
46             For example to filter on sequences in the database which are too short
47             for your criteria you would do the following.
48              
49             Define a hit filter method
50              
51             sub hit_filter {
52             my $hit = shift;
53             return $hit->length E 100; # test if length of the hit sequence
54             # long enough
55             }
56             my $writer = Bio::SearchIO::Writer::TextResultWriter->new(
57             -filters => { 'HIT' =E \&hit_filter }
58             );
59              
60             Another example would be to filter HSPs on percent identity, let's
61             only include HSPs which are 75% identical or better.
62              
63             sub hsp_filter {
64             my $hsp = shift;
65             return $hsp->percent_identity E 75;
66             }
67             my $writer = Bio::SearchIO::Writer::TextResultWriter->new(
68             -filters => { 'HSP' =E \&hsp_filter }
69             );
70              
71             See L for more info on the filter method.
72              
73              
74             This module will use the module Text::Wrap if it is installed to wrap
75             the Query description line. If you do not have Text::Wrap installed
76             this module will work fine but you won't have the Query line wrapped.
77             You will see a warning about this when you first instantiate a
78             TextResultWriter - to avoid these warnings from showing up, simply set
79             the verbosity upon initialization to -1 like this: my $writer = new
80             Bio::SearchIO::Writer::TextResultWriter(-verbose =E -1);
81              
82             =head1 FEEDBACK
83              
84             =head2 Mailing Lists
85              
86             User feedback is an integral part of the evolution of this and other
87             Bioperl modules. Send your comments and suggestions preferably to
88             the Bioperl mailing list. Your participation is much appreciated.
89              
90             bioperl-l@bioperl.org - General discussion
91             http://bioperl.org/wiki/Mailing_lists - About the mailing lists
92              
93             =head2 Support
94              
95             Please direct usage questions or support issues to the mailing list:
96              
97             I
98              
99             rather than to the module maintainer directly. Many experienced and
100             reponsive experts will be able look at the problem and quickly
101             address it. Please include a thorough description of the problem
102             with code and data examples if at all possible.
103              
104             =head2 Reporting Bugs
105              
106             Report bugs to the Bioperl bug tracking system to help us keep track
107             of the bugs and their resolution. Bug reports can be submitted via the
108             web:
109              
110             https://github.com/bioperl/bioperl-live/issues
111              
112             =head1 AUTHOR - Jason Stajich
113              
114             Email jason@bioperl.org
115              
116             =head1 APPENDIX
117              
118             The rest of the documentation details each of the object methods.
119             Internal methods are usually preceded with a _
120              
121             =cut
122              
123              
124             # Let the code begin...
125              
126              
127             package Bio::SearchIO::Writer::TextResultWriter;
128 1     1   801 use vars qw($MaxNameLen $MaxDescLen $AlignmentLineWidth $DescLineLen $TextWrapLoaded);
  1         1  
  1         54  
129 1     1   4 use strict;
  1         1  
  1         43  
130              
131             # Object preamble - inherits from Bio::Root::RootI
132              
133             BEGIN {
134 1     1   1 $MaxDescLen = 65;
135 1         1 $AlignmentLineWidth = 60;
136 1         1 eval { require Text::Wrap; $TextWrapLoaded = 1;};
  1         361  
  1         1826  
137 1 50       17 if( $@ ) {
138 0         0 $TextWrapLoaded = 0;
139             }
140             }
141              
142 1     1   491 use POSIX;
  1         4191  
  1         4  
143              
144 1     1   1908 use base qw(Bio::Root::Root Bio::SearchIO::SearchWriterI);
  1         1  
  1         289  
145              
146             =head2 new
147              
148             Title : new
149             Usage : my $obj = Bio::SearchIO::Writer::TextResultWriter->new();
150             Function: Builds a new Bio::SearchIO::Writer::TextResultWriter object
151             Returns : Bio::SearchIO::Writer::TextResultWriter
152             Args : -filters => hashref with any or all of the keys (HSP HIT RESULT)
153             which have values pointing to a subroutine reference
154             which will expect to get a Hit,HSP, Result object respectively
155             -no_wublastlinks => boolean. Do not display WU-BLAST lines even if
156             they are parsed out
157             Links = (1)
158              
159             =cut
160              
161             sub new {
162 1     1 1 13 my($class,@args) = @_;
163              
164 1         7 my $self = $class->SUPER::new(@args);
165 1         6 my ($filters,$nowublastlinks) = $self->_rearrange([qw(FILTERS
166             NO_WUBLASTLINKS)],
167             @args);
168 1 50       4 if( defined $filters ) {
169 0 0       0 if( !ref($filters) =~ /HASH/i ) {
170 0         0 $self->warn("Did not provide a hashref for the FILTERS option, ignoring.");
171             } else {
172 0         0 while( my ($type,$code) = each %{$filters} ) {
  0         0  
173 0         0 $self->filter($type,$code);
174             }
175             }
176             }
177 1         4 $self->no_wublastlinks(! $nowublastlinks);
178 1 50       3 unless( $TextWrapLoaded ) {
179 0         0 $self->warn("Could not load Text::Wrap - the Query Description will not be line wrapped\n");
180             } else {
181 1         1 $Text::Wrap::columns = $MaxDescLen;
182             }
183 1         2 return $self;
184             }
185              
186              
187             =head2 to_string
188              
189             Purpose : Produces data for each Search::Result::ResultI in a string.
190             : This is an abstract method. For some useful implementations,
191             : see ResultTableWriter.pm, HitTableWriter.pm,
192             : and HSPTableWriter.pm.
193             Usage : print $writer->to_string( $result_obj, @args );
194             Argument : $result_obj = A Bio::Search::Result::ResultI object
195             : @args = any additional arguments used by your implementation.
196             Returns : String containing data for each search Result or any of its
197             : sub-objects (Hits and HSPs).
198             Throws : n/a
199              
200             =cut
201              
202             sub to_string {
203 1     1 1 2 my ($self,$result,$num) = @_;
204 1   50     2 $num ||= 0;
205 1 50       3 return unless defined $result;
206 1         2 my $links = $self->no_wublastlinks;
207 1         7 my ($resultfilter,$hitfilter, $hspfilter) = ( $self->filter('RESULT'),
208             $self->filter('HIT'),
209             $self->filter('HSP') );
210 1 50 33     4 return '' if( defined $resultfilter && ! &{$resultfilter}($result) );
  0         0  
211            
212 1         1 my ($qtype,$dbtype,$dbseqtype,$type);
213 1         7 my $alg = $result->algorithm;
214            
215 1 50       3 my $wublast = ($result->algorithm_version =~ /WashU/) ? 1 : 0;
216            
217             # This is actually wrong for the FASTAs I think
218 1 50 0     7 if( $alg =~ /T(FAST|BLAST)([XY])/i ) {
    0 0        
    0          
    0          
    0          
219 1         1 $qtype = $dbtype = 'translated';
220 1         2 $dbseqtype = $type = 'PROTEIN';
221             } elsif( $alg =~ /T(FAST|BLAST)N/i ) {
222 0         0 $qtype = '';
223 0         0 $dbtype = 'translated';
224 0         0 $type = 'PROTEIN';
225 0         0 $dbseqtype = 'NUCLEOTIDE';
226             } elsif( $alg =~ /(FAST|BLAST)N/i ||
227             $alg =~ /(WABA|EXONERATE)/i ) {
228 0         0 $qtype = $dbtype = '';
229 0         0 $type = $dbseqtype = 'NUCLEOTIDE';
230             } elsif( $alg =~ /(FAST|BLAST)P/ ||
231             $alg =~ /SSEARCH|(HMM|SEARCH|PFAM)/i ) {
232 0         0 $qtype = $dbtype = '';
233 0         0 $type = $dbseqtype = 'PROTEIN';
234             } elsif( $alg =~ /(FAST|BLAST)[XY]/i ) {
235 0         0 $qtype = 'translated';
236 0         0 $dbtype = 'PROTEIN';
237 0         0 $dbseqtype = $type = 'PROTEIN';
238             } else {
239 0         0 print STDERR "algorithm was ", $result->algorithm, " couldn't match\n";
240             }
241            
242            
243 1 50       6 my %baselens = ( 'Sbjct:' => ( $dbtype eq 'translated' ) ? 3 : 1,
    50          
244             'Query:' => ( $qtype eq 'translated' ) ? 3 : 1);
245              
246 1         1 my $str;
247 1 50 33     5 if( ! defined $num || $num <= 1 ) {
248 1         1 $str = &{$self->start_report}($result);
  1         3  
249             }
250              
251 1         1 $str .= &{$self->title}($result);
  1         3  
252 1         3 $str .= $result->algorithm . " " . $result->algorithm_version . "\n\n\n";
253 1   33     3 $str .= $result->algorithm_reference || $self->algorithm_reference($result);
254 1         4 $str .= &{$self->introduction}($result);
  1         3  
255              
256              
257 1         3 $str .= qq{
258             Score E
259             Sequences producing significant alignments: (bits) value
260             };
261 1         1 my $hspstr = '';
262 1 50       12 if( $result->can('rewind')) {
263 1         3 $result->rewind(); # support stream based parsing routines
264             }
265 1         3 while( my $hit = $result->next_hit ) {
266 20 50 33     38 next if( defined $hitfilter && ! &{$hitfilter}($hit) );
  0         0  
267 20         39 my $nm = $hit->name();
268 20 50       37 $self->debug( "no $nm for name (".$hit->description(). "\n")
269             unless $nm;
270 20         18 my ($gi,$acc) = &{$self->id_parser}($nm);
  20         32  
271 20         31 my $p = "%-$MaxDescLen". "s";
272 20         14 my $descsub;
273 20         38 my $desc = sprintf("%s %s",$nm,$hit->description);
274 20 50       30 if( length($desc) - 3 > $MaxDescLen) {
275 20         36 $descsub = sprintf($p,
276             substr($desc,0,$MaxDescLen-3) .
277             "...");
278             } else {
279 0         0 $descsub = sprintf($p,$desc);
280             }
281 20 0       50 $str .= $wublast ? sprintf("%s %-4s %s\n",
    0          
    50          
    50          
    50          
282             $descsub,
283             defined $hit->raw_score ? $hit->raw_score : ' ',
284             defined $hit->significance ? $hit->significance : '?') :
285             sprintf("%s %-4s %s\n",
286             $descsub,
287             defined $hit->bits ? $hit->bits: ' ',
288             defined $hit->significance ? $hit->significance : '?');
289 20         41 my @hsps = $hit->hsps;
290 20 50       35 if( @hsps ) {
291 20 50       37 $hspstr .= sprintf(">%s %s\n%9sLength = %d\n\n",
292             $hit->name,
293             defined $hit->description ? $hit->description : '',
294             '', # empty is for the %9s in the str formatting
295             $hit->length);
296              
297 20         28 foreach my $hsp ( @hsps ) {
298 21 50 33     40 next if( defined $hspfilter && ! &{$hspfilter}($hsp) );
  0         0  
299 21         39 $hspstr .= sprintf(" Score = %4s bits (%s), Expect = %s",
300             $hsp->bits, $hsp->score, $hsp->evalue);
301 21 50       39 if( $hsp->pvalue ) {
302 0         0 $hspstr .= ", P = ".$hsp->pvalue;
303             }
304 21         22 $hspstr .= "\n";
305 21         33 $hspstr .= sprintf(" Identities = %d/%d (%d%%)",
306             ( $hsp->frac_identical('total') *
307             $hsp->length('total')),
308             $hsp->length('total'),
309             POSIX::floor($hsp->frac_identical('total')
310             * 100));
311            
312 21 50       46 if( $type eq 'PROTEIN' ) {
313 21         36 $hspstr .= sprintf(", Positives = %d/%d (%d%%)",
314             ( $hsp->frac_conserved('total') *
315             $hsp->length('total')),
316             $hsp->length('total'),
317             POSIX::floor($hsp->frac_conserved('total') * 100));
318              
319             }
320 21 50       37 if( $hsp->gaps ) {
321 0         0 $hspstr .= sprintf(", Gaps = %d/%d (%d%%)",
322             $hsp->gaps('total'),
323             $hsp->length('total'),
324             POSIX::floor(100 * $hsp->gaps('total') /
325             $hsp->length('total')));
326             }
327 21         24 $hspstr .= "\n";
328 21         28 my ($hframe,$qframe) = ( $hsp->hit->frame,
329             $hsp->query->frame);
330 21         36 my ($hstrand,$qstrand) = ($hsp->hit->strand,$hsp->query->strand);
331             # so TBLASTX will have Query/Hit frames
332             # BLASTX will have Query frame
333             # TBLASTN will have Hit frame
334 21 50 33     45 if( $hstrand || $qstrand ) {
335 21         20 $hspstr .= " Frame = ";
336 21         14 my ($signq, $signh);
337 21 50       26 unless( $hstrand ) {
338 0         0 $hframe = undef;
339             # if strand is null or 0 then it is protein
340             # and this no frame
341             } else {
342 21 100       27 $signh = $hstrand < 0 ? '-' : '+';
343             }
344 21 50       24 unless( $qstrand ) {
345 0         0 $qframe = undef;
346             # if strand is null or 0 then it is protein
347             } else {
348 21 100       25 $signq =$qstrand < 0 ? '-' : '+';
349             }
350             # remember bioperl stores frames as 0,1,2 (GFF way)
351             # BLAST reports reports as 1,2,3 so
352             # we have to add 1 to the frame values
353 21 50 33     96 if( defined $hframe && ! defined $qframe) {
    50 33        
354 0         0 $hspstr .= "$signh".($hframe+1);
355             } elsif( defined $qframe && ! defined $hframe) {
356 0         0 $hspstr .= "$signq".($qframe+1);
357             } else {
358 21         67 $hspstr .= sprintf(" %s%d / %s%d",
359             $signq,$qframe+1,
360             $signh, $hframe+1);
361             }
362             }
363            
364 21 50 33     118 if( $links &&
      33        
365             $hsp->can('links') && defined(my $lnks = $hsp->links) ) {
366 0         0 $hspstr .= sprintf(" Links = %s\n",$lnks);
367             }
368 21         20 $hspstr .= "\n\n";
369              
370 21 100 50     30 my @hspvals = ( {'name' => 'Query:',
    100 50        
    100          
    100          
371             'seq' => $hsp->query_string,
372             'start' => ( $qstrand >= 0 ?
373             $hsp->query->start :
374             $hsp->query->end),
375             'end' => ($qstrand >= 0 ?
376             $hsp->query->end :
377             $hsp->query->start),
378             'index' => 0,
379             'direction' => $qstrand || 1
380             },
381             { 'name' => ' 'x6, # this might need to adjust for long coordinates??
382             'seq' => $hsp->homology_string,
383             'start' => undef,
384             'end' => undef,
385             'index' => 0,
386             'direction' => 1
387             },
388             { 'name' => 'Sbjct:',
389             'seq' => $hsp->hit_string,
390             'start' => ($hstrand >= 0 ?
391             $hsp->hit->start : $hsp->hit->end),
392             'end' => ($hstrand >= 0 ?
393             $hsp->hit->end : $hsp->hit->start),
394             'index' => 0,
395             'direction' => $hstrand || 1
396             }
397             );
398              
399              
400             # let's set the expected length (in chars) of the starting number
401             # in an alignment block so we can have things line up
402             # Just going to try and set to the largest
403              
404 85         83 my ($numwidth) = sort { $b <=> $a }(length($hspvals[0]->{'start'}),
405             length($hspvals[0]->{'end'}),
406             length($hspvals[2]->{'start'}),
407 21         91 length($hspvals[2]->{'end'}));
408 21         24 my $count = 0;
409 21         38 while ( $count <= $hsp->length('total') ) {
410 21         30 foreach my $v ( @hspvals ) {
411 63         89 my $piece = substr($v->{'seq'}, $v->{'index'} +$count,
412             $AlignmentLineWidth);
413 63         41 my $cp = $piece;
414 63         59 my $plen = scalar ( $cp =~ tr/\-//);
415 63         56 my ($start,$end) = ('','');
416 63 100       105 if( defined $v->{'start'} ) {
417 42         42 $start = $v->{'start'};
418             # since strand can be + or - use the direction
419             # to signify which whether to add or substract from end
420             my $d = $v->{'direction'} * ( $AlignmentLineWidth - $plen )*
421 42         56 $baselens{$v->{'name'}};
422 42 50       51 if( length($piece) < $AlignmentLineWidth ) {
423             $d = (length($piece) - $plen) * $v->{'direction'} *
424 42         54 $baselens{$v->{'name'}};
425             }
426 42         41 $end = $v->{'start'} + $d - $v->{'direction'};
427 42         30 $v->{'start'} += $d;
428             }
429             $hspstr .= sprintf("%s %-".$numwidth."s %s %s\n",
430 63         207 $v->{'name'},
431             $start,
432             $piece,
433             $end
434             );
435             }
436 21         19 $count += $AlignmentLineWidth;
437 21         33 $hspstr .= "\n";
438             }
439             }
440 20         75 $hspstr .= "\n";
441             }
442             }
443 1         20 $str .= "\n\n".$hspstr;
444            
445 1   33     5 $str .= sprintf(qq{ Database: %s
      50        
446             Posted date: %s
447             Number of letters in database: %s
448             Number of sequences in database: %s
449              
450             Matrix: %s
451             },
452             $result->database_name(),
453             $result->get_statistic('posted_date') ||
454             POSIX::strftime("%b %d, %Y %I:%M %p",localtime),
455             &_numwithcommas($result->database_letters()),
456             &_numwithcommas($result->database_entries()),
457             $result->get_parameter('matrix') || '');
458              
459 1 50       3 if( defined (my $open = $result->get_parameter('gapopen')) ) {
460 0   0     0 $str .= sprintf("Gap Penalties Existence: %d, Extension: %d\n",
      0        
461             $open || 0, $result->get_parameter('gapext') || 0);
462             }
463              
464             # skip those params we've already output
465 1         5 foreach my $param ( grep { ! /matrix|gapopen|gapext/i }
  3         10  
466             $result->available_parameters ) {
467 2         5 $str .= "$param: ". $result->get_parameter($param) ."\n";
468            
469             }
470 1         2 $str .= "Search Statistics\n";
471             # skip posted date, we already output it
472 1         5 foreach my $stat ( sort grep { ! /posted_date/ }
  27         28  
473             $result->available_statistics ) {
474 26         35 my $expect = $result->get_parameter('expect');
475 26         31 my $v = $result->get_statistic($stat);
476 26 100       59 if( $v =~ /^\d+$/ ) {
477 18         18 $v = &_numwithcommas($v);
478             }
479 26 100 66     65 if( defined $expect &&
480             $stat eq 'seqs_better_than_cutoff' ) {
481 1         3 $str .= "seqs_better_than_$expect: $v\n";
482             } else {
483 25         75 my $v =
484             $str .= "$stat: $v\n";
485             }
486             }
487 1         3 $str .= "\n\n";
488 1         13 return $str;
489             }
490              
491              
492             =head2 start_report
493              
494             Title : start_report
495             Usage : $index->start_report( CODE )
496             Function: Stores or returns the code to
497             write the start of the block, the block </td> </tr> <tr> <td class="h" > <a name="498">498</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> and the start of the <BODY> block of HTML. Useful </td> </tr> <tr> <td class="h" > <a name="499">499</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> for (for instance) specifying alternative </td> </tr> <tr> <td class="h" > <a name="500">500</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> HTML if you are embedding the output in </td> </tr> <tr> <td class="h" > <a name="501">501</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> an HTML page which you have already started. </td> </tr> <tr> <td class="h" > <a name="502">502</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (For example a routine returning a null string). </td> </tr> <tr> <td class="h" > <a name="503">503</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns \&default_start_report (see below) if not </td> </tr> <tr> <td class="h" > <a name="504">504</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> set. </td> </tr> <tr> <td class="h" > <a name="505">505</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Example : $index->start_report( \&my_start_report ) </td> </tr> <tr> <td class="h" > <a name="506">506</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : ref to CODE if called without arguments </td> </tr> <tr> <td class="h" > <a name="507">507</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : CODE </td> </tr> <tr> <td class="h" > <a name="508">508</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="509">509</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="510">510</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="511">511</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub start_report { </td> </tr> <tr> <td class="h" > <a name="512">512</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#512-1"> 1 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#512-1"> 1 </a> </td> <td > 1 </td> <td class="s"> my( $self, $code ) = @_; </td> </tr> <tr> <td class="h" > <a name="513">513</a> </td> <td class="c3" > 1 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#513-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 3 </td> <td class="s"> if ($code) { </td> </tr> <tr> <td class="h" > <a name="514">514</a> </td> <td class="c0" > <a href="#554"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{'_start_report'} = $code; </td> </tr> <tr> <td class="h" > <a name="515">515</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="516">516</a> </td> <td class="c3" > 1 </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--condition.html#516-1"> 50 </a> </td> <td >   </td> <td >   </td> <td > 8 </td> <td class="s"> return $self->{'_start_report'} || \&default_start_report; </td> </tr> <tr> <td class="h" > <a name="517">517</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="518">518</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="519">519</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 default_start_report </td> </tr> <tr> <td class="h" > <a name="520">520</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="521">521</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : default_start_report </td> </tr> <tr> <td class="h" > <a name="522">522</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $self->default_start_report($result) </td> </tr> <tr> <td class="h" > <a name="523">523</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: The default method to call when starting a report. </td> </tr> <tr> <td class="h" > <a name="524">524</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : sting </td> </tr> <tr> <td class="h" > <a name="525">525</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : First argument is a Bio::Search::Result::ResultI </td> </tr> <tr> <td class="h" > <a name="526">526</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="527">527</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="528">528</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="529">529</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub default_start_report { </td> </tr> <tr> <td class="h" > <a name="530">530</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#530-1"> 1 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#530-1"> 1 </a> </td> <td > 1 </td> <td class="s"> my ($result) = @_; </td> </tr> <tr> <td class="h" > <a name="531">531</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2 </td> <td class="s"> return ""; </td> </tr> <tr> <td class="h" > <a name="532">532</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="533">533</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="534">534</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 title </td> </tr> <tr> <td class="h" > <a name="535">535</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="536">536</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : title </td> </tr> <tr> <td class="h" > <a name="537">537</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $self->title($CODE) </td> </tr> <tr> <td class="h" > <a name="538">538</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="539">539</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Stores or returns the code to provide HTML for the given </td> </tr> <tr> <td class="h" > <a name="540">540</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> BLAST report that will appear at the top of the BLAST report </td> </tr> <tr> <td class="h" > <a name="541">541</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> HTML output. Useful for (for instance) specifying </td> </tr> <tr> <td class="h" > <a name="542">542</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> alternative routines to write your own titles. </td> </tr> <tr> <td class="h" > <a name="543">543</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns \&default_title (see below) if not </td> </tr> <tr> <td class="h" > <a name="544">544</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> set. </td> </tr> <tr> <td class="h" > <a name="545">545</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Example : $index->title( \&my_title ) </td> </tr> <tr> <td class="h" > <a name="546">546</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : ref to CODE if called without arguments </td> </tr> <tr> <td class="h" > <a name="547">547</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : CODE </td> </tr> <tr> <td class="h" > <a name="548">548</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="549">549</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="550">550</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="551">551</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub title { </td> </tr> <tr> <td class="h" > <a name="552">552</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#552-1"> 1 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#552-1"> 1 </a> </td> <td > 1 </td> <td class="s"> my( $self, $code ) = @_; </td> </tr> <tr> <td class="h" > <a name="553">553</a> </td> <td class="c3" > 1 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#553-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 3 </td> <td class="s"> if ($code) { </td> </tr> <tr> <td class="h" > <a name="554">554</a> </td> <td class="c0" > <a href="#602"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{'_title'} = $code; </td> </tr> <tr> <td class="h" > <a name="555">555</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="556">556</a> </td> <td class="c3" > 1 </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--condition.html#556-1"> 50 </a> </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> return $self->{'_title'} || \&default_title; </td> </tr> <tr> <td class="h" > <a name="557">557</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="558">558</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="559">559</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 default_title </td> </tr> <tr> <td class="h" > <a name="560">560</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="561">561</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : default_title </td> </tr> <tr> <td class="h" > <a name="562">562</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $self->default_title($result) </td> </tr> <tr> <td class="h" > <a name="563">563</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Provides HTML for the given BLAST report that will appear </td> </tr> <tr> <td class="h" > <a name="564">564</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> at the top of the BLAST report output. </td> </tr> <tr> <td class="h" > <a name="565">565</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : empty for text implementation </td> </tr> <tr> <td class="h" > <a name="566">566</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : First argument is a Bio::Search::Result::ResultI </td> </tr> <tr> <td class="h" > <a name="567">567</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="568">568</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="569">569</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="570">570</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub default_title { </td> </tr> <tr> <td class="h" > <a name="571">571</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#571-1"> 1 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#571-1"> 1 </a> </td> <td > 2 </td> <td class="s"> my ($result) = @_; </td> </tr> <tr> <td class="h" > <a name="572">572</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2 </td> <td class="s"> return ""; </td> </tr> <tr> <td class="h" > <a name="573">573</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # The HTML implementation </td> </tr> <tr> <td class="h" > <a name="574">574</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return sprintf( </td> </tr> <tr> <td class="h" > <a name="575">575</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # qq{<CENTER><H1><a href="http://bioperl.org">Bioperl</a> Reformatted HTML of %s Search Report<br> for %s</H1></CENTER>}, </td> </tr> <tr> <td class="h" > <a name="576">576</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $result->algorithm, </td> </tr> <tr> <td class="h" > <a name="577">577</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $result->query_name()); </td> </tr> <tr> <td class="h" > <a name="578">578</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="579">579</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="580">580</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="581">581</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 introduction </td> </tr> <tr> <td class="h" > <a name="582">582</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="583">583</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : introduction </td> </tr> <tr> <td class="h" > <a name="584">584</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $self->introduction($CODE) </td> </tr> <tr> <td class="h" > <a name="585">585</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="586">586</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Stores or returns the code to provide HTML for the given </td> </tr> <tr> <td class="h" > <a name="587">587</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> BLAST report detailing the query and the </td> </tr> <tr> <td class="h" > <a name="588">588</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> database information. </td> </tr> <tr> <td class="h" > <a name="589">589</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Useful for (for instance) specifying </td> </tr> <tr> <td class="h" > <a name="590">590</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> routines returning alternative introductions. </td> </tr> <tr> <td class="h" > <a name="591">591</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns \&default_introduction (see below) if not </td> </tr> <tr> <td class="h" > <a name="592">592</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> set. </td> </tr> <tr> <td class="h" > <a name="593">593</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Example : $index->introduction( \&my_introduction ) </td> </tr> <tr> <td class="h" > <a name="594">594</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : ref to CODE if called without arguments </td> </tr> <tr> <td class="h" > <a name="595">595</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : CODE </td> </tr> <tr> <td class="h" > <a name="596">596</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="597">597</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="598">598</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="599">599</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub introduction { </td> </tr> <tr> <td class="h" > <a name="600">600</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#600-1"> 1 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#600-1"> 1 </a> </td> <td > 1 </td> <td class="s"> my( $self, $code ) = @_; </td> </tr> <tr> <td class="h" > <a name="601">601</a> </td> <td class="c3" > 1 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#601-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 2 </td> <td class="s"> if ($code) { </td> </tr> <tr> <td class="h" > <a name="602">602</a> </td> <td class="c0" > <a href="#683"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{'_introduction'} = $code; </td> </tr> <tr> <td class="h" > <a name="603">603</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="604">604</a> </td> <td class="c3" > 1 </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--condition.html#604-1"> 50 </a> </td> <td >   </td> <td >   </td> <td > 8 </td> <td class="s"> return $self->{'_introduction'} || \&default_introduction; </td> </tr> <tr> <td class="h" > <a name="605">605</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="606">606</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="607">607</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 default_introduction </td> </tr> <tr> <td class="h" > <a name="608">608</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="609">609</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : default_introduction </td> </tr> <tr> <td class="h" > <a name="610">610</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $self->default_introduction($result) </td> </tr> <tr> <td class="h" > <a name="611">611</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Outputs HTML to provide the query </td> </tr> <tr> <td class="h" > <a name="612">612</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> and the database information </td> </tr> <tr> <td class="h" > <a name="613">613</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : string containing HTML </td> </tr> <tr> <td class="h" > <a name="614">614</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : First argument is a Bio::Search::Result::ResultI </td> </tr> <tr> <td class="h" > <a name="615">615</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Second argument is string holding literature citation </td> </tr> <tr> <td class="h" > <a name="616">616</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="617">617</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="618">618</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="619">619</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub default_introduction { </td> </tr> <tr> <td class="h" > <a name="620">620</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#620-1"> 1 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#620-1"> 1 </a> </td> <td > 1 </td> <td class="s"> my ($result) = @_; </td> </tr> <tr> <td class="h" > <a name="621">621</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="622">622</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3 </td> <td class="s"> return sprintf( </td> </tr> <tr> <td class="h" > <a name="623">623</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> qq{ </td> </tr> <tr> <td class="h" > <a name="624">624</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Query= %s </td> </tr> <tr> <td class="h" > <a name="625">625</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (%s letters) </td> </tr> <tr> <td class="h" > <a name="626">626</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="627">627</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Database: %s </td> </tr> <tr> <td class="h" > <a name="628">628</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> %s sequences; %s total letters </td> </tr> <tr> <td class="h" > <a name="629">629</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }, </td> </tr> <tr> <td class="h" > <a name="630">630</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> &_linewrap($result->query_name . " " . </td> </tr> <tr> <td class="h" > <a name="631">631</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $result->query_description), </td> </tr> <tr> <td class="h" > <a name="632">632</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> &_numwithcommas($result->query_length), </td> </tr> <tr> <td class="h" > <a name="633">633</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $result->database_name(), </td> </tr> <tr> <td class="h" > <a name="634">634</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> &_numwithcommas($result->database_entries()), </td> </tr> <tr> <td class="h" > <a name="635">635</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> &_numwithcommas($result->database_letters()), </td> </tr> <tr> <td class="h" > <a name="636">636</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ); </td> </tr> <tr> <td class="h" > <a name="637">637</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="638">638</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="639">639</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 end_report </td> </tr> <tr> <td class="h" > <a name="640">640</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="641">641</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : end_report </td> </tr> <tr> <td class="h" > <a name="642">642</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $self->end_report() </td> </tr> <tr> <td class="h" > <a name="643">643</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: The method to call when ending a report, this is </td> </tr> <tr> <td class="h" > <a name="644">644</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> mostly for cleanup for formats which require you to </td> </tr> <tr> <td class="h" > <a name="645">645</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> have something at the end of the document (</BODY></HTML>) </td> </tr> <tr> <td class="h" > <a name="646">646</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> for HTML </td> </tr> <tr> <td class="h" > <a name="647">647</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : string </td> </tr> <tr> <td class="h" > <a name="648">648</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : none </td> </tr> <tr> <td class="h" > <a name="649">649</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="650">650</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="651">651</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="652">652</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub end_report { </td> </tr> <tr> <td class="h" > <a name="653">653</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#653-1"> 1 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#653-1"> 1 </a> </td> <td > 3 </td> <td class="s"> return ""; </td> </tr> <tr> <td class="h" > <a name="654">654</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="655">655</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="656">656</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="657">657</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # copied from Bio::Index::Fasta </td> </tr> <tr> <td class="h" > <a name="658">658</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # useful here as well </td> </tr> <tr> <td class="h" > <a name="659">659</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="660">660</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 id_parser </td> </tr> <tr> <td class="h" > <a name="661">661</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="662">662</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : id_parser </td> </tr> <tr> <td class="h" > <a name="663">663</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $index->id_parser( CODE ) </td> </tr> <tr> <td class="h" > <a name="664">664</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Stores or returns the code used by record_id to </td> </tr> <tr> <td class="h" > <a name="665">665</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> parse the ID for record from a string. Useful </td> </tr> <tr> <td class="h" > <a name="666">666</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> for (for instance) specifying a different </td> </tr> <tr> <td class="h" > <a name="667">667</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> parser for different flavours of FASTA file. </td> </tr> <tr> <td class="h" > <a name="668">668</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns \&default_id_parser (see below) if not </td> </tr> <tr> <td class="h" > <a name="669">669</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> set. If you supply your own id_parser </td> </tr> <tr> <td class="h" > <a name="670">670</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> subroutine, then it should expect a fasta </td> </tr> <tr> <td class="h" > <a name="671">671</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> description line. An entry will be added to </td> </tr> <tr> <td class="h" > <a name="672">672</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> the index for each string in the list returned. </td> </tr> <tr> <td class="h" > <a name="673">673</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Example : $index->id_parser( \&my_id_parser ) </td> </tr> <tr> <td class="h" > <a name="674">674</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : ref to CODE if called without arguments </td> </tr> <tr> <td class="h" > <a name="675">675</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : CODE </td> </tr> <tr> <td class="h" > <a name="676">676</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="677">677</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="678">678</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="679">679</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub id_parser { </td> </tr> <tr> <td class="h" > <a name="680">680</a> </td> <td class="c3" > 20 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#680-1"> 20 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#680-1"> 1 </a> </td> <td > 15 </td> <td class="s"> my( $self, $code ) = @_; </td> </tr> <tr> <td class="h" > <a name="681">681</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="682">682</a> </td> <td class="c3" > 20 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#682-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 25 </td> <td class="s"> if ($code) { </td> </tr> <tr> <td class="h" > <a name="683">683</a> </td> <td class="c0" > <a href="#706"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{'_id_parser'} = $code; </td> </tr> <tr> <td class="h" > <a name="684">684</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="685">685</a> </td> <td class="c3" > 20 </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--condition.html#685-1"> 50 </a> </td> <td >   </td> <td >   </td> <td > 89 </td> <td class="s"> return $self->{'_id_parser'} || \&default_id_parser; </td> </tr> <tr> <td class="h" > <a name="686">686</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="687">687</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="688">688</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="689">689</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="690">690</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 default_id_parser </td> </tr> <tr> <td class="h" > <a name="691">691</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="692">692</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : default_id_parser </td> </tr> <tr> <td class="h" > <a name="693">693</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $id = default_id_parser( $header ) </td> </tr> <tr> <td class="h" > <a name="694">694</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: The default Fasta ID parser for Fasta.pm </td> </tr> <tr> <td class="h" > <a name="695">695</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns $1 from applying the regexp /^>\s*(\S+)/ </td> </tr> <tr> <td class="h" > <a name="696">696</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> to $header. </td> </tr> <tr> <td class="h" > <a name="697">697</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : ID string </td> </tr> <tr> <td class="h" > <a name="698">698</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : a fasta header line string </td> </tr> <tr> <td class="h" > <a name="699">699</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="700">700</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="701">701</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="702">702</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub default_id_parser { </td> </tr> <tr> <td class="h" > <a name="703">703</a> </td> <td class="c3" > 20 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#703-1"> 20 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#703-1"> 1 </a> </td> <td > 15 </td> <td class="s"> my ($string) = @_; </td> </tr> <tr> <td class="h" > <a name="704">704</a> </td> <td class="c3" > 20 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 13 </td> <td class="s"> my ($gi,$acc); </td> </tr> <tr> <td class="h" > <a name="705">705</a> </td> <td class="c3" > 20 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#705-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 44 </td> <td class="s"> if( $string =~ s/gi\|(\d+)\|?// ) </td> </tr> <tr> <td class="h" > <a name="706">706</a> </td> <td class="c0" > <a href="# "> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> { $gi = $1; $acc = $1;} </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > <a href="#711"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="707">707</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="708">708</a> </td> <td class="c3" > 20 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#708-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 89 </td> <td class="s"> if( $string =~ /(\w+)\|([A-Z\d\.\_]+)(\|[A-Z\d\_]+)?/ ) { </td> </tr> <tr> <td class="h" > <a name="709">709</a> </td> <td class="c3" > 20 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#709-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 55 </td> <td class="s"> $acc = defined $2 ? $2 : $1; </td> </tr> <tr> <td class="h" > <a name="710">710</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="711">711</a> </td> <td class="c0" > <a href="#712"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $acc = $string; </td> </tr> <tr> <td class="h" > <a name="712">712</a> </td> <td class="c0" > <a href="#713"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $acc =~ s/^\s+(\S+)/$1/; </td> </tr> <tr> <td class="h" > <a name="713">713</a> </td> <td class="c0" > <a href="#718"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $acc =~ s/(\S+)\s+$/$1/; </td> </tr> <tr> <td class="h" > <a name="714">714</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="715">715</a> </td> <td class="c3" > 20 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 31 </td> <td class="s"> return ($gi,$acc); </td> </tr> <tr> <td class="h" > <a name="716">716</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="717">717</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="718">718</a> </td> <td class="c0" > <a href="#719"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#718-1"> 0 </a> </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#718-1"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#718-1"> 0 </a> </td> <td > 0 </td> <td class="s"> sub MIN { $a <=> $b ? $a : $b; } </td> </tr> <tr> <td class="h" > <a name="719">719</a> </td> <td class="c0" > <a href="#735"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#719-1"> 0 </a> </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#719-1"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#719-1"> 0 </a> </td> <td > 0 </td> <td class="s"> sub MAX { $a <=> $b ? $b : $a; } </td> </tr> <tr> <td class="h" > <a name="720">720</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="721">721</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="722">722</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 algorithm_reference </td> </tr> <tr> <td class="h" > <a name="723">723</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="724">724</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : algorithm_reference </td> </tr> <tr> <td class="h" > <a name="725">725</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : my $reference = $writer->algorithm_reference($result); </td> </tr> <tr> <td class="h" > <a name="726">726</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Returns the appropriate Bibliographic reference for the </td> </tr> <tr> <td class="h" > <a name="727">727</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> algorithm format being produced </td> </tr> <tr> <td class="h" > <a name="728">728</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : String </td> </tr> <tr> <td class="h" > <a name="729">729</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : L<Bio::Search::Result::ResultI> to reference </td> </tr> <tr> <td class="h" > <a name="730">730</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="731">731</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="732">732</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="733">733</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="734">734</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub algorithm_reference{ </td> </tr> <tr> <td class="h" > <a name="735">735</a> </td> <td class="c0" > <a href="#736"> 0 </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#735-1"> 0 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#735-1"> 1 </a> </td> <td > 0 </td> <td class="s"> my ($self,$result) = @_; </td> </tr> <tr> <td class="h" > <a name="736">736</a> </td> <td class="c0" > <a href="#738"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#736-1"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--condition.html#736-1"> 0 </a> </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return '' if( ! defined $result || !ref($result) || </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="737">737</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ! $result->isa('Bio::Search::Result::ResultI')) ; </td> </tr> <tr> <td class="h" > <a name="738">738</a> </td> <td class="c0" > <a href="#739"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#738-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if( $result->algorithm =~ /BLAST/i ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="739">739</a> </td> <td class="c0" > <a href="#740"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $res = $result->algorithm . ' '. $result->algorithm_version. "\n"; </td> </tr> <tr> <td class="h" > <a name="740">740</a> </td> <td class="c0" > <a href="#741"> 0 </a> </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#740-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if( $result->algorithm_version =~ /WashU/i ) { </td> </tr> <tr> <td class="h" > <a name="741">741</a> </td> <td class="c0" > <a href="#748"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return $res .qq{ </td> </tr> <tr> <td class="h" > <a name="742">742</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Copyright (C) 1996-2000 Washington University, Saint Louis, Missouri USA. </td> </tr> <tr> <td class="h" > <a name="743">743</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> All Rights Reserved. </td> </tr> <tr> <td class="h" > <a name="744">744</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="745">745</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Reference: Gish, W. (1996-2000) http://blast.wustl.edu </td> </tr> <tr> <td class="h" > <a name="746">746</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="747">747</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="748">748</a> </td> <td class="c0" > <a href="#756"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return $res . qq{ </td> </tr> <tr> <td class="h" > <a name="749">749</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A. Schaffer, </td> </tr> <tr> <td class="h" > <a name="750">750</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997), </td> </tr> <tr> <td class="h" > <a name="751">751</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> "Gapped BLAST and PSI-BLAST: a new generation of protein database search </td> </tr> <tr> <td class="h" > <a name="752">752</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> programs", Nucleic Acids Res. 25:3389-3402. </td> </tr> <tr> <td class="h" > <a name="753">753</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="754">754</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="755">755</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif( $result->algorithm =~ /FAST/i ) { </td> </tr> <tr> <td class="h" > <a name="756">756</a> </td> <td class="c0" > <a href="#759"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return $result->algorithm. " ". $result->algorithm_version . "\n". </td> </tr> <tr> <td class="h" > <a name="757">757</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> "\nReference: Pearson et al, Genomics (1997) 46:24-36\n"; </td> </tr> <tr> <td class="h" > <a name="758">758</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="759">759</a> </td> <td class="c0" > <a href="#774"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return ''; </td> </tr> <tr> <td class="h" > <a name="760">760</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="761">761</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="762">762</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="763">763</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # from Perl Cookbook 2.17 </td> </tr> <tr> <td class="h" > <a name="764">764</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _numwithcommas { </td> </tr> <tr> <td class="h" > <a name="765">765</a> </td> <td class="c3" > 23 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#765-1"> 23 </a> </td> <td >   </td> <td > 24 </td> <td class="s"> my $num = reverse( $_[0] ); </td> </tr> <tr> <td class="h" > <a name="766">766</a> </td> <td class="c3" > 23 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 63 </td> <td class="s"> $num =~ s/(\d{3})(?=\d)(?!\d*\.)/$1,/g; </td> </tr> <tr> <td class="h" > <a name="767">767</a> </td> <td class="c3" > 23 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> return scalar reverse $num; </td> </tr> <tr> <td class="h" > <a name="768">768</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="769">769</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="770">770</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _linewrap { </td> </tr> <tr> <td class="h" > <a name="771">771</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#771-1"> 1 </a> </td> <td >   </td> <td > 1 </td> <td class="s"> my ($str) = @_; </td> </tr> <tr> <td class="h" > <a name="772">772</a> </td> <td class="c3" > 1 </td> <td class="c0" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#772-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> if($TextWrapLoaded) { </td> </tr> <tr> <td class="h" > <a name="773">773</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> return Text::Wrap::wrap("","",$str); # use Text::Wrap </td> </tr> <tr> <td class="h" > <a name="774">774</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> } else { return $str; } # cannot wrap </td> </tr> <tr> <td class="h" > <a name="775">775</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="776">776</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 Methods Bio::SearchIO::SearchWriterI </td> </tr> <tr> <td class="h" > <a name="777">777</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="778">778</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> L<Bio::SearchIO::SearchWriterI> inherited methods. </td> </tr> <tr> <td class="h" > <a name="779">779</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="780">780</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 filter </td> </tr> <tr> <td class="h" > <a name="781">781</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="782">782</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : filter </td> </tr> <tr> <td class="h" > <a name="783">783</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $writer->filter('hsp', \&hsp_filter); </td> </tr> <tr> <td class="h" > <a name="784">784</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Filter out either at HSP,Hit,or Result level </td> </tr> <tr> <td class="h" > <a name="785">785</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : none </td> </tr> <tr> <td class="h" > <a name="786">786</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : string => data type, </td> </tr> <tr> <td class="h" > <a name="787">787</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> CODE reference </td> </tr> <tr> <td class="h" > <a name="788">788</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="789">789</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="790">790</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="791">791</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="792">792</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 no_wublastlinks </td> </tr> <tr> <td class="h" > <a name="793">793</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="794">794</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title : no_wublastlinks </td> </tr> <tr> <td class="h" > <a name="795">795</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Usage : $obj->no_wublastlinks($newval) </td> </tr> <tr> <td class="h" > <a name="796">796</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Function: Get/Set boolean value regarding whether or not to display </td> </tr> <tr> <td class="h" > <a name="797">797</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Link = (1) </td> </tr> <tr> <td class="h" > <a name="798">798</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> type output in the report output (WU-BLAST only) </td> </tr> <tr> <td class="h" > <a name="799">799</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns : boolean </td> </tr> <tr> <td class="h" > <a name="800">800</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Args : on set, new boolean value (a scalar or undef, optional) </td> </tr> <tr> <td class="h" > <a name="801">801</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="802">802</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="803">803</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="804">804</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="805">805</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub no_wublastlinks{ </td> </tr> <tr> <td class="h" > <a name="806">806</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#806-1"> 2 </a> </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--subroutine.html#806-1"> 1 </a> </td> <td > 3 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="807">807</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="808">808</a> </td> <td class="c3" > 2 </td> <td class="c3" > <a href="Bio-SearchIO-Writer-TextResultWriter-pm--branch.html#808-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 8 </td> <td class="s"> return $self->{'no_wublastlinks'} = shift if @_; </td> </tr> <tr> <td class="h" > <a name="809">809</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2 </td> <td class="s"> return $self->{'no_wublastlinks'}; </td> </tr> <tr> <td class="h" > <a name="810">810</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="811">811</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="812">812</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="813">813</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 1; </td> </tr> </table> </body> </html>