3 # BioPerl module for wrapping statistics
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Chad Matsalla (bioinformatics1 at dieselwurks dot com)
9 # Copyright Chad Matsalla
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Search::GenericStatistics - An object for statistics
21 my $void = $obj->set_statistic("statistic_name","statistic_value");
22 my $value = $obj->get_statistic("statistic_name");
26 This is a basic container to hold the statistics returned from a program.
32 User feedback is an integral part of the evolution of this and other
33 Bioperl modules. Send your comments and suggestions preferably to
34 the Bioperl mailing list. Your participation is much appreciated.
36 bioperl-l@bioperl.org - General discussion
37 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
41 Please direct usage questions or support issues to the mailing list:
43 I<bioperl-l@bioperl.org>
45 rather than to the module maintainer directly. Many experienced and
46 reponsive experts will be able look at the problem and quickly
47 address it. Please include a thorough description of the problem
48 with code and data examples if at all possible.
52 Report bugs to the Bioperl bug tracking system to help us keep track
53 of the bugs and their resolution. Bug reports can be submitted via the
56 https://github.com/bioperl/bioperl-live/issues
58 =head1 AUTHOR - Chad Matsalla
60 Email bioinformatics1 at dieselwurks dot com
64 Sendu Bala, bix@sendu.me.uk
68 The rest of the documentation details each of the object methods.
69 Internal methods are usually preceded with a _
73 # Let the code begin...
75 package Bio
::Search
::GenericStatistics
;
79 use base
qw(Bio::Root::Root Bio::Search::StatisticsI);
82 my ($class, @args) = @_;
83 my $self = $class->SUPER::new
(@args);
90 Usage : $statistic_object->get_statistic($statistic_name);
91 Function: Get the value of a statistic named $statistic_name
92 Returns : A scalar that should be a string
93 Args : A scalar that should be a string
99 return $self->{stats
}->{$arg};
104 Title : set_statistic
105 Usage : $statistic_object->set_statistic($statistic_name => $statistic_value);
106 Function: Set the value of a statistic named $statistic_name to $statistic_value
108 Args : A hash containing name=>value pairs
113 my ($self,$name,$value) = @_;
114 $self->{stats
}->{$name} = $value;
117 =head2 available_statistics
119 Title : available_statistics
120 Usage : my @statnames = $statistic_object->available_statistics
121 Function: Returns the names of the available statistics
122 Returns : list of available statistic names
127 sub available_statistics
{
129 return keys %{$self->{stats
}};