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

Annotation of /FigWebServices/show_map.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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 : olson 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 :     my $org = $cgi->param('org');
41 :     $org = $org ? $org : "";
42 :    
43 :     my $map = $cgi->param('map');
44 :    
45 :     # These are probably already this, but ...
46 :    
47 :     $ENV{"REQUEST_METHOD"} = "GET";
48 :    
49 :     if ((! -d "$FIG_Config::data/Map_Source/Maps/$map") && ($map =~ /^MAP\d+$/))
50 :     {
51 :     $ENV{"QUERY_STRING"} = "map=$map&org=$org";
52 :     my @html = `./show_kegg_map.cgi`;
53 :     print join("",@html);
54 :     exit;
55 :     }
56 :    
57 :     @ecs_hit = ();
58 :     @table = ();
59 :    
60 :     if ($org)
61 :     {
62 :     my @ecs = $fig->map_to_ecs($map);
63 :     my $user = $cgi->param('user');
64 :     if (! $user) { $user = "" }
65 :     my $hits = $fig->seqs_with_roles_in_genomes([$org],[@ecs],$user);
66 :     if ($hits = $hits->{$org})
67 :     {
68 :     @ecs_hit = keys(%$hits);
69 :     my $col_hdrs = ["EC","name","genes"];
70 :     my $tab = [];
71 :     my($x,$ec);
72 :     foreach $ec (sort @ecs_hit)
73 :     {
74 :     if ($x = $hits->{$ec})
75 :     {
76 :     push(@$tab,[$ec,$fig->ec_name($ec),join(",",map { &HTML::fid_link($cgi,$_->[0],1) } @$x)]);
77 :     }
78 :     }
79 :     my $gs = $fig->genus_species($org);
80 :     @table = &HTML::make_table($col_hdrs,$tab,"Relevant Sequences for $gs");
81 :     push(@table,$cgi->hr);
82 :     }
83 :     }
84 :    
85 :     my $roles = "org=$org";
86 :     #my $roles = "role=" . join("&role=",@ecs_hit);
87 :     $ENV{"QUERY_STRING"} = "map=$map&$roles";
88 :     @output = `./show_local_map.cgi`;
89 : olson 1.2 # &HTML::show_page($cgi,\@output);
90 :    
91 :     print @output;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3