Back this out, related tests are failing
[bioperl-live.git] / Bio / Search / GenericDatabase.pm
blob540fc7c2467581caae596ad35bbb9e6496f87b9d
1 #-----------------------------------------------------------------
3 # BioPerl module Bio::Search::GenericDatabase
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Steve Chervitz <sac@bioperl.org>
9 # You may distribute this module under the same terms as perl itself
10 #-----------------------------------------------------------------
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::Search::GenericDatabase - Generic implementation of Bio::Search::DatabaseI
18 =head1 SYNOPSIS
20 use Bio::Search::GenericDatabase;
22 $db = Bio::Search::GenericDatabase->new( -name => 'my Blast db',
23 -date => '2001-03-13',
24 -length => 2352511,
25 -entries => 250000 );
27 $name = $db->name();
28 $date = $db->date();
29 $num_letters = $db->letters();
30 $num_entries = $db->entries();
32 =head1 DESCRIPTION
34 This module provides a basic implementation of L<Bio::Search::DatabaseI>.
35 See documentation in that module for more information.
37 =head1 FEEDBACK
39 =head2 Mailing Lists
41 User feedback is an integral part of the evolution of this and other
42 Bioperl modules. Send your comments and suggestions preferably to one
43 of the Bioperl mailing lists. Your participation is much appreciated.
45 bioperl-l@bioperl.org - General discussion
46 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
48 =head2 Support
50 Please direct usage questions or support issues to the mailing list:
52 I<bioperl-l@bioperl.org>
54 rather than to the module maintainer directly. Many experienced and
55 reponsive experts will be able look at the problem and quickly
56 address it. Please include a thorough description of the problem
57 with code and data examples if at all possible.
59 =head2 Reporting Bugs
61 Report bugs to the Bioperl bug tracking system to help us keep track
62 the bugs and their resolution. Bug reports can be submitted via the
63 web:
65 https://redmine.open-bio.org/projects/bioperl/
67 =head1 AUTHOR
69 Steve Chervitz E<lt>sac@bioperl.orgE<gt>
71 See L<the FEEDBACK section | FEEDBACK> for where to send bug reports and comments.
73 =head1 COPYRIGHT
75 Copyright (c) 2001 Steve Chervitz. All Rights Reserved.
77 =head1 DISCLAIMER
79 This software is provided "as is" without warranty of any kind.
81 =cut
83 =head1 APPENDIX
86 The rest of the documentation details each of the object methods.
88 =cut
90 # Let the code begin...
92 package Bio::Search::GenericDatabase;
94 use strict;
96 use base qw(Bio::Root::Root Bio::Search::DatabaseI);
98 sub new {
99 my ($class, @args) = @_;
100 my $self = $class->SUPER::new(@args);
101 my ($name, $date, $length, $ents) =
102 $self->_rearrange( [qw(NAME DATE LENGTH ENTRIES)], @args);
104 $name && $self->name($name);
105 $date && $self->date($date);
106 $length && $self->letters($length);
107 $ents && $self->entries($ents);
109 return $self;
112 =head2 name
114 See L<Bio::Search::DatabaseI::name>() for documentation
116 This implementation is a combined set/get accessor.
118 =cut
120 #---------------
121 sub name {
122 #---------------
123 my $self = shift;
124 if(@_) {
125 my $name = shift;
126 $name =~ s/(^\s+|\s+$)//g;
127 $self->{'_db'} = $name;
129 $self->{'_db'};
132 =head2 date
134 See L<Bio::Search::DatabaseI::date>() for documentation
136 This implementation is a combined set/get accessor.
138 =cut
140 #-----------------------
141 sub date {
142 #-----------------------
143 my $self = shift;
144 if(@_) { $self->{'_dbDate'} = shift; }
145 $self->{'_dbDate'};
149 =head2 letters
151 See L<Bio::Search::DatabaseI::letters>() for documentation
153 This implementation is a combined set/get accessor.
155 =cut
157 #----------------------
158 sub letters {
159 #----------------------
160 my $self = shift;
161 if(@_) { $self->{'_dbLetters'} = shift; }
162 $self->{'_dbLetters'};
166 =head2 entries
168 See L<Bio::Search::DatabaseI::entries>() for documentation
170 This implementation is a combined set/get accessor.
172 =cut
174 #------------------
175 sub entries {
176 #------------------
177 my $self = shift;
178 if(@_) { $self->{'_dbEntries'} = shift; }
179 $self->{'_dbEntries'};