-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfasta.pl
More file actions
39 lines (34 loc) · 1002 Bytes
/
Copy pathfasta.pl
File metadata and controls
39 lines (34 loc) · 1002 Bytes
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
#!/usr/bin/perl
#require "Parse_Form.lib";
#&Parse_Form;
require "./cgi-lib.pl";
my (%formdata, # The form data
%cgi_cfn, # The uploaded file(s) client-provided name(s)
%cgi_ct, # The uploaded file(s) content-type(s). These are
# set by the user's browser and may be unreliable
%cgi_sfn, # The uploaded file(s) name(s) on the server (this machine)
$ret, # Return value of the ReadParse call.
@data,
);
$cgi_lib::writefiles = "/tmp";
$ret = &ReadParse(\%formdata,\%cgi_cfn,\%cgi_ct,\%cgi_sfn);
print "Content-type:text/html\n\n";
print "<HTML><HEAD><TITLE>Sequence</TITLE></HEAD><BODY>";
$clusterID = $formdata{CLUSTER};
$specie = $formdata{SPECIE};
$f1 = 0; $f2 = 0;
open (FASTA,"$formdata{FASTA}");
while (<FASTA>){
if ($f2 && $f1){
$seq = $_ ;
last;
}
if (/Cluster $clusterID\</){
$f1 = 1;
}elsif(/Cluster/){
$f1 = 0;
}
$f2 = 1 if ($f1 && /$specie/);
}
print "$seq";
print "</BODY></HTML>";