Bio::CorbaServer PrimarySeq
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::CorbaServer::PrimarySeq - PrimarySeq server bindings
Package variables
No package variables defined.
Included modules
Bio::CorbaServer::Base
Inherit
Bio::CorbaServer::Base POA_bsane::seqcore::AnonymousSequence
Synopsis
    # get a Bio::CorbaServer::PrimarySeq somehow
my $seqstring = $seq->seq;
Description
This object represents the binding of the Primary Sequence
object in Bioperl to the BioCorba object. This is pretty
simple as the objects are almost identical
Methods
new
No description
Code
get_typeDescriptionCode
is_circularDescriptionCode
get_lengthDescriptionCode
seqDescriptionCode
sub_seqDescriptionCode
_seqDescriptionCode
max_request_lengthDescriptionCode
get_idDescriptionCode
get_nameDescriptionCode
get_descriptionDescriptionCode
get_basisDescriptionCode
Methods description
get_typecode    nextTop
 Title   : get_type
Usage : my $type = $self->get_type();
Function: Return the type of the biological sequence, e.g. PROTEIN,
RNA, DNA,
Returns : type [ PROTEIN, RNA, DNA]
Args : [optional] type to set for this sequence
is_circularcodeprevnextTop
 Title   : is_circular
Usage : $obj->is_circular()
Function: Return whether the biological sequence is circular or linear
Example :
Returns : boolean
Args : value to set (non zero is true)
get_lengthcodeprevnextTop
 Title   : get_length
Usage : my $len = $obj->get_length
Function: returns length of biological sequence
Returns : long
Args : none
seqcodeprevnextTop
 Title   : seq
Usage : my $seqstr = $obj->seq
Function: biological sequence as a string
Returns : string representing sequence contained
Args : none
sub_seqcodeprevnextTop
 Title   : sub_seq
Usage : $self->sub_seq($begin,$end)
Function: obtains a subsequence of the biological sequence as a string
Returns : subseq of sequence beginning at start finishing at end
Args : start - start point of substring to obtain (sequence start at 1)
end - end point of substring to obtain
_seqcodeprevnextTop
 Title   : _seq
Usage : get/set seq reference
Function:
Example : $self->_seq($new_seq)
Returns : reference to underlying contained seq object
Args : [optional] new-value
max_request_lengthcodeprevnextTop
 Title   : max_request_length
Usage :
Function:
Example :
Returns :
Args :
get_idcodeprevnextTop
 Title   : get_id
Usage : my $id = $seq->accession();
Function: Retrieve a sequence id (accession number)
Returns : string
Args : none
get_namecodeprevnextTop
 Title   : get_name
Usage : my $name = $seq->get_name();
Function: Retrieves a sequence name
Returns : string
Args : nonex
get_descriptioncodeprevnextTop
 Title   : get_description
Usage : my $desc = $seq->get_description();
Function: Retrieves the description for this sequence
Returns : string
Args : none
get_basiscodeprevnextTop
 Title   : get_basis
Usage : my $basis = $seq->get_basis
Function: Retrieves the basis this sequence is from (always experimental)
Returns : numeric
Args : none
Methods code
newdescriptionprevnextTop
sub new {
    my ($class, @args) = @_;
    my $self = $class->SUPER::new(@args);
    my ($seq) = $self->_rearrange([qw(SEQ)],@args);

    if( ! defined $seq || !ref $seq || ! $seq->isa('Bio::PrimarySeqI') ) {
	$seq = '' if( !defined $seq );
	$self->throw($class ." got a non sequence [$seq] for server object");
    }
    $self->_seq($seq);
    $self->is_circular(0);  
    return $self;
}
get_typedescriptionprevnextTop
sub get_type {
    my $self = shift;
    # this returns a string representing the alphabet
my $moltype = uc $self->_seq->alphabet; if( $moltype eq 'DNA' ) { return 1; } elsif ( $moltype eq 'RNA' ) { return 2; } elsif ( $moltype =~ /PROT/i ) { return 0; } else { return -1; }
}
is_circulardescriptionprevnextTop
sub is_circular {
    my ($self,$value) = @_;
    if( defined $value ) {
	$self->{'_circular'} = $value;
    }
    return defined $self->{'_circular'} && $self->{'_circular'} ? 1 : 0;
}
get_lengthdescriptionprevnextTop
sub get_length {
    my $self = shift;
    return $self->_seq->length();
}
seqdescriptionprevnextTop
sub seq {
    my $self = shift;
    my $seqstr = $self->_seq->seq;

    return $seqstr;
}
sub_seqdescriptionprevnextTop
sub sub_seq {
    my ($self,$start,$end) = @_;
    if( !defined $end || !defined $start || ($end < $start) ) {
	$start = '' if( !defined $start);
	$end = '' if( !defined $end);
	throw bsane::OutOfBounds
	    (reason=>"start is not before end ($start,$end)");
    } elsif( ($end - $start ) > $self->max_request_length ) {
	throw bsane::RequestTooLarge
	    (reason=> ($end-$start) . " is larger than max request length", 
	     suggested_size=>$self->max_request_length);
    } 

    my $seqstr;
    eval {
	$seqstr = $self->_seq->subseq($start,$end);
    };
    if( $@ ) {	
	throw bsane::OutOfRange(reason=>$@);
    } 
    
    return $seqstr;
}
_seqdescriptionprevnextTop
sub _seq {
    my ($self,$value) = @_;
    if( defined $value) {	
	$self->{'_seqobj'} = $value;
    }
    return $self->{'_seqobj'};
}
max_request_lengthdescriptionprevnextTop
sub max_request_length {
   my ($self,@args) = @_;

   return 100000;
}
get_iddescriptionprevnextTop
sub get_id {
   my ($self) = @_;
   return $self->_seq->accession || $self->_seq->display_id();
}
get_namedescriptionprevnextTop
sub get_name {
   my ($self) = @_;
   return $self->_seq->display_id();
}
get_descriptiondescriptionprevnextTop
sub get_description {
   my ($self,@args) = @_;
   return $self->_seq->desc();
}
get_basisdescriptionprevnextTop
sub get_basis {
   my ($self) = @_;
   return 1; # 1 is experimental
} 1;
}
General documentation
FEEDBACKTop
Mailing ListsTop
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@bioperl.org                 - BioPerl discussion
biocorba-l@biocorba.org - BioCorba discussion
http://www.bioperl.org/MailList.html - About the BioPerl mailing list
http://www.biocorba.org/MailList.html - About the BioCorba mailing list
Reporting BugsTop
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:
  bioperl-bugs@bio.perl.org
http://bio.perl.org/bioperl-bugs/
AUTHOR - Ewan Birney, Jason StajichTop
Email birney@ebi.ac.uk
jason@bioperl.org
APPENDIXTop
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
AnonymousSeq MethodsTop
Private MethodsTop
Private Methods local to this module
Identifiable interfaceTop