2 # BioPerl module for Bio::DB::SeqVersion
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Brian Osborne
8 # Copyright Brian Osborne 2006
10 # You may distribute this module under the same terms as Perl itself
12 # POD documentation - main docs before the code
16 Bio::DB::SeqVersion - front end to querying databases for identifier
21 use Bio::DB::SeqVersion;
23 my $query = Bio::DB::SeqVersion->new(-type => 'gi');
25 my @all_gis = $query->get_all(2);
27 my $live_gi = $query->get_recent(2);
31 The default type is 'gi'.
37 User feedback is an integral part of the evolution of this and other
38 Bioperl modules. Send your comments and suggestions preferably to
39 the Bioperl mailing list. Your participation is much appreciated.
41 bioperl-l@bioperl.org - General discussion
42 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
46 Please direct usage questions or support issues to the mailing list:
48 I<bioperl-l@bioperl.org>
50 rather than to the module maintainer directly. Many experienced and
51 reponsive experts will be able look at the problem and quickly
52 address it. Please include a thorough description of the problem
53 with code and data examples if at all possible.
57 Report bugs to the Bioperl bug tracking system to help us keep track
58 of the bugs and their resolution. Bug reports can be submitted via
61 https://github.com/bioperl/bioperl-live/issues
63 =head1 AUTHOR - Brian Osborne
65 Email bosborne at alum.mit.edu
69 Torsten Seemann - torsten.seemann AT infotech.monash.edu.au
73 The rest of the documentation details each of the object methods.
74 Internal methods are usually preceded with a _
78 # Let the code begin...
80 package Bio
::DB
::SeqVersion
;
83 use base
qw(Bio::WebAgent Bio::Root::Root);
85 # Private class variable
87 my $DEFAULTIDTYPE = 'gi'; # sub default_id_type()
91 Usage : my $obj = Bio::DB::SeqVersion->new();
92 Function: Create a Bio::DB::SeqVersion object
93 Returns : An instance of Bio::DB::SeqVersion
94 Args : -type Identifier namespace, default is 'gi'
99 my($class,@args) = @_;
101 if( $class =~ /Bio::DB::SeqVersion::\S+/ ) {
102 my ($self) = $class->SUPER::new
(@args);
103 $self->_initialize(@args);
108 @param{ map { lc $_ } keys %param } = values %param; # lowercase keys
110 # we delete '-type' so it doesn't get passed to the sub-class constructor
111 # note: delete() returns the value of the item deleted (undef if non-existent)
112 my $type = lc( delete($param{'-type'}) || $DEFAULTIDTYPE );
114 return unless( $class->_load_seqversion_module($type) );
116 # we pass %param here, not @args, as we have filtered out -type
117 return "Bio::DB::SeqVersion::$type"->new(%param);
132 my ($self,@args) = @_;
133 $self->throw_not_implemented();
147 my ($self,@args) = @_;
148 $self->throw_not_implemented();
151 =head2 _load_seqversion_module
153 Title : _load_seqversion_module
154 Usage : Used internally
155 Function: Loads up a module at run time on demand
158 Args : Name of identifier type
162 sub _load_seqversion_module
{
164 my $module = "Bio::DB::SeqVersion::" . $db;
167 eval { $ok = $self->_load_module($module) };
171 $self: $module cannot be found
173 For more information about the Bio::DB::SeqVersion system please see
174 the Bio::DB::SeqVersion docs.
181 =head2 default_id_type
183 Title : default_id_type
184 Usage : my $type = $self->default_id_type
185 Function: Returns default identifier type for this module
191 sub default_id_type
{
192 return $DEFAULTIDTYPE;