perl - Submit multiple fasta sequence using WWW::Mechanize -


i want summit multiple protein sequences in fasta format on this server using following perl script

use www::mechanize;  # webpage form  $mech = www::mechanize->new(); $mech->show_progress(1);  $url = "http://harrier.nagahama-i-bio.ac.jp/sosui/sosu/sosuigsubmit.html"; $mech->get($url);  # checks see if scripts call  sub validateinput{     $file = shift;     $infh = io::file->new( $file ) || die "can't open input file\n";     close($infh);     return 1; }  validateinput($argv[0]);  # fill fields appropriate data , submit  $fields = {     'in'    => $argv[0],     'value' => 'exec' };  $mech->submit_form(      fields => $fields, );  # print results  print $mech->content(); 

but every time getting result

<html> <br><br><br> <table> <tr><td align=left width=300>total proteins</td><th>0</th></tr> <tr><td align=left width=300>total membrane proteins</td><th>0</th></tr> <tr><td align=left width=300>percentage</td><th> 0.0 %</th></tr> </table> </html> 

which result page when submit form without input. suspect there problem sequence submission. input file this

>atcg00420 mqgtlsvwlakrglvhrslgfdyqgietlqikpedwhsiavilyvygynylrsqcaydvapggllasvyhltrieygv    nqaeevcikvfthrsnpripsvfwvwkstdfqeresydmlgitydshprlkrilmpeswigwplrkdyiapnfyeiqday >atcg00360 msaqsegnyaealqnyyeamrleidpydrsyilyniglihtsngehtkaleyyfralernpflpqafnnmavichyrgeqaiqqgdsemaeawfaqaaeywkqaitltpgnyieaqnwltitrrfe 

and calling script

perl my_script input.seq >output 

thanks helping me out.

for starters, line:

    'in'    => $argv[0], 

means you're sending them filename, rather contents of file. you'll need contents first, , send those. libraries file::slurper handy this.


Comments