[bug 3148] switch default to "expasy" until we can work out REST service interface
[bioperl-live.git] / Bio / DB / RandomAccessI.pm
bloba7153defd966099d2d40edbb5ab732960d0ca45f
1 # POD documentation - main docs before the code
5 =head1 NAME
7 Bio::DB::RandomAccessI - Abstract interface for a sequence database
9 =head1 SYNOPSIS
12 # get a database object somehow using a concrete class
15 $seq = $db->get_Seq_by_id('ROA1_HUMAN');
18 # $seq is a Bio::Seq object
21 =head1 DESCRIPTION
23 This is a pure interface class - in other words, all this does is define
24 methods which other (concrete) classes will actually implement.
26 The Bio::DB::RandomAccessI class defines what methods a generic database class
27 should have. At the moment it is just the ability to make Bio::Seq objects
28 from a name (id) or a accession number.
30 =head1 CONTACT
32 Ewan Birney E<lt>birney@ebi.ac.ukE<gt> originally wrote this class.
34 =head2 Support
36 Please direct usage questions or support issues to the mailing list:
38 I<bioperl-l@bioperl.org>
40 rather than to the module maintainer directly. Many experienced and
41 reponsive experts will be able look at the problem and quickly
42 address it. Please include a thorough description of the problem
43 with code and data examples if at all possible.
45 =head2 Reporting Bugs
47 Report bugs to the Bioperl bug tracking system to help us keep track
48 the bugs and their resolution. Bug reports can be submitted via the web:
50 http://bugzilla.open-bio.org/
52 =head1 APPENDIX
54 The rest of the documentation details each of the object
55 methods. Internal methods are usually preceded with a _
57 =cut
60 # Let the code begin...
62 package Bio::DB::RandomAccessI;
64 use strict;
66 use Bio::Root::RootI;
68 use base qw(Bio::Root::Root);
70 =head2 get_Seq_by_id
72 Title : get_Seq_by_id
73 Usage : $seq = $db->get_Seq_by_id('ROA1_HUMAN')
74 Function: Gets a Bio::Seq object by its name
75 Returns : a Bio::Seq object or undef if not found
76 Args : the id (as a string) of a sequence,
78 =cut
80 sub get_Seq_by_id{
81 my ($self,@args) = @_;
82 $self->throw_not_implemented();
85 =head2 get_Seq_by_acc
87 Title : get_Seq_by_acc
88 Usage : $seq = $db->get_Seq_by_acc('X77802');
89 $seq = $db->get_Seq_by_acc(Locus => 'X77802');
90 Function: Gets a Bio::Seq object by accession number
91 Returns : A Bio::Seq object or undef if not found
92 Args : accession number (as a string), or a two
93 element list consisting of namespace=>accession
94 Throws : "more than one sequences correspond to this accession"
95 if the accession maps to multiple primary ids and
96 method is called in a scalar context
98 NOTE: The two-element form allows you to choose the namespace for the
99 accession number.
101 =cut
103 sub get_Seq_by_acc{
104 my ($self,@args) = @_;
105 $self->throw_not_implemented();
109 =head2 get_Seq_by_version
111 Title : get_Seq_by_version
112 Usage : $seq = $db->get_Seq_by_version('X77802.1');
113 Function: Gets a Bio::Seq object by sequence version
114 Returns : A Bio::Seq object
115 Args : accession.version (as a string)
116 Throws : "acc.version does not exist" exception
118 =cut
121 sub get_Seq_by_version{
122 my ($self,@args) = @_;
123 $self->throw_not_implemented();
126 ## End of Package