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

Annotation of /FigWebServices/find_reaction_paths.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download)

1 : olson 1.1 use strict;
2 :     use integer;
3 :     use FIG;
4 :     use FIG_Config;
5 :     use CGI;
6 :     use HTML;
7 :     use CGI::Carp qw(fatalsToBrowser);
8 :     use model;
9 :    
10 :     our $fig = new FIG;
11 :     my $cgi = new CGI;
12 :     my $html = [];
13 :    
14 :     # There are six consecutive entries to this script:
15 :     # 1) from the Find reactions paths button on subsys.cgi. This entry passes a particular
16 :     # subsystem name, scenario name and genome, and the script finds all possible paths
17 :     # from inputs to outputs for the subsystem scenario, given the genome's reactions.
18 :     # 2) Next, on the find_reaction_paths.cgi page, the user can select any combination
19 :     # of the presented paths for the subsystem/scenario, enter a name for the combination,
20 :     # and create FluxAnalyzer files for the named combination.
21 :    
22 :     my $genome = $cgi->param("genome");
23 :     my $number_of_paths = $cgi->param("one_or_all");
24 :    
25 :     #foreach my $elem($cgi->param){
26 :     # push @$html, $cgi->p($elem),
27 :     # $cgi->p($cgi->param($elem));
28 :     #}
29 :    
30 :     if ($genome eq "")
31 :     {
32 :     $genome = "All";
33 :     }
34 :    
35 :     # the following cgi params are used in entry 1 & 2
36 :     my $ssa = $cgi->param("ssa");
37 :     my $scenario = $cgi->param("scenario_name");
38 :    
39 :     # the following cgi params are used in entry 2
40 :     my @checked = $cgi->param("checked");
41 :     my $paths_name = $cgi->param("paths_name");
42 :    
43 :     push @$html, "<TITLE>Finding reaction paths for $ssa ($genome, $scenario)</TITLE>\n";
44 :    
45 :    
46 :     #We need to load up the superset file before we can use the module
47 :     #this is so that it knows what superset to save the scenario under
48 :     model::load_superset_file("$FIG_Config::global/Models/hope_supersets.txt");
49 :    
50 :     if(!defined @checked)
51 :     {
52 :     #Okay we first want to run path finding on the scenario and display the results
53 :     push (@$html, $cgi->start_form(-method => 'post' , -action => 'find_reaction_paths.cgi',-name => 'write_paths'),
54 :     $cgi->hidden(-name => 'genome', -value => "$genome", -override => 1), "\n",
55 :     $cgi->hidden(-name => 'ssa', -value => "$ssa", -override => 1), "\n",
56 :     $cgi->hidden(-name => 'scenario_name', -value => "$scenario", -override => 1), "\n");
57 :    
58 :     model::show_path_results_two(model::internal_scenario($genome,$ssa,$scenario, $number_of_paths),$html,$cgi);
59 :    
60 :     push(@$html, $cgi->br, &HTML::java_buttons("write_paths","checked"), $cgi->br,
61 :     $cgi->submit(-name => 'batch_assign',
62 :     -label =>"Create FluxAnalyzer files for selected paths"),
63 :     $cgi->br,$cgi->br,$cgi->end_form);
64 :    
65 :    
66 :     }
67 :     else #here we want to write the selected paths out.
68 :     {
69 :     my $path = model::write_selected_scenarios(\@checked,$genome,$ssa,$scenario);
70 :     push(@$html,"<h2>Wrote $scenario paths to</h2> <h4>$path</h4>",$cgi->br,
71 :     $cgi->p("<h4>Paths:</h4>",@checked),
72 :     "<a href=\"directoryRead.cgi?create_assembly_id=$genome\">View Scenarios</a>");
73 :     }
74 :    
75 :     &HTML::show_page($cgi,$html);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3