[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.14, Mon Dec 5 19:12:12 2005 UTC revision 1.15, Mon Jan 30 22:00:15 2006 UTC
# Line 1  Line 1 
1  #  ##################################################################
2  # Copyright (c) 2003-2006 University of Chicago and Fellowship  # Copyright (c) 2003-2006 University of Chicago and Fellowship
3  # for Interpretations of Genomes. All Rights Reserved.  # for Interpretations of Genomes. All Rights Reserved.
4  #  #
# Line 14  Line 14 
14  # Genomes at veronika@thefig.info or download a copy from  # Genomes at veronika@thefig.info or download a copy from
15  # http://www.theseed.org/LICENSE.TXT.  # http://www.theseed.org/LICENSE.TXT.
16  #  #
17    ##################################################################
18    
19  use FIG;  use FIG;
20  require SproutFIG;  require SproutFIG;
# Line 102  Line 103 
103                  &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"),
104                  $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),
105                  $cgi->br,                  $cgi->br,
106                    $cgi->checkbox( -name => 'sort_by_func', -value => 1, -override => 1, -checked => 0, -label => 'Sort by Function'),
107                    $cgi->br,
108                    $cgi->checkbox( -name => 'write_tab', -value => 1, -override => 1, -checked => 0, -label => 'Export Tab Delimited Table'),
109                    $cgi->br,
110                    $cgi->br,
111                  $cgi->submit("Find the Discriminating Proteins from Given Organism"),$cgi->reset,                  $cgi->submit("Find the Discriminating Proteins from Given Organism"),$cgi->reset,
112                  $cgi->br,                  $cgi->br,
113                  $cgi->br,                  $cgi->br,
# Line 121  Line 127 
127          if (@set2 > 0)          if (@set2 > 0)
128          {          {
129              @hits = &differentiating_genes(\@set1,\@set2,$given,$sim_cutoff);              @hits = &differentiating_genes(\@set1,\@set2,$given,$sim_cutoff);
130              @hits    = sort { ($b->[1] <=> $a->[1]) || ($a->[0] cmp $b->[0]) } @hits;              if ($cgi->param('sort_by_func'))
131                {
132                    @hits    = sort { ($a->[2] cmp $b->[2]) or ($b->[1] <=> $a->[1]) or (&FIG::by_fig_id($a->[0],$b->[0])) } @hits;
133                }
134                else
135                {
136                    @hits    = sort { ($b->[1] <=> $a->[1]) || (&FIG::by_fig_id($a->[0],$b->[0])) } @hits;
137                }
138    
139              $col_hdrs = ["Gene","Score","Function"];              if ($cgi->param('write_tab'))
140                {
141                    push(@$html,"<pre>\n");
142                    foreach $_ (@hits)
143                    {
144                        push(@$html,join("\t",@$_) . "\n");
145                    }
146                    push(@$html,"</pre>\n");
147                }
148                else
149                {
150                    $col_hdrs = ["","Gene","Score","Function"];
151              $tab      = [];              $tab      = [];
152              $title    = "Genes that Discriminate";                  my $gs = $fig_or_sprout->genus_species($given);
153                    $title    = "Genes in $gs that Discriminate";
154                    my $subscript = 1;
155              foreach $_ (@hits)              foreach $_ (@hits)
156              {              {
157                  my($peg,$score) = @$_;                      my($peg,$score,$function) = @$_;
158                  push(@$tab,[&HTML::fid_link($cgi,$peg,"local"),$score,&InterfaceRoutines::function_ofS($fig_or_sprout,$peg,$cgi->param('user'))]);                      push(@$tab,[$subscript,&HTML::fid_link($cgi,$peg,"local"),$score,$function]);
159                        $subscript++;
160              }              }
161    
162              push(@$html,&HTML::make_table($col_hdrs,$tab,$title));              push(@$html,&HTML::make_table($col_hdrs,$tab,$title));
163          }          }
164            }
165          else          else
166          {          {
167              my($i,$j,%which_col,$peg1,$func1,$link,$genome1,$hit);              my($i,$j,%which_col,$peg1,$func1,$link,$genome1,$hit);
# Line 253  Line 281 
281          $n2 = @set2;          $n2 = @set2;
282          if ($sc >= 1)          if ($sc >= 1)
283          {          {
284              push(@hits,[$peg,$sc]);              push(@hits,[$peg,$sc,scalar $fig_or_sprout->function_of($peg)]);
285          }          }
286      }      }
287      return @hits;      return @hits;

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3