1 # POD documentation - main docs before the code
7 Bio::DB::RandomAccessI - Abstract interface for a sequence database
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
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 an accession number.
32 Ewan Birney E<lt>birney@ebi.ac.ukE<gt> originally wrote this class.
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.
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 https://github.com/bioperl/bioperl-live/issues
54 The rest of the documentation details each of the object
55 methods. Internal methods are usually preceded with a _
60 # Let the code begin...
62 package Bio
::DB
::RandomAccessI
;
68 use base
qw(Bio::Root::Root);
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,
81 my ($self,@args) = @_;
82 $self->throw_not_implemented();
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
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
121 sub get_Seq_by_version
{
122 my ($self,@args) = @_;
123 $self->throw_not_implemented();