lightened up icon nav submenu link colors a bit
[sgn.git] / cgi-bin / secretom / search.pl
blob06104485825e22d0c7526f7081d144d555fbff28
2 # quick hack to implement a secretom search...
3 # most of this concerns Arabidopsis so we don't have anything in the SGN database...
7 use strict;
9 use CXGN::Page;
10 use CXGN::Tools::Identifiers qw | link_identifier |;
11 my $page = CXGN::Page->new();
12 my ($query) = $page->get_encoded_arguments("query");
14 my $secretom_file_dir = '/data/prod/public/secretom/';
16 my $tabfile = 'Tair9RiceBrachyITAG1.tab';
18 $page->header();
20 print <<HTML;
23 <center>
26 <form>
28 <img src='/documents/img/secretom/secretom_logo.jpg' border="0" width="50%" /><br /><br />
30 Search<br /><br />
31 <input type="text" name="query" value="$query" /><br /><br />
33 <input type="submit" value="Search" size="20" />
35 </center>
37 </form>
39 HTML
41 my @matches = ();
44 if ($query) {
46 my @column_headers = (
47 "locus name",
48 "annotation",
49 "protein length",
50 "mol weight",
51 "signalp-nn (Dscore)",
52 "signalp-nn (YES if Dscore >= 0.43, NO otherwise)",
53 "signalp-nn pred sp len",
54 "signalp-hmm sp score",
55 "signalp-hmm sa score",
56 "signalp-hmm prediction (SP,SA or NS)",
57 "targetP result (C,M,S,_)"
61 @matches = `grep -i \"$query\" $secretom_file_dir/$tabfile`; # this should be ok because we use get_encoded_arguments...
63 print "<br /><br />Your search \"<b>$query</b>\" return ".scalar(@matches)." matches. <br /><br />\n";
65 if (@matches) {
70 print "Results: <br />\n";
71 print qq | <table alt="Secretom Results" > |;
73 print format_table_row(@column_headers);
74 foreach my $match (@matches) {
75 my @fields = (split /\t/, $match)[0,1,4,5,6,7,8,9,10,11,12];
76 my $link = link_identifier($fields[0]);
77 $fields[0] = $link if(defined $link);
78 print format_table_row(@fields);
80 print "</table>\n";
87 $page->footer();
90 sub format_table_row {
91 my @row = @_;
93 return "<tr><td class=\"boxbgcolor5\">".(join "</td><td class=\"boxbgcolor5\">", @row)."</td></tr>\n";