1 # POD documentation - main docs before the code
8 Bio::DB::RandomAccessI - Abstract interface for a sequence database
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
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.
33 Ewan Birney E<lt>birney@ebi.ac.ukE<gt> originally wrote this class.
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/
44 The rest of the documentation details each of the object
45 methods. Internal methods are usually preceded with a _
50 # Let the code begin...
52 package Bio
::DB
::RandomAccessI
;
58 use base
qw(Bio::Root::Root);
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,
71 my ($self,@args) = @_;
72 $self->throw_not_implemented();
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
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
111 sub get_Seq_by_version
{
112 my ($self,@args) = @_;
113 $self->throw_not_implemented();