Bio::Ontology
GOterm
Toolbar
Summary
Bio::Ontology::GOterm - representation of GO terms
Package variables
No package variables defined.
Inherit
Synopsis
$term = Bio::Ontology::GOterm->new
( -go_id => "GO:0016847",
-name => "1-aminocyclopropane-1-carboxylate synthase",
-definition => "Catalysis of ...",
-is_obsolete => 0,
-comment => "" );
$term->add_definition_references( @refs );
$term->add_secondary_GO_ids( @ids );
$term->add_aliases( @aliases );
foreach my $dr ( $term->each_definition_reference() ) {
print $dr, "\n";
}
# etc.
Description
This is "dumb" class for GO terms (it provides no functionality
related to graphs). Implements Bio::Ontology::TermI.
Methods
Methods description
Title : new Usage : $term = Bio::Ontology::GOterm->new( -go_id => "GO:0016847", -name => "1-aminocyclopropane-1-carboxylate synthase", -definition => "Catalysis of ...", -is_obsolete => 0, -comment => "" ); Function: Creates a new Bio::Ontology::GOterm. Returns : A new Bio::Ontology::GOterm object. Args : -go_id => the goid of this GO term [GO:nnnnnnn] or [nnnnnnn] (nnnnnnn is a zero-padded integer of seven digits) -name => the name of this GO term [scalar] -definition => the definition of this GO term [scalar] -ontology => the ontology for this term (a Bio::Ontology::OntologyI compliant object) -version => version information [scalar] -is_obsolete => the obsoleteness of this GO term [0 or 1] -comment => a comment [scalar] |
Title : init() Usage : $term->init(); Function: Initializes this GOterm to all "" and empty lists. Returns : Args : |
Title : GO_id Usage : $term->GO_id( "GO:0003947" ); or print $term->GO_id(); Function: Set/get for the goid of this GO term.
This is essentially an alias to identifier(), with added
format checking.
Returns : The goid [GO:nnnnnnn].
Args : The goid [GO:nnnnnnn] or [nnnnnnn] (nnnnnnn is a
zero-padded integer of seven digits) (optional). |
Title : get_secondary_GO_ids Usage : @ids = $term->get_secondary_GO_ids(); Function: Returns a list of secondary goids of this Term.
This is aliased to remove_secondary_ids().
Returns : A list of secondary goids [array of [GO:nnnnnnn]]
(nnnnnnn is a zero-padded integer of seven digits).
Args : |
Title : add_secondary_GO_id Usage : $term->add_secondary_GO_id( @ids ); or $term->add_secondary_GO_id( $id ); Function: Pushes one or more secondary goids into the list of secondary goids.
This is aliased to remove_secondary_ids().
Returns :
Args : One secondary goid [GO:nnnnnnn or nnnnnnn] or a list
of secondary goids [array of [GO:nnnnnnn or nnnnnnn]]
(nnnnnnn is a zero-padded integer of seven digits). |
Title : remove_secondary_GO_ids() Usage : $term->remove_secondary_GO_ids(); Function: Deletes (and returns) the secondary goids of this Term.
This is aliased to remove_secondary_ids().
Returns : A list of secondary goids [array of [GO:nnnnnnn]]
(nnnnnnn is a zero-padded integer of seven digits).
Args : |
Title : to_string() Usage : print $term->to_string(); Function: to_string method for GO terms. Returns : A string representation of this GOterm. Args : |
Methods code
sub new
{
my( $class,@args ) = @_;
my $self = $class->SUPER::new( @args );
my ( $GO_id )
= $self->_rearrange( [ qw( GO_ID ) ], @args );
$GO_id && $self->GO_id( $GO_id );
return $self;
}
} |
sub init
{
my $self = shift;
$self->SUPER::init(@_);
}
} |
sub GO_id
{ my $self = shift;
my $value;
if ( @_ ) {
$value = $self->_check_go_id( shift );
unshift(@_, $value);
}
return $self->identifier( @_ );
}
} |
sub get_secondary_GO_ids
{ return shift->get_secondary_ids(@_);
}
} |
sub add_secondary_GO_id
{ return shift->add_secondary_id(@_);
}
} |
sub remove_secondary_GO_ids
{ return shift->remove_secondary_ids(@_);
}
} |
sub to_string
{ my( $self ) = @_;
my $s = "";
$s .= "-- GO id:\n";
$s .= ($self->GO_id() || '')."\n";
$s .= "-- Name:\n";
$s .= ($self->name() || '') ."\n";
$s .= "-- Definition:\n";
$s .= ($self->definition() || '') ."\n";
$s .= "-- Category:\n";
if ( defined( $self->ontology() ) ) {
$s .= $self->ontology()->name()."\n";
}
else {
$s .= "\n";
}
$s .= "-- Version:\n";
$s .= ($self->version() || '') ."\n";
$s .= "-- Is obsolete:\n";
$s .= $self->is_obsolete()."\n";
$s .= "-- Comment:\n";
$s .= ($self->comment() || '') ."\n";
$s .= "-- Definition references:\n";
$s .= $self->_array_to_string( $self->get_dbxrefs() )."\n";
$s .= "-- Secondary GO ids:\n";
$s .= $self->_array_to_string( $self->get_secondary_GO_ids() )."\n";
$s .= "-- Aliases:\n";
$s .= $self->_array_to_string( $self->get_synonyms() );
return $s;
}
} |
sub _check_go_id
{ my ( $self, $value ) = @_;
unless ( $value =~ /^(GO:)?\d{7}$/ || $value eq GOID_DEFAULT ) {
$self->throw( "Found [" . $value
. "] where [GO:nnnnnnn] or [nnnnnnn] expected" );
}
unless ( $value =~ /^GO:/ ) {
$value = "GO:".$value;
}
return $value;
}
} |
| _array_to_string | description | prev | next | Top |
sub _array_to_string
{ my( $self, @value ) = @_;
my $s = "";
for ( my $i = 0; $i < scalar( @value ); ++$i ) {
if ( ! ref( $value[ $i ] ) ) {
$s .= "#" . $i . "\n-- " . $value[ $i ] . "\n";
}
}
return $s;
}
*each_secondary_GO_id =\& get_secondary_GO_ids;
*add_secondary_GO_ids =\& add_secondary_GO_id;
1;} |
General documentation
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 - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
with code and data examples if at all possible.
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via the web:
https://redmine.open-bio.org/projects/bioperl/
The rest of the documentation details each of the object
methods.