1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
#!/engine/perl/bin/perl.exe
use strict;
use warnings;
use CGI;
use IO::File;
print "Content-type: text/html\n\n";
my $form = new CGI;
my $program = $form->param('program');
my $datalib = $form->param('datalib');
my $sequence = $form->param('sequence');
my $path = $form->param('fichierseq');
my $matrix = $form->param('matrix');
my $evalue = $form->param('evalue');
my $filter = $form->param('filter');
$ARGV[0]=' -p ';
$ARGV[1]=' -i ';
$ARGV[2]=' -d ';
$ARGV[3]=' -o ';
$ARGV[4]=' -T ';
$ARGV[5]=' -e ';
$ARGV[6]=' -M ';
$ARGV[7]=' -F ';
my $input_query = IO::File->new_tmpfile()||die "Unable to make new bl_input temporary file: $!";
my $blastall = "\\Blast\\blastall.exe";
my $DB = "\\Blast\\$datalib";
my $output = IO::File->new_tmpfile()||die "Unable to make new bl_output temporary file: $!";
if ($path eq '') {
if ($sequence ne '') {
open (FQ, ">$input_query") || die("Problème avec le fichier $input_query : $!");
print FQ $sequence;
close (FQ);
system($blastall.$ARGV[0].$program.$ARGV[7].$filter.$ARGV[1].$input_query.$ARGV[2].$DB.$ARGV[3].$output.$ARGV[5].$evalue.$ARGV[6].$matrix.$ARGV[4]);
wait;
}
else {
open (OUT, ">$output") || die("Problème avec le fichier $output : $!");
print OUT "<html>
<head>
<title>ERROR_#bl001</title>
</head>
<body>
<p><strong><font color=\"#A800000\" size=\"3\" face=\"Verdana, Arial, Helvetica, sans-serif\">ERROR<font color=\"#666666\"> [#bl001]</font><br><br>
<font color=\"#000000\">Input sequence was not sized...</font></font></strong></p>
</body>
</html>";
close (OUT);
}
}
else {
if ($sequence eq '') {
open (FS, $path) || die("Can not open $path : $!");
my @seq = <FS>;
close (FS);
open (F, ">$input_query") || die("Problème avec le fichier $input_query : $!");
print F @seq;
close (F);
system($blastall.$ARGV[0].$program.$ARGV[7].$filter.$ARGV[1].$input_query.$ARGV[2].$DB.$ARGV[3].$output.$ARGV[5].$evalue.$ARGV[6].$matrix.$ARGV[4]);
wait;
}
else {
open (OUT, ">$output") || die("Problème avec le fichier $output : $!");
print "<html>
<head>
<title>ERROR_#bl002</title>
</head>
<body>
<p><strong><font color=\"#A800000\" size=\"3\" face=\"Verdana, Arial, Helvetica, sans-serif\">ERROR<font color=\"#666666\"> [#bl002]</font><br><br>
<font color=\"#000000\">The text area and the browse menu can not be both used for seizure...</font></font></strong></p>
</body>
</html>";
close (OUT);
}
}
open(OUT,$output) || die("Problème avec le fichier $output : $!");
while(<OUT>) {
print;
}
close(OUT);
exit; |
Partager