[Bio] / FigWebServices / sigs.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/sigs.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19, Wed Jun 28 22:09:37 2006 UTC revision 1.20, Mon Jul 10 21:29:17 2006 UTC
# Line 21  Line 21 
21    
22  use HTML;  use HTML;
23  use CGI;  use CGI;
24    use Tracer;
25  my $cgi = new CGI;  my $cgi = new CGI;
26    
27  if (0) {  if (0) {
# Line 59  Line 60 
60      $fig_or_sprout = new FIG;      $fig_or_sprout = new FIG;
61      unshift @$html, "<TITLE>The SEED Signature Genes Page</TITLE>\n";      unshift @$html, "<TITLE>The SEED Signature Genes Page</TITLE>\n";
62  }  }
63    my $tracing = $cgi->param('TRACE');
64    if ($tracing) {
65        TSetup($tracing, "QUEUE");
66    }
67    
68  my @tmp = grep { $_ =~ /^\d+\.\d+$/ } $cgi->param;  my @tmp = grep { $_ =~ /^\d+\.\d+$/ } $cgi->param;
69  my @set1 = grep { $cgi->param($_) eq "set1" } @tmp;  my @set1 = grep { $cgi->param($_) eq "set1" } @tmp;
# Line 100  Line 105 
105                  $cgi->hidden(-name => 'SPROUT', -value => $sprout),                  $cgi->hidden(-name => 'SPROUT', -value => $sprout),
106                  $cgi->h1("Find Proteins that Discriminate Two Sets of Organisms or Are Common to a Set of Organisms"),                  $cgi->h1("Find Proteins that Discriminate Two Sets of Organisms or Are Common to a Set of Organisms"),
107                  &HTML::make_table($col_hdrs,$tab,"Pick organisms for Set 1 and Set 2"),                  &HTML::make_table($col_hdrs,$tab,"Pick organisms for Set 1 and Set 2"),
108                  $cgi->br, "Similarity Cutoff: ",$cgi->textfield(-name => cutoff, -size => 10, -value => 1.0e-10),                  $cgi->br, "Similarity Cutoff: ",$cgi->textfield(-name => "cutoff", -size => 10, -value => 1.0e-10),
109                  $cgi->br,                  $cgi->br,
110                  $cgi->checkbox( -name => 'sort_by_func', -value => 1, -override => 1, -checked => 0, -label => 'Sort by Function'),                  $cgi->checkbox( -name => 'sort_by_func', -value => 1, -override => 1, -checked => 0, -label => 'Sort by Function'),
111                  $cgi->br,                  $cgi->br,
112                  $cgi->checkbox( -name => 'write_tab', -value => 1, -override => 1, -checked => 0, -label => 'Export Tab Delimited Table'),                  $cgi->checkbox( -name => 'write_tab', -value => 1, -override => 1, -checked => 0, -label => 'Export Tab Delimited Table'),
113                  $cgi->br,                  $cgi->br,
114                    $cgi->br, "Tracing: ",$cgi->textfield(-name => "TRACE", -size => 30),
115                    $cgi->br,
116                  $cgi->br,                  $cgi->br,
117                  $cgi->submit("Find the Discriminating Proteins from Given Organism"),$cgi->reset,                  $cgi->submit("Find the Discriminating Proteins from Given Organism"),$cgi->reset,
118                  $cgi->br,                  $cgi->br,
# Line 126  Line 133 
133          if (@set2 > 0)          if (@set2 > 0)
134          {          {
135              @hits = &differentiating_genes(\@set1,\@set2,$given,$sim_cutoff);              @hits = &differentiating_genes(\@set1,\@set2,$given,$sim_cutoff);
136                Trace(scalar(@hits) . " hits found by differentiating_genes.") if T(3);
137              if ($cgi->param('sort_by_func'))              if ($cgi->param('sort_by_func'))
138              {              {
139                  @hits    = sort { ($a->[2] cmp $b->[2]) or ($b->[1] <=> $a->[1]) or (&FIG::by_fig_id($a->[0],$b->[0])) } @hits;                  @hits    = sort { ($a->[2] cmp $b->[2]) or ($b->[1] <=> $a->[1]) or (&FIG::by_fig_id($a->[0],$b->[0])) } @hits;
# Line 204  Line 212 
212          push(@$html,$cgi->h1("You need to fill in at least Set1"));          push(@$html,$cgi->h1("You need to fill in at least Set1"));
213      }      }
214  }  }
215    if ($tracing) {
216        push @{$html}, QTrace("html");
217    }
218  &HTML::show_page($cgi,$html);  &HTML::show_page($cgi,$html);
219    
220  sub common_genes {  sub common_genes {
# Line 278  Line 288 
288    
289  #       my $sc = sprintf "%.3f", ($n_set1 / @set1) - (($n_set2 / @set2) * $fudge);  #       my $sc = sprintf "%.3f", ($n_set1 / @set1) - (($n_set2 / @set2) * $fudge);
290          my $sc = sprintf "%.3f", &sig($n_set1,(@set1 - $n_set1),$n_set2,(@set2 - $n_set2));          my $sc = sprintf "%.3f", &sig($n_set1,(@set1 - $n_set1),$n_set2,(@set2 - $n_set2));
291          $n1 = @set1;  
         $n2 = @set2;  
292          if ($sc >= 1)          if ($sc >= 1)
293          {          {
294              push(@hits,[$peg,$sc,scalar $fig_or_sprout->function_of($peg)]);              push(@hits,[$peg,$sc,scalar $fig_or_sprout->function_of($peg)]);

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3