| 1 | # | ||
| 2 | # BioPerl module for PathI | ||
| 3 | # | ||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 5 | # | ||
| 6 | # Cared for by Hilmar Lapp <hlapp at gmx.net> | ||
| 7 | # | ||
| 8 | # (c) Hilmar Lapp, hlapp at gmx.net, 2003. | ||
| 9 | # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2003. | ||
| 10 | # | ||
| 11 | # You may distribute this module under the same terms as perl itself. | ||
| 12 | # Refer to the Perl Artistic License (see the license accompanying this | ||
| 13 | # software package, or see http://www.perl.com/language/misc/Artistic.html) | ||
| 14 | # for the terms under which you may use, modify, and redistribute this module. | ||
| 15 | # | ||
| 16 | # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED | ||
| 17 | # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||
| 18 | # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
| 19 | # | ||
| 20 | # You may distribute this module under the same terms as perl itself | ||
| 21 | |||
| 22 | # POD documentation - main docs before the code | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Bio::Ontology::PathI - Interface for a path between ontology terms | ||
| 27 | |||
| 28 | =head1 SYNOPSIS | ||
| 29 | |||
| 30 | # see documentation of methods and an implementation, e.g., | ||
| 31 | # Bio::Ontology::Path | ||
| 32 | |||
| 33 | =head1 DESCRIPTION | ||
| 34 | |||
| 35 | This is the minimal interface for a path between two terms in | ||
| 36 | an ontology. Ontology engines may use this. | ||
| 37 | |||
| 38 | Essentially this is a very thin extension of the | ||
| 39 | L<Bio::Ontology::RelationshipI> interface. It basically adds an | ||
| 40 | attribute distance(). For a RelationshipI, you can think of distance as | ||
| 41 | equal to zero (subject == object) or 1 (subject != object). | ||
| 42 | |||
| 43 | =head1 FEEDBACK | ||
| 44 | |||
| 45 | =head2 Mailing Lists | ||
| 46 | |||
| 47 | User feedback is an integral part of the evolution of this and other | ||
| 48 | Bioperl modules. Send your comments and suggestions preferably to | ||
| 49 | the Bioperl mailing list. Your participation is much appreciated. | ||
| 50 | |||
| 51 | bioperl-l@bioperl.org - General discussion | ||
| 52 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 53 | |||
| 54 | =head2 Support | ||
| 55 | |||
| 56 | Please direct usage questions or support issues to the mailing list: | ||
| 57 | |||
| 58 | I<bioperl-l@bioperl.org> | ||
| 59 | |||
| 60 | rather than to the module maintainer directly. Many experienced and | ||
| 61 | reponsive experts will be able look at the problem and quickly | ||
| 62 | address it. Please include a thorough description of the problem | ||
| 63 | with code and data examples if at all possible. | ||
| 64 | |||
| 65 | =head2 Reporting Bugs | ||
| 66 | |||
| 67 | Report bugs to the Bioperl bug tracking system to help us keep track | ||
| 68 | of the bugs and their resolution. Bug reports can be submitted via | ||
| 69 | the web: | ||
| 70 | |||
| 71 | https://github.com/bioperl/bioperl-live/issues | ||
| 72 | |||
| 73 | =head1 AUTHOR - Hilmar Lapp | ||
| 74 | |||
| 75 | Email hlapp at gmx.net | ||
| 76 | |||
| 77 | =head1 APPENDIX | ||
| 78 | |||
| 79 | The rest of the documentation details each of the object methods. | ||
| 80 | Internal methods are usually preceded with a _ | ||
| 81 | |||
| 82 | =cut | ||
| 83 | |||
| 84 | |||
| 85 | # Let the code begin... | ||
| 86 | |||
| 87 | |||
| 88 | package Bio::Ontology::PathI; | ||
| 89 | 2 | $Bio::Ontology::PathI::VERSION = '1.7.8'; | |
| 90 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 91 | |||
| 92 | 2 | ▶ | use base qw(Bio::Ontology::RelationshipI); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 93 | |||
| 94 | |||
| 95 | =head2 distance | ||
| 96 | |||
| 97 | Title : distance | ||
| 98 | Usage : $obj->distance($newval) | ||
| 99 | Function: Get (and set if the implementation allows it) the distance | ||
| 100 | between the two terms connected by this path. | ||
| 101 | |||
| 102 | Example : | ||
| 103 | Returns : value of distance (a scalar) | ||
| 104 | Args : on set, new value (a scalar or undef, optional) | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | 0 | ▶ | sub distance{ |
|
Subroutine
distance: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 109 | 0 | return shift->throw_not_implemented(); | |
| 110 | } | ||
| 111 | |||
| 112 | =head1 Bio::Ontology::RelationshipI Methods | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | =head2 subject_term | ||
| 117 | |||
| 118 | Title : subject_term | ||
| 119 | Usage : $subj = $rel->subject_term(); | ||
| 120 | Function: Set/get for the subject term of this Relationship. | ||
| 121 | |||
| 122 | The common convention for ontologies is to express | ||
| 123 | relationships between terms as triples (subject, predicate, | ||
| 124 | object). | ||
| 125 | |||
| 126 | Returns : The subject term [Bio::Ontology::TermI]. | ||
| 127 | Args : | ||
| 128 | |||
| 129 | =cut | ||
| 130 | |||
| 131 | =head2 object_term | ||
| 132 | |||
| 133 | Title : object_term | ||
| 134 | Usage : $object = $rel->object_term(); | ||
| 135 | Function: Set/get for the object term of this Relationship. | ||
| 136 | |||
| 137 | The common convention for ontologies is to express | ||
| 138 | relationships between terms as triples (subject, predicate, | ||
| 139 | object). | ||
| 140 | |||
| 141 | Returns : The object term [Bio::Ontology::TermI]. | ||
| 142 | Args : | ||
| 143 | |||
| 144 | =cut | ||
| 145 | |||
| 146 | =head2 predicate_term | ||
| 147 | |||
| 148 | Title : predicate_term | ||
| 149 | Usage : $type = $rel->predicate_term(); | ||
| 150 | Function: Set/get for the predicate of this relationship. | ||
| 151 | |||
| 152 | For a path the predicate (relationship type) is defined as | ||
| 153 | the greatest common denominator of all predicates | ||
| 154 | (relationship types) encountered along the path. I.e., if | ||
| 155 | predicate A is-a predicate B, the greatest common | ||
| 156 | denominator for a path containing both predicates A and B is B | ||
| 157 | |||
| 158 | Returns : The predicate term [Bio::Ontology::TermI]. | ||
| 159 | Args : | ||
| 160 | |||
| 161 | =cut | ||
| 162 | |||
| 163 | =head2 ontology | ||
| 164 | |||
| 165 | Title : ontology | ||
| 166 | Usage : $ont = $obj->ontology() | ||
| 167 | Function: Get the ontology that defined this relationship. | ||
| 168 | Example : | ||
| 169 | Returns : an object implementing Bio::Ontology::OntologyI | ||
| 170 | Args : | ||
| 171 | |||
| 172 | See L<Bio::Ontology::OntologyI>. | ||
| 173 | |||
| 174 | =cut | ||
| 175 | |||
| 176 | 2 | 1; | |