merge upstream
[bioperl-live.git] / Bio / Ontology / RelationshipFactory.pm
blob6bb7cdb73c8a4bf24de528a30b33f18d5eb54157
2 # BioPerl module for Bio::Ontology::RelationshipFactory
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Hilmar Lapp <hlapp at gmx.net>
8 # Copyright Hilmar Lapp
10 # You may distribute this module under the same terms as perl itself
13 # (c) Hilmar Lapp, hlapp at gmx.net, 2002.
14 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
16 # You may distribute this module under the same terms as perl itself.
17 # Refer to the Perl Artistic License (see the license accompanying this
18 # software package, or see http://www.perl.com/language/misc/Artistic.html)
19 # for the terms under which you may use, modify, and redistribute this module.
21 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
22 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
23 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26 # POD documentation - main docs before the code
28 =head1 NAME
30 Bio::Ontology::RelationshipFactory - Instantiates a new
31 Bio::Ontology::RelationshipI (or derived class) through a factory
33 =head1 SYNOPSIS
35 use Bio::Ontology::RelationshipFactory;
37 # the default type is Bio::Ontology::Relationship
38 my $factory = Bio::Ontology::RelationshipFactory->new(
39 -type => 'Bio::Ontology::GOterm');
40 my $clu = $factory->create_object(-name => 'peroxisome',
41 -ontology => 'Gene Ontology',
42 -identifier => 'GO:0005777');
45 =head1 DESCRIPTION
47 This object will build L<Bio::Ontology::RelationshipI> objects generically.
49 =head1 FEEDBACK
51 =head2 Mailing Lists
53 User feedback is an integral part of the evolution of this and other
54 Bioperl modules. Send your comments and suggestions preferably to
55 the Bioperl mailing list. Your participation is much appreciated.
57 bioperl-l@bioperl.org - General discussion
58 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
60 =head2 Support
62 Please direct usage questions or support issues to the mailing list:
64 I<bioperl-l@bioperl.org>
66 rather than to the module maintainer directly. Many experienced and
67 reponsive experts will be able look at the problem and quickly
68 address it. Please include a thorough description of the problem
69 with code and data examples if at all possible.
71 =head2 Reporting Bugs
73 Report bugs to the Bioperl bug tracking system to help us keep track
74 of the bugs and their resolution. Bug reports can be submitted via
75 the web:
77 https://github.com/bioperl/bioperl-live/issues
79 =head1 AUTHOR - Hilmar Lapp
81 Email hlapp at gmx.net
84 =head1 APPENDIX
86 The rest of the documentation details each of the object methods.
87 Internal methods are usually preceded with a _
89 =cut
92 # Let the code begin...
95 package Bio::Ontology::RelationshipFactory;
96 use strict;
98 use Bio::Root::Root;
100 use base qw(Bio::Factory::ObjectFactory);
102 =head2 new
104 Title : new
105 Usage : my $obj = Bio::Ontology::RelationshipFactory->new();
106 Function: Builds a new Bio::Ontology::RelationshipFactory object
107 Returns : Bio::Ontology::RelationshipFactory
108 Args : -type => string, name of a Bio::Ontology::RelationshipI
109 derived class.
110 The default is Bio::Ontology::Relationship.
112 See L<Bio::Ontology::Relationship>, L<Bio::Ontology::RelationshipI>.
114 =cut
116 sub new {
117 my($class,@args) = @_;
119 my $self = $class->SUPER::new(@args);
121 # make sure this matches our requirements
122 $self->interface("Bio::Ontology::RelationshipI");
123 $self->type($self->type() || "Bio::Ontology::Relationship");
125 return $self;