It fetches structural information from PDB(protein databank) in terms of protein's id.
#!/usr/bin/perl
use WWW::Mechanize;
die "Please enter keyword\n" unless $ARGV[0];
$ARGV[0] = uc $ARGV[0];
$url = 'http://www.rcsb.org/pdb/';
$agent = new WWW::Mechanize;
$agent->get($url);
$agent->submit_form(
'form_number' => 1,
'fields' => {
'LDAP::keyword' => $ARGV[0],
'LDAP::keyword_op' => 'by_id',
}
);
$agent->follow_link('n' => $_) for( qw/1 9/ );
$agent->follow_link('url' =>qq'http://www.rcsb.org/pdb/cgi/export.cgi/
+$ARGV[0].pdb.gz?format=PDB&pdbId=$ARGV[0]&compression=gz',
);
open F, '>', $ARGV[0].".gz";
binmode(F);
print F $agent->content;
close F;
`gunzip $ARGV[0].gz`;