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

Annotation of /FigWebServices/array2sub.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (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 : mkubal 1.9 push(@$html,$cgi->h3("Subsystems"));
16 : mkubal 1.8 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 : olson 1.10 my $prefix = &FIG::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 : mkubal 1.9 push(@$html,$cgi->h3("Pegs Not in Subsystem"));
56 : mkubal 1.8 push(@$html,"<TABLE>");
57 :    
58 :     foreach my $p (@pegs_with_no_ss)
59 :     {
60 : olson 1.10 my $cgi = &FIG::cgi_url();
61 :     my $url =qq(<a href="$cgi/protein.cgi?prot=$p&user=">$p</a>);
62 : mkubal 1.8 push(@$html,"<TR><TD>$url</TD></TR>");
63 :     }
64 :     push(@$html,"</TABLE>");
65 :    
66 : mkubal 1.1 &HTML::show_page($cgi,$html);
67 :     }
68 :    
69 :     else{
70 :    
71 :     $html = [];
72 : mkubal 1.8 push @$html, "<TITLE>Connect Differentially Expressed Pegs to Subsystems</TITLE>";
73 : mkubal 1.1
74 :     push(@$html,$cgi->start_form(-action => "array2sub.cgi", -method => 'post'));
75 :    
76 :    
77 :     my @gs_list;
78 :     my @genomes = $fig->genomes('complete');
79 :     foreach $g (@genomes){
80 :     my $gs = $fig->genus_species($g);
81 :     push(@gs_list, $gs.", ".$g);
82 :     }
83 :    
84 :     @gs_list2 =sort {uc($a) cmp uc($b)} @gs_list;
85 :     push(@$html,
86 :     $cgi->h3("select genome"),
87 :     $cgi->scrolling_list(-name => 'genome',
88 :     -values => [@gs_list2],
89 :     -size => 10,
90 :     -multiple => 1
91 :     ),
92 :     $cgi->hr
93 :     );
94 :    
95 :     #my $opt=$fig->get_keys("peg"); # all the peg tags
96 :     #my @options=sort {uc($a) cmp uc($b)} keys %$opt;
97 :     #unshift(@options, undef);
98 :     @options =("microarray_sigmaB_regulon","pH_75_vs_55");
99 :     push(@$html,$cgi->h3("select experiment"), $cgi->popup_menu(-name => 'attribute', -values=>\@options), $cgi->br, $cgi->hr);
100 :    
101 :     @options2 = ("up regulated","down regulated");
102 :     push(@$html,$cgi->h3("select value"), $cgi->popup_menu(-name => 'value', -values=>\@options2), $cgi->br,$cgi->hr);
103 :    
104 :     push(@$html,$cgi->submit('find subsystems'), $cgi->end_form);
105 :    
106 :     &HTML::show_page($cgi,$html);
107 :    
108 : olson 1.10 }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3