[Bioperl-l] PDB Parser

Sendu Bala bix at sendu.me.uk
Wed Aug 22 07:51:42 UTC 2007


neeti somaiya wrote:
> Hi,
> 
> I wanted to automate my pdb script, right from downloading of data. As per
> the solution given by RCSB about custom report for pdb ids and titles only,
> I was trying something like the code below, but it doesnt seem to work :-
> 
> my $url = '
> http://www.pdb.org/pdb/results/tabularReport.do?reportTitle=CustomReport&customReportColumns=
> VStructureSummary.structureId~VCitation.title&format=csv';
> use LWP::Simple;
> my $content = get $url;
> die "Couldn't get $url" unless defined $content;
> 
> Can anyone tell how I can do it, if there is any other way to do it, or if I
> am going wrong somewhere, or if it is't possible for this case at all.

Use LWP::UserAgent so you can see what's going on.

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
my $response = $ua->get($url);
if ($response->is_success) {
   print $response->content;
}
else {
   die $response->status_line;
}


Gives:
500 Internal Server Error

Most likely the server is expecting some kind of cookie and falls over 
when you try to visit that url without it. So start where they told you 
to and grab pages successively, keeping any cookies.



More information about the Bioperl-l mailing list