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

Diff of /FigWebServices/link.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Thu Mar 15 19:19:30 2007 UTC revision 1.6, Wed Feb 27 02:05:39 2008 UTC
# Line 2  Line 2 
2    
3  =head1 Protein Page Link  =head1 Protein Page Link
4    
5  This is a simple redirection script that takes a feature name as input and opens  This is a simple redirection script that takes a string as input and opens
6  the appropriate protein page. The feature name can be a FIG feature ID or  the appropriate page.
 an external alias.  
7    
8  This script supports the following CGI query parameters.  This script supports the following CGI query parameters.
9    
# Line 13  Line 12 
12  =item id  =item id
13    
14  ID of the desired feature. This can be a FIG ID or an alias. If it is preceded  ID of the desired feature. This can be a FIG ID or an alias. If it is preceded
15  by C<nmpdr|>, then we will try to force the Sprout protein page. If it is preceded  by C<nmpdr|>, then we will try to force the Sprout protein page.
16  by C<sv|>, then we will try to force the Seed Viewer.  
17    =item sop
18    
19    ID of a procedure in the SEED wiki.
20    
21  =back  =back
22    
# Line 30  Line 32 
32  my $cgi = CGI->new();  my $cgi = CGI->new();
33  ETracing($cgi);  ETracing($cgi);
34  eval {  eval {
35      #check for SOP      # Get the possible IDs.
36      my $sopID = $cgi->param('sop');      my $sopID = $cgi->param('sop');
37        my $genomeID = $cgi->param('genome');
38        my $pegID = $cgi->param('id');
39      if ($sopID) {      if ($sopID) {
40            # This is for the annotation SOP.
41          if ($sopID =~ /SOP010/i) {          if ($sopID =~ /SOP010/i) {
42                  $url = "http://www.theseed.org/w/images/2/23/Annotation_sop.pdf";                  $url = "http://www.theseed.org/w/images/2/23/Annotation_sop.pdf";
                 print $cgi->redirect(-uri => $url);  
43          } else {          } else {
44                  Confess("Invalid SOP number");                  Confess("Invalid SOP number");
45          }          }
46        } elsif ($genomeID) {
47      } else {          # Here we have an organism ID.
48      # Get the protein ID.          my $escapedID = uri_escape($genomeID);
49      my $pegID = $cgi->param('id');          $url = "$FIG_Config::nmpdr_site_url/FIG/seedviewer.cgi?page=BrowseGenome&organism=$escapedID";
50      if (! $pegID) {      } elsif ($pegID) {
51          # No protein ID, so we fail.          # Here we have a PEG ID.
         Confess("No ID specified.");  
     } else {  
         # The code will compute a redirection URL and put it in the variable below.  
         # Check for an NMPDR or SEED viewer ID.  
         if ($pegID =~ /^nmpdr\|(.+)$/) {  
             # Escape the PEG found.  
52              my $escapedID = uri_escape($1);              my $escapedID = uri_escape($1);
53              # If we have an NMPDR defined, use it.          $url = "$FIG_Config::nmpdr_site_url/FIG/seedviewer.cgi?page=Annotation&feature=$escapedID"
             if ($FIG_Config::nmpdr_site_url) {  
                 $url = "$FIG_Config::nmpdr_site_url/FIG/protein.cgi?SPROUT=1;prot=$escapedID";  
             } else {  
                 # No NMPDR, so we ask for a protein page.  
                 $url = "protein.cgi?prot=$escapedID";  
             }  
54          } else {          } else {
55              # Go to a protein page, but try to decide whether we should be SEED or Sprout.          Confess("Unrecognized identifier.");
             my $mode = $cgi->param('SPROUT');  
             if (! defined $mode) {  
                 $mode = ($FIG_Config::nmpdr_site_url ? 1 : 0);  
             }  
             my $escapedID = uri_escape($pegID);  
             $url = "protein.cgi?prot=$escapedID;SPROUT=$mode";  
56          }          }
57          print $cgi->redirect(-uri => $url);          print $cgi->redirect(-uri => $url);
     }  
     }  
58  };  };
59  if ($@) {  if ($@) {
60      # Get the error message.      # Get the error message.

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3