[Bioperl-l] SMART domain sequence images
Stephen L. Mathias
smathias at unm.edu
Tue May 11 15:33:24 EDT 2004
John,
I would try writing your output to a filehandle which is explicitly set
to binary mode:
open OUT < $file or die "Can't open file:$!\n";
binmode OUT;
...
print OUT resp->content();
...
close OUT;
HTH.
-Steve
On Tue, 2004-05-11 at 09:59, 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
--
( Stephen L. Mathias, Ph.D. ( (
) Office of Biocomputing ) )
( University of New Mexico School of Medicine ( s m a t h i a s (
) MSC08 4560 ) @ u n m . e d u )
( 1 University of New Mexico ( (
) Albuquerque, NM 87131-0001 ) )
More information about the Bioperl-l
mailing list