[Bio] / FigKernelScripts / to_prodom.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/to_prodom.pl

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

revision 1.1, Thu Jun 1 16:11:26 2006 UTC revision 1.2, Tue Jun 6 03:10:49 2006 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use CGI qw(:standard);  #use CGI qw(:standard);
5  use CGI::Carp qw(warningsToBrowser fatalsToBrowser);  #use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
6  use Data::Dumper;  use Data::Dumper;
7  use LWP;  use LWP;
8  use HTTP::Request::Common;  use HTTP::Request::Common;
# Line 10  Line 11 
11    
12  my $fig = new FIG;  my $fig = new FIG;
13  my $user_agent = LWP::UserAgent->new;  my $user_agent = LWP::UserAgent->new;
14    my $usage = "usage: to_prodom [peg pegID]";
15    my @arguments_in;
16    my $arguments_in;
17    my $temp;
18    
19  if (@ARGV < 1) {  if (@ARGV > 0)
20      die "A PegID was not provided. usage: to_prodom.pl PegID";  {
21        @arguments_in = @ARGV;
22    }
23    else
24    {
25        die $usage;
26      }      }
27    
28  print header;  my %arg_pairs = ();
29  my $peg = $ARGV[0];  
30    foreach (@arguments_in)
31    {
32        my ($name,$val) = split(/\t/,$_);
33        $arg_pairs{$name} = $val;
34    }
35    
36    my @keys = keys %arg_pairs;
37    
38    my $peg = $arg_pairs{'peg'};
39    
 $peg =~ s/peg\=//g;  
40  $peg =~ s/\%7C/\|/g;  $peg =~ s/\%7C/\|/g;
41    
42    
43  my $seq = $fig->get_translation($peg);  my $seq = $fig->get_translation($peg);
44  my @aliases=$fig->feature_aliases($peg);  my @aliases=$fig->feature_aliases($peg);
45    
# Line 32  Line 52 
52  # Order of importance is sp, tr, uni  # Order of importance is sp, tr, uni
53    
54  my @all_ids;  my @all_ids;
   
55  &add_to_array (\@uni_ids);  &add_to_array (\@uni_ids);
56  &add_to_array (\@tr_ids);  &add_to_array (\@tr_ids);
57  &add_to_array (\@sp_ids);  &add_to_array (\@sp_ids);
58    
59    
60  foreach (@all_ids) {  foreach (@all_ids) {
61    
62      &to_prodom_by_id($_);      &to_prodom_by_id($_);
63  }  }
64    
65    
66  # If made it this far, use sequence to get the Prodom website  # If made it this far, use sequence to get the Prodom website
67  &to_prodom_by_seq;  
68    #&to_prodom_by_seq;
69    
70  ###############  ###############
71  # Subroutines  # Subroutines
# Line 84  Line 106 
106              my $result = $response->content;              my $result = $response->content;
107              # Replace relative paths with absolute paths              # Replace relative paths with absolute paths
108              $result =~ s/\.\./http:\/\/prodes\.toulouse\.inra\.fr\/prodom\/current\//g;              $result =~ s/\.\./http:\/\/prodes\.toulouse\.inra\.fr\/prodom\/current\//g;
109    
110                #Get rid of css reference because it breaks the FIG header
111                $result =~ s/<link rel=.*?>//g;
112              print $result;              print $result;
113              exit;              exit;
114          }          }
# Line 110  Line 135 
135      my $result = $response->content;      my $result = $response->content;
136      # Replace relative paths with absolute paths      # Replace relative paths with absolute paths
137      $result =~ s/\.\./http:\/\/prodes\.toulouse\.inra\.fr\/prodom\/current\//g;      $result =~ s/\.\./http:\/\/prodes\.toulouse\.inra\.fr\/prodom\/current\//g;
138        $result =~ s/<link rel=.*?>//g;
139      print $result;      print $result;
140    
141  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3