| 1 | # | ||
| 2 | # | ||
| 3 | # BioPerl module for wrapping Blast statistics | ||
| 4 | # | ||
| 5 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 6 | # | ||
| 7 | # Cared for by Chad Matsalla (bioinformatics1 at dieselwurks dot com) | ||
| 8 | # | ||
| 9 | # Copyright Chad Matsalla | ||
| 10 | # | ||
| 11 | # You may distribute this module under the same terms as perl itself | ||
| 12 | |||
| 13 | # POD documentation - main docs before the code | ||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | Bio::Search::BlastStatistics - An object for Blast statistics | ||
| 18 | |||
| 19 | =head1 SYNOPSIS | ||
| 20 | |||
| 21 | # this is a wrapper to hold the statistics from a Blast report | ||
| 22 | my $bs = $result->get_statistics(); | ||
| 23 | # you can get a statistic generically, like this: | ||
| 24 | my $kappa = $bs->get_statistic("kappa"); | ||
| 25 | # or specifically, like this: | ||
| 26 | my $kappa2 = $bs->get_kappa(); | ||
| 27 | |||
| 28 | |||
| 29 | =head1 DESCRIPTION | ||
| 30 | |||
| 31 | This is a basic container to hold the statistics returned from a Blast. | ||
| 32 | |||
| 33 | =head1 FEEDBACK | ||
| 34 | |||
| 35 | =head2 Mailing Lists | ||
| 36 | |||
| 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. | ||
| 40 | |||
| 41 | bioperl-l@bioperl.org - General discussion | ||
| 42 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 43 | |||
| 44 | =head2 Support | ||
| 45 | |||
| 46 | Please direct usage questions or support issues to the mailing list: | ||
| 47 | |||
| 48 | I<bioperl-l@bioperl.org> | ||
| 49 | |||
| 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. | ||
| 54 | |||
| 55 | =head2 Reporting Bugs | ||
| 56 | |||
| 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 the | ||
| 59 | web: | ||
| 60 | |||
| 61 | https://github.com/bioperl/bioperl-live/issues | ||
| 62 | |||
| 63 | =head1 AUTHOR - Chad Matsalla | ||
| 64 | |||
| 65 | Email bioinformatics1 at dieselwurks dot com | ||
| 66 | |||
| 67 | =head1 APPENDIX | ||
| 68 | |||
| 69 | The rest of the documentation details each of the object methods. | ||
| 70 | Internal methods are usually preceded with a _ | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | |||
| 75 | # Let the code begin... | ||
| 76 | |||
| 77 | |||
| 78 | package Bio::Search::BlastStatistics; | ||
| 79 | 13 | $Bio::Search::BlastStatistics::VERSION = '1.7.8'; | |
| 80 | 13 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 81 | |||
| 82 | # Object preamble - inherits from Bio::Root::Root | ||
| 83 | |||
| 84 | |||
| 85 | 13 | ▶ | use base qw(Bio::Root::RootI Bio::Search::StatisticsI); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | |||
| 91 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 92 | 0 | my ($class, @args) = @_; | |
| 93 | # really, don't bother with any initial initialization | ||
| 94 | 0 | my $self = $class->SUPER::new(@args); | |
| 95 | 0 | return $self; | |
| 96 | } | ||
| 97 | |||
| 98 | |||
| 99 | =head2 get_statistic | ||
| 100 | |||
| 101 | Title : get_statistic | ||
| 102 | Usage : $statistic_object->get_statistic($statistic_name); | ||
| 103 | Function: Get the value of a statistic named $statistic_name | ||
| 104 | Returns : A scalar that should be a string | ||
| 105 | Args : A scalar that should be a string | ||
| 106 | |||
| 107 | =cut | ||
| 108 | |||
| 109 | 0 | ▶ | sub get_statistic { |
|
Subroutine
get_statistic: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 110 | 0 | my ($self,$arg) = @_; | |
| 111 | 0 | return $self->{$arg}; | |
| 112 | } | ||
| 113 | |||
| 114 | |||
| 115 | =head2 set_statistic | ||
| 116 | |||
| 117 | Title : set_statistic | ||
| 118 | Usage : $statistic_object->set_statistic($statistic_name => $statistic_value); | ||
| 119 | Function: Set the value of a statistic named $statistic_name to $statistic_value | ||
| 120 | Returns : Void | ||
| 121 | Args : A hash containing name=>value pairs | ||
| 122 | |||
| 123 | =cut | ||
| 124 | |||
| 125 | 0 | ▶ | sub set_statistic { |
|
Subroutine
set_statistic: not called CC=2 SCAR=17.9
Pod
documented
| |||
| 126 | 0 | my ($self,%args) = @_; | |
| 127 | 0 | foreach (keys %args) { | |
| 128 | 0 | $self->{$_} = $args{$_}; | |
| 129 | } | ||
| 130 | } | ||
| 131 | |||
| 132 | |||
| 133 | |||
| 134 | 13 | 1; | |