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

Diff of /FigKernelPackages/FIG.pm

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

revision 1.78, Mon May 3 17:16:50 2004 UTC revision 1.79, Tue May 4 16:27:23 2004 UTC
# Line 5  Line 5 
5  use Blast;  use Blast;
6  use FIG_Config;  use FIG_Config;
7  use tree_utilities;  use tree_utilities;
8  #use Clearinghouse;  
9    #
10    # Conditionally evaluate this in case its prerequisites are not available.
11    #
12    
13    our $ClearinghouseOK = eval {
14        require Clearinghouse;
15    };
16    
17  use IO::Socket;  use IO::Socket;
18    
# Line 4932  Line 4939 
4939      return $genomes;      return $genomes;
4940  }  }
4941    
4942    sub get_clearinghouse
4943    {
4944        my($self, $url) = @_;
4945    
4946        if (defined($self->{_clearinghouse}))
4947        {
4948            return $self->{_clearinghouse};
4949        }
4950    
4951        if (!$ClearinghouseOK)
4952        {
4953            warn "Error: Clearinghouse code not available.\n";
4954            return undef;
4955        }
4956    
4957        if ($url eq "")
4958        {
4959            $url = "http://www-unix.mcs.anl.gov/~olson/SEED/api.cgi";
4960        }
4961    
4962        my $ch = new Clearinghouse($url);
4963        $self->{_clearinghouse} = $ch;
4964    
4965        return $ch;
4966    }
4967    
4968  sub publish_subsystem_to_clearinghouse  sub publish_subsystem_to_clearinghouse
4969  {  {
4970      my($self, $ssa, $url) = @_;      my($self, $ssa, $url) = @_;
4971    
4972      $ssa =~ s/ /_/g;      $ssa =~ s/ /_/g;
4973    
4974      #my $ch = new Clearinghouse($url);      my $ch = $self->get_clearinghouse($url);
4975      my $ch;  
4976        if (!defined($ch))
4977        {
4978            warn "Cannot publish: clearinghouse not available\n";
4979            return undef;
4980        }
4981    
4982      my($version, $curator, $pedigree, $roles) = $self->subsystem_info($ssa);      my($version, $curator, $pedigree, $roles) = $self->subsystem_info($ssa);
4983    
# Line 4972  Line 5010 
5010      my $package = join("", @$spreadsheet, @$notes);      my $package = join("", @$spreadsheet, @$notes);
5011      print "Sending...\n";      print "Sending...\n";
5012      $ch->upload_subsystem_package($url, $package);      $ch->upload_subsystem_package($url, $package);
5013    
5014        return 1;
5015  }  }
5016    
5017    

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3