| 1 | #----------------------------------------------------------------- | ||||||||||
| 2 | # | ||||||||||
| 3 | # BioPerl module Bio::Search::GenericDatabase | ||||||||||
| 4 | # | ||||||||||
| 5 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||
| 6 | # | ||||||||||
| 7 | # Cared for by Steve Chervitz <sac@bioperl.org> | ||||||||||
| 8 | # | ||||||||||
| 9 | # You may distribute this module under the same terms as perl itself | ||||||||||
| 10 | #----------------------------------------------------------------- | ||||||||||
| 11 | |||||||||||
| 12 | # POD documentation - main docs before the code | ||||||||||
| 13 | |||||||||||
| 14 | =head1 NAME | ||||||||||
| 15 | |||||||||||
| 16 | Bio::Search::GenericDatabase - Generic implementation of Bio::Search::DatabaseI | ||||||||||
| 17 | |||||||||||
| 18 | =head1 SYNOPSIS | ||||||||||
| 19 | |||||||||||
| 20 | use Bio::Search::GenericDatabase; | ||||||||||
| 21 | |||||||||||
| 22 | $db = Bio::Search::GenericDatabase->new( -name => 'my Blast db', | ||||||||||
| 23 | -date => '2001-03-13', | ||||||||||
| 24 | -length => 2352511, | ||||||||||
| 25 | -entries => 250000 ); | ||||||||||
| 26 | |||||||||||
| 27 | $name = $db->name(); | ||||||||||
| 28 | $date = $db->date(); | ||||||||||
| 29 | $num_letters = $db->letters(); | ||||||||||
| 30 | $num_entries = $db->entries(); | ||||||||||
| 31 | |||||||||||
| 32 | =head1 DESCRIPTION | ||||||||||
| 33 | |||||||||||
| 34 | This module provides a basic implementation of L<Bio::Search::DatabaseI>. | ||||||||||
| 35 | See documentation in that module for more information. | ||||||||||
| 36 | |||||||||||
| 37 | =head1 FEEDBACK | ||||||||||
| 38 | |||||||||||
| 39 | =head2 Mailing Lists | ||||||||||
| 40 | |||||||||||
| 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. | ||||||||||
| 44 | |||||||||||
| 45 | bioperl-l@bioperl.org - General discussion | ||||||||||
| 46 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||
| 47 | |||||||||||
| 48 | =head2 Support | ||||||||||
| 49 | |||||||||||
| 50 | Please direct usage questions or support issues to the mailing list: | ||||||||||
| 51 | |||||||||||
| 52 | I<bioperl-l@bioperl.org> | ||||||||||
| 53 | |||||||||||
| 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. | ||||||||||
| 58 | |||||||||||
| 59 | =head2 Reporting Bugs | ||||||||||
| 60 | |||||||||||
| 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: | ||||||||||
| 64 | |||||||||||
| 65 | https://github.com/bioperl/bioperl-live/issues | ||||||||||
| 66 | |||||||||||
| 67 | =head1 AUTHOR | ||||||||||
| 68 | |||||||||||
| 69 | Steve Chervitz E<lt>sac@bioperl.orgE<gt> | ||||||||||
| 70 | |||||||||||
| 71 | See L<the FEEDBACK section | FEEDBACK> for where to send bug reports and comments. | ||||||||||
| 72 | |||||||||||
| 73 | =head1 COPYRIGHT | ||||||||||
| 74 | |||||||||||
| 75 | Copyright (c) 2001 Steve Chervitz. All Rights Reserved. | ||||||||||
| 76 | |||||||||||
| 77 | =head1 DISCLAIMER | ||||||||||
| 78 | |||||||||||
| 79 | This software is provided "as is" without warranty of any kind. | ||||||||||
| 80 | |||||||||||
| 81 | =cut | ||||||||||
| 82 | |||||||||||
| 83 | =head1 APPENDIX | ||||||||||
| 84 | |||||||||||
| 85 | |||||||||||
| 86 | The rest of the documentation details each of the object methods. | ||||||||||
| 87 | |||||||||||
| 88 | =cut | ||||||||||
| 89 | |||||||||||
| 90 | # Let the code begin... | ||||||||||
| 91 | |||||||||||
| 92 | package Bio::Search::GenericDatabase; | ||||||||||
| 93 | 1 | $Bio::Search::GenericDatabase::VERSION = '1.7.8'; | |||||||||
| 94 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 95 | |||||||||||
| 96 | 1 | ▶ | use base qw(Bio::Root::Root Bio::Search::DatabaseI); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 97 | |||||||||||
| 98 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||
| 99 | 0 | my ($class, @args) = @_; | |||||||||
| 100 | 0 | my $self = $class->SUPER::new(@args); | |||||||||
| 101 | 0 | my ($name, $date, $length, $ents) = | |||||||||
| 102 | $self->_rearrange( [qw(NAME DATE LENGTH ENTRIES)], @args); | ||||||||||
| 103 | |||||||||||
| 104 | 0 | ▶ | $name && $self->name($name); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 105 | 0 | ▶ | $date && $self->date($date); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 106 | 0 | ▶ | $length && $self->letters($length); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 107 | 0 | ▶ | $ents && $self->entries($ents); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 108 | |||||||||||
| 109 | 0 | return $self; | |||||||||
| 110 | } | ||||||||||
| 111 | |||||||||||
| 112 | =head2 name | ||||||||||
| 113 | |||||||||||
| 114 | See L<Bio::Search::DatabaseI::name>() for documentation | ||||||||||
| 115 | |||||||||||
| 116 | This implementation is a combined set/get accessor. | ||||||||||
| 117 | |||||||||||
| 118 | =cut | ||||||||||
| 119 | |||||||||||
| 120 | #--------------- | ||||||||||
| 121 | 0 | ▶ | sub name { | ||||||||
|
Subroutine
name: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 122 | #--------------- | ||||||||||
| 123 | 0 | my $self = shift; | |||||||||
| 124 | 0 | ▶ | if(@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 125 | 0 | my $name = shift; | |||||||||
| 126 | 0 | $name =~ s/(^\s+|\s+$)//g; | |||||||||
| 127 | 0 | $self->{'_db'} = $name; | |||||||||
| 128 | } | ||||||||||
| 129 | 0 | $self->{'_db'}; | |||||||||
| 130 | } | ||||||||||
| 131 | |||||||||||
| 132 | =head2 date | ||||||||||
| 133 | |||||||||||
| 134 | See L<Bio::Search::DatabaseI::date>() for documentation | ||||||||||
| 135 | |||||||||||
| 136 | This implementation is a combined set/get accessor. | ||||||||||
| 137 | |||||||||||
| 138 | =cut | ||||||||||
| 139 | |||||||||||
| 140 | #----------------------- | ||||||||||
| 141 | 0 | ▶ | sub date { | ||||||||
|
Subroutine
date: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 142 | #----------------------- | ||||||||||
| 143 | 0 | my $self = shift; | |||||||||
| 144 | 0 | ▶ | if(@_) { $self->{'_dbDate'} = shift; } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 145 | 0 | $self->{'_dbDate'}; | |||||||||
| 146 | } | ||||||||||
| 147 | |||||||||||
| 148 | |||||||||||
| 149 | =head2 letters | ||||||||||
| 150 | |||||||||||
| 151 | See L<Bio::Search::DatabaseI::letters>() for documentation | ||||||||||
| 152 | |||||||||||
| 153 | This implementation is a combined set/get accessor. | ||||||||||
| 154 | |||||||||||
| 155 | =cut | ||||||||||
| 156 | |||||||||||
| 157 | #---------------------- | ||||||||||
| 158 | 0 | ▶ | sub letters { | ||||||||
|
Subroutine
letters: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 159 | #---------------------- | ||||||||||
| 160 | 0 | my $self = shift; | |||||||||
| 161 | 0 | ▶ | if(@_) { $self->{'_dbLetters'} = shift; } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 162 | 0 | $self->{'_dbLetters'}; | |||||||||
| 163 | } | ||||||||||
| 164 | |||||||||||
| 165 | |||||||||||
| 166 | =head2 entries | ||||||||||
| 167 | |||||||||||
| 168 | See L<Bio::Search::DatabaseI::entries>() for documentation | ||||||||||
| 169 | |||||||||||
| 170 | This implementation is a combined set/get accessor. | ||||||||||
| 171 | |||||||||||
| 172 | =cut | ||||||||||
| 173 | |||||||||||
| 174 | #------------------ | ||||||||||
| 175 | 0 | ▶ | sub entries { | ||||||||
|
Subroutine
entries: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 176 | #------------------ | ||||||||||
| 177 | 0 | my $self = shift; | |||||||||
| 178 | 0 | ▶ | if(@_) { $self->{'_dbEntries'} = shift; } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 179 | 0 | $self->{'_dbEntries'}; | |||||||||
| 180 | } | ||||||||||
| 181 | |||||||||||
| 182 | 1 | 1; | |||||||||