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

Diff of /FigWebServices/clust_ss.cgi

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

revision 1.2, Mon Feb 18 22:08:23 2008 UTC revision 1.5, Wed Apr 16 00:55:53 2008 UTC
# Line 85  Line 85 
85      my($fig,$cgi,$retry) = @_;      my($fig,$cgi,$retry) = @_;
86    
87      my $just_hypo = $cgi->param('just_hypo');      my $just_hypo = $cgi->param('just_hypo');
88        my $restrict  = $cgi->param('restrict');
89      if (open(INTERESTING,"<$FIG_Config::global/interesting.pegs"))      if (open(INTERESTING,"<$FIG_Config::global/interesting.pegs"))
90      {      {
91          my @pegs = <INTERESTING>;          my @pegs = <INTERESTING>;
92          chomp @pegs;          chomp @pegs;
93          close(INTERESTING);          close(INTERESTING);
94    
95            if ($restrict)
96            {
97                @pegs = map  { $_->[0] }
98                        grep { $_->[1] =~ /$restrict/i }
99                        map  { [$_,$fig->genus_species(&FIG::genome_of($_))] }
100                        @pegs;
101            }
102    
103          my $tries = 30;          my $tries = 30;
104          my $peg;          my $peg;
105          while ((! $peg) && $tries)          while ((! $peg) && $tries)
# Line 115  Line 124 
124          if ((! $peg) && $retry)          if ((! $peg) && $retry)
125          {          {
126              &clean_interesting($fig);              &clean_interesting($fig);
127              return &get_interesting($fig,0);              return &get_interesting($fig,$cgi,0);
128          }          }
129          else          else
130          {          {
# Line 151  Line 160 
160          chomp @pegs;          chomp @pegs;
161          close(INTERESTING);          close(INTERESTING);
162    
163          @pegs = grep { &not_in_sub($_) } @pegs;          @pegs = grep { &not_in_sub($fig,$_) } @pegs;
164          open(INTERESTING,">$FIG_Config::global/interesting.pegs")          open(INTERESTING,">$FIG_Config::global/interesting.pegs")
165              || die "could not open $FIG_Config::global/interesting.pegs";              || die "could not open $FIG_Config::global/interesting.pegs";
166          print INTERESTING join("\n",@pegs),"\n";          print INTERESTING join("\n",@pegs),"\n";
# Line 159  Line 168 
168      }      }
169  }  }
170    
171    sub not_in_sub {
172        my($fig,$peg) = @_;
173    
174        my @tmp = grep { $fig->usable_subsystem($_) } $fig->peg_to_subsystems($peg);
175        return (@tmp == 0);
176    }
177    
178    
179  sub get_user_and_type {  sub get_user_and_type {
180      my($fig,$cgi,$html) = @_;      my($fig,$cgi,$html) = @_;
181    
# Line 166  Line 183 
183                                    -method => 'post'),                                    -method => 'post'),
184                   'User: ',                   'User: ',
185                   $cgi->textfield(-name => "user", -size => 10, -value => ''),                   $cgi->textfield(-name => "user", -size => 10, -value => ''),
186                     "<br>Restrict to genomes matching the pattern: ",
187                     $cgi->textfield(-name => "restrict", -size => 20, -value => ''),
188                   $cgi->br,$cgi->br,                   $cgi->br,$cgi->br,
189                   $cgi->checkbox(-name => 'just_hypo', -value => "", -checked => 0, -label => 'just hypothetical'),                   $cgi->checkbox(-name => 'just_hypo', -value => "", -checked => 0, -label => 'just hypothetical'),
190                   $cgi->br,$cgi->br,                   $cgi->br,$cgi->br,

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3