Permalink
Browse files

Client side code remapped to new Biocorba 0.2 and improved SeqI inter…

…face

svn path=/bioperl-corba-client/trunk/; revision=28
  • Loading branch information...
1 parent f07222f commit 55063edfc587e7cee406a03ebfc518371dad8421 @hyphaltip hyphaltip committed Feb 8, 2001
View
@@ -1,4 +1,4 @@
-
+# $Id$
#
# BioPerl module for Bio::CorbaClient::Base
#
@@ -33,20 +33,19 @@ so we can throw nicely.
=head2 Mailing Lists
-User feedback is an integral part of the evolution of this
-and other Bioperl modules. Send your comments and suggestions preferably
- to one of the Bioperl mailing lists.
-Your participation is much appreciated.
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to one
+of the Bioperl mailing lists. Your participation is much appreciated.
- bioperl-l@bio.perl.org - General discussion
- bioperl-guts-l@bio.perl.org - Technically-oriented discussion
- http://bio.perl.org/MailList.html - About the mailing lists
+ bioperl-l@bioperl.org - General Bioperl discussion
+ biocorba-l@biocorba.org - General Biocorba discussion
+ http://www.bioperl.org/MailList.html - About the bioperl mailing list
+ http://www.biocorba.org/MailList.shtml - About the biocorba mailing list
=head2 Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track
- the bugs and their resolution.
- Bug reports can be submitted via email or the web:
+the bugs and their resolution. Bug reports can be submitted via email or the web:
bioperl-bugs@bio.perl.org
http://bio.perl.org/bioperl-bugs/
@@ -76,9 +75,11 @@ use Bio::Root::RootI;
@ISA = qw(Bio::Root::RootI);
sub new {
- my ($class,$corbaref) = @_;
+ my ($class,@args) = @_;
+
+ my $self = $class->SUPER::new(@args);
+ my ($corbaref) = $self->_rearrange([qw(CORBAREF)],@args);
- my $self = bless {}, $class;
if( defined $corbaref ) {
$self->corbaref($corbaref);
}
View
@@ -1,4 +1,4 @@
-
+# $Id$
#
# BioPerl module for Bio::CorbaClient::Client
#
@@ -35,14 +35,14 @@ This object provides BioCorba object creation support.
=head2 Mailing Lists
-User feedback is an integral part of the evolution of this
-and other Bioperl modules. Send your comments and suggestions preferably
- to one of the Bioperl mailing lists.
-Your participation is much appreciated.
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to one
+of the Bioperl mailing lists. Your participation is much appreciated.
- bioperl-l@bio.perl.org - General discussion
- bioperl-guts-l@bio.perl.org - Technically-oriented discussion
- http://bio.perl.org/MailList.html - About the mailing lists
+ bioperl-l@bioperl.org - General Bioperl discussion
+ biocorba-l@biocorba.org - General Biocorba discussion
+ http://www.bioperl.org/MailList.html - About the bioperl mailing list
+ http://www.biocorba.org/MailList.shtml - About the biocorba mailing list
=head2 Reporting Bugs
@@ -57,46 +57,45 @@ Report bugs to the Bioperl bug tracking system to help us keep track
Email jason@chg.mc.duke.edu
-
=head1 APPENDIX
-The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
+The rest of the documentation details each of the object
+methods. Internal methods are usually preceded with a _
=cut
# object code begins
package Bio::CorbaClient::Client;
-use vars qw($AUTOLOAD @ISA);
+use vars qw(@ISA);
use strict;
use CORBA::ORBit idl => [ 'biocorba.idl' ];
-use Bio::Root::Object;
-use Bio::CorbaServer::Base;
-
-
-@ISA = qw ( Bio::Root::Object );
+use Bio::Root::RootI;
-sub _initialize {
+@ISA = qw ( Bio::Root::RootI );
- my ( $self, @args ) = @_;
+sub new {
+ my ( $class, @args ) = @_;
+ my $self = $class->SUPER::new(@args);
my ( $idl, $ior, $orbname ) = $self->_rearrange( [ qw(IDL IOR ORBNAME)],
@args);
- $self->{_ior} = $ior || $self->throw("must provide an ior file to open");
- $self->{_idl} = $idl || 'biocorba.idl';
- $self->{_orbname} = $orbname || 'orbit-local-orb';
+ $self->{'_ior'} = $ior || $self->throw("must provide an ior file to open");
+ $self->{'_idl'} = $idl || 'biocorba.idl';
+ $self->{'_orbname'} = $orbname || 'orbit-local-orb';
my $orb = CORBA::ORB_init($orbname);
- open( IOR, $self->{_ior}) || $self->throw("cannot open ior file " . $self->{_ior});
+ open( IOR, $self->{'_ior'}) || $self->throw("cannot open ior file " .
+ $self->{'_ior'});
my $iorfile = <IOR>;
chomp($iorfile);
- $self->{_orb} = $orb;
- $self->{_iorfile} = $iorfile;
+ $self->{'_orb'} = $orb;
+ $self->{'_iorfile'} = $iorfile;
return $self;
}
@@ -114,11 +113,14 @@ sub new_object {
return undef;
}
$args = [ () ] if( !defined $args );
- $obj = $objectname->new( $self->{_orb}->string_to_object($self->{_iorfile}), @$args );
+ my $ior = $self->{'_iorfile'};
+ $obj = $objectname->new( '-corbaref' =>
+ $self->{'_orb'}->string_to_object($ior),
+ @$args );
if( @$ || !defined $obj ) {
$self->throw("Cannot instantiate object of type $objectname");
}
- push @{$self->{_clientobjs}}, $obj;
+ push @{$self->{'_clientobjs'}}, $obj;
return $obj;
}
View
@@ -1,5 +1,4 @@
-
-
+# $Id$
#
# BioPerl module for Bio::CorbaClient::ORB
#
@@ -30,27 +29,28 @@ happens.
=head2 Mailing Lists
-User feedback is an integral part of the evolution of this
-and other Bioperl modules. Send your comments and suggestions preferably
- to one of the Bioperl mailing lists.
-Your participation is much appreciated.
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to one
+of the Bioperl mailing lists. Your participation is much appreciated.
- bioperl-l@bio.perl.org - General discussion
- bioperl-guts-l@bio.perl.org - Technically-oriented discussion
- http://bio.perl.org/MailList.html - About the mailing lists
+ bioperl-l@bioperl.org - General Bioperl discussion
+ biocorba-l@biocorba.org - General Biocorba discussion
+ http://www.bioperl.org/MailList.html - About the bioperl mailing list
+ http://www.biocorba.org/MailList.shtml - About the biocorba mailing list
=head2 Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track
- the bugs and their resolution.
- Bug reports can be submitted via email or the web:
+the bugs and their resolution. Bug reports can be submitted via email
+or the web:
bioperl-bugs@bio.perl.org
http://bio.perl.org/bioperl-bugs/
-=head1 AUTHOR - Ewan Birney
+=head1 AUTHOR - Ewan Birney, Jason Stajich
Email birney@ebi.ac.uk
+ jason@chg.mc.duke.edu
Describe contact details here
@@ -60,10 +60,8 @@ The rest of the documentation details each of the object methods. Internal metho
=cut
-
# Let the code begin...
-
package Bio::CorbaClient::ORB;
use CORBA::ORBit idl => [ 'biocorba.idl' ];
@@ -73,7 +71,6 @@ sub get_orb {
if( !defined $orb ) {
$orb = CORBA::ORB_init("orbit-local-orb");
}
-
return $orb;
}
@@ -1,4 +1,4 @@
-
+# $Id$
#
# BioPerl module for Bio::CorbaClient::PrimarySeq.pm
#
@@ -16,6 +16,7 @@ Bio::CorbaClient::PrimarySeq.pm - Wrapper to make Biocorba PrimarySeq
=head1 SYNOPSIS
+Describe usage here.
=head1 DESCRIPTION
@@ -26,50 +27,81 @@ PrimarySeq. It does not have to do a great deal...
=head2 Mailing Lists
-User feedback is an integral part of the evolution of this
-and other Bioperl modules. Send your comments and suggestions preferably
- to one of the Bioperl mailing lists.
-Your participation is much appreciated.
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to one
+of the Bioperl mailing lists. Your participation is much appreciated.
- bioperl-l@bio.perl.org - General discussion
- bioperl-guts-l@bio.perl.org - Technically-oriented discussion
- http://bio.perl.org/MailList.html - About the mailing lists
+ bioperl-l@bioperl.org - General Bioperl discussion
+ biocorba-l@biocorba.org - General Biocorba discussion
+ http://www.bioperl.org/MailList.html - About the bioperl mailing list
+ http://www.biocorba.org/MailList.shtml - About the biocorba mailing list
=head2 Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track
- the bugs and their resolution.
- Bug reports can be submitted via email or the web:
+the bugs and their resolution. Bug reports can be submitted via email
+or the web:
bioperl-bugs@bio.perl.org
http://bio.perl.org/bioperl-bugs/
-=head1 AUTHOR - Ewan Birney
+=head1 AUTHOR - Ewan Birney, Jason Stajich
Email birney@ebi.ac.uk
+ jason@chg.mc.duke.edu
Describe contact details here
=head1 APPENDIX
-The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
+The rest of the documentation details each of the object
+methods. Internal methods are usually preceded with a _
=cut
-
# Let the code begin...
-
package Bio::CorbaClient::PrimarySeq;
-use vars qw($AUTOLOAD @ISA);
+use vars qw(@SEQTYPES @ISA);
use strict;
-
use Bio::CorbaClient::Base;
use Bio::PrimarySeqI;
@ISA = qw(Bio::CorbaClient::Base Bio::PrimarySeqI);
+BEGIN { @SEQTYPES = qw(PROTEIN DNA RNA) }
+
+=head2 is_circular
+
+ Title : is_circular
+ Usage : my $circular = $seq->is_circular
+ Function: return whether or not this sequence is circular
+ Returns : boolean
+ Args : none
+
+=cut
+
+sub is_circular {
+ my ($self) = @_;
+ return $self->corbaref->is_circular();
+}
+
+=head2 length
+
+ Title : length
+ Usage : $len = $seq->length
+ Function: return sequence length
+ Returns : (long) sequence length
+ Args : none
+
+=cut
+
+sub length {
+ my ($self ) = @_;
+ return $self->corbaref->length();
+}
+
=head2 seq
Title : seq
@@ -87,7 +119,7 @@ sub seq {
$self->warn("Attempting to set the value of a primary seq when it is a corba object. You will need to make an in-memory copy");
}
- return $self->corbaref->get_seq();
+ return $self->corbaref->seq();
}
=head2 subseq
@@ -103,8 +135,7 @@ sub seq {
sub subseq {
my($self,$start,$end) = @_;
-
- return $self->corbaref->get_subseq($start,$end);
+ return $self->corbaref->subseq($start,$end);
}
=head2 display_id
@@ -187,10 +218,24 @@ sub moltype {
if( defined $val ) {
$self->warn("Attempting to set the value of a primary seq when it is a corba object. You will need to make an in-memory copy");
}
- my $t = lc $self->corbaref->type();
+ my $t = lc $SEQTYPES[$self->corbaref->type()];
return $t if( $t eq 'protein' || $t eq 'rna' );
return 'dna';
+}
+
+=head2 version
+
+ Title : version
+ Usage : $seq->version
+ Function: return (unstable) sequence version
+ Returns : (long) version
+ Args : none
+
+=cut
+sub version {
+ my ($self ) = @_;
+ return $self->corbaref->version;
}
Oops, something went wrong.

0 comments on commit 55063ed

Please sign in to comment.