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

Annotation of /FigWebServices/ma2sub.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (view) (download)

1 : olson 1.6 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : mkubal 1.1 use FIG;
19 :     my $fig = new FIG;
20 :     use HTML;
21 :     use CGI;
22 :    
23 :     my $cgi = new CGI;
24 :     my $html = [];
25 :    
26 :     if($cgi->param('genome') && $cgi->param('attribute') && $cgi->param('value'))
27 :     {
28 :    
29 :     push (@$html, "<TITLE>Connect Pegs with Attributes to Subsystems</TITLE>");
30 :    
31 :     my $genome_string = $cgi->param('genome');
32 : mkubal 1.2 my @string_parts = split(", ",$genome_string);
33 : mkubal 1.1 my $genome = $string_parts[1];
34 :     my $att_param = $cgi->param('attribute');
35 :     my $value_param = $cgi->param('value');
36 :    
37 :     my @pegs = $fig->pegs_of($genome);
38 :     my %list_of_ss;
39 :     foreach my $peg (@pegs) {
40 :     next unless (my @attr=$fig->get_attributes($peg));
41 :     foreach my $attr (@attr) {
42 :     next unless (defined $attr);
43 :     my ($gotpeg, $tag, $val, $link)=@$attr;
44 :     $tag = uc($tag);
45 :     next unless ($tag eq $att_param);
46 :     next unless($val eq $value_param);
47 :     my @subsystems = $fig->subsystems_for_peg($peg);
48 :     foreach my $ss (@subsystems)
49 :     {
50 :     my $ss_name = $ss->[0];
51 :     $list_of_ss{$ss_name} = "1";
52 :     }
53 :     }
54 :     }
55 :     my @list = keys(%list_of_ss);
56 :    
57 : overbeek 1.5 my $prefix = &FIG::cgi_url(-relative => 1) . "/subsys.cgi?user=&ssa_name=";
58 : mkubal 1.1 my $suffix = "&request=show_ssa";
59 :     push(@$html,"<TABLE>");
60 :     foreach my $s (@list)
61 :     {
62 :     my $url = "<a href='$prefix.$s.$suffix'>$s</a>";
63 :     push(@$html,"<TR><TD>$url</TD></TR>");
64 :    
65 :     }
66 :     push(@$html,"</TABLE>");
67 :     &HTML::show_page($cgi,$html);
68 :     }
69 :    
70 :     else{
71 :    
72 : mkubal 1.3 $html = [];
73 :     push @$html, "<TITLE>Connect Pegs with Attributes to Subsystems</TITLE>";
74 : mkubal 1.1
75 : mkubal 1.3 push(@$html,$cgi->start_form(-action => "ma2sub.cgi", -method => 'post'));
76 : mkubal 1.1
77 :    
78 : mkubal 1.3 my @gs_list;
79 :     my @genomes = $fig->genomes('complete');
80 :     foreach $g (@genomes){
81 :     my $gs = $fig->genus_species($g);
82 :     push(@gs_list, $gs.", ".$g);
83 :     }
84 :    
85 :     @gs_list2 =sort {uc($a) cmp uc($b)} @gs_list;
86 :     push(@$html,
87 :     $cgi->h3("select genome"),
88 :     $cgi->scrolling_list(-name => 'genome',
89 : mkubal 1.1 -values => [@gs_list2],
90 :     -size => 10,
91 :     -multiple => 1
92 :     ),
93 : mkubal 1.3 $cgi->hr
94 :     );
95 :    
96 :     #my $opt=$fig->get_keys("peg"); # all the peg tags
97 :     #my @options=sort {uc($a) cmp uc($b)} keys %$opt;
98 :     #unshift(@options, undef);
99 :     @options =("microarray_sigmaB_regulon","pH_75_vs_55");
100 :     push(@$html,$cgi->h3("select experiment"), $cgi->popup_menu(-name => 'attribute', -values=>\@options), $cgi->br, $cgi->hr);
101 : mkubal 1.1
102 : mkubal 1.3 @options2 = ("up regulated","down regulated");
103 :     push(@$html,$cgi->h3("select value"), $cgi->popup_menu(-name => 'value', -values=>\@options2), $cgi->br,$cgi->hr);
104 : mkubal 1.1
105 : mkubal 1.3 push(@$html,$cgi->submit('find subsystems'), $cgi->end_form);
106 : mkubal 1.1
107 : mkubal 1.3 &HTML::show_page($cgi,$html);
108 : mkubal 1.1
109 : olson 1.4 }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3