[Bioperl-l] Modify wwwBLAST html report

Rytsareva, Inna (I) IRytsareva at dow.com
Thu Jul 9 16:33:01 EDT 2009


Hello.

Thanks so much for your help!!

I need some ideas how to get follow:

There is a wwwBLAST html report from blast.real. And I have references
(maybe I'll place them in an array of strings). Each string is a
reference to GBrowse for each HSP.

Like: <a
href=http://eluxb08/cgi-bin/gbrowse/gbrowse/ssp_wt/?ref=AS398_CO295;star
t=188396;stop=189355;add=AS398_CO295%20BLAST%20HSP%281%29%20188396..1893
55;h_region=AS398_CO295:188396..189355> HSP  188396 189355</a><br>

So, I'd need to modify this HTML page and "push" a reference between
Sbjct and Score or between tags </PRE> and <PRE> for each HSP.
 
For now my script is:
########################################################################
############################
#!/usr/bin/perl

#
# $Id: blast.cgi,v 1.1 2002/08/06 19:03:51 dondosha Exp $
#

$|=1;
use CGI::Pretty qw (:standard);
use CGI::Carp qw (fatalsToBrowser);
use CGI;


use HTML::Strip;

use IO::String;
use List::Util qw (min max);
use Switch;
use File::Temp qw/ tempfile tempdir /;


use Data::Dumper;

use Bio::SearchIO;
use Bio::SearchIO::blast;


print "Content-type: text/html \n\n";

$ENV{DEBUG_COMMAND_LINE} = TRUE;
$ENV{BLASTDB} = "db";

open (BLAST,"cat $blast_form_data |./blast.REAL|");
@blast = <BLAST>;
my $hs = new HTML::Strip;

my ($o_f,$out_file) = tempfile();
open (OUTFILE,">$out_file");

foreach $blast (@blast)
{
print $blast; # printing BLAST 
my $text=$hs->parse($blast);
print OUTFILE $text;
}
close OUTFILE;
$hs->eof;

my $q = new CGI;

my $in = Bio::SearchIO->new (  	-file 	=>$out_file,
				-format =>'blast') or die $!;

while (my $result = $in->next_result) 
{
	while (my $hit = $result->next_hit)
	{
		while (my $hsp = $hit->next_hsp) 	
		{
			$qhit = $hit->name;
			$qstart = $hsp->hit->start;
			$qend = $hsp->hit->end;

			print"<a
href=http://eluxb08/cgi-bin/gbrowse/gbrowse/chado-ssp_wt/?ref=$qhit;star
t=$qstart;stop=$qend;add=$qhit%20BLAST%20HSP%281%29%20$qstart..$qend;h_r
egion=$qhit:$qstart..$qend> HSP $qname $qstart $qend</a><br>\n";

unlink $out_file;			
		}
				
	}
			
}

########################################################################
########################

It prints the BLAST report and then the links.

Thanks,

Inna Rytsareva
Discovery Information Management
Dow AgroSciences
Indianapolis, IN 
317-337-4716




More information about the Bioperl-l mailing list