Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/DB/XEMBLService.pm @ 0:1f6dce3d34e0
Uploaded
| author | mahtabm |
|---|---|
| date | Thu, 11 Apr 2013 02:01:53 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:1f6dce3d34e0 |
|---|---|
| 1 # | |
| 2 # $Id: XEMBLService.pm,v 1.3 2002/10/22 07:38:29 lapp Exp $ | |
| 3 # | |
| 4 # BioPerl module for Bio::DB::XEMBLService | |
| 5 # | |
| 6 # Cared for by Lincoln Stein <lstein@cshl.org> | |
| 7 # | |
| 8 # Copyright Lincoln Stein | |
| 9 # | |
| 10 # You may distribute this module under the same terms as perl itself | |
| 11 | |
| 12 # POD documentation - main docs before the code | |
| 13 | |
| 14 =head1 NAME | |
| 15 | |
| 16 Bio::DB::XEMBLService - SOAP service definition for XEMBL | |
| 17 | |
| 18 =head1 SYNOPSIS | |
| 19 | |
| 20 #usage | |
| 21 | |
| 22 =head1 DESCRIPTION | |
| 23 | |
| 24 SOAP service definition for XEMBL. | |
| 25 | |
| 26 =head1 FEEDBACK | |
| 27 | |
| 28 =head2 Mailing Lists | |
| 29 | |
| 30 User feedback is an integral part of the evolution of this and other | |
| 31 Bioperl modules. Send your comments and suggestions preferably to one | |
| 32 of the Bioperl mailing lists. Your participation is much appreciated. | |
| 33 | |
| 34 bioperl-l@bioperl.org - General discussion | |
| 35 http://bio.perl.org/MailList.html - About the mailing lists | |
| 36 | |
| 37 =head2 Reporting Bugs | |
| 38 | |
| 39 Report bugs to the Bioperl bug tracking system to help us keep track | |
| 40 the bugs and their resolution. | |
| 41 Bug reports can be submitted via email or the web: | |
| 42 | |
| 43 bioperl-bugs@bio.perl.org | |
| 44 http://bugzilla.bioperl.org/ | |
| 45 | |
| 46 =head1 AUTHOR - Lincoln Stein | |
| 47 | |
| 48 Email lstein@cshl.org | |
| 49 | |
| 50 =head1 APPENDIX | |
| 51 | |
| 52 The rest of the documentation details each of the object | |
| 53 methods. Internal methods are usually preceded with a _ | |
| 54 | |
| 55 =cut | |
| 56 | |
| 57 | |
| 58 | |
| 59 package Bio::DB::XEMBLService; | |
| 60 | |
| 61 # -- generated by SOAP::Lite (v0.51) for Perl -- soaplite.com -- Copyright (C) 2000-2001 Paul Kulchenko -- | |
| 62 # -- generated from http://www.ebi.ac.uk/xembl/XEMBL.wsdl [Sat Jan 26 14:47:29 2002] | |
| 63 | |
| 64 my %methods = ( | |
| 65 getNucSeq => { | |
| 66 endpoint => 'http://www.ebi.ac.uk:80/cgi-bin/xembl/XEMBL-SOAP.pl', | |
| 67 soapaction => 'http://www.ebi.ac.uk/XEMBL#getNucSeq', | |
| 68 uri => 'http://www.ebi.ac.uk/XEMBL', | |
| 69 parameters => [ | |
| 70 SOAP::Data->new(name => 'format', type => 'xsd:string', attr => {}), | |
| 71 SOAP::Data->new(name => 'ids', type => 'xsd:string', attr => {}), | |
| 72 ], | |
| 73 }, | |
| 74 ); | |
| 75 | |
| 76 use SOAP::Lite; | |
| 77 use Exporter; | |
| 78 use Carp (); | |
| 79 | |
| 80 use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS); | |
| 81 @ISA = qw(Exporter SOAP::Lite); | |
| 82 @EXPORT_OK = (keys %methods); | |
| 83 %EXPORT_TAGS = ('all' => [@EXPORT_OK]); | |
| 84 | |
| 85 no strict 'refs'; | |
| 86 for my $method (@EXPORT_OK) { | |
| 87 my %method = %{$methods{$method}}; | |
| 88 *$method = sub { | |
| 89 my $self = UNIVERSAL::isa($_[0] => __PACKAGE__) | |
| 90 ? ref $_[0] ? shift # OBJECT | |
| 91 # CLASS, either get self or create new and assign to self | |
| 92 : (shift->self || __PACKAGE__->self(__PACKAGE__->new)) | |
| 93 # function call, either get self or create new and assign to self | |
| 94 : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new)); | |
| 95 $self->proxy($method{endpoint} || Carp::croak "No server address (proxy) specified") unless $self->proxy; | |
| 96 my @templates = @{$method{parameters}}; | |
| 97 my $som = $self | |
| 98 -> endpoint($method{endpoint}) | |
| 99 -> uri($method{uri}) | |
| 100 -> on_action(sub{qq!"$method{soapaction}"!}) | |
| 101 -> call($method => map {shift(@templates)->value($_)} @_); | |
| 102 UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result | |
| 103 : $som; | |
| 104 } | |
| 105 } | |
| 106 | |
| 107 1; |
