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

Annotation of /FigWebServices/att2sub.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 : mkubal 1.2 my $genome_string = $cgi->param('genome');
32 :     my @string_parts = split($genome_string,", ");
33 :     my $genome = $string_parts[1];
34 : mkubal 1.1 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 :     $val = uc($val);
47 : mkubal 1.2 #$value_param = uc($value_param);
48 : mkubal 1.1 next unless($val eq $value_param);
49 :     my @subsystems = $fig->subsystems_for_peg($peg);
50 :     foreach my $ss (@subsystems)
51 :     {
52 :     my $ss_name = $ss->[0];
53 :     $list_of_ss{$ss_name} = "1";
54 :     }
55 :     }
56 :     }
57 :     my @list = keys(%list_of_ss);
58 :    
59 : overbeek 1.5 my $prefix = &FIG::cgi_url(-relative => 1) . "/subsys.cgi?user=&ssa_name=";
60 : mkubal 1.1 my $suffix = "&request=show_ssa";
61 :     push(@$html,"<TABLE>");
62 :     foreach my $s (@list)
63 :     {
64 :     my $url = "<a href='$prefix.$s.$suffix'>$s</a>";
65 :     push(@$html,"<TR><TD>$url</TD></TR>");
66 :    
67 :     }
68 :     push(@$html,"</TABLE>");
69 :     &HTML::show_page($cgi,$html);
70 :     }
71 :    
72 :     else{
73 :    
74 :     $html = [];
75 :     push @$html, "<TITLE>Connect Pegs with Attributes to Subsystems</TITLE>";
76 :    
77 :     push(@$html,$cgi->start_form(-action => "att2sub.cgi",
78 :     -method => 'post')
79 :     );
80 :    
81 :    
82 :     my @gs_list;
83 :     my @genomes = $fig->genomes('complete');
84 :     foreach $g (@genomes){
85 :     my $gs = $fig->genus_species($g);
86 : mkubal 1.3 push(@gs_list, $gs.", ".$g);
87 : mkubal 1.1 }
88 :    
89 :     @gs_list2 =sort {uc($a) cmp uc($b)} @gs_list;
90 :     push(@$html,
91 :     $cgi->h3("select genome"),
92 :     $cgi->scrolling_list(-name => 'genome',
93 :     -values => [@gs_list2],
94 :     -size => 10,
95 :     -multiple => 1
96 :     ),
97 :     $cgi->hr
98 :     );
99 :    
100 :     my $opt=$fig->get_keys("peg"); # all the peg tags
101 :     my @options=sort {uc($a) cmp uc($b)} keys %$opt;
102 :     unshift(@options, undef);
103 :     push(@$html,$cgi->h3("select experiment"), $cgi->popup_menu(-name => 'attribute', -values=>\@options), $cgi->br, $cgi->hr);
104 :    
105 :     #my $opt2=$fig->get_values("peg"); # all the peg tags
106 :     #my @options2=sort {uc($a) cmp uc($b)} keys %$opt2;
107 :     #unshift(@options2, undef);
108 :     @options2 = ("up regulated","down regulated");
109 :     push(@$html,$cgi->h3("select value"), $cgi->popup_menu(-name => 'value', -values=>\@options2), $cgi->br,$cgi->hr);
110 :    
111 :     push(@$html,$cgi->submit('find subsystems'), $cgi->end_form);
112 :    
113 :     &HTML::show_page($cgi,$html);
114 :    
115 : olson 1.4 }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3