Bump RC to 2; will tag, bag, and ship tomorrow after tests
[bioperl-live.git] / Bio / DB / RandomAccessI.pm
blob7c771488518b6dc4f589ce7cc2430a3ba28ea141
1 # POD documentation - main docs before the code
3 # $Id$
6 =head1 NAME
8 Bio::DB::RandomAccessI - Abstract interface for a sequence database
10 =head1 SYNOPSIS
13 # get a database object somehow using a concrete class
16 $seq = $db->get_Seq_by_id('ROA1_HUMAN');
19 # $seq is a Bio::Seq object
22 =head1 DESCRIPTION
24 This is a pure interface class - in other words, all this does is define
25 methods which other (concrete) classes will actually implement.
27 The Bio::DB::RandomAccessI class defines what methods a generic database class
28 should have. At the moment it is just the ability to make Bio::Seq objects
29 from a name (id) or a accession number.
31 =head1 CONTACT
33 Ewan Birney E<lt>birney@ebi.ac.ukE<gt> originally wrote this class.
35 =head2 Reporting Bugs
37 Report bugs to the Bioperl bug tracking system to help us keep track
38 the bugs and their resolution. Bug reports can be submitted via the web:
40 http://bugzilla.open-bio.org/
42 =head1 APPENDIX
44 The rest of the documentation details each of the object
45 methods. Internal methods are usually preceded with a _
47 =cut
50 # Let the code begin...
52 package Bio::DB::RandomAccessI;
54 use strict;
56 use Bio::Root::RootI;
58 use base qw(Bio::Root::Root);
60 =head2 get_Seq_by_id
62 Title : get_Seq_by_id
63 Usage : $seq = $db->get_Seq_by_id('ROA1_HUMAN')
64 Function: Gets a Bio::Seq object by its name
65 Returns : a Bio::Seq object or undef if not found
66 Args : the id (as a string) of a sequence,
68 =cut
70 sub get_Seq_by_id{
71 my ($self,@args) = @_;
72 $self->throw_not_implemented();
75 =head2 get_Seq_by_acc
77 Title : get_Seq_by_acc
78 Usage : $seq = $db->get_Seq_by_acc('X77802');
79 $seq = $db->get_Seq_by_acc(Locus => 'X77802');
80 Function: Gets a Bio::Seq object by accession number
81 Returns : A Bio::Seq object or undef if not found
82 Args : accession number (as a string), or a two
83 element list consisting of namespace=>accession
84 Throws : "more than one sequences correspond to this accession"
85 if the accession maps to multiple primary ids and
86 method is called in a scalar context
88 NOTE: The two-element form allows you to choose the namespace for the
89 accession number.
91 =cut
93 sub get_Seq_by_acc{
94 my ($self,@args) = @_;
95 $self->throw_not_implemented();
99 =head2 get_Seq_by_version
101 Title : get_Seq_by_version
102 Usage : $seq = $db->get_Seq_by_version('X77802.1');
103 Function: Gets a Bio::Seq object by sequence version
104 Returns : A Bio::Seq object
105 Args : accession.version (as a string)
106 Throws : "acc.version does not exist" exception
108 =cut
111 sub get_Seq_by_version{
112 my ($self,@args) = @_;
113 $self->throw_not_implemented();
116 ## End of Package