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

Diff of /FigWebServices/wc.cgi

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

revision 1.13, Thu Jul 17 19:09:58 2014 UTC revision 1.14, Sat Jun 20 13:21:39 2015 UTC
# Line 1  Line 1 
 ########################################################################  
1  # -*- perl -*-  # -*- perl -*-
2  #  #
3  # Copyright (c) 2003-2006 University of Chicago and Fellowship  # Copyright (c) 2003-2006 University of Chicago and Fellowship
# Line 54  Line 53 
53  my $function = $cgi->param('function');  my $function = $cgi->param('function');
54  my $reaction = $cgi->param('reaction');  my $reaction = $cgi->param('reaction');
55  my $dataD    = $cgi->param('dataD');  my $dataD    = $cgi->param('dataD');
56    my $base     = $cgi->param('base');
57  #  #
58  # If we are operating in RAST, the csD sits within the  # If we are operating in RAST, the csD sits within the
59  # RAST job directory and the dataD setting is the  # RAST job directory and the dataD setting is the
60  # RAST job number.  # RAST job number.
61  #  #
62    
63  my $csD      = "/homes/overbeek/Ross/MakeCS.Kbase/Data/CS";  my $csD;
64    if ($base)
65    {
66        $csD = $base;
67    }
68    else
69    {
70        $csD      = "/homes/overbeek/Ross/MakeCS.Kbase/Data/CS";
71    }
72  if ($FIG_Config::rast_jobs && -d $FIG_Config::rast_jobs)  if ($FIG_Config::rast_jobs && -d $FIG_Config::rast_jobs)
73  {  {
74      $csD = "$FIG_Config::rast_jobs/$dataD/CloseStrains";      $csD = "$FIG_Config::rast_jobs/$dataD/CloseStrains";
# Line 77  Line 83 
83    
84  if ($request eq "show_otus")  if ($request eq "show_otus")
85  {  {
86      &show_otus($cgi,$csD);      &show_otus($cgi,$csD,$base);
87      exit;      exit;
88  }  }
89  elsif (($request eq "show_options_for_otu") && $dataD)  elsif (($request eq "show_options_for_otu") && $dataD)
90  {  {
91      $html = &CloseStrains::show_options_for_otu($cgi,$dataD,$dataDF);      $html = &CloseStrains::show_options_for_otu($cgi,$dataD,$dataDF,$base);
92        push(@$html,"<a target=_blank href=./wc.cgi?dataD=$dataD&base=$base&request=newick_tree>Newick Tree</a>\n");
93    }
94    elsif ($request eq "newick_tree")
95    {
96        if (open(TREE,"<$dataDF/estimated.phylogeny.nwk"))
97        {
98            my @tree = map { $_ =~ s/,/,\n/g; $_ } <TREE>;
99    
100            push(@$html,"<pre>",@tree,"</pre>");
101            close(TREE);
102        }
103  }  }
104  elsif ($request eq "show_signatures")  elsif ($request eq "show_signatures")
105  {  {
106      &CloseStrains::show_signatures($cgi,$parms,$html);      &CloseStrains::show_signatures($cgi,$parms,$html,$base);
107  }  }
108  elsif ($request eq "show_signatures_reactions")  elsif ($request eq "show_signatures_reactions")
109  {  {
110      &CloseStrains::show_signatures_reactions($cgi,$parms,$html);      &CloseStrains::show_signatures_reactions($cgi,$parms,$html,$base);
111  }  }
112  elsif ($request eq "compute_sigs")  elsif ($request eq "compute_sigs")
113  {  {
114      &CloseStrains::compute_signatures($cgi,$parms,$html);      &CloseStrains::compute_signatures($cgi,$parms,$html,$base);
115  }  }
116  elsif ($request eq "compute_signatures_reactions")  elsif ($request eq "compute_signatures_reactions")
117  {  {
# Line 104  Line 121 
121  {  {
122      $function =~ s/^\s+//;      $function =~ s/^\s+//;
123      $function =~ s/\s+$//;      $function =~ s/\s+$//;
124      &CloseStrains::show_func($cgi,$parms,$html,$function);      &CloseStrains::show_func($cgi,$parms,$html,$function,$base);
125  }  }
126  elsif (($request eq "show_family_pegs") && $family)  elsif (($request eq "show_family_pegs") && $family)
127  {  {
128      &CloseStrains::show_family_pegs($cgi,$parms,$html,$family);      &CloseStrains::show_family_pegs($cgi,$parms,$html,$family,$base);
129  }  }
130  elsif (($request eq "show_virulence_functions") && (-s "$dataDF/virulence.functions"))  elsif (($request eq "show_virulence_functions") && (-s "$dataDF/virulence.functions"))
131  {  {
132      &CloseStrains::show_virulence_functions($cgi,$parms,$html);      &CloseStrains::show_virulence_functions($cgi,$parms,$html,$base);
133  }  }
134  elsif (($request eq 'show_indexed_funcs') && $keywords)  elsif (($request eq 'show_indexed_funcs') && $keywords)
135  {  {
136      &CloseStrains::show_indexed_funcs($cgi,$parms,$html,$keywords);      &CloseStrains::show_indexed_funcs($cgi,$parms,$html,$keywords,$base);
137  }  }
138  elsif (($request eq "show_ali_or_occurs_tree") && $ali)  elsif (($request eq "show_ali_or_occurs_tree") && $ali)
139  {  {
140      &CloseStrains::show_ali($cgi,$parms);  # NOTE: the alignment invokes Gary's alignment viewer,      &CloseStrains::show_ali($cgi,$parms,$base);  # NOTE: the alignment invokes Gary's alignment viewer,
141                                              # which prints the header, so we print everything in show_ali                                              # which prints the header, so we print everything in show_ali
142      exit;      exit;
143  }  }
144  elsif (($request eq "show_ali_or_occurs_tree") && $tree)  elsif (($request eq "show_ali_or_occurs_tree") && $tree)
145  {  {
146      &CloseStrains::show_occurs_tree($cgi,$parms,$html);      &CloseStrains::show_occurs_tree($cgi,$parms,$html,$base);
147  }  }
148  elsif (($request eq "show_family_tree") && $family)  elsif (($request eq "show_family_tree") && $family)
149  {  {
150      &CloseStrains::show_family_tree($cgi,$parms,$html,$family);      &CloseStrains::show_family_tree($cgi,$parms,$html,$family,$base);
151  }  }
152  elsif (($request eq "show_node") && $node)  elsif (($request eq "show_node") && $node)
153  {  {
154      &CloseStrains::show_node($cgi,$parms,$html,$node);      &CloseStrains::show_node($cgi,$parms,$html,$node,$base);
155  }  }
156  elsif ($request eq "show_otu_tree")  elsif ($request eq "show_otu_tree")
157  {  {
158      &CloseStrains::show_otu_tree($cgi,$parms,$html,'families');      &CloseStrains::show_otu_tree($cgi,$parms,$html,'families',$base);
159  }  }
160  elsif ($request eq "show_reactions")  elsif ($request eq "show_reactions")
161  {  {
162      &CloseStrains::show_reactions($cgi,$parms,$html);      &CloseStrains::show_reactions($cgi,$parms,$html,$base);
163  }  }
164  elsif (($request eq "show_reaction_on_tree") && $reaction)  elsif (($request eq "show_reaction_on_tree") && $reaction)
165  {  {
166      &CloseStrains::show_reaction_on_tree($cgi,$reaction,$parms,$html);      &CloseStrains::show_reaction_on_tree($cgi,$reaction,$parms,$html,$base);
167  }  }
168  elsif (($request eq "show_reaction_genome_data") && $reaction && $genome)  elsif (($request eq "show_reaction_genome_data") && $reaction && $genome)
169  {  {
170      &CloseStrains::show_reaction_genome_data($cgi,$reaction,$genome,$dataDF,$parms,$html);      &CloseStrains::show_reaction_genome_data($cgi,$reaction,$genome,$dataDF,$parms,$html,$base);
171  }  }
172  elsif ($request eq "show_options_for_reactions")  elsif ($request eq "show_options_for_reactions")
173  {  {
174      &CloseStrains::show_options_for_reactions($cgi,$html,$dataD,$dataDF);      &CloseStrains::show_options_for_reactions($cgi,$html,$dataD,$dataDF,$base);
175  #    &CloseStrains::show_signatures_reactions($cgi,$parms,$html);  #    &CloseStrains::show_signatures_reactions($cgi,$parms,$html,$base);
176  }  }
177  elsif ($request eq "show_otu_tree_reactions")  elsif ($request eq "show_otu_tree_reactions")
178  {  {
179      &CloseStrains::show_otu_tree($cgi,$parms,$html,'reactions');      &CloseStrains::show_otu_tree($cgi,$parms,$html,'reactions',$base);
180  }  }
181  elsif ($request eq "show_adjacency")  elsif ($request eq "show_adjacency")
182  {  {
183      &CloseStrains::show_otu_tree($cgi,$parms,$html,'adjacency');      &CloseStrains::show_otu_tree($cgi,$parms,$html,'adjacency',$base);
184  }  }
185  elsif ($request eq "show_clusters")  elsif ($request eq "show_clusters")
186  {  {
187      &CloseStrains::show_clusters($cgi,$parms,$html);      &CloseStrains::show_clusters($cgi,$parms,$html,$base);
188  }  }
189  elsif ($request eq "show_help")  elsif ($request eq "show_help")
190  {  {
# Line 216  Line 233 
233  exit;  exit;
234    
235  sub show_otus {  sub show_otus {
236      my($cgi,$datadir) = @_;      my($cgi,$datadir,$base) = @_;
237    
238      print $cgi->header;      print $cgi->header;
239      if (opendir(GENERA,$csD))      if (opendir(GENERA,$csD))
# Line 228  Line 245 
245          print "<h2>Genera Available</h2>\n";          print "<h2>Genera Available</h2>\n";
246          foreach my $g (sort @genera)          foreach my $g (sort @genera)
247          {          {
248              print "<h3><a target='_blank' href='wc.cgi?request=show_options_for_otu&dataD=$g'>$g</a>\n";              print "<h3><a target='_blank' href='wc.cgi?request=show_options_for_otu&dataD=$g&base=$base'>$g</a>\n";
249          }          }
250      }      }
251      else      else
# Line 243  Line 260 
260      if ((-s "$dataDF/virulence.functions") && ($dataDF =~ /([^\/]+)$/))      if ((-s "$dataDF/virulence.functions") && ($dataDF =~ /([^\/]+)$/))
261      {      {
262          my $dataDQ = uri_escape($1);          my $dataDQ = uri_escape($1);
263          return "<a target='_blank' href='wc.cgi?request=show_virulence_functions&dataD=$dataDQ'>Some Posssible Functions Associated with Virulence</a>";          return "<a target='_blank' href='wc.cgi?request=show_virulence_functions&base=$base&dataD=$dataDQ'>Some Posssible Functions Associated with Virulence</a>";
264      }      }
265      return '';      return '';
266  }  }
   
   

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3