[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.12, Sun Sep 18 13:44:15 2005 UTC
# Line 5  Line 5 
5    
6  my $cgi = new CGI;  my $cgi = new CGI;
7  my $html = [];  my $html = [];
8    my @pegs_with_no_ss = ();
9    
10  if($cgi->param('genome') && $cgi->param('attribute') && $cgi->param('value'))  if($cgi->param('genome') && $cgi->param('attribute') && $cgi->param('value'))
11  {  {
12    
13          push (@$html, "<TITLE>Connect Pegs with Attributes to Subsystems</TITLE>");          push (@$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>");
14            push(@$html, $cgi->br,$cgi->hr);
15            push(@$html,$cgi->h3("Subsystems: # of pegs with matching expression level"));
16          my $genome_string = $cgi->param('genome');          my $genome_string = $cgi->param('genome');
17          my @string_parts = split(", ",$genome_string);          my @string_parts = split(", ",$genome_string);
18          my $genome = $string_parts[1];          my $genome = $string_parts[1];
19          my $att_param = $cgi->param('attribute');          my $att_param = $cgi->param('attribute');
20          my $value_param = $cgi->param('value');          my $value_param = $cgi->param('value');
21            my $ss_counter;
22            my @all = $fig->all_subsystems();
23            foreach my $a (@all){ $ss_counter{$a} = 0 }
24          my @pegs = $fig->pegs_of($genome);          my @pegs = $fig->pegs_of($genome);
25          my %list_of_ss;          my %list_of_ss;
26          foreach my $peg (@pegs) {          foreach my $peg (@pegs) {
# Line 27  Line 31 
31                          next unless ($tag eq $att_param);                          next unless ($tag eq $att_param);
32                          next unless($val eq $value_param);                          next unless($val eq $value_param);
33                          my @subsystems = $fig->subsystems_for_peg($peg);                          my @subsystems = $fig->subsystems_for_peg($peg);
34                            my $no_ss = 1;
35                          foreach my $ss (@subsystems)                          foreach my $ss (@subsystems)
36                          {                          {
37                                  my $ss_name = $ss->[0];                                  my $ss_name = $ss->[0];
38                                    $counter = $ss_counter{$ss_name};
39                                    $counter = $counter + 1;
40                                  $list_of_ss{$ss_name} = "1";                                  $list_of_ss{$ss_name} = "1";
41                                    $ss_counter{$ss_name} = $counter;
42                                    $no_ss = 0;
43                          }                          }
44                            if($no_ss){push(@pegs_with_no_ss,$peg)}
45                   }                   }
46          }          }
47          my @list = keys(%list_of_ss);          my @list = keys(%list_of_ss);
48    
49          my $prefix = "$FIG_Config::cgi_url"."/subsys.cgi?user=&ssa_name=";          my $prefix = &FIG::cgi_url() . "/subsys.cgi?user=&ssa_name=";
50          my $suffix = "&request=show_ssa";          my $suffix = "&request=show_ssa";
51          push(@$html,"<TABLE>");          push(@$html,"<TABLE>");
52          foreach my $s (@list)          foreach my $s (@list)
53          {          {
54               my $peg_count = $ss_counter{$s};
55             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>";
56             push(@$html,"<TR><TD>$url</TD></TR>");             push(@$html,"<TR><TD>$url</TD><TD>$peg_count</TD></TR>");
57    
58           }           }
59             push(@$html,"</TABLE>",$cgi->hr);
60    
61             push(@$html,$cgi->h3("Pegs Not in Subsystem"));
62             push(@$html,"<TABLE>");
63    
64             foreach my $p (@pegs_with_no_ss)
65             {
66                    my $cgi = &FIG::cgi_url();
67                    my $url =qq(<a href="$cgi/protein.cgi?prot=$p&user=">$p</a>);
68                    push(@$html,"<TR><TD>$url</TD></TR>");
69             }
70           push(@$html,"</TABLE>");           push(@$html,"</TABLE>");
71    
72           &HTML::show_page($cgi,$html);           &HTML::show_page($cgi,$html);
73  }  }
74    
75  else{  else{
76    
77          $html = [];          $html = [];
78          push @$html, "<TITLE>Connect Pegs with Attributes to Subsystems</TITLE>";          push @$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>";
79    
80          push(@$html,$cgi->start_form(-action => "array2sub.cgi",  -method => 'post'));          push(@$html,$cgi->start_form(-action => "array2sub.cgi",  -method => 'post'));
81    
# Line 82  Line 104 
104          @options =("microarray_sigmaB_regulon","pH_75_vs_55");          @options =("microarray_sigmaB_regulon","pH_75_vs_55");
105          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);
106    
107          @options2 = ("up regulated","down regulated");          @options2 = ("up regulated","down regulated","present");
108          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);
109    
110          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.12

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3