[Milan-pm] (no subject)
marcos rebelo
oleber at gmail.com
Wed Apr 1 08:13:24 PDT 2009
2009/4/1 Paola Bisignano <paola.bisignano at gmail.com>:
>
> #!/usr/local/bin/perl
> use LWP::Simple;
> use strict;
> use warnings;
> use LWP 5.64;
> use LWP::UserAgent;
> print "Quale entry di PDB vuoi aprire? ";
> my $pdb=<STDIN>;
> chomp ($pdb);
> my $url1 =
> "http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/GetPage.pl?pdbcode=$pdb";
> my $content = get $url1;
> die "Couldn't get $url1" unless defined $content;
> while ($content=~ m/uniprot_id=(.*?)&/g)
>
> {
> my $code=$1;
> print "ID uniprot: $code\n";
> chomp ($code);
> my $browser =LWP::UserAgent->new;
> my $url = URI-> new ("http://www.uniprot.org/uniprot/$code.fasta");
> my $response=$browser-> get ($url);
> my $fasta=$response->content;
> print "$fasta" ;
> };
>
>
>
>
>
> this is my script...first I must digit the pdb code (form my test I use
> 1xmj, that I'm sure it has a ligand) I want to explore, (that's the code of
> a protein structure) and then I go to the web page...to extract another
> code, that'uniprot code, so the script thakes that code and put it into
> another web site and estract and print the aminoacidic sequence of the
> protein, then i need to know something about the ligand...and I need to
> access to the file running.pl that brings some information which I have to
> extract....and i don't know what to do
>
> _______________________________________________
> Milan-pm mailing list
> Milan-pm at pm.org
> http://mail.pm.org/mailman/listinfo/milan-pm
>
>
your code is similar to this simpler code:
#!/usr/local/bin/perl
use strict;
use warnings;
use LWP::Simple;
print "Quale entry di PDB vuoi aprire? ";
my $pdb = <STDIN>;
chomp ($pdb);
my $url = "http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/GetPage.pl?pdbcode=$pdb";
my $content = get($url);
die "Couldn't get $url" unless defined $content;
foreach my $code ( $content =~ m/uniprot_id=(.*?)&/g) {
print "ID uniprot: $code\n";
chomp ($code);
my $fasta=get("http://www.uniprot.org/uniprot/$code.fasta");
print "$fasta" ;
};
Now, you need to explain your problem to someone that doesn't know
anything about this bio stuff.
Best Regards
Marcos Rebelo
--
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org
More information about the Milan-pm
mailing list