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

View of /FigWebServices/show_map.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (annotate)
Fri Jul 2 15:58:09 2004 UTC (15 years, 9 months ago) by olson
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, merge-trunktag-bobdev_news-1, merge-bodev_news-3, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
Changes since 1.1: +3 -1 lines
fix another double-header

use FIG;
my $fig = new FIG;

use HTML;
use strict;
use GenoGraphics;
use CGI;
my $cgi = new CGI;

if (0)
{
    print $cgi->header;
    my @params = $cgi->param;
    print "<pre>\n";
    foreach $_ (@params)
    {
	print "$_\t:",join(",",$cgi->param($_)),":\n";
    }
    exit;
}

my(@output,@ecs_hit,@table);
my $org = $cgi->param('org');
$org = $org ? $org : "";

my $map = $cgi->param('map');

# These are probably already this, but ...

$ENV{"REQUEST_METHOD"} = "GET";

if ((! -d "$FIG_Config::data/Map_Source/Maps/$map") && ($map =~ /^MAP\d+$/))
{
    $ENV{"QUERY_STRING"} = "map=$map&org=$org";
    my @html = `./show_kegg_map.cgi`;
    print join("",@html);
    exit;
}

@ecs_hit = ();
@table = ();

if ($org)
{
    my @ecs = $fig->map_to_ecs($map);
    my $user = $cgi->param('user');
    if (! $user) { $user = "" }
    my $hits = $fig->seqs_with_roles_in_genomes([$org],[@ecs],$user);
    if ($hits = $hits->{$org})
    {
	@ecs_hit = keys(%$hits);
	my $col_hdrs = ["EC","name","genes"];
	my $tab         = [];
	my($x,$ec);
	foreach $ec (sort @ecs_hit)
	{
	    if ($x = $hits->{$ec})
	    {
		push(@$tab,[$ec,$fig->ec_name($ec),join(",",map { &HTML::fid_link($cgi,$_->[0],1) } @$x)]);
	    }
	}
	my $gs = $fig->genus_species($org);
	@table = &HTML::make_table($col_hdrs,$tab,"Relevant Sequences for $gs");
	push(@table,$cgi->hr);
    }
}

my $roles = "org=$org";
#my $roles = "role=" . join("&role=",@ecs_hit);
$ENV{"QUERY_STRING"} = "map=$map&$roles";
@output = `./show_local_map.cgi`;
# &HTML::show_page($cgi,\@output);

print @output;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3