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

Diff of /FigWebServices/start.cgi

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

revision 1.9, Thu Feb 9 20:43:50 2006 UTC revision 1.10, Thu Jun 29 15:52:59 2006 UTC
# Line 25  Line 25 
25  # Pattern search.  # Pattern search.
26  #  #
27    
28    use CGI::Carp qw(fatalsToBrowser); # this makes debugging a lot easier by throwing errors out to the browser
29  use FIG;  use FIG;
30  use HTML;  use HTML;
31  use CGI;  use CGI;
# Line 61  Line 62 
62  # Command handlers  # Command handlers
63  #  #
64    
65    # combinations:
66    #
67    # 1. text                  : c. search
68    # 2. text + org            : c. search limited to org
69    # 3. text + subsys         : a. search within subsystem
70    # 4. text + org + subsys   : a. search within subsystem
71    # 5. org                   : d. genome stats
72    # 6. org  + subsys         : b. subsystem display focussed on organism
73    # 7. subsys                : b. subsystem display
74    
75    if (
76        ($cgi->param('search_string') && $cgi->param('search_string') ne "Enter search terms") &&
77        ($cgi->param('sel_subsystem') && $cgi->param('sel_subsystem') ne "Pick a subsystem")
78       )
79    {
80     # type a.
81     # combo's 3 and 4. Genome is handled in the subroutine
82     &do_subsys_search($cgi, $html);
83    }
84    if ($cgi->param('sel_subsystem') && $cgi->param('sel_subsystem') ne "Pick a subsystem")
85    {
86     # type b.
87     # combo's 6 and 7. Genome is handled in the subroutine
88     &do_view_subsystem($cgi, $html);
89    }
90  if ($cgi->param('search_string') && $cgi->param('search_string') ne "Enter search terms")  if ($cgi->param('search_string') && $cgi->param('search_string') ne "Enter search terms")
91  {  {
92     # type c
93     # combo's 1 and 2. Genome is handled in the subroutine
94   &do_text_search($cgi, $html);   &do_text_search($cgi, $html);
95  }  }
96  if ($cgi->param('sel_genome') && $cgi->param('sel_genome') ne "Pick an organism")  if ($cgi->param('sel_genome') && $cgi->param('sel_genome') ne "Pick an organism")
97  {  {
98     # type d
99     # combo 5 only
100   &do_view_genome($cgi, $html);   &do_view_genome($cgi, $html);
101  }  }
 if ($cgi->param('sel_subsystem') && $cgi->param('sel_subsystem') ne "Pick a subsystem")  
 {  
  &do_view_subsystem($cgi, $html);  
 }  
102  if ($cgi->param('go_old'))  if ($cgi->param('go_old'))
103  {  {
104   &do_go_old_seed($cgi, $html);   &do_go_old_seed($cgi, $html);
# Line 217  Line 243 
243  }  }
244    
245    
246    sub do_subsys_search
247    {
248        my($cgi, $html) = @_;
249    
250        #
251        # Just redirect to the subsystem seearch page from index.cgi.
252        #
253    
254        my $sub = $cgi->param('sel_subsystem');
255        if ($sub eq "_choose_sub")
256        {
257            return;
258        }
259        my $esc_ssa = uri_escape($sub);
260    
261        my $str = $cgi->param('search_string'). " " . $sub;
262        my $esc_str = uri_escape($str);
263    
264    
265        my @params;
266        push(@params, "subsearch=$esc_str");
267        push(@params, "user=$user");
268        #push(@params, "ssa_name=$esc_ssa");
269        push(@params, "Find PEGs=1");
270    
271        if ($cgi->param('sel_genome')  ne "_choose_org")
272        {
273            push(@params, "genome=".$cgi->param('sel_genome'));
274        }
275        my $params = join("&", @params);
276    
277        #RAE: this was going to subsys.cgi, now we'll go to display subsys.cgi
278        #my $sub_url = $fig->cgi_url() . "/subsys.cgi?$params";
279        my $sub_url = $fig->cgi_url() . "/index.cgi?$params";
280        print $cgi->redirect($sub_url);
281        exit(0);
282    }
283    
284  sub do_view_subsystem  sub do_view_subsystem
285  {  {
286      my($cgi, $html) = @_;      my($cgi, $html) = @_;
# Line 230  Line 294 
294      {      {
295          return;          return;
296      }      }
297    
298    
299      #      #
300      # bring up clustered in phylogenetic sort      # bring up clustered in phylogenetic sort
301      #      #
302    
303      my $esc_ssa = uri_escape($sub);      my $esc_ssa = uri_escape($sub);
   
304      my @params;      my @params;
305      push(@params, "sort=by_phylo");      push(@params, "sort=by_phylo");
306      push(@params, "show_clusters=1");      push(@params, "show_clusters=1");
# Line 243  Line 308 
308      push(@params, "user=$user");      push(@params, "user=$user");
309      push(@params, "ssa_name=$esc_ssa");      push(@params, "ssa_name=$esc_ssa");
310    
311        if ($cgi->param('sel_genome')  ne "_choose_org")
312        {
313            push(@params, "focus=".$cgi->param('sel_genome'));
314        }
315      my $params = join("&", @params);      my $params = join("&", @params);
316      my $sub_url = $fig->cgi_url() . "/subsys.cgi?$params";  
317        #RAE: this was going to subsys.cgi, now we'll go to display subsys.cgi
318        #my $sub_url = $fig->cgi_url() . "/subsys.cgi?$params";
319        my $sub_url = $fig->cgi_url() . "/display_subsys.cgi?$params";
320      print $cgi->redirect($sub_url);      print $cgi->redirect($sub_url);
321      exit 0;      exit(0);
322  }  }
323    
324  sub do_view_genome  sub do_view_genome
# Line 275  Line 347 
347    
348      my $str = $cgi->param('search_string');      my $str = $cgi->param('search_string');
349    
350        # limit searches by genome
351        my $search;
352        my $genome =  $cgi->param('sel_genome');
353        if ($genome eq "_choose_org")
354        {
355            $search = "&Search=1";
356        }
357        else
358        {
359            $search = "&Search genome selected below=1&korgs=($genome)";
360        }
361    
362      my $esc_str = uri_escape($str);      my $esc_str = uri_escape($str);
363    
364      my $redir = $fig->cgi_url() . "/index.cgi?pattern=$esc_str&Search=1&user=$user";      my $redir = $fig->cgi_url() . "/index.cgi?pattern=$esc_str$search&user=$user";
365      print $cgi->redirect($redir);      print $cgi->redirect($redir);
366  }  }
367    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3