3 # BioPerl module for Bio::Ontology::TermFactory
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
29 Bio::Ontology::TermFactory - Instantiates a new
30 Bio::Ontology::TermI (or derived class) through a factory
34 use Bio::Ontology::TermFactory;
36 # the default type is Bio::Ontology::Term
37 my $factory = Bio::Ontology::TermFactory->new(
38 -type => 'Bio::Ontology::GOterm');
39 my $term = $factory->create_object(-name => 'peroxisome',
40 -ontology => 'Gene Ontology',
41 -identifier => 'GO:0005777');
46 This object will build L<Bio::Ontology::TermI> objects generically.
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
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
65 http://bugzilla.open-bio.org/
67 =head1 AUTHOR - Hilmar Lapp
69 Email hlapp at gmx.net
74 The rest of the documentation details each of the object methods.
75 Internal methods are usually preceded with a _
80 # Let the code begin...
83 package Bio
::Ontology
::TermFactory
;
88 use base
qw(Bio::Factory::ObjectFactory);
93 Usage : my $obj = Bio::Ontology::TermFactory->new();
94 Function: Builds a new Bio::Ontology::TermFactory object
95 Returns : Bio::Ontology::TermFactory
96 Args : -type => string, name of a Bio::Ontology::TermI derived class.
97 The default is Bio::Ontology::Term.
99 See L<Bio::Ontology::TermI>, L<Bio::Ontology::Term>.
104 my($class,@args) = @_;
106 my $self = $class->SUPER::new
(@args);
108 # make sure this matches our requirements
109 $self->interface("Bio::Ontology::TermI");
110 $self->type($self->type() || "Bio::Ontology::Term");
118 Title : create_object
119 Usage : my $term = $factory->create_object(<named parameters>);
120 Function: Instantiates new Bio::Ontology::TermI (or one of its child classes)
122 This object allows us to genericize the instantiation of
125 Returns : Bio::Ontology::TermI compliant object
126 The return type is configurable using new(-type =>"...").
127 Args : initialization parameters specific to the type of term
128 object we want. Typically
130 -identifier => identifier for the term
131 -ontology => ontology for the term
133 See L<Bio::Ontology::TermI>.