line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# BioPerl module for Bio::Matrix::Scoring |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Cared for by Jason Stajich |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Jason Stajich |
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::Matrix::Scoring - Object which can hold scoring matrix information |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Bio::Matrix::Scoring; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
An object which can handle AA or NT scoring matrix information. Some |
25
|
|
|
|
|
|
|
transformation properties are available too. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 FEEDBACK |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 Mailing Lists |
30
|
|
|
|
|
|
|
|
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. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
36
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 Support |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
I |
43
|
|
|
|
|
|
|
|
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. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 Reporting Bugs |
50
|
|
|
|
|
|
|
|
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: |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR - Jason Stajich |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Email jason-at-bioperl-dot-org |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 APPENDIX |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The rest of the documentation details each of the object methods. |
64
|
|
|
|
|
|
|
Internal methods are usually preceded with a _ |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Let the code begin... |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
package Bio::Matrix::Scoring; |
73
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
1
|
|
|
1
|
|
3
|
use base qw(Bio::Matrix::Generic); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
419
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 new |
79
|
|
|
|
|
|
|
|
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 : |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub new { |
91
|
2
|
|
|
2
|
1
|
7
|
my ($class, @args) = @_; |
92
|
2
|
|
|
|
|
11
|
my $self = $class->SUPER::new(@args); |
93
|
|
|
|
|
|
|
|
94
|
2
|
|
|
|
|
9
|
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); |
99
|
|
|
|
|
|
|
|
100
|
2
|
|
|
|
|
12
|
$self->entropy ($entropy); |
101
|
2
|
|
|
|
|
4
|
$self->expected_score($expected); |
102
|
2
|
|
|
|
|
3
|
$self->scale ($scale); |
103
|
2
|
|
|
|
|
3
|
$self->scale_value($scaleval); |
104
|
2
|
|
|
|
|
5
|
$self->database ($database); |
105
|
2
|
|
|
|
|
5
|
$self->lowest_score($lowestscore); |
106
|
2
|
|
|
|
|
5
|
$self->highest_score($highestscore); |
107
|
2
|
|
|
|
|
4
|
$self->lambda($lambda); |
108
|
2
|
|
|
|
|
3
|
$self->H($H); |
109
|
|
|
|
|
|
|
|
110
|
2
|
|
|
|
|
10
|
return $self; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 entropy |
114
|
|
|
|
|
|
|
|
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) |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub entropy{ |
126
|
4
|
|
|
4
|
1
|
929
|
my $self = shift; |
127
|
|
|
|
|
|
|
|
128
|
4
|
100
|
|
|
|
14
|
return $self->{'entropy'} = shift if @_; |
129
|
2
|
|
|
|
|
7
|
return $self->{'entropy'}; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 expected_score |
133
|
|
|
|
|
|
|
|
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) |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=cut |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub expected_score{ |
145
|
4
|
|
|
4
|
1
|
6
|
my $self = shift; |
146
|
|
|
|
|
|
|
|
147
|
4
|
100
|
|
|
|
13
|
return $self->{'expected'} = shift if @_; |
148
|
2
|
|
|
|
|
8
|
return $self->{'expected'}; |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head2 scale |
152
|
|
|
|
|
|
|
|
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) |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=cut |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub scale{ |
164
|
4
|
|
|
4
|
1
|
6
|
my $self = shift; |
165
|
|
|
|
|
|
|
|
166
|
4
|
100
|
|
|
|
11
|
return $self->{'scale'} = shift if @_; |
167
|
2
|
|
|
|
|
9
|
return $self->{'scale'}; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head2 scale_value |
171
|
|
|
|
|
|
|
|
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) |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=cut |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub scale_value{ |
183
|
2
|
|
|
2
|
1
|
1
|
my $self = shift; |
184
|
|
|
|
|
|
|
|
185
|
2
|
50
|
|
|
|
5
|
return $self->{'scale_value'} = shift if @_; |
186
|
0
|
|
|
|
|
0
|
return $self->{'scale_value'}; |
187
|
|
|
|
|
|
|
} |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head2 description |
190
|
|
|
|
|
|
|
|
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) |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub description{ |
202
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
203
|
|
|
|
|
|
|
|
204
|
0
|
0
|
|
|
|
0
|
return $self->{'description'} = shift if @_; |
205
|
0
|
|
|
|
|
0
|
return $self->{'description'}; |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=head2 database |
209
|
|
|
|
|
|
|
|
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) |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=cut |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
sub database{ |
221
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
222
|
|
|
|
|
|
|
|
223
|
2
|
50
|
|
|
|
5
|
return $self->{'database'} = shift if @_; |
224
|
0
|
|
|
|
|
0
|
return $self->{'database'}; |
225
|
|
|
|
|
|
|
} |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=head2 lowest_score |
228
|
|
|
|
|
|
|
|
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) |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=cut |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
sub lowest_score{ |
240
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
241
|
|
|
|
|
|
|
|
242
|
2
|
50
|
|
|
|
26
|
return $self->{'lowest_score'} = shift if @_; |
243
|
0
|
|
|
|
|
0
|
return $self->{'lowest_score'}; |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=head2 highest_score |
247
|
|
|
|
|
|
|
|
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) |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
=cut |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
sub highest_score{ |
259
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
260
|
|
|
|
|
|
|
|
261
|
2
|
50
|
|
|
|
5
|
return $self->{'highest_score'} = shift if @_; |
262
|
0
|
|
|
|
|
0
|
return $self->{'highest_score'}; |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=head2 lambda |
266
|
|
|
|
|
|
|
|
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) |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=cut |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
sub lambda{ |
278
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
279
|
|
|
|
|
|
|
|
280
|
2
|
50
|
|
|
|
5
|
return $self->{'lambda'} = shift if @_; |
281
|
0
|
|
|
|
|
0
|
return $self->{'lambda'}; |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=head2 H |
285
|
|
|
|
|
|
|
|
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) |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=cut |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
sub H{ |
297
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
298
|
2
|
50
|
|
|
|
7
|
return $self->{'H'} = shift if @_; |
299
|
0
|
|
|
|
|
|
return $self->{'H'}; |
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
1; |