[Bio] / FigKernelPackages / FFserver.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FFserver.pm

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

revision 1.2, Thu Apr 30 20:33:41 2009 UTC revision 1.3, Thu May 7 22:07:13 2009 UTC
# Line 2  Line 2 
2  package FFserver;  package FFserver;
3    
4  use LWP::UserAgent;  use LWP::UserAgent;
 use FIG_Config;  
5  use Data::Dumper;  use Data::Dumper;
6    use YAML;
7    
8  use strict;  use strict;
9    
# Line 11  Line 11 
11  {  {
12      my($class, $server_url) = @_;      my($class, $server_url) = @_;
13    
14      $server_url = $FIG_Config::FFserver_url unless $server_url;      $server_url = "http://servers.nmpdr.org/figfam/server.cgi" unless $server_url;
     $server_url = "http://bio-macpro-1.mcs.anl.gov/~disz/FIG/figfam_server.cgi" unless $server_url;  
15    
16    
17      my $self = {      my $self = {
# Line 23  Line 22 
22      return bless $self, $class;      return bless $self, $class;
23  }  }
24    
25    sub members_of_families
26    {
27        my($self, @ids) = @_;
28        my $form = [ (map  { (id => $_)  } @ids), function => 'members_of_families'];
29        return $self->run_query_form($form);
30    }
31    
32    sub run_query_form
33    {
34        my($self, $form) = @_;
35    
36        my $res = $self->{ua}->post($self->{server_url}, $form);
37    
38        if ($res->is_success)
39        {
40            return Load($res->content);
41        }
42        else
43        {
44            die "error on post " . $res->content;
45        }
46    }
47    
48  sub assign_function_to_prot  sub assign_function_to_prot
49  {  {
50      my($self, $input) = @_;      my($self, $input) = @_;
# Line 56  Line 78 
78          $wq = FastaWorkQueue->new($input);          $wq = FastaWorkQueue->new($input);
79      }      }
80    
81      return ResultHandler->new($wq, $self->{server_url}, 'assign_function_to_DNA', \&id_seq_pair_bundler, \&tab_delimited_dna_data_output_parser);      return ResultHandler->new($wq, $self->{server_url}, 'assign_functions_to_DNA', \&id_seq_pair_bundler, \&tab_delimited_output_parser);
82  }  }
83    
84  sub id_seq_pair_bundler  sub id_seq_pair_bundler
# Line 130  Line 152 
152              }              }
153              else              else
154              {              {
155                  die "error on post " . $res->content;                  die "error " . $res->status_line . " on post " . $res->content;
156              }              }
157          }          }
158          else          else

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3