#!/usr/bin/env perl use strict; use Carp; use Pod::Usage; =head1 NAME cgiUniprotEntry.pl - cgi scripts to grep a uniprot AC and print a fasta with derivated sequence =head1 DESCRIPTION get a uniprot Entry in .dat format and display the derived sequence =head1 ARGUMENTS =head3 ac=string A uniprot accession code (to be retieved from http://www.expasy.org/uniprot/yourac.txt =head3 outputformat=(dat|fasta|html) The output format in which the entry is printed =head1 COPYRIGHT Copyright (C) 2004-2005 Geneva Bioinformatics www.genebio.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 AUTHORS Alexandre Masselot, www.genebio.com =cut $|=1; # flush immediately; BEGIN{ eval{ require DefEnv; DefEnv::read(); }; } END{ } my $isCGI; use CGI qw(:standard); if($isCGI){ use CGI::Carp qw(fatalsToBrowser warningsToBrowser); warningsToBrowser(1); } BEGIN{ $isCGI=$ENV{GATEWAY_INTERFACE}=~/CGI/; sub carp_error{ my $msg=shift; if ($isCGI){ my $q=new CGI; error($q, $msg); }else{ print STDERR $msg; } } CGI::Carp::set_message(\&carp_error) if $isCGI; sub error(){ my($q, $msg)=@_; # $q->header; print $q->start_html(-title=>"$0", -author=>'alexandre.masselot@genebio.com', -BGCOLOR=>'white'); print "
$msg\n"; $q->end_html; exit; } } use InSilicoSpectro::Databanks::DBEntryUniprot; use File::Basename; use CGI qw(:standard); my $query = new CGI; if($query->param('doc')){ print $query->header; while(){ print $_; } exit(0); } my $script=basename($0); my $help=$query->param('help'); if(defined $help){ print $query->header(-type=>'text/plain'); pod2usage(-verbose=>2, -exitval=>2, -output=>\*STDOUT); exit(0); } unless($query->param('ac')){ my %cookies=$query->cookie($script); my $outputformat=$cookies{outputformat}; my $ac=$cookies{ac}; print $query->header; # print $query->start_html(-title=>"$script", # -author=>'alexandre.masselot@genebio.com', # -script=>[ # { # -src => 'elementControl.js', # -language=> 'JavaScript', # } # ] # ); print <
| ID | ".$dbu->ID." |
| description | ".$dbu->description." |