[Bioperl-l] html stripped from blast report

Jason Stajich jason at cgt.duhs.duke.edu
Sat Jul 24 09:30:20 EDT 2004


Brian,George - this works fine for me (adding the package statement).

#!/usr/bin/perl -w
use Bio::SearchIO;
use HTML::Strip;

my $hs = HTML::Strip->new();

# replace the blast parser's _readline method with one that
# auto-strips HTML:
package Bio::SearchIO::blast; # added this line.

sub Bio::SearchIO::blast::_readline {
    my ($self, @args) = @_;
    my $line = $self->SUPER::_readline(@args);
    return unless defined $line;
    return $hs->parse($line);
}

my $in = new Bio::SearchIO(-format => 'blast',
			   -file   => $ARGV[0]);

while( my $r = $in->next_result ) {
    print $r->query_name, "\n";
}

On Fri, 23 Jul 2004, Brian Osborne wrote:

> George,
>
> No, that definitely won't work. I'll remove it from the FAQ and take a
> look...
>
> Brian O.
>
> -----Original Message-----
> From: bioperl-l-bounces at portal.open-bio.org
> [mailto:bioperl-l-bounces at portal.open-bio.org]On Behalf Of ghrose at unm.edu
> Sent: Monday, July 19, 2004 4:47 PM
> To: bioperl-l at portal.open-bio.org
> Subject: [Bioperl-l] html stripped from blast report
>
> Dear Bioperl,
>
> I'm trying to use the code in
> http://bio.perl.org/Core/Latest/faq.html#Q3.7
> to strip html out of a blast report that is html format.
>
> ******The code
>
> #!/usr/bin/perl
>
> use strict;
> use DBI;
> use Bio::Perl;
> use Bio::SearchIO;
> use Bio::SearchIO::blast;
> use HTML::Strip;
>
> my $hs = new HTML::Strip;
>
>           # replace the blast parser's _readline method with one that
>           # auto-strips HTML:
>
>           sub Bio::SearchIO::blast::_readline {
>             my ($self, @args) = @_;
>     return $hs->parse($self->SUPER::_readline(@args));
>           }
>
> my $in = new Bio::SearchIO(-format => 'blast',
>                                -file   => $ARGV[0]);
>
>
> *******gives me the following error.
>
>
> georges-Computer:~/Desktop/ben-p020 george$ perl insert_7_4hstrip.pl
> p018xnr.html > test3
> Can't locate object method "_readline" via package "main" at
> insert_7_4hstrip.pl line 17.
>
>
> I believe I have the HTML::Strip installed correctly.
> I'm running this script on macosx10.3.
>
> Can you give me some advise on how to solve this problem?
>
> Thank you,
>
> George
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list