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

Annotation of /FigWebServices/array2sub.cgi

Parent Directory Parent Directory | Revision Log Revision Log


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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3