bug 2549; fixed small bug in Bio::Taxon which doesn't catch -common_name
[bioperl-live.git] / Bio / Ontology / RelationshipFactory.pm
blob5529743f35559a31aaec45687f6dde07065bb01a
1 # $Id$
3 # BioPerl module for Bio::Ontology::RelationshipFactory
5 # Cared for by Hilmar Lapp <hlapp at gmx.net>
7 # Copyright Hilmar Lapp
9 # You may distribute this module under the same terms as perl itself
12 # (c) Hilmar Lapp, hlapp at gmx.net, 2002.
13 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
15 # You may distribute this module under the same terms as perl itself.
16 # Refer to the Perl Artistic License (see the license accompanying this
17 # software package, or see http://www.perl.com/language/misc/Artistic.html)
18 # for the terms under which you may use, modify, and redistribute this module.
20 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
21 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
22 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25 # POD documentation - main docs before the code
27 =head1 NAME
29 Bio::Ontology::RelationshipFactory - Instantiates a new
30 Bio::Ontology::RelationshipI (or derived class) through a factory
32 =head1 SYNOPSIS
34 use Bio::Ontology::RelationshipFactory;
36 # the default type is Bio::Ontology::Relationship
37 my $factory = Bio::Ontology::RelationshipFactory->new(
38 -type => 'Bio::Ontology::GOterm');
39 my $clu = $factory->create_object(-name => 'peroxisome',
40 -ontology => 'Gene Ontology',
41 -identifier => 'GO:0005777');
44 =head1 DESCRIPTION
46 This object will build L<Bio::Ontology::RelationshipI> objects generically.
48 =head1 FEEDBACK
50 =head2 Mailing Lists
52 User feedback is an integral part of the evolution of this and other
53 Bioperl modules. Send your comments and suggestions preferably to
54 the Bioperl mailing list. Your participation is much appreciated.
56 bioperl-l@bioperl.org - General discussion
57 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
59 =head2 Reporting Bugs
61 Report bugs to the Bioperl bug tracking system to help us keep track
62 of the bugs and their resolution. Bug reports can be submitted via
63 the web:
65 http://bugzilla.open-bio.org/
67 =head1 AUTHOR - Hilmar Lapp
69 Email hlapp at gmx.net
72 =head1 APPENDIX
74 The rest of the documentation details each of the object methods.
75 Internal methods are usually preceded with a _
77 =cut
80 # Let the code begin...
83 package Bio::Ontology::RelationshipFactory;
84 use strict;
86 use Bio::Root::Root;
88 use base qw(Bio::Factory::ObjectFactory);
90 =head2 new
92 Title : new
93 Usage : my $obj = Bio::Ontology::RelationshipFactory->new();
94 Function: Builds a new Bio::Ontology::RelationshipFactory object
95 Returns : Bio::Ontology::RelationshipFactory
96 Args : -type => string, name of a Bio::Ontology::RelationshipI
97 derived class.
98 The default is Bio::Ontology::Relationship.
100 See L<Bio::Ontology::Relationship>, L<Bio::Ontology::RelationshipI>.
102 =cut
104 sub new {
105 my($class,@args) = @_;
107 my $self = $class->SUPER::new(@args);
109 # make sure this matches our requirements
110 $self->interface("Bio::Ontology::RelationshipI");
111 $self->type($self->type() || "Bio::Ontology::Relationship");
113 return $self;