maint: restructure to use Dist::Zilla
[bioperl-live.git] / lib / Bio / Matrix / Scoring.pm
blob84788ca7022d0376013bc3d7b772706dcf87b7e9
2 # BioPerl module for Bio::Matrix::Scoring
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Jason Stajich <jason-at-bioperl-dot-org>
8 # Copyright Jason Stajich
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::Matrix::Scoring - Object which can hold scoring matrix information
18 =head1 SYNOPSIS
20 use Bio::Matrix::Scoring;
22 =head1 DESCRIPTION
24 An object which can handle AA or NT scoring matrix information. Some
25 transformation properties are available too.
27 =head1 FEEDBACK
29 =head2 Mailing Lists
31 User feedback is an integral part of the evolution of this and other
32 Bioperl modules. Send your comments and suggestions preferably to
33 the Bioperl mailing list. Your participation is much appreciated.
35 bioperl-l@bioperl.org - General discussion
36 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
38 =head2 Support
40 Please direct usage questions or support issues to the mailing list:
42 I<bioperl-l@bioperl.org>
44 rather than to the module maintainer directly. Many experienced and
45 reponsive experts will be able look at the problem and quickly
46 address it. Please include a thorough description of the problem
47 with code and data examples if at all possible.
49 =head2 Reporting Bugs
51 Report bugs to the Bioperl bug tracking system to help us keep track
52 of the bugs and their resolution. Bug reports can be submitted via
53 the web:
55 https://github.com/bioperl/bioperl-live/issues
57 =head1 AUTHOR - Jason Stajich
59 Email jason-at-bioperl-dot-org
61 =head1 APPENDIX
63 The rest of the documentation details each of the object methods.
64 Internal methods are usually preceded with a _
66 =cut
69 # Let the code begin...
72 package Bio::Matrix::Scoring;
73 use strict;
76 use base qw(Bio::Matrix::Generic);
78 =head2 new
80 Title : new
81 Usage : my $obj = Bio::Matrix::Scoring->new();
82 Function: Builds a new Bio::Matrix::Scoring object
83 Returns : an instance of Bio::Matrix::Scoring
84 Args :
87 =cut
90 sub new {
91 my ($class, @args) = @_;
92 my $self = $class->SUPER::new(@args);
94 my ($entropy,$expected,$scale,$scaleval,$database,
95 $lowestscore,$highestscore,$lambda,$H) =
96 $self->_rearrange([qw(
97 ENTROPY EXPECTED SCALE SCALE_VALUE DATABASE
98 LOWEST_SCORE HIGHEST_SCORE LAMBDA H)], @args);
100 $self->entropy ($entropy);
101 $self->expected_score($expected);
102 $self->scale ($scale);
103 $self->scale_value($scaleval);
104 $self->database ($database);
105 $self->lowest_score($lowestscore);
106 $self->highest_score($highestscore);
107 $self->lambda($lambda);
108 $self->H($H);
110 return $self;
113 =head2 entropy
115 Title : entropy
116 Usage : $obj->entropy($newval)
117 Function:
118 Example :
119 Returns : value of entropy (a scalar)
120 Args : on set, new value (a scalar or undef, optional)
123 =cut
125 sub entropy{
126 my $self = shift;
128 return $self->{'entropy'} = shift if @_;
129 return $self->{'entropy'};
132 =head2 expected_score
134 Title : expected_score
135 Usage : $obj->expected_score($newval)
136 Function:
137 Example :
138 Returns : value of expected (a scalar)
139 Args : on set, new value (a scalar or undef, optional)
142 =cut
144 sub expected_score{
145 my $self = shift;
147 return $self->{'expected'} = shift if @_;
148 return $self->{'expected'};
151 =head2 scale
153 Title : scale
154 Usage : $obj->scale($newval)
155 Function:
156 Example :
157 Returns : value of scale (a scalar)
158 Args : on set, new value (a scalar or undef, optional)
161 =cut
163 sub scale{
164 my $self = shift;
166 return $self->{'scale'} = shift if @_;
167 return $self->{'scale'};
170 =head2 scale_value
172 Title : scale_value
173 Usage : $obj->scale_value($newval)
174 Function:
175 Example :
176 Returns : value of scale_value (a scalar)
177 Args : on set, new value (a scalar or undef, optional)
180 =cut
182 sub scale_value{
183 my $self = shift;
185 return $self->{'scale_value'} = shift if @_;
186 return $self->{'scale_value'};
189 =head2 description
191 Title : description
192 Usage : $obj->description($newval)
193 Function:
194 Example :
195 Returns : value of description (a scalar)
196 Args : on set, new value (a scalar or undef, optional)
199 =cut
201 sub description{
202 my $self = shift;
204 return $self->{'description'} = shift if @_;
205 return $self->{'description'};
208 =head2 database
210 Title : database
211 Usage : $obj->database($newval)
212 Function:
213 Example :
214 Returns : value of database (a scalar)
215 Args : on set, new value (a scalar or undef, optional)
218 =cut
220 sub database{
221 my $self = shift;
223 return $self->{'database'} = shift if @_;
224 return $self->{'database'};
227 =head2 lowest_score
229 Title : lowest_score
230 Usage : $obj->lowest_score($newval)
231 Function:
232 Example :
233 Returns : value of lowest_score (a scalar)
234 Args : on set, new value (a scalar or undef, optional)
237 =cut
239 sub lowest_score{
240 my $self = shift;
242 return $self->{'lowest_score'} = shift if @_;
243 return $self->{'lowest_score'};
246 =head2 highest_score
248 Title : highest_score
249 Usage : $obj->highest_score($newval)
250 Function:
251 Example :
252 Returns : value of highest_score (a scalar)
253 Args : on set, new value (a scalar or undef, optional)
256 =cut
258 sub highest_score{
259 my $self = shift;
261 return $self->{'highest_score'} = shift if @_;
262 return $self->{'highest_score'};
265 =head2 lambda
267 Title : lambda
268 Usage : $obj->lambda($newval)
269 Function:
270 Example :
271 Returns : value of lambda (a scalar)
272 Args : on set, new value (a scalar or undef, optional)
275 =cut
277 sub lambda{
278 my $self = shift;
280 return $self->{'lambda'} = shift if @_;
281 return $self->{'lambda'};
284 =head2 H
286 Title : H
287 Usage : $obj->H($newval)
288 Function:
289 Example :
290 Returns : value of H (a scalar)
291 Args : on set, new value (a scalar or undef, optional)
294 =cut
296 sub H{
297 my $self = shift;
298 return $self->{'H'} = shift if @_;
299 return $self->{'H'};