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

Diff of /FigWebServices/array2sub.cgi

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

revision 1.7, Tue Jul 26 04:51:52 2005 UTC revision 1.14, Mon Dec 5 19:12:11 2005 UTC
# Line 1  Line 1 
1    #
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  use FIG;  use FIG;
19  my $fig = new FIG;  my $fig = new FIG;
20  use HTML;  use HTML;
# Line 5  Line 22 
22    
23  my $cgi = new CGI;  my $cgi = new CGI;
24  my $html = [];  my $html = [];
25    my @pegs_with_no_ss = ();
26    
27  if($cgi->param('genome') && $cgi->param('attribute') && $cgi->param('value'))  if($cgi->param('genome') && $cgi->param('attribute') && $cgi->param('value'))
28  {  {
29    
30          push (@$html, "<TITLE>Connect Pegs with Attributes to Subsystems</TITLE>");          push (@$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>");
31            push(@$html, $cgi->br,$cgi->hr);
32            push(@$html,$cgi->h3("Subsystems: # of pegs with matching expression level"));
33          my $genome_string = $cgi->param('genome');          my $genome_string = $cgi->param('genome');
34          my @string_parts = split(", ",$genome_string);          my @string_parts = split(", ",$genome_string);
35          my $genome = $string_parts[1];          my $genome = $string_parts[1];
36          my $att_param = $cgi->param('attribute');          my $att_param = $cgi->param('attribute');
37          my $value_param = $cgi->param('value');          my $value_param = $cgi->param('value');
38            my $ss_counter;
39            my @all = $fig->all_subsystems();
40            foreach my $a (@all){ $ss_counter{$a} = 0 }
41          my @pegs = $fig->pegs_of($genome);          my @pegs = $fig->pegs_of($genome);
42          my %list_of_ss;          my %list_of_ss;
43          foreach my $peg (@pegs) {          foreach my $peg (@pegs) {
# Line 27  Line 48 
48                          next unless ($tag eq $att_param);                          next unless ($tag eq $att_param);
49                          next unless($val eq $value_param);                          next unless($val eq $value_param);
50                          my @subsystems = $fig->subsystems_for_peg($peg);                          my @subsystems = $fig->subsystems_for_peg($peg);
51                            my $no_ss = 1;
52                          foreach my $ss (@subsystems)                          foreach my $ss (@subsystems)
53                          {                          {
54                                  my $ss_name = $ss->[0];                                  my $ss_name = $ss->[0];
55                                    $counter = $ss_counter{$ss_name};
56                                    $counter = $counter + 1;
57                                  $list_of_ss{$ss_name} = "1";                                  $list_of_ss{$ss_name} = "1";
58                                    $ss_counter{$ss_name} = $counter;
59                                    $no_ss = 0;
60                          }                          }
61                            if($no_ss){push(@pegs_with_no_ss,$peg)}
62                   }                   }
63          }          }
64          my @list = keys(%list_of_ss);          my @list = keys(%list_of_ss);
65    
66          my $prefix = "$FIG_Config::cgi_url"."/subsys.cgi?user=&ssa_name=";          my $prefix = subsys.cgi?user=&ssa_name=";
67          my $suffix = "&request=show_ssa";          my $suffix = "&request=show_ssa";
68          push(@$html,"<TABLE>");          push(@$html,"<TABLE>");
69          foreach my $s (@list)          foreach my $s (@list)
70          {          {
71               my $peg_count = $ss_counter{$s};
72             my $url = "<a href="."$prefix"."$s"."$suffix"."&color_by_peg_tag=$att_param".">$s</a>";             my $url = "<a href="."$prefix"."$s"."$suffix"."&color_by_peg_tag=$att_param".">$s</a>";
73             push(@$html,"<TR><TD>$url</TD></TR>");             push(@$html,"<TR><TD>$url</TD><TD>$peg_count</TD></TR>");
74    
75             }
76             push(@$html,"</TABLE>",$cgi->hr);
77    
78             push(@$html,$cgi->h3("Pegs Not in Subsystem"));
79             push(@$html,"<TABLE>");
80    
81             foreach my $p (@pegs_with_no_ss)
82             {
83                    my $cgi = &FIG::cgi_url(-relative => 1);
84                    my $url =qq(<a href="protein.cgi?prot=$p&user=">$p</a>);
85                    push(@$html,"<TR><TD>$url</TD></TR>");
86           }           }
87           push(@$html,"</TABLE>");           push(@$html,"</TABLE>");
88    
89           &HTML::show_page($cgi,$html);           &HTML::show_page($cgi,$html);
90  }  }
91    
92  else{  else{
93    
94          $html = [];          $html = [];
95          push @$html, "<TITLE>Connect Pegs with Attributes to Subsystems</TITLE>";          push @$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>";
96    
97          push(@$html,$cgi->start_form(-action => "array2sub.cgi",  -method => 'post'));          push(@$html,$cgi->start_form(-action => "array2sub.cgi",  -method => 'post'));
98    
# Line 82  Line 121 
121          @options =("microarray_sigmaB_regulon","pH_75_vs_55");          @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);          push(@$html,$cgi->h3("select experiment"), $cgi->popup_menu(-name => 'attribute', -values=>\@options), $cgi->br, $cgi->hr);
123    
124          @options2 = ("up regulated","down regulated");          @options2 = ("up regulated","down regulated","present");
125          push(@$html,$cgi->h3("select value"), $cgi->popup_menu(-name => 'value', -values=>\@options2), $cgi->br,$cgi->hr);          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);          push(@$html,$cgi->submit('find subsystems'), $cgi->end_form);

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3