1
#-----------------------------------------------------------------------------
2
# PACKAGE : Bio::Root::Xref.pm
3
# AUTHOR : Steve Chervitz (sac@bioperl.org)
5
# REVISION: $Id: Xref.pm,v 1.8 2002/01/23 11:30:22 heikki Exp $
8
# WARNING: This is considered an experimental module.
10
# Copyright (c) 1997-8 Steve Chervitz. All Rights Reserved.
11
# This module is free software; you can redistribute it and/or
12
# modify it under the same terms as Perl itself.
13
#-----------------------------------------------------------------------------
15
package Bio::Root::Xref;
17
use Bio::Root::Global;
18
use Bio::Root::Object ();
19
use Bio::Root::Vector ();
21
@Bio::Root::Xref::ISA = qw( Bio::Root::Vector Bio::Root::Object );
23
use vars qw($ID $VERSION);
24
$ID = 'Bio::Root::Xref';
31
Bio::Root::Xref - A generic cross-reference object.
33
B<WARNING: This module is still in the experimental phase and has not been tested.>
37
=head2 Object Creation
39
use Bio::Root::Object;
41
$myObj->xref($object_ref);
43
=head2 Object Manipulation
46
---------------------------------------------------------------------
47
obj() - Get the cross-referenced object.
48
desc() - Description of the nature of the cross-reference.
49
set_desc() - Set description.
50
type() - Symmetric or assymetric.
53
---------------------------------------------------------------------
54
clear() - remove all cross-references within the Xref object (not implemented).
58
An instance of B<Bio::Root::Xref.pm> manages sets of objects not
59
necessarily related by inheritance or composition, but by an arbitrary
60
criterion defined by the client. Currently, Bio::Root::Xref inherits
61
from both B<Bio::Root::Object.pm> and B<Bio::Root::Vector.pm>. An Xref
62
object is an example of a heterogeneous Vector object since different
63
objects in the vector need not all derive from the same base class.
65
The two objects involved in the cross-reference typically involve a
66
symmetrical relationship in which each will have a Xref object relating it
67
to the other object. This relationship is not necessarily transitive,
68
however: if A is an xref of B and B is an xref of C, A is not
69
necessarily an xref of C. Assymetric Xrefs are also possible.
71
The establishment of cross-references is managed by B<Bio::Root::Object.pm>.
72
See the xref() method in that module.
74
B<The API for this module is not complete since the module is under development. Caveat emptor.>
79
Bio::Root::Object.pm - Core object
80
Bio::Root::Global.pm - Manages global variables/constants
82
http://bio.perl.org/Projects/modules.html - Online module documentation
83
http://bio.perl.org/ - Bioperl Project Homepage
89
User feedback is an integral part of the evolution of this and other Bioperl modules.
90
Send your comments and suggestions preferably to one of the Bioperl mailing lists.
91
Your participation is much appreciated.
93
bioperl-l@bioperl.org - General discussion
94
http://bioperl.org/MailList.shtml - About the mailing lists
98
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and
99
their resolution. Bug reports can be submitted via email or the web:
101
bioperl-bugs@bio.perl.org
102
http://bio.perl.org/bioperl-bugs/
106
Steve Chervitz E<lt>sac@bioperl.orgE<gt>
108
See L<the FEEDBACK section | FEEDBACK> for where to send bug reports and comments.
112
Bio::Root::Xref.pm, 0.01 pre-alpha
116
Copyright (c) 1997-8 Steve Chervitz. All Rights Reserved.
117
This module is free software; you can redistribute it and/or
118
modify it under the same terms as Perl itself.
123
Update documentation to work with pod2html from Perl 5.004.
130
#### END of main POD documentation.
137
#####################################################################################
139
#####################################################################################
142
my( $self, %param ) = @_;
144
$self->SUPER::_initialize(%param);
146
$self->{'_obj'} = ($param{-OBJ} || undef);
148
## By default, all Xrefs are symmetric.
149
## Create symmetric cross-reference in obj.
151
$self->{'_obj'}->xref(-OBJ=>$param{-PARENT});
152
$self->{'_type'} = 'sym';
154
$self->{'_type'} = 'asym';
159
#####################################################################################
161
#####################################################################################
163
sub obj {my ($self) = shift; return $self->{'_obj'}; }
164
sub desc {my ($self) = shift; return $self->{'_desc'}; }
165
sub type {my ($self) = shift; return $self->{'_type'}; }
167
sub set_desc {my ($self,$desc) = @_;
168
$self->{'_desc'} = $desc;
172
## Not implemented. Need to do this carefully.
173
## Not sure if this method is needed.
180
#####################################################################################
182
#####################################################################################
186
_obj : The object being cross-referenced to the parent.
187
_type : Symmetric or asymmetric
188
_desc : Description associated with the cross-reference
190
INHERITED DATA MEMBERS (from Bio::Root::Object)
192
_parent : The object receiving the cross-reference.
193
_name : Descriptive nature of the cross-reference.