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

Annotation of /FigWebServices/show_local_map.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (view) (download)

1 : olson 1.4 #
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 File::Copy;
22 :     use HTML;
23 :     use strict;
24 :     use GenoGraphics;
25 :     use CGI;
26 :     my $cgi = new CGI;
27 :    
28 :     if (0)
29 :     {
30 :     print $cgi->header;
31 :     my @params = $cgi->param;
32 :     print "<pre>\n";
33 :     foreach $_ (@params)
34 :     {
35 :     print "$_\t:",join(",",$cgi->param($_)),":\n";
36 :     }
37 :     exit;
38 :     }
39 :    
40 :     my(@output,@ecs_hit,@table);
41 :    
42 :     my $map = $cgi->param('map');
43 :     my $org = $cgi->param('org');
44 :     my $roles;
45 :     my @ecs_hit = ();
46 :     my @table = ();
47 :     my @ecs;
48 :    
49 :     if ($org)
50 :     {
51 :     @ecs = $fig->map_to_ecs($map);
52 :     my $user = $cgi->param('user');
53 :     if (! $user) { $user = "" }
54 :     my $hits = $fig->seqs_with_roles_in_genomes([$org],[@ecs],$user);
55 :     if ($hits = $hits->{$org})
56 :     {
57 :     @ecs_hit = keys(%$hits);
58 :     my $col_hdrs = ["EC","name","genes"];
59 :     my $tab = [];
60 :     my($x,$ec);
61 :     foreach $ec (sort @ecs_hit)
62 :     {
63 :     if ($x = $hits->{$ec})
64 :     {
65 : redwards 1.5 push(@$tab,[$ec,$fig->ec_name($ec),join(",",map { &HTML::fid_link($cgi,$_->[0],1,0,1) } @$x)]);
66 : olson 1.1 }
67 :     }
68 :     my $gs = $fig->genus_species($org);
69 :     @table = &HTML::make_table($col_hdrs,$tab,"Relevant Sequences for $gs");
70 :     push(@table,$cgi->hr);
71 :     }
72 :     }
73 :    
74 :     $roles = join("^^^", @ecs_hit);
75 :     $roles =~ s/ /+/g;
76 :    
77 : disz 1.2 my $map_html = `cat $FIG_Config::data/MAP_SUPPORT/Maps/$map/link.table`;
78 : olson 1.1
79 : olson 1.3 my $cgi = &FIG::cgi_url();
80 :     @output = sprintf "<IMG SRC = \"$cgi/get_map_image.cgi?map=$map&roles=$roles\" USEMAP = \"#%s\" BORDER = 0>
81 : olson 1.1 <MAP NAME = \"%s\">%s</MAP>", "TESTMAP", "TESTMAP", $map_html;
82 :    
83 :     splice(@output,0,0,@table);
84 :     print @output;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3