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

View of /FigWebServices/protein.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.219 - (download) (annotate)
Tue Jul 25 20:44:53 2006 UTC (13 years, 8 months ago) by hwang
Branch: MAIN
Changes since 1.218: +1 -0 lines
Added the line to see the changes to get pubmed journals

# -*- perl -*-
#
# Copyright (c) 2003-2006 University of Chicago and Fellowship
# for Interpretations of Genomes. All Rights Reserved.
#
# This file is part of the SEED Toolkit.
# 
# The SEED Toolkit is free software. You can redistribute
# it and/or modify it under the terms of the SEED Toolkit
# Public License. 
#
# You should have received a copy of the SEED Toolkit Public License
# along with this program; if not write to the University of Chicago
# at info@ci.uchicago.edu or the Fellowship for Interpretation of
# Genomes at veronika@thefig.info or download a copy from
# http://www.theseed.org/LICENSE.TXT.
#

my $sproutAvail = eval {
    require SproutFIG;
    require PageBuilder;
};

use warnings;
use strict;

use CGI qw(:standard);
use HTML::Template;
use Data::Dumper;

use FIG;
use FIG_Config;
use FIG_CGI;
use UserData;
use FigWebServices::SeedComponents;

eval {
    &main();
};

if($@) {
    print header(),start_html();
    print STDERR "EXCEPTION: $@\n";
    print "EXCEPTION: $@\n",end_html();
}

1;

sub main {
    # initialize fig object
    my ($fig, $cgi, $user) = FIG_CGI::init(debug_save   => 0,
					   debug_load   => 0,
					   print_params => 0);

    
    # check if an external page is to be displayed, called with data from seed
    if ($cgi->param('tool')) {
	
	my $user = $cgi->param('user');
	
	my $html = "";
	$html .= $cgi->header();

	my $parameters = { fig_object  => $fig,
			   peg_id      => $cgi->param('prot'),
			   table_style => 'plain',
			   fig_disk    => $FIG_Config::fig_disk . "/",
			   form_target => 'protein.cgi'
	};

	# write the seed header
	$html .= FigWebServices::SeedComponents::Framework::get_plain_header($parameters);
	$html .= "<br/>" . FigWebServices::SeedComponents::Protein::get_index_link() . "<br/><hr/>";

	# call the tool page
	$html .= & FigWebServices::SeedComponents::Basic::call_tool($fig, $cgi->param('prot'));

	$html .= "<hr/>" . FigWebServices::SeedComponents::Protein::get_index_link();

	$html .= $cgi->end_html();

	print $html;

    # check for the new framework
    } elsif ($cgi->param('new_framework')) {
	
	# display the new version
	my @out = `./frame.cgi`;
	print @out;
	exit;
	
    } else {
	
	# display the old version
	
	my $user = $cgi->param('user');
	
	my $html = "";
	$html .= $cgi->header();

	my $parameters = { fig_object  => $fig,
			   peg_id      => $cgi->param('prot'),
			   table_style => 'plain',
			   fig_disk    => $FIG_Config::fig_disk . "/",
			   form_target => 'protein.cgi'
	};

	my ($min, $max, $features) = FigWebServices::SeedComponents::Protein::get_region_data($parameters);
	$parameters->{min} = $min;
	$parameters->{max} = $max;
	$parameters->{features} = $features;
	
	$html .= FigWebServices::SeedComponents::Framework::get_plain_header($parameters);
	$html .= "<br/>" . FigWebServices::SeedComponents::Protein::get_index_link() . "<br/>";
	$html .= FigWebServices::SeedComponents::Framework::get_js_css_links();

	# check for request parameter
	my $request = $cgi->param("request") || "";

	# check for quick assign
	if ($request eq "fast_assign")            {
	    &FigWebServices::SeedComponents::Protein::make_assignment($fig,$cgi,$cgi->param('prot'));
	    $request = "";
	}

	if    ($request eq "view_annotations") {
	    $html .= &FigWebServices::SeedComponents::Protein::view_annotations($fig,$cgi,$cgi->param('prot'));
	} elsif ($request eq "view_all_annotations") {
	    $html .= &FigWebServices::SeedComponents::Protein::view_all_annotations($fig,$cgi,$cgi->param('prot'));
	} elsif ($request eq "show_coupling_evidence") { 
	    $html .= &FigWebServices::SeedComponents::Protein::show_coupling_evidence($fig,$cgi,$cgi->param('prot'));
	} elsif ($request eq "abstract_coupling") {
	    $html .= &FigWebServices::SeedComponents::Protein::show_abstract_coupling_evidence($fig,$cgi,$cgi->param('prot'));
	} elsif ($request eq "ec_to_maps") {
	    $html .= &FigWebServices::SeedComponents::Protein::show_ec_to_maps($fig,$cgi);
	} elsif ($request eq "link_to_map") {
	    $html .= &FigWebServices::SeedComponents::Protein::link_to_map($fig,$cgi);
	} elsif ($request eq "fusions") {
	    $html = &FigWebServices::SeedComponents::Protein::show_fusions($fig,$cgi,$cgi->param('prot'));
	}

	# otherwise show normal page
	else {

	    $html .= FigWebServices::SeedComponents::Protein::get_title($parameters);
	    $html .= FigWebServices::SeedComponents::Protein::get_current_assignment($parameters);
	    $html .= "<hr/>";
	    $html .= FigWebServices::SeedComponents::Protein::get_translation_link();
	    $html .= "<hr/>";
	    $html .= FigWebServices::SeedComponents::Protein::get_peg_view($parameters);
	    $html .= FigWebServices::SeedComponents::Protein::get_chromosome_context($parameters);
	    $parameters->{initial_value} = 'expanded';
	    $html .= FigWebServices::SeedComponents::Protein::get_subsystem_connections($parameters);
	    $parameters->{initial_value} = 'collapsed';
	    $html .= FigWebServices::SeedComponents::Protein::get_aa_sequence($parameters);
	    $parameters->{initial_value} = 'collapsed';
	    $html .= FigWebServices::SeedComponents::Protein::get_dna_sequence($parameters);
	    $parameters->{initial_value} = 'collapsed';
	    $html .= FigWebServices::SeedComponents::Protein::get_dna_sequence_adjacent($parameters);
	    $parameters->{initial_value} = 'expanded';
	    $html .= FigWebServices::SeedComponents::Protein::get_assignments_for_identical_proteins($parameters);
	    $parameters->{initial_value} = 'collapsed';
	    $html .= FigWebServices::SeedComponents::Protein::get_links($parameters);
	    $parameters->{initial_value} = 'collapsed';
	    $html .= FigWebServices::SeedComponents::Protein::get_functional_coupling($parameters);
	    $parameters->{initial_value} = 'collapsed';
	    $html .= FigWebServices::SeedComponents::Protein::get_attributes($parameters);
	    $parameters->{initial_value} = 'collapsed';
	    $html .= FigWebServices::SeedComponents::Protein::get_protein_families($parameters);
	    $html .= "<br/><hr/>";
	    $html .= FigWebServices::SeedComponents::Protein::get_compared_regions($parameters);
	    $html .= "<br/><hr/>";
	    $html .= FigWebServices::SeedComponents::Protein::get_pubmed_url($parameters);
	    $html .= FigWebServices::SeedComponents::Protein::get_similarities($parameters);
	    $html .= "<br/><hr/>";
	    $parameters->{noheadline} = 1;
	    $html .= FigWebServices::SeedComponents::Protein::get_tools($parameters);
	    $parameters->{noheadline} = undef;
	}

	$html .= "<br/><hr/>";
	$html .= FigWebServices::SeedComponents::Protein::get_index_link();
	
	print $html;
	print end_html();
    }
}

sub show_standard {

}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3