1
# $Id: LocationI.pm,v 1.1.2.2 2006/10/02 23:10:15 sendu Exp $
3
# BioPerl module for Bio::DB::LocationI
5
# Cared for by Chris Fields <cjfields at uiuc dot edu>
7
# Copyright Chris Fields
9
# You may distribute this module under the same terms as perl itself
11
# POD documentation - main docs before the code
15
Bio::DB::LocationI - A RandomAccessI-like abstract interface for
16
retrieving location data from a sequence database and returning
17
Bio::LocationI objects
22
# get a database object somehow using a concrete class
25
$loc = $db->get_Location_by_id('123456');
28
# $loc is a Bio::LocationI object
33
This is a pure interface class - in other words, all this does is define
34
methods which other (concrete) classes will actually implement.
36
The Bio::DB::LocationI class defines methods used to retrieve location data
37
from a sequence. This is returned in the form of Bio::LocationI objects,
44
At the moment it is just the ability to make Bio::LocationI objects
45
from a name or unique id (id), an accession number (acc), and so on.
49
Ewan Birney originally wrote Bio::DB::RandomAccessI, from which this class
54
User feedback is an integral part of the
55
evolution of this and other Bioperl modules. Send
56
your comments and suggestions preferably to one
57
of the Bioperl mailing lists. Your participation
60
bioperl-l@lists.open-bio.org - General discussion
61
http://www.bioperl.org/wiki/Mailing_lists - About the mailing lists
65
Report bugs to the Bioperl bug tracking system to
66
help us keep track the bugs and their resolution.
67
Bug reports can be submitted via the web.
69
http://bugzilla.open-bio.org/
73
Email cjfields at uiuc dot edu
77
The rest of the documentation details each of the
78
object methods. Internal methods are usually
83
# Let the code begin...
85
package Bio::DB::LocationI;
91
use base qw(Bio::Root::Root);
93
=head2 get_Location_by_id
95
Title : get_Location_by_id
96
Usage : $loc = $db->get_Location_by_id('123456')
97
Function: Gets a Bio::LocationI-implementing object by its name (id)
98
Returns : a Bio::LocationI object or undef if not found
99
Args : the id (as a string) of a sequence
103
sub get_Location_by_id{
104
my ($self,@args) = @_;
105
$self->throw_not_implemented();
108
=head2 get_Location_by_acc
110
Title : get_Location_by_acc
111
Usage : $loc = $db->get_Location_by_acc('X77802');
112
Function: Gets a Bio::LocationI object by accession number
113
Returns : A Bio::LocationI object or undef if not found
114
Args : accession number (as a string)
115
Throws : "more than one sequences correspond to this accession"
116
if the accession maps to multiple primary ids and
117
method is called in a scalar context
121
sub get_Location_by_acc{
122
my ($self,@args) = @_;
123
$self->throw_not_implemented();
126
=head2 get_Location_by_version
128
Title : get_Location_by_version
129
Usage : $loc = $db->get_Location_by_version('X77802.1');
130
Function: Gets a Bio::LocationI object by sequence version
131
Returns : A Bio::LocationI object
132
Args : accession.version (as a string)
133
Throws : "acc.version does not exist" exception
137
sub get_Location_by_version{
138
my ($self,@args) = @_;
139
$self->throw_not_implemented();