1
# $Id: SeqVersion.pm,v 1.5.4.2 2006/10/05 12:17:55 sendu Exp $
3
# BioPerl module for Bio::DB::SeqVersion
5
# Cared for by Brian Osborne
7
# Copyright Brian Osborne 2006
9
# You may distribute this module under the same terms as Perl itself
11
# POD documentation - main docs before the code
15
Bio::DB::SeqVersion - front end to querying databases for identifier
20
use Bio::DB::SeqVersion;
22
my $query = Bio::DB::SeqVersion->new(-type => 'gi');
24
my @all_gis = $query->get_all(2);
26
my $live_gi = $query->get_recent(2);
30
The default type is 'gi'.
36
User feedback is an integral part of the evolution of this and other
37
Bioperl modules. Send your comments and suggestions preferably to
38
the Bioperl mailing list. Your participation is much appreciated.
40
bioperl-l@bioperl.org - General discussion
41
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
45
Report bugs to the Bioperl bug tracking system to help us keep track
46
of the bugs and their resolution. Bug reports can be submitted via
49
http://bugzilla.open-bio.org/
51
=head1 AUTHOR - Brian Osborne
53
Email bosborne at alum.mit.edu
57
Torsten Seemann - torsten.seemann AT infotech.monash.edu.au
61
The rest of the documentation details each of the object methods.
62
Internal methods are usually preceded with a _
66
# Let the code begin...
68
package Bio::DB::SeqVersion;
71
use base qw(Bio::WebAgent Bio::Root::Root);
73
# Private class variable
75
my $DEFAULTIDTYPE = 'gi'; # sub default_id_type()
79
Usage : my $obj = new Bio::DB::SeqVersion();
80
Function: Create a Bio::DB::SeqVersion object
81
Returns : An instance of Bio::DB::SeqVersion
82
Args : -type Identifier namespace, default is 'gi'
87
my($class,@args) = @_;
89
if( $class =~ /Bio::DB::SeqVersion::\S+/ ) {
90
my ($self) = $class->SUPER::new(@args);
91
$self->_initialize(@args);
96
@param{ map { lc $_ } keys %param } = values %param; # lowercase keys
98
# we delete '-type' so it doesn't get passed to the sub-class constructor
99
# note: delete() returns the value of the item deleted (undef if non-existent)
100
my $type = lc( delete($param{'-type'}) || $DEFAULTIDTYPE );
102
return unless( $class->_load_seqversion_module($type) );
104
# we pass %param here, not @args, as we have filtered out -type
105
return "Bio::DB::SeqVersion::$type"->new(%param);
120
my ($self,@args) = @_;
121
$self->throw_not_implemented();
135
my ($self,@args) = @_;
136
$self->throw_not_implemented();
139
=head2 _load_seqversion_module
141
Title : _load_seqversion_module
142
Usage : Used internally
143
Function: Loads up a module at run time on demand
146
Args : Name of identifier type
150
sub _load_seqversion_module {
152
my $module = "Bio::DB::SeqVersion::" . $db;
155
eval { $ok = $self->_load_module($module) };
159
$self: $module cannot be found
161
For more information about the Bio::DB::SeqVersion system please see
162
the Bio::DB::SeqVersion docs.
169
=head2 default_id_type
171
Title : default_id_type
172
Usage : my $type = $self->default_id_type
173
Function: Returns default identifier type for this module
179
sub default_id_type {
180
return $DEFAULTIDTYPE;