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

Annotation of /FigWebServices/array2sub.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (view) (download)

1 : olson 1.14 #
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 : mkubal 1.8 my @pegs_with_no_ss = ();
26 : mkubal 1.1
27 :     if($cgi->param('genome') && $cgi->param('attribute') && $cgi->param('value'))
28 :     {
29 :    
30 : mkubal 1.8 push (@$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>");
31 :     push(@$html, $cgi->br,$cgi->hr);
32 : mkubal 1.11 push(@$html,$cgi->h3("Subsystems: # of pegs with matching expression level"));
33 : mkubal 1.8 my $genome_string = $cgi->param('genome');
34 : mkubal 1.1 my @string_parts = split(", ",$genome_string);
35 :     my $genome = $string_parts[1];
36 :     my $att_param = $cgi->param('attribute');
37 :     my $value_param = $cgi->param('value');
38 : mkubal 1.12 my $ss_counter;
39 : mkubal 1.11 my @all = $fig->all_subsystems();
40 :     foreach my $a (@all){ $ss_counter{$a} = 0 }
41 : mkubal 1.1 my @pegs = $fig->pegs_of($genome);
42 :     my %list_of_ss;
43 :     foreach my $peg (@pegs) {
44 : mkubal 1.5 next unless (my @attr=$fig->get_attributes($peg));
45 :     foreach my $attr (@attr) {
46 : mkubal 1.1 next unless (defined $attr);
47 :     my ($gotpeg, $tag, $val, $link)=@$attr;
48 : mkubal 1.5 next unless ($tag eq $att_param);
49 :     next unless($val eq $value_param);
50 : mkubal 1.1 my @subsystems = $fig->subsystems_for_peg($peg);
51 : mkubal 1.8 my $no_ss = 1;
52 : mkubal 1.11 foreach my $ss (@subsystems)
53 :     {
54 : mkubal 1.12 my $ss_name = $ss->[0];
55 :     $counter = $ss_counter{$ss_name};
56 : mkubal 1.11 $counter = $counter + 1;
57 : mkubal 1.1 $list_of_ss{$ss_name} = "1";
58 : mkubal 1.12 $ss_counter{$ss_name} = $counter;
59 : mkubal 1.11 $no_ss = 0;
60 : mkubal 1.1 }
61 : mkubal 1.8 if($no_ss){push(@pegs_with_no_ss,$peg)}
62 : mkubal 1.1 }
63 :     }
64 :     my @list = keys(%list_of_ss);
65 :    
66 : overbeek 1.13 my $prefix = subsys.cgi?user=&ssa_name=";
67 : mkubal 1.1 my $suffix = "&request=show_ssa";
68 :     push(@$html,"<TABLE>");
69 :     foreach my $s (@list)
70 :     {
71 : mkubal 1.11 my $peg_count = $ss_counter{$s};
72 : mkubal 1.7 my $url = "<a href="."$prefix"."$s"."$suffix"."&color_by_peg_tag=$att_param".">$s</a>";
73 : mkubal 1.11 push(@$html,"<TR><TD>$url</TD><TD>$peg_count</TD></TR>");
74 : mkubal 1.1
75 :     }
76 : mkubal 1.8 push(@$html,"</TABLE>",$cgi->hr);
77 :    
78 : mkubal 1.9 push(@$html,$cgi->h3("Pegs Not in Subsystem"));
79 : mkubal 1.8 push(@$html,"<TABLE>");
80 :    
81 :     foreach my $p (@pegs_with_no_ss)
82 :     {
83 : overbeek 1.13 my $cgi = &FIG::cgi_url(-relative => 1);
84 :     my $url =qq(<a href="protein.cgi?prot=$p&user=">$p</a>);
85 : mkubal 1.8 push(@$html,"<TR><TD>$url</TD></TR>");
86 :     }
87 :     push(@$html,"</TABLE>");
88 :    
89 : mkubal 1.1 &HTML::show_page($cgi,$html);
90 :     }
91 :    
92 :     else{
93 :    
94 :     $html = [];
95 : mkubal 1.8 push @$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>";
96 : mkubal 1.1
97 :     push(@$html,$cgi->start_form(-action => "array2sub.cgi", -method => 'post'));
98 :    
99 :    
100 :     my @gs_list;
101 :     my @genomes = $fig->genomes('complete');
102 :     foreach $g (@genomes){
103 :     my $gs = $fig->genus_species($g);
104 :     push(@gs_list, $gs.", ".$g);
105 :     }
106 :    
107 :     @gs_list2 =sort {uc($a) cmp uc($b)} @gs_list;
108 :     push(@$html,
109 :     $cgi->h3("select genome"),
110 :     $cgi->scrolling_list(-name => 'genome',
111 :     -values => [@gs_list2],
112 :     -size => 10,
113 :     -multiple => 1
114 :     ),
115 :     $cgi->hr
116 :     );
117 :    
118 :     #my $opt=$fig->get_keys("peg"); # all the peg tags
119 :     #my @options=sort {uc($a) cmp uc($b)} keys %$opt;
120 :     #unshift(@options, undef);
121 :     @options =("microarray_sigmaB_regulon","pH_75_vs_55");
122 :     push(@$html,$cgi->h3("select experiment"), $cgi->popup_menu(-name => 'attribute', -values=>\@options), $cgi->br, $cgi->hr);
123 :    
124 : mkubal 1.11 @options2 = ("up regulated","down regulated","present");
125 : mkubal 1.1 push(@$html,$cgi->h3("select value"), $cgi->popup_menu(-name => 'value', -values=>\@options2), $cgi->br,$cgi->hr);
126 :    
127 :     push(@$html,$cgi->submit('find subsystems'), $cgi->end_form);
128 :    
129 :     &HTML::show_page($cgi,$html);
130 :    
131 : olson 1.10 }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3