[Bioperl-l] SMART domain sequence images

Barry Moore barry.moore at genetics.utah.edu
Tue May 11 19:41:44 EDT 2004


John-

If you can parse out the path to the png file, then you can use 
LWP::Simple getstore method 
(http://search.cpan.org/~gaas/libwww-perl-5.65/lib/LWP/Simple.pm) to 
send it to a file.  This has worked well for me in similar web server 
hacks with image files.

Barry

john herbert wrote:

>Hello BioPerlers.
>I am working on a smallish set of peptides and would like to bulk
>download all the SMART domain pngs from the SMART website. Is there
>anything in BioPerl for this? Or does anyone know how I could capture
>the PNG files generated on sequences containing SMART domains from
>SMART's website. 
>
>Here is an LWP script I tried using:
>#!/usr/local/bin/perl
>
>use strict;
>use lib
>'/usr/ngasi/contexts/jakeysnakey/jakeysnakey/NewPerlLib/lib/perl5/site_perl';
>use LWP::UserAgent;
>use HTTP::Headers;
>use URI::URL;
>use HTTP::Request;
>
>my $hders = HTTP::Headers->new(Accept => 'image/png');
>my $url =
>qq(http://smart.embl-heidelberg.de/smart/DD2.cgi?smart=428:DEXDc(64|265)+HELICc(301|382)+"%20border=0%20usemap="#map00"%20ALT="Bubblogram");
>
>
>my $url_ob = URI::URL->new($url);
>my $req = HTTP::Request->new('POST',$url_ob,$hders);
>my $ua = LWP::UserAgent->new();
>my $resp = $ua->request($req);
>if($resp->is_success){
>  print $resp->content();
>}else{
>  print $resp->message();
>}
>
>
>I have tried using this LWP script which works in the fact that it does
>collect the png binary data but it will not open as a png file. If I
>compare the file I have collected with my script, than with one I have
>attained by right clicking in windows explorer and saved to my desktop,
>there are some differences. I have no idea why they would be different.
>
>
>If there are anyone who has any ideas on this, I would be grateful.
>thanks.
>
>John.
>
>
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org
>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>  
>

-- 
Barry Moore
Dept. of Human Genetics
University of Utah
Salt Lake City, UT





More information about the Bioperl-l mailing list