| 1 | # | ||
| 2 | # BioPerl module for wrapping runtime parameters | ||
| 3 | # | ||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 5 | # | ||
| 6 | # Cared for by Chad Matsalla (bioinformatics1 at dieselwurks dot com) | ||
| 7 | # | ||
| 8 | # Copyright Chad Matsalla | ||
| 9 | # | ||
| 10 | # You may distribute this module under the same terms as perl itself | ||
| 11 | |||
| 12 | # POD documentation - main docs before the code | ||
| 13 | |||
| 14 | =head1 NAME | ||
| 15 | |||
| 16 | Bio::Tools::Run::GenericParameters - An object for the parameters used to run programs | ||
| 17 | |||
| 18 | =head1 SYNOPSIS | ||
| 19 | |||
| 20 | my $void = $obj->set_parameter("parameter_name","parameter_value"); | ||
| 21 | my $value = $obj->get_parameter("parameter_name"); | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | This is a basic container to hold the parameters used to run a | ||
| 26 | program. This module may get incorporated into the more generic | ||
| 27 | Bio::Tools::Run framework in bioperl-run distribution. | ||
| 28 | |||
| 29 | =head1 FEEDBACK | ||
| 30 | |||
| 31 | =head2 Mailing Lists | ||
| 32 | |||
| 33 | User feedback is an integral part of the evolution of this and other | ||
| 34 | Bioperl modules. Send your comments and suggestions preferably to | ||
| 35 | the Bioperl mailing list. Your participation is much appreciated. | ||
| 36 | |||
| 37 | bioperl-l@bioperl.org - General discussion | ||
| 38 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 39 | |||
| 40 | =head2 Support | ||
| 41 | |||
| 42 | Please direct usage questions or support issues to the mailing list: | ||
| 43 | |||
| 44 | I<bioperl-l@bioperl.org> | ||
| 45 | |||
| 46 | rather than to the module maintainer directly. Many experienced and | ||
| 47 | reponsive experts will be able look at the problem and quickly | ||
| 48 | address it. Please include a thorough description of the problem | ||
| 49 | with code and data examples if at all possible. | ||
| 50 | |||
| 51 | =head2 Reporting Bugs | ||
| 52 | |||
| 53 | Report bugs to the Bioperl bug tracking system to help us keep track | ||
| 54 | of the bugs and their resolution. Bug reports can be submitted via the | ||
| 55 | web: | ||
| 56 | |||
| 57 | https://github.com/bioperl/bioperl-live/issues | ||
| 58 | |||
| 59 | =head1 AUTHOR - Chad Matsalla | ||
| 60 | |||
| 61 | Email bioinformatics1 at dieselwurks dot com | ||
| 62 | |||
| 63 | =head1 CONTRIBUTORS | ||
| 64 | |||
| 65 | Sendu Bala, bix@sendu.me.uk | ||
| 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 | # Let the code begin... | ||
| 75 | |||
| 76 | package Bio::Tools::Run::GenericParameters; | ||
| 77 | 36 | $Bio::Tools::Run::GenericParameters::VERSION = '1.7.8'; | |
| 78 | 36 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 79 | |||
| 80 | 36 | ▶ | use base qw(Bio::Root::Root Bio::Tools::Run::ParametersI); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 81 | |||
| 82 | 152 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 83 | 152 | my ($class, @args) = @_; | |
| 84 | 152 | my $self = $class->SUPER::new(@args); | |
| 85 | 152 | return $self; | |
| 86 | } | ||
| 87 | |||
| 88 | =head2 get_parameter | ||
| 89 | |||
| 90 | Title : get_parameter | ||
| 91 | Usage : $parameter_object->get_parameter($param_name); | ||
| 92 | Function: Get the value of a parameter named $param_name | ||
| 93 | Returns : A scalar that should be a string | ||
| 94 | Args : A scalar that should be a string | ||
| 95 | |||
| 96 | =cut | ||
| 97 | |||
| 98 | 66 | ▶ | sub get_parameter { |
|
Subroutine
get_parameter: called CC=1 SCAR=0.0
Pod
documented
| |||
| 99 | 66 | my ($self,$arg) = @_; | |
| 100 | 66 | return $self->{params}->{$arg}; | |
| 101 | } | ||
| 102 | |||
| 103 | =head2 set_parameter | ||
| 104 | |||
| 105 | Title : set_parameter | ||
| 106 | Usage : $parameter_object->set_parameter($param_name => $param_value); | ||
| 107 | Function: Set the value of a parameter named $param_name to $param_value | ||
| 108 | Returns : Void | ||
| 109 | Args : A hash containing name=>value pairs | ||
| 110 | |||
| 111 | =cut | ||
| 112 | |||
| 113 | 290 | ▶ | sub set_parameter { |
|
Subroutine
set_parameter: called CC=1 SCAR=0.0
Pod
documented
| |||
| 114 | 290 | my ($self,$name,$value) = @_; | |
| 115 | 290 | $self->{params}->{$name} = $value; | |
| 116 | } | ||
| 117 | |||
| 118 | =head2 available_parameters | ||
| 119 | |||
| 120 | Title : available_parameters | ||
| 121 | Usage : my @paramnames = $parameter_object->available_parameters | ||
| 122 | Function: Returns the names of the available parameters | ||
| 123 | Returns : list of available parameter names | ||
| 124 | Args : none | ||
| 125 | |||
| 126 | =cut | ||
| 127 | |||
| 128 | 5 | ▶ | sub available_parameters { |
|
Subroutine
available_parameters: called CC=1 SCAR=0.0
Pod
documented
| |||
| 129 | 5 | my $self = shift; | |
| 130 | 5 | return keys %{$self->{params}}; | |
| 131 | } | ||
| 132 | |||
| 133 | 36 | 1; | |