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

Annotation of /FigWebServices/show_kegg_map.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download)

1 : olson 1.3 #
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 : efrank 1.1 use FIG;
19 :     my $fig = new FIG;
20 :    
21 :     use HTML;
22 :     use strict;
23 :     use GenoGraphics;
24 :     use CGI;
25 :     my $cgi = new CGI;
26 :    
27 :     if (0)
28 :     {
29 :     print $cgi->header;
30 :     my @params = $cgi->param;
31 :     print "<pre>\n";
32 :     foreach $_ (@params)
33 :     {
34 :     print "$_\t:",join(",",$cgi->param($_)),":\n";
35 :     }
36 :     exit;
37 :     }
38 :    
39 :     my(@output,@ecs_hit,@table);
40 :    
41 :     my $map = $cgi->param('map');
42 :     my $org = $cgi->param('org');
43 :     @ecs_hit = ();
44 :     @table = ();
45 :    
46 :     if ($org)
47 :     {
48 :     my @ecs = $fig->map_to_ecs($map);
49 :     my $user = $cgi->param('user');
50 :     if (! $user) { $user = "" }
51 :     my $hits = $fig->seqs_with_roles_in_genomes([$org],[@ecs],$user);
52 :     if ($hits = $hits->{$org})
53 :     {
54 :     @ecs_hit = keys(%$hits);
55 :     my $col_hdrs = ["EC","name","genes"];
56 :     my $tab = [];
57 :     my($x,$ec);
58 :     foreach $ec (sort @ecs_hit)
59 :     {
60 :     if ($x = $hits->{$ec})
61 :     {
62 : redwards 1.4 push(@$tab,[$ec,$fig->ec_name($ec),join(",",map { &HTML::fid_link($cgi,$_->[0],1,0,1) } @$x)]);
63 : efrank 1.1 }
64 :     }
65 :     my $gs = $fig->genus_species($org);
66 :     @table = &HTML::make_table($col_hdrs,$tab,"Relevant Sequences for $gs");
67 :     push(@table,$cgi->hr);
68 :     }
69 :     }
70 :    
71 :     my $url = "http://www.genome.ad.jp/dbget-bin/show_pathway?$map" . join("",map { "+" . $_ } @ecs_hit);
72 :     @output = &HTML::get_html($url,"get",[]);
73 :    
74 :     my $i;
75 :     for ($i=0; ($i < @output) && ($output[$i] !~ /\<body\>/i); $i++) {}
76 :     if ($i == @output)
77 :     {
78 :     for ($i=0; ($i < @output) && ($output[$i] !~ /\<html\>/i); $i++) {}
79 :     if ($i == @output)
80 :     {
81 :     $i = -1;
82 :     }
83 :     }
84 : olson 1.2
85 : efrank 1.1 splice(@output,$i+1,0,@table);
86 : olson 1.2 # &HTML::show_page($cgi,\@output);
87 :     print @output;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3