Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/Ontology/RelationshipFactory.pm @ 0:1f6dce3d34e0
Uploaded
author | mahtabm |
---|---|
date | Thu, 11 Apr 2013 02:01:53 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1f6dce3d34e0 |
---|---|
1 # $Id: RelationshipFactory.pm,v 1.1.2.1 2003/03/27 10:07:56 lapp Exp $ | |
2 # | |
3 # BioPerl module for Bio::Ontology::RelationshipFactory | |
4 # | |
5 # Cared for by Hilmar Lapp <hlapp at gmx.net> | |
6 # | |
7 # Copyright Hilmar Lapp | |
8 # | |
9 # You may distribute this module under the same terms as perl itself | |
10 | |
11 # | |
12 # (c) Hilmar Lapp, hlapp at gmx.net, 2002. | |
13 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002. | |
14 # | |
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. | |
19 # | |
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. | |
23 # | |
24 | |
25 # POD documentation - main docs before the code | |
26 | |
27 =head1 NAME | |
28 | |
29 Bio::Ontology::RelationshipFactory - Instantiates a new Bio::Ontology::RelationshipI (or derived class) through a factory | |
30 | |
31 =head1 SYNOPSIS | |
32 | |
33 use Bio::Ontology::RelationshipFactory; | |
34 | |
35 # the default type is Bio::Ontology::Relationship | |
36 my $factory = new Bio::Ontology::RelationshipFactory(-type => 'Bio::Ontology::GOterm'); | |
37 my $clu = $factory->create_object(-name => 'peroxisome', | |
38 -ontology => 'Gene Ontology', | |
39 -identifier => 'GO:0005777'); | |
40 | |
41 | |
42 =head1 DESCRIPTION | |
43 | |
44 This object will build L<Bio::Ontology::RelationshipI> objects generically. | |
45 | |
46 =head1 FEEDBACK | |
47 | |
48 =head2 Mailing Lists | |
49 | |
50 User feedback is an integral part of the evolution of this and other | |
51 Bioperl modules. Send your comments and suggestions preferably to | |
52 the Bioperl mailing list. Your participation is much appreciated. | |
53 | |
54 bioperl-l@bioperl.org - General discussion | |
55 http://bioperl.org/MailList.shtml - About the mailing lists | |
56 | |
57 =head2 Reporting Bugs | |
58 | |
59 Report bugs to the Bioperl bug tracking system to help us keep track | |
60 of the bugs and their resolution. Bug reports can be submitted via | |
61 email or the web: | |
62 | |
63 bioperl-bugs@bioperl.org | |
64 http://bugzilla.bioperl.org/ | |
65 | |
66 =head1 AUTHOR - Hilmar Lapp | |
67 | |
68 Email hlapp at gmx.net | |
69 | |
70 | |
71 =head1 APPENDIX | |
72 | |
73 The rest of the documentation details each of the object methods. | |
74 Internal methods are usually preceded with a _ | |
75 | |
76 =cut | |
77 | |
78 | |
79 # Let the code begin... | |
80 | |
81 | |
82 package Bio::Ontology::RelationshipFactory; | |
83 use vars qw(@ISA); | |
84 use strict; | |
85 | |
86 use Bio::Root::Root; | |
87 use Bio::Factory::ObjectFactory; | |
88 | |
89 @ISA = qw(Bio::Factory::ObjectFactory); | |
90 | |
91 =head2 new | |
92 | |
93 Title : new | |
94 Usage : my $obj = new Bio::Ontology::RelationshipFactory(); | |
95 Function: Builds a new Bio::Ontology::RelationshipFactory object | |
96 Returns : Bio::Ontology::RelationshipFactory | |
97 Args : -type => string, name of a L<Bio::Ontology::RelationshipI> | |
98 derived class. | |
99 The default is L<Bio::Ontology::Relationship>. | |
100 | |
101 =cut | |
102 | |
103 sub new { | |
104 my($class,@args) = @_; | |
105 | |
106 my $self = $class->SUPER::new(@args); | |
107 | |
108 # make sure this matches our requirements | |
109 $self->interface("Bio::Ontology::RelationshipI"); | |
110 $self->type($self->type() || "Bio::Ontology::Relationship"); | |
111 | |
112 return $self; | |
113 } | |
114 | |
115 1; |