[Bioperl-l] please help me to check why this perl script does notwork!

Fei Li lifei03 at gmail.com
Mon May 30 05:27:17 EDT 2005


Odd enough!  I copy the sentences from your script. And it works now. 

possibly, I need not add the "  "SEQSUB" , "submit".   As matter of
fact , I also remove the "full", it works fine.

--Fei



On 5/30/05, Marc Logghe <Marc.Logghe at devgen.com> wrote:
> 
> > Thanks all.  I tried the both "SEQPASTE" and "seqpaste". but
> > it did not work.
> >
> > Also, I modified the script according to Marc 's advice.
> 
> That is odd. In my hands it works. I'll attach the complete script.
> The output is:
> <HTML>
> <HEAD><TITLE>Webface Jobsubmission</TITLE></HEAD>
> If Javascript is disabled, follow <a
> href="http://www.cbs.dtu.dk/cgi-bin/nph-webface?jobid=chlorop,429AB96A0C
> 8A9C29&opt=wait">This link</a>
> 
> <script LANGUAGE="JavaScript"><!--
> location.replace("http://www.cbs.dtu.dk/cgi-bin/nph-webface?jobid=chloro
> p,429AB96A0C8A9C29&opt=wait")
> //--></script>
> </HTML>
> 
> 
> *********************************
> 
> HTH,
> Marc
> 
> 
> 
> 
> >
> >  my $response =
> > $browser->post('http://www.cbs.dtu.dk/cgi-bin/nph-webface',
> >                        {"configfile" =>
> > "/usr/opt/www/pub/CBS/services/ChloroP-1.1/chlorop.cf",
> >                               "SEQPASTE" => "$input_sequence",
> >                                "SEQSUB" => "",
> >                          "full" => "full",
> >                               "submit" => "Submit"
> >                               } );
> >
> > unfortunately,  it still did work.
> >
> > The problem is still complain that "Read: Field not declared;
> > 'seqpaste'"
> >
> >
> > What's more interesiting, when I move the hidden value to
> > another place. It complains differently
> >
> > my $response =
> > $browser->post('http://www.cbs.dtu.dk/cgi-bin/nph-webface',
> >                        {
> >                               "SEQPASTE" => "$input_sequence",
> >                                "SEQSUB" => "",
> >                          "full" => "full",
> >                           "configfile" =>
> > "/usr/opt/www/pub/CBS/services/ChloroP-1.1/chlorop.cf",
> >                               "submit" => "Submit"
> >                               } );
> >
> > Complain:  Read: Field not declared; 'submit'
> >
> > --------------I believe the problem is due to this sentence,
> > but i do not know what it is and where it is :-(
> >
> >
> > On 5/30/05, Marc Logghe <Marc.Logghe at devgen.com> wrote:
> > > Hi,
> > > There are a few issues with the script:
> > > 1) @seq is not an array of (fasta) sequences, but in your
> > case a list
> > > of lines. This can be fixed like so:
> > > #@seq = <INPUT>;
> > > local $/ = undef;
> > > @seq = split /\n(?=>)/, <INPUT>;
> > >
> > > 2) You have to POST all necessary parameters, including the
> > hidden ones.
> > > Also, apparently, you have to pass a hash ref in stead of
> > an array ref
> > > to post():
> > >          my $response =
> > > $browser->post('http://www.cbs.dtu.dk/cgi-bin/nph-webface',
> > >                        { "SEQPASTE" => "$item",
> > >                          full => 'full',
> > >                          "configfile" =>
> > > "/usr/opt/www/pub/CBS/services/ChloroP-1.1/chlorop.cf"
> > >                        }
> > >                          );
> > >
> > > 3) The resulting content is an html page with javascript in
> > it and a
> > > url where to fetch the result when finished. So I guess you have to
> > > parse out that url and perform another request.
> > >
> > > HTH,
> > > Marc
> > >
> > >
> > > Marc Logghe, PhD
> > > deVGen NV
> > > Technologiepark 30
> > > B - 9052 Ghent-Zwijnaarde
> > > Tel. +32 9 324 24 83
> > > Fax. +32 9 324 24 25
> > > Web: www.devgen.com
> > >
> > >  --- Disclaimer start ---
> > > This e-mail and any attachments thereto may contain
> > information which
> > > is confidential and/or which is proprietary to the sender.
> > > Accordingly, this e-mail and any attachments thereto, as
> > well as any
> > > and all information contained therein, are intended for the
> > sole use
> > > of the recipient or recipients designated above. Any use of this
> > > e-mail, of any attachments thereto, of any and all information
> > > contained therein, and/or of any part(s) thereof
> > (including, without
> > > limitation, total or partial reproduction, communication and/or
> > > distribution in any form) by persons other than the designated
> > > recipient(s) is prohibited. If you have received this
> > e-mail in error,
> > > please notify the sender either by telephone or by e-mail
> > and delete the material from any computer.
> > > Thank you for your cooperation.
> > > --- Disclaimer end ---
> > >
> > >
> > > > -----Original Message-----
> > > > From: bioperl-l-bounces at portal.open-bio.org
> > > > [mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of Fei Li
> > > > Sent: Sunday, May 29, 2005 9:37 AM
> > > > To: Bioperl-l at portal.open-bio.org
> > > > Subject: [Bioperl-l] please help me to check why this perl script
> > > > does notwork!
> > > >
> > > > I wish to submit some protein sequences via LWP:UserAgent  to the
> > > > http://www.cbs.dtu.dk/services/ChloroP/
> > > >
> > > > The error message is given as follows:
> > > >
> > > > <HTML><HEAD><TITLE>Webface Error</TITLE></HEAD><font
> > > > color=red><h1>Webface Error: </h1><h4>
> > > > Read: Field not declared; 'seqpaste'</h4> <br> </font></HTML>
> > > >
> > > > *********************************
> > > >
> > > >
> > > > #! /usr/bin/perl -w
> > > > use strict;
> > > > use HTTP::Request::Common;
> > > > use LWP::UserAgent;
> > > >
> > > > my $browser = LWP::UserAgent->new;
> > > > my @seq;
> > > > my $count =0;
> > > >
> > > > my $infile = "my_test_file"; #input my Fasta file
> > > >
> > > > open INPUT, "$infile" or die "can not open $infile:$!";
> > open OUTPUT,
> > > > ">>$infile.ChloroP.res" or die "Cannot create the output
> > file: $!";
> > > >
> > > > @seq = <INPUT>;
> > > > my $total = @seq;
> > > >
> > > > foreach my $item (@seq){
> > > >         $count ++;
> > > >         chomp $item;
> > > >          my $response =
> > > > $browser->post('http://www.cbs.dtu.dk/cgi-bin/nph-webface',
> > > >                        [ "SEQPASTE" => "$item",
> > > >                                "submit" => "Submit"]
> > > >                          );
> > > >           warn "WARN!: ", $response->status_line, "\n" unless
> > > > $response->is_success;
> > > >
> > > >           if($response->is_success){
> > > >                   my $result = $response->content;
> > > >                   open OUTPUT, ">>$infile.ChloroP.res" or die
> > > > "Cannot create the output file: $!";
> > > >                   print OUTPUT "$result\n";
> > > >                   print OUTPUT
> > > > "\n*********************************\n\n\n";
> > > >             }
> > > >   print "$count of $total finished\n";
> > > >   }
> > > >
> > > >  close OUTPUT;
> > > >  close INPUT;
> > > >
> > > > _______________________________________________
> > > > Bioperl-l mailing list
> > > > Bioperl-l at portal.open-bio.org
> > > > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> > > >
> > >
> >
> 
> 
> 


-- 
Do not guess who  I. am  I am not Bush in BlackHouse



More information about the Bioperl-l mailing list