Sync branch with trunk
[bioperl-live.git] / Bio / Ontology / SimpleGOEngine / GraphAdaptor02.pm
blob190131a4c413fefbbedbf7f3be4a2c601a6e1d18
1 # $Id: GraphAdaptor02.pm 10525 2006-09-26 22:03:22Z sendu $
3 # BioPerl adaptor for old Graph verions (0.2x) for use in
4 # Bio::Ontology::SimpleGOEngine
6 # Cared for by Nat Goodman <natg at shore.net>
8 # (c) Nathan Goodman natg@shore.net 2005
9 # (c) ISB, Institute for Systems Biology 2005
11 # You may distribute this module under the same terms as perl itself.
12 # Refer to the Perl Artistic License (see the license accompanying this
13 # software package, or see http://www.perl.com/language/misc/Artistic.html)
14 # for the terms under which you may use, modify, and redistribute this module.
16 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 # You may distribute this module under the same terms as perl itself
22 # POD documentation - main docs before the code
24 =head1 NAME
26 Bio::Ontology::SimpleGOEngine::GraphAdaptor02 - Graph adaptor (v02.x) for
27 Bio::Ontology::SimpleGOEngine
29 =head1 DESCRIPTION
31 Internal subclass of Bio::Ontology::SimpleGOEngine::GraphAdaptor for
32 Graph v0.2x.
34 Call this via Bio::Ontology::SimpleGOEngine::GraphAdaptor
36 =head1 FEEDBACK
38 =head2 Mailing Lists
40 User feedback is an integral part of the evolution of this and other
41 Bioperl modules. Send your comments and suggestions preferably to the
42 Bioperl mailing lists Your participation is much appreciated.
44 bioperl-l@bioperl.org - General discussion
45 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
47 =head2 Reporting Bugs
49 report bugs to the Bioperl bug tracking system to help us keep track
50 the bugs and their resolution. Bug reports can be submitted via the
51 web:
53 http://bugzilla.open-bio.org/
55 =head1 AUTHOR
57 Nat Goodman
59 Email: natg at shore.net
61 Address:
63 Institute for Systems Biology
64 1441 N 34th St
65 Seattle, WA 98103-8904
67 =head1 APPENDIX
69 The rest of the documentation details each of the object
70 methods. Internal methods are usually preceded with a _
72 =cut
74 # Let the code begin...
76 package Bio::Ontology::SimpleGOEngine::GraphAdaptor02;
79 use strict;
81 use base qw(Bio::Ontology::SimpleGOEngine::GraphAdaptor);
83 # edges
84 # v0.2x returns (u0,v0, u1,v1, ...)
85 # v0.5x returns ([u0,v0], [u1,v1], ...)
86 sub edges {
87 my $self=shift;
88 my @edges02=$self->_graph->edges(@_);
89 my @edges;
90 while (@edges02) {
91 my($u,$v)=(shift @edges02,shift @edges02);
92 push(@edges,[$u,$v]);
94 @edges;
97 # edges_at
98 # v0.2x uses edges() method and returns (u0,v0, u1,v1, ...)
99 # v0.5x returns ([u0,v0], [u1,v1], ...)
100 sub edges_at {
101 my $self=shift;
102 $self->edges(@_);
105 # set_vertex_attribute
106 # v0.2x uses set_attribute($attribute,$v,$value)
107 sub set_vertex_attribute {
108 my($self,$v,$attribute,$value)=@_;
109 $self->_graph->set_attribute($attribute,$v,$value);
112 # get_vertex_attribute
113 # v0.2x uses get_attribute($attribute,$v)
114 sub get_vertex_attribute {
115 my($self,$v,$attribute)=@_;
116 $self->_graph->get_attribute($attribute,$v);
119 # set_edge_attribute
120 # v0.2x uses set_attribute($attribute,$u,$v,$value)
121 sub set_edge_attribute {
122 my($self,$u,$v,$attribute,$value)=@_;
123 $self->_graph->set_attribute($attribute,$u,$v,$value);
126 # get_edge_attribute
127 # v0.2x uses get_attribute($attribute,$u,$v)
128 sub get_edge_attribute {
129 my($self,$u,$v,$attribute)=@_;
130 $self->_graph->get_attribute($attribute,$u,$v);