tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / Ontology / SimpleGOEngine / GraphAdaptor02.pm
blobb48b7c4e2d41fbb5398d9ab4e6060a1f9734343a
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 # Please direct questions and support issues to <bioperl-l@bioperl.org>
8 # Cared for by Nat Goodman <natg at shore.net>
10 # (c) Nathan Goodman natg@shore.net 2005
11 # (c) ISB, Institute for Systems Biology 2005
13 # You may distribute this module under the same terms as perl itself.
14 # Refer to the Perl Artistic License (see the license accompanying this
15 # software package, or see http://www.perl.com/language/misc/Artistic.html)
16 # for the terms under which you may use, modify, and redistribute this module.
18 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
19 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
20 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 # You may distribute this module under the same terms as perl itself
24 # POD documentation - main docs before the code
26 =head1 NAME
28 Bio::Ontology::SimpleGOEngine::GraphAdaptor02 - Graph adaptor (v02.x) for
29 Bio::Ontology::SimpleGOEngine
31 =head1 DESCRIPTION
33 Internal subclass of Bio::Ontology::SimpleGOEngine::GraphAdaptor for
34 Graph v0.2x.
36 Call this via Bio::Ontology::SimpleGOEngine::GraphAdaptor
38 =head1 FEEDBACK
40 =head2 Mailing Lists
42 User feedback is an integral part of the evolution of this and other
43 Bioperl modules. Send your comments and suggestions preferably to the
44 Bioperl mailing lists Your participation is much appreciated.
46 bioperl-l@bioperl.org - General discussion
47 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
49 =head2 Support
51 Please direct usage questions or support issues to the mailing list:
53 I<bioperl-l@bioperl.org>
55 rather than to the module maintainer directly. Many experienced and
56 reponsive experts will be able look at the problem and quickly
57 address it. Please include a thorough description of the problem
58 with code and data examples if at all possible.
60 =head2 Reporting Bugs
62 report bugs to the Bioperl bug tracking system to help us keep track
63 the bugs and their resolution. Bug reports can be submitted via the
64 web:
66 http://bugzilla.open-bio.org/
68 =head1 AUTHOR
70 Nat Goodman
72 Email: natg at shore.net
74 Address:
76 Institute for Systems Biology
77 1441 N 34th St
78 Seattle, WA 98103-8904
80 =head1 APPENDIX
82 The rest of the documentation details each of the object
83 methods. Internal methods are usually preceded with a _
85 =cut
87 # Let the code begin...
89 package Bio::Ontology::SimpleGOEngine::GraphAdaptor02;
92 use strict;
94 use base qw(Bio::Ontology::SimpleGOEngine::GraphAdaptor);
96 # edges
97 # v0.2x returns (u0,v0, u1,v1, ...)
98 # v0.5x returns ([u0,v0], [u1,v1], ...)
99 sub edges {
100 my $self=shift;
101 my @edges02=$self->_graph->edges(@_);
102 my @edges;
103 while (@edges02) {
104 my($u,$v)=(shift @edges02,shift @edges02);
105 push(@edges,[$u,$v]);
107 @edges;
110 # edges_at
111 # v0.2x uses edges() method and returns (u0,v0, u1,v1, ...)
112 # v0.5x returns ([u0,v0], [u1,v1], ...)
113 sub edges_at {
114 my $self=shift;
115 $self->edges(@_);
118 # set_vertex_attribute
119 # v0.2x uses set_attribute($attribute,$v,$value)
120 sub set_vertex_attribute {
121 my($self,$v,$attribute,$value)=@_;
122 $self->_graph->set_attribute($attribute,$v,$value);
125 # get_vertex_attribute
126 # v0.2x uses get_attribute($attribute,$v)
127 sub get_vertex_attribute {
128 my($self,$v,$attribute)=@_;
129 $self->_graph->get_attribute($attribute,$v);
132 # set_edge_attribute
133 # v0.2x uses set_attribute($attribute,$u,$v,$value)
134 sub set_edge_attribute {
135 my($self,$u,$v,$attribute,$value)=@_;
136 $self->_graph->set_attribute($attribute,$u,$v,$value);
139 # get_edge_attribute
140 # v0.2x uses get_attribute($attribute,$u,$v)
141 sub get_edge_attribute {
142 my($self,$u,$v,$attribute)=@_;
143 $self->_graph->get_attribute($attribute,$u,$v);