Hi fellow Monks!
So, I have the following script for running a tool I need for my research through the web, since it is not available for download.
My question is, since the authors suggest that web users should allow a small interval between submissions, how can I tell the script to execute with a, say, 1 minute interval per run, so as not to overload their server?
use WWW::Mechanize;
($fasta, $type) = @ARGV;
#type -> euk, Gpos, Gneg
$outfile = $fasta.".SIGNALCF";
open OUT, ">>$outfile";
open IN, $fasta;
while(<IN>)
{
if($_=~/^>(.*)/)
{
$id=$1;
$seq=<IN>; chomp $seq; $mikos=length($seq);
$url = 'http://www.csbio.sjtu.edu.cn/bioinf/Signal-CF/';
$mech = WWW::Mechanize->new();
$mech->get($url);
$mech->submit_form
(
form_number => 1,
fields =>
{
#textarea name | value
S1 => $seq,
#Radio button name | value
R2 => $type
}
);
$result = $mech->content();
#case with NO signal peptide
if($result=~/According to our computational result, your input
+ sequence/) {print OUT $id."\t0\n";}
#case with signal peptide
if($result=~/According to our computational results, the signa
+l peptide is:\<font color\=red\>1\-(\d+)\<\/font>/)
{$sp_end=$1; print OUT $id."\t".$sp_end."\n";}
}
}
close IN;
close OUT;
Thank you!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.