2 # BioPerl module for Bio::DB::LocationI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Chris Fields <cjfields at bioperl dot org>
8 # Copyright Chris Fields
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::DB::LocationI - A RandomAccessI-like abstract interface for
17 retrieving location data from a sequence database and returning
18 Bio::LocationI objects
23 # get a database object somehow using a concrete class
26 $loc = $db->get_Location_by_id('123456');
29 # $loc is a Bio::LocationI object
34 This is a pure interface class - in other words, all this does is define
35 methods which other (concrete) classes will actually implement.
37 The Bio::DB::LocationI class defines methods used to retrieve location data
38 from a sequence. This is returned in the form of Bio::LocationI objects,
45 At the moment it is just the ability to make Bio::LocationI objects
46 from a name or unique id (id), an accession number (acc), and so on.
50 Ewan Birney originally wrote Bio::DB::RandomAccessI, from which this class
55 User feedback is an integral part of the
56 evolution of this and other Bioperl modules. Send
57 your comments and suggestions preferably to one
58 of the Bioperl mailing lists. Your participation
61 bioperl-l@lists.open-bio.org - General discussion
62 http://www.bioperl.org/wiki/Mailing_lists - About the mailing lists
66 Please direct usage questions or support issues to the mailing list:
68 I<bioperl-l@bioperl.org>
70 rather than to the module maintainer directly. Many experienced and
71 reponsive experts will be able look at the problem and quickly
72 address it. Please include a thorough description of the problem
73 with code and data examples if at all possible.
77 Report bugs to the Bioperl bug tracking system to
78 help us keep track the bugs and their resolution.
79 Bug reports can be submitted via the web.
81 https://github.com/bioperl/bioperl-live/issues
85 Email cjfields at bioperl dot org
89 The rest of the documentation details each of the
90 object methods. Internal methods are usually
95 # Let the code begin...
97 package Bio
::DB
::LocationI
;
101 use Bio
::Root
::RootI
;
103 use base
qw(Bio::Root::Root);
105 =head2 get_Location_by_id
107 Title : get_Location_by_id
108 Usage : $loc = $db->get_Location_by_id('123456')
109 Function: Gets a Bio::LocationI-implementing object by its name (id)
110 Returns : a Bio::LocationI object or undef if not found
111 Args : the id (as a string) of a sequence
115 sub get_Location_by_id
{
116 my ($self,@args) = @_;
117 $self->throw_not_implemented();
120 =head2 get_Location_by_acc
122 Title : get_Location_by_acc
123 Usage : $loc = $db->get_Location_by_acc('X77802');
124 Function: Gets a Bio::LocationI object by accession number
125 Returns : A Bio::LocationI object or undef if not found
126 Args : accession number (as a string)
127 Throws : "more than one sequences correspond to this accession"
128 if the accession maps to multiple primary ids and
129 method is called in a scalar context
133 sub get_Location_by_acc
{
134 my ($self,@args) = @_;
135 $self->throw_not_implemented();
138 =head2 get_Location_by_version
140 Title : get_Location_by_version
141 Usage : $loc = $db->get_Location_by_version('X77802.1');
142 Function: Gets a Bio::LocationI object by sequence version
143 Returns : A Bio::LocationI object
144 Args : accession.version (as a string)
145 Throws : "acc.version does not exist" exception
149 sub get_Location_by_version
{
150 my ($self,@args) = @_;
151 $self->throw_not_implemented();