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

Annotation of /FigWebServices/array2sub.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (view) (download)

1 : mkubal 1.1 use FIG;
2 :     my $fig = new FIG;
3 :     use HTML;
4 :     use CGI;
5 :    
6 :     my $cgi = new CGI;
7 :     my $html = [];
8 : mkubal 1.8 my @pegs_with_no_ss = ();
9 : mkubal 1.1
10 :     if($cgi->param('genome') && $cgi->param('attribute') && $cgi->param('value'))
11 :     {
12 :    
13 : mkubal 1.8 push (@$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>");
14 :     push(@$html, $cgi->br,$cgi->hr);
15 :     push(@$html,$cgi->h3("Subsytems"));
16 :     my $genome_string = $cgi->param('genome');
17 : mkubal 1.1 my @string_parts = split(", ",$genome_string);
18 :     my $genome = $string_parts[1];
19 :     my $att_param = $cgi->param('attribute');
20 :     my $value_param = $cgi->param('value');
21 :    
22 :     my @pegs = $fig->pegs_of($genome);
23 :     my %list_of_ss;
24 :     foreach my $peg (@pegs) {
25 : mkubal 1.5 next unless (my @attr=$fig->get_attributes($peg));
26 :     foreach my $attr (@attr) {
27 : mkubal 1.1 next unless (defined $attr);
28 :     my ($gotpeg, $tag, $val, $link)=@$attr;
29 : mkubal 1.5 next unless ($tag eq $att_param);
30 :     next unless($val eq $value_param);
31 : mkubal 1.1 my @subsystems = $fig->subsystems_for_peg($peg);
32 : mkubal 1.8 my $no_ss = 1;
33 : mkubal 1.1 foreach my $ss (@subsystems)
34 :     {
35 :     my $ss_name = $ss->[0];
36 :     $list_of_ss{$ss_name} = "1";
37 : mkubal 1.8 $ss = 0;
38 : mkubal 1.1 }
39 : mkubal 1.8 if($no_ss){push(@pegs_with_no_ss,$peg)}
40 : mkubal 1.1 }
41 :     }
42 :     my @list = keys(%list_of_ss);
43 :    
44 : mkubal 1.3 my $prefix = "$FIG_Config::cgi_url"."/subsys.cgi?user=&ssa_name=";
45 : mkubal 1.1 my $suffix = "&request=show_ssa";
46 :     push(@$html,"<TABLE>");
47 :     foreach my $s (@list)
48 :     {
49 : mkubal 1.7 my $url = "<a href="."$prefix"."$s"."$suffix"."&color_by_peg_tag=$att_param".">$s</a>";
50 : mkubal 1.1 push(@$html,"<TR><TD>$url</TD></TR>");
51 :    
52 :     }
53 : mkubal 1.8 push(@$html,"</TABLE>",$cgi->hr);
54 :    
55 :     push(@$html,$cgi->h3("Pegs Not in Subsytem"));
56 :     push(@$html,"<TABLE>");
57 :    
58 :     foreach my $p (@pegs_with_no_ss)
59 :     {
60 :     my $url ="<a href="."$FIG_Config::cgi_url"."/protein.cgi?prot=$p&user=".">$p</a>";
61 :     push(@$html,"<TR><TD>$url</TD></TR>");
62 :     }
63 :     push(@$html,"</TABLE>");
64 :    
65 : mkubal 1.1 &HTML::show_page($cgi,$html);
66 :     }
67 :    
68 :     else{
69 :    
70 :     $html = [];
71 : mkubal 1.8 push @$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>";
72 : mkubal 1.1
73 :     push(@$html,$cgi->start_form(-action => "array2sub.cgi", -method => 'post'));
74 :    
75 :    
76 :     my @gs_list;
77 :     my @genomes = $fig->genomes('complete');
78 :     foreach $g (@genomes){
79 :     my $gs = $fig->genus_species($g);
80 :     push(@gs_list, $gs.", ".$g);
81 :     }
82 :    
83 :     @gs_list2 =sort {uc($a) cmp uc($b)} @gs_list;
84 :     push(@$html,
85 :     $cgi->h3("select genome"),
86 :     $cgi->scrolling_list(-name => 'genome',
87 :     -values => [@gs_list2],
88 :     -size => 10,
89 :     -multiple => 1
90 :     ),
91 :     $cgi->hr
92 :     );
93 :    
94 :     #my $opt=$fig->get_keys("peg"); # all the peg tags
95 :     #my @options=sort {uc($a) cmp uc($b)} keys %$opt;
96 :     #unshift(@options, undef);
97 :     @options =("microarray_sigmaB_regulon","pH_75_vs_55");
98 :     push(@$html,$cgi->h3("select experiment"), $cgi->popup_menu(-name => 'attribute', -values=>\@options), $cgi->br, $cgi->hr);
99 :    
100 :     @options2 = ("up regulated","down regulated");
101 :     push(@$html,$cgi->h3("select value"), $cgi->popup_menu(-name => 'value', -values=>\@options2), $cgi->br,$cgi->hr);
102 :    
103 :     push(@$html,$cgi->submit('find subsystems'), $cgi->end_form);
104 :    
105 :     &HTML::show_page($cgi,$html);
106 :    
107 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3