~ubuntu-branches/ubuntu/hoary/bioperl/hoary

« back to all changes in this revision

Viewing changes to Bio/Matrix/Scoring.pm

  • Committer: Bazaar Package Importer
  • Author(s): Matt Hope
  • Date: 2004-04-18 14:24:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040418142411-gr92uexquw4w8liq
Tags: 1.4-1
* New upstream release
* Examples and working code are installed by default to usr/bin,
  this has been moved to usr/share/doc/bioperl/bin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: Scoring.pm,v 1.1 2003/08/08 20:23:17 jason Exp $
 
2
#
 
3
# BioPerl module for Bio::Matrix::Scoring
 
4
#
 
5
# Cared for by Jason Stajich <jason-at-bioperl-dot-org>
 
6
#
 
7
# Copyright Jason Stajich
 
8
#
 
9
# You may distribute this module under the same terms as perl itself
 
10
 
 
11
# POD documentation - main docs before the code
 
12
 
 
13
=head1 NAME
 
14
 
 
15
Bio::Matrix::Scoring - Object which can hold scoring matrix information
 
16
 
 
17
=head1 SYNOPSIS
 
18
 
 
19
  use Bio::Matrix::Scoring;
 
20
 
 
21
=head1 DESCRIPTION
 
22
 
 
23
An object which can handle AA or NT scoring matrix information.  Some
 
24
transformation properties are available too.
 
25
 
 
26
=head1 FEEDBACK
 
27
 
 
28
=head2 Mailing Lists
 
29
 
 
30
User feedback is an integral part of the evolution of this and other
 
31
Bioperl modules. Send your comments and suggestions preferably to
 
32
the Bioperl mailing list.  Your participation is much appreciated.
 
33
 
 
34
  bioperl-l@bioperl.org              - General discussion
 
35
  http://bioperl.org/MailList.shtml  - About the mailing lists
 
36
 
 
37
=head2 Reporting Bugs
 
38
 
 
39
Report bugs to the Bioperl bug tracking system to help us keep track
 
40
of the bugs and their resolution. Bug reports can be submitted via
 
41
the web:
 
42
 
 
43
  http://bugzilla.bioperl.org/
 
44
 
 
45
=head1 AUTHOR - Jason Stajich
 
46
 
 
47
Email jason-at-bioperl-dot-org
 
48
 
 
49
Describe contact details here
 
50
 
 
51
=head1 CONTRIBUTORS
 
52
 
 
53
Additional contributors names and emails here
 
54
 
 
55
=head1 APPENDIX
 
56
 
 
57
The rest of the documentation details each of the object methods.
 
58
Internal methods are usually preceded with a _
 
59
 
 
60
=cut
 
61
 
 
62
 
 
63
# Let the code begin...
 
64
 
 
65
 
 
66
package Bio::Matrix::Scoring;
 
67
use vars qw(@ISA);
 
68
use strict;
 
69
 
 
70
use Bio::Matrix::Generic;
 
71
 
 
72
@ISA = qw(Bio::Matrix::Generic);
 
73
 
 
74
=head2 new
 
75
 
 
76
 Title   : new
 
77
 Usage   : my $obj = new Bio::Matrix::Scoring();
 
78
 Function: Builds a new Bio::Matrix::Scoring object 
 
79
 Returns : an instance of Bio::Matrix::Scoring
 
80
 Args    :
 
81
 
 
82
 
 
83
=cut
 
84
 
 
85
 
 
86
sub new { 
 
87
    my ($class, @args) = @_;
 
88
    my $self = $class->SUPER::new(@args);
 
89
    
 
90
    my ($entropy,$expected,$scale,$scaleval,$database,
 
91
        $lowestscore,$highestscore,$lambda,
 
92
        $H) = $self->_rearrange([qw(ENTROPY EXPECTED SCALE
 
93
                                    SCALE_VALUE DATABASE
 
94
                                    LOWEST_SCORE
 
95
                                    HIGHEST_SCORE
 
96
                                    LAMBDA H)], @args);
 
97
 
 
98
    $self->entropy  ($entropy);
 
99
    $self->expected_score($expected);
 
100
    $self->scale    ($scale);
 
101
    $self->scale_value($scaleval);
 
102
    $self->database ($database);
 
103
    $self->lowest_score($lowestscore);
 
104
    $self->highest_score($highestscore);
 
105
    $self->lambda($lambda);
 
106
    $self->H($H);
 
107
                                    
 
108
        
 
109
    return $self;
 
110
}
 
111
 
 
112
=head2 entropy
 
113
 
 
114
 Title   : entropy
 
115
 Usage   : $obj->entropy($newval)
 
116
 Function: 
 
117
 Example : 
 
118
 Returns : value of entropy (a scalar)
 
119
 Args    : on set, new value (a scalar or undef, optional)
 
120
 
 
121
 
 
122
=cut
 
123
 
 
124
sub entropy{
 
125
    my $self = shift;
 
126
 
 
127
    return $self->{'entropy'} = shift if @_;
 
128
    return $self->{'entropy'};
 
129
}
 
130
 
 
131
=head2 expected_score
 
132
 
 
133
 Title   : expected_score
 
134
 Usage   : $obj->expected_score($newval)
 
135
 Function: 
 
136
 Example : 
 
137
 Returns : value of expected (a scalar)
 
138
 Args    : on set, new value (a scalar or undef, optional)
 
139
 
 
140
 
 
141
=cut
 
142
 
 
143
sub expected_score{
 
144
    my $self = shift;
 
145
 
 
146
    return $self->{'expected'} = shift if @_;
 
147
    return $self->{'expected'};
 
148
}
 
149
 
 
150
=head2 scale
 
151
 
 
152
 Title   : scale
 
153
 Usage   : $obj->scale($newval)
 
154
 Function: 
 
155
 Example : 
 
156
 Returns : value of scale (a scalar)
 
157
 Args    : on set, new value (a scalar or undef, optional)
 
158
 
 
159
 
 
160
=cut
 
161
 
 
162
sub scale{
 
163
    my $self = shift;
 
164
 
 
165
    return $self->{'scale'} = shift if @_;
 
166
    return $self->{'scale'};
 
167
}
 
168
 
 
169
=head2 scale_value
 
170
 
 
171
 Title   : scale_value
 
172
 Usage   : $obj->scale_value($newval)
 
173
 Function: 
 
174
 Example : 
 
175
 Returns : value of scale_value (a scalar)
 
176
 Args    : on set, new value (a scalar or undef, optional)
 
177
 
 
178
 
 
179
=cut
 
180
 
 
181
sub scale_value{
 
182
    my $self = shift;
 
183
 
 
184
    return $self->{'scale_value'} = shift if @_;
 
185
    return $self->{'scale_value'};
 
186
}
 
187
 
 
188
=head2 description
 
189
 
 
190
 Title   : description
 
191
 Usage   : $obj->description($newval)
 
192
 Function: 
 
193
 Example : 
 
194
 Returns : value of description (a scalar)
 
195
 Args    : on set, new value (a scalar or undef, optional)
 
196
 
 
197
 
 
198
=cut
 
199
 
 
200
sub description{
 
201
    my $self = shift;
 
202
 
 
203
    return $self->{'description'} = shift if @_;
 
204
    return $self->{'description'};
 
205
}
 
206
 
 
207
=head2 database
 
208
 
 
209
 Title   : database
 
210
 Usage   : $obj->database($newval)
 
211
 Function: 
 
212
 Example : 
 
213
 Returns : value of database (a scalar)
 
214
 Args    : on set, new value (a scalar or undef, optional)
 
215
 
 
216
 
 
217
=cut
 
218
 
 
219
sub database{
 
220
    my $self = shift;
 
221
 
 
222
    return $self->{'database'} = shift if @_;
 
223
    return $self->{'database'};
 
224
}
 
225
 
 
226
=head2 lowest_score
 
227
 
 
228
 Title   : lowest_score
 
229
 Usage   : $obj->lowest_score($newval)
 
230
 Function: 
 
231
 Example : 
 
232
 Returns : value of lowest_score (a scalar)
 
233
 Args    : on set, new value (a scalar or undef, optional)
 
234
 
 
235
 
 
236
=cut
 
237
 
 
238
sub lowest_score{
 
239
    my $self = shift;
 
240
 
 
241
    return $self->{'lowest_score'} = shift if @_;
 
242
    return $self->{'lowest_score'};
 
243
}
 
244
 
 
245
=head2 highest_score
 
246
 
 
247
 Title   : highest_score
 
248
 Usage   : $obj->highest_score($newval)
 
249
 Function: 
 
250
 Example : 
 
251
 Returns : value of highest_score (a scalar)
 
252
 Args    : on set, new value (a scalar or undef, optional)
 
253
 
 
254
 
 
255
=cut
 
256
 
 
257
sub highest_score{
 
258
    my $self = shift;
 
259
 
 
260
    return $self->{'highest_score'} = shift if @_;
 
261
    return $self->{'highest_score'};
 
262
}
 
263
 
 
264
=head2 lambda
 
265
 
 
266
 Title   : lambda
 
267
 Usage   : $obj->lambda($newval)
 
268
 Function: 
 
269
 Example : 
 
270
 Returns : value of lambda (a scalar)
 
271
 Args    : on set, new value (a scalar or undef, optional)
 
272
 
 
273
 
 
274
=cut
 
275
 
 
276
sub lambda{
 
277
    my $self = shift;
 
278
 
 
279
    return $self->{'lambda'} = shift if @_;
 
280
    return $self->{'lambda'};
 
281
}
 
282
 
 
283
=head2 H
 
284
 
 
285
 Title   : H
 
286
 Usage   : $obj->H($newval)
 
287
 Function: 
 
288
 Example : 
 
289
 Returns : value of H (a scalar)
 
290
 Args    : on set, new value (a scalar or undef, optional)
 
291
 
 
292
 
 
293
=cut
 
294
 
 
295
sub H{
 
296
    my $self = shift;
 
297
    return $self->{'H'} = shift if @_;
 
298
    return $self->{'H'};
 
299
}
 
300
 
 
301
1;