.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::SearchIO::Writer::HTMLResultWriter 3pm" .TH Bio::SearchIO::Writer::HTMLResultWriter 3pm "2021-08-15" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::SearchIO::Writer::HTMLResultWriter \- write a Bio::Search::ResultI in HTML .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Bio::SearchIO; \& use Bio::SearchIO::Writer::HTMLResultWriter; \& \& my $in = Bio::SearchIO\->new(\-format => \*(Aqblast\*(Aq, \& \-file => shift @ARGV); \& \& my $writer = Bio::SearchIO::Writer::HTMLResultWriter\->new(); \& my $out = Bio::SearchIO\->new(\-writer => $writer); \& $out\->write_result($in\->next_result); \& \& \& # to filter your output \& my $MinLength = 100; # need a variable with scope outside the method \& sub hsp_filter { \& my $hsp = shift; \& return 1 if $hsp\->length(\*(Aqtotal\*(Aq) > $MinLength; \& } \& sub result_filter { \& my $result = shift; \& return $hsp\->num_hits > 0; \& } \& \& my $writer = Bio::SearchIO::Writer::HTMLResultWriter\->new \& (\-filters => { \*(AqHSP\*(Aq => \e&hsp_filter} ); \& my $out = Bio::SearchIO\->new(\-writer => $writer); \& $out\->write_result($in\->next_result); \& \& # can also set the filter via the writer object \& $writer\->filter(\*(AqRESULT\*(Aq, \e&result_filter); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This object implements the SearchWriterI interface which will produce a set of \s-1HTML\s0 for a specific Bio::Search::Report::ReportI interface. .PP See Bio::SearchIO::SearchWriterI for more info on the filter method. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR \- Jason Stajich" .IX Header "AUTHOR - Jason Stajich" Email jason-at-bioperl-dot-org .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Gary Williams G.Williams@hgmp.mrc.ac.uk .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "new" .IX Subsection "new" .Vb 12 \& Title : new \& Usage : my $obj = Bio::SearchIO::Writer::HTMLResultWriter\->new(); \& Function: Builds a new Bio::SearchIO::Writer::HTMLResultWriter object \& Returns : Bio::SearchIO::Writer::HTMLResultWriter \& Args : \-filters => hashref with any or all of the keys (HSP HIT RESULT) \& which have values pointing to a subroutine reference \& which will expect to get a \& \-nucleotide_url => URL sprintf string base for the nt sequences \& \-protein_url => URL sprintf string base for the aa sequences \& \-no_wublastlinks => boolean. Do not display WU\-BLAST lines \& even if they are parsed out. \& Links = (1) .Ve .SS "remote_database_url" .IX Subsection "remote_database_url" .Vb 8 \& Title : remote_database_url \& Usage : $obj\->remote_database_url($type,$newval) \& Function: This should return or set a string that contains a %s which can be \& filled in with sprintf. \& Returns : value of remote_database_url \& Args : $type \- \*(AqPROTEIN\*(Aq or \*(AqP\*(Aq for protein URLS \& \*(AqNUCLEOTIDE\*(Aq or \*(AqN\*(Aq for nucleotide URLS \& $value \- new value to set [optional] .Ve .SS "to_string" .IX Subsection "to_string" .Vb 10 \& Purpose : Produces data for each Search::Result::ResultI in a string. \& : This is an abstract method. For some useful implementations, \& : see ResultTableWriter.pm, HitTableWriter.pm, \& : and HSPTableWriter.pm. \& Usage : print $writer\->to_string( $result_obj, @args ); \& Argument : $result_obj = A Bio::Search::Result::ResultI object \& : @args = any additional arguments used by your implementation. \& Returns : String containing data for each search Result or any of its \& : sub\-objects (Hits and HSPs). \& Throws : n/a .Ve .SS "hit_link_desc" .IX Subsection "hit_link_desc" .Vb 11 \& Title : hit_link_desc \& Usage : $self\->hit_link_desc(\e&link_function); \& Function: Get/Set the function which provides an HTML \& link(s) for the given hit to be used \& within the description section at the top of the BLAST report. \& This allows a person reading the report within \& a web browser to go to one or more database entries for \& the given hit from the description section. \& Returns : Function reference \& Args : Function reference \& See Also: L .Ve .SS "default_hit_link_desc" .IX Subsection "default_hit_link_desc" .Vb 8 \& Title : default_hit_link_desc \& Usage : $self\->default_hit_link_desc($hit, $result) \& Function: Provides an HTML link(s) for the given hit to be used \& within the description section at the top of the BLAST report. \& This allows a person reading the report within \& a web browser to go to one or more database entries for \& the given hit from the description section. \& Returns : string containing HTML markup "hit_link_align(\e&link_function); \& Function: Get/Set the function which provides an HTML link(s) \& for the given hit to be used \& within the HSP alignment section of the BLAST report. \& This allows a person reading the report within \& a web browser to go to one or more database entries for \& the given hit from the alignment section. \& Returns : string containing HTML markup "hit_desc_line(\e&link_function); \& Function: Get/Set the function which provides HTML for the description \& information from a hit. This allows one to parse \& the rest of the description and split up lines, add links, etc. \& Returns : Function reference \& Args : Function reference \& See Also: L .Ve .SS "default_hit_desc_line" .IX Subsection "default_hit_desc_line" .Vb 6 \& Title : default_hit_desc_line \& Usage : $self\->default_hit_desc_line($hit, $result) \& Function: Parses the description line information, splits based on the \& hidden \ex01 between independent descriptions, checks the lines for \& possible web links, and adds HTML link(s) for the given hit to be \& used. \& \& Returns : string containing HTML markup "start_report( CODE ) \& Function: Stores or returns the code to \& write the start of the block, the block \& and the start of the <BODY> block of HTML. Useful \& for (for instance) specifying alternative \& HTML if you are embedding the output in \& an HTML page which you have already started. \& (For example a routine returning a null string). \& Returns \e&default_start_report (see below) if not \& set. \& Example : $index\->start_report( \e&my_start_report ) \& Returns : ref to CODE if called without arguments \& Args : CODE .Ve .SS "default_start_report" .IX Subsection "default_start_report" .Vb 5 \& Title : default_start_report \& Usage : $self\->default_start_report($result) \& Function: The default method to call when starting a report. \& Returns : sting \& Args : First argument is a Bio::Search::Result::ResultI .Ve .SS "title" .IX Subsection "title" .Vb 2 \& Title : title \& Usage : $self\->title($CODE) \& \& Function: Stores or returns the code to provide HTML for the given \& BLAST report that will appear at the top of the BLAST report \& HTML output. Useful for (for instance) specifying \& alternative routines to write your own titles. \& Returns \e&default_title (see below) if not \& set. \& Example : $index\->title( \e&my_title ) \& Returns : ref to CODE if called without arguments \& Args : CODE .Ve .SS "default_title" .IX Subsection "default_title" .Vb 10 \& Title : default_title \& Usage : $self\->default_title($result) \& Function: Provides HTML for the given BLAST report that will appear \& at the top of the BLAST report HTML output. \& Returns : string containing HTML markup \& The default implementation returns <CENTER> <H1> HTML \& containing text such as: \& "Bioperl Reformatted HTML of BLASTP Search Report \& for gi|1786183|gb|AAC73113.1|" \& Args : First argument is a Bio::Search::Result::ResultI .Ve .SS "introduction" .IX Subsection "introduction" .Vb 2 \& Title : introduction \& Usage : $self\->introduction($CODE) \& \& Function: Stores or returns the code to provide HTML for the given \& BLAST report detailing the query and the \& database information. \& Useful for (for instance) specifying \& routines returning alternative introductions. \& Returns \e&default_introduction (see below) if not \& set. \& Example : $index\->introduction( \e&my_introduction ) \& Returns : ref to CODE if called without arguments \& Args : CODE .Ve .SS "default_introduction" .IX Subsection "default_introduction" .Vb 7 \& Title : default_introduction \& Usage : $self\->default_introduction($result) \& Function: Outputs HTML to provide the query \& and the database information \& Returns : string containing HTML \& Args : First argument is a Bio::Search::Result::ResultI \& Second argument is string holding literature citation .Ve .SS "end_report" .IX Subsection "end_report" .Vb 8 \& Title : end_report \& Usage : $self\->end_report() \& Function: The method to call when ending a report, this is \& mostly for cleanup for formats which require you to \& have something at the end of the document (</BODY></HTML>) \& for HTML \& Returns : string \& Args : none .Ve .SS "id_parser" .IX Subsection "id_parser" .Vb 10 \& Title : id_parser \& Usage : $index\->id_parser( CODE ) \& Function: Stores or returns the code used by record_id to \& parse the ID for record from a string. Useful \& for (for instance) specifying a different \& parser for different flavours of FASTA file. \& Returns \e&default_id_parser (see below) if not \& set. If you supply your own id_parser \& subroutine, then it should expect a fasta \& description line. An entry will be added to \& the index for each string in the list returned. \& Example : $index\->id_parser( \e&my_id_parser ) \& Returns : ref to CODE if called without arguments \& Args : CODE .Ve .SS "default_id_parser" .IX Subsection "default_id_parser" .Vb 11 \& Title : default_id_parser \& Usage : $id = default_id_parser( $header ) \& Function: The default Fasta ID parser for Fasta.pm \& Returns $1 from applying the regexp /^>\es*(\eS+)/ \& to $header. \& Returns : ID string \& The default implementation checks for NCBI\-style \& identifiers in the given string (\*(Aqgi|12345|AA54321\*(Aq). \& For these IDs, it extracts the GI and accession and \& returns a two\-element list of strings (GI, acc). \& Args : a fasta header line string .Ve .SS "algorithm_reference" .IX Subsection "algorithm_reference" .Vb 6 \& Title : algorithm_reference \& Usage : my $reference = $writer\->algorithm_reference($result); \& Function: Returns the appropriate Bibliographic reference for the \& algorithm format being produced \& Returns : String \& Args : L<Bio::Search::Result::ResultI> to reference .Ve .SS "Methods Bio::SearchIO::SearchWriterI" .IX Subsection "Methods Bio::SearchIO::SearchWriterI" Bio::SearchIO::SearchWriterI inherited methods. .SS "filter" .IX Subsection "filter" .Vb 6 \& Title : filter \& Usage : $writer\->filter(\*(Aqhsp\*(Aq, \e&hsp_filter); \& Function: Filter out either at HSP,Hit,or Result level \& Returns : none \& Args : string => data type, \& CODE reference .Ve .SS "no_wublastlinks" .IX Subsection "no_wublastlinks" .Vb 7 \& Title : no_wublastlinks \& Usage : $obj\->no_wublastlinks($newval) \& Function: Get/Set boolean value regarding whether or not to display \& Link = (1) \& type output in the report output (WU\-BLAST only) \& Returns : boolean \& Args : on set, new boolean value (a scalar or undef, optional) .Ve