Bio/Tools/ECnumber.pm

filter: Statementstmt 91.8% 112 / 122 Branchbran 79.1% 38 / 48 Conditioncond 66.6% 20 / 30 MC/DCmcdc 31.2% 5 / 16 Subroutinesub 100% 21 / 21 Podpod 100% 12 / 12 totaltotal 83.5% 208 / 249 CC 35 SCAR 17.1
CC
35
Cov
85%
_check_for_illegal_defaults
11.5
is_member
10.1
is_equal
6.6
CRAP 5.5
« Bio/Ontology/OBOEngine.pm ↑ Summary Bio/Tools/Sigcleave.pm »
1 #
2 # BioPerl module for Bio::Tools::ECnumber
3 #
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 #
6 # Cared for by Christian M. Zmasek <czmasek-at-burnham.org> or <cmzmasek@yahoo.com>
7 #
8 # (c) Christian M. Zmasek, czmasek-at-burnham.org, 2002.
9 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
10 #
11 # You may distribute this module under the same terms as perl itself.
12 # Refer to the Perl Artistic License (see the license accompanying this
13 # software package, or see http://www.perl.com/language/misc/Artistic.html)
14 # for the terms under which you may use, modify, and redistribute this module.
15 #
16 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 #
20  
21 # POD documentation - main docs before the code
22  
23  
24 =head1 NAME
25  
26 Bio::Tools::ECnumber - representation of EC numbers (Enzyme Classification)
27  
28 =head1 SYNOPSIS
29  
30 use Bio::Tools::ECnumber;
31  
32 # Creation of ECnumber objects
33 my $EC1 = Bio::Tools::ECnumber->new( -ec_string => "4.3.2.1" );
34 my $EC2 = Bio::Tools::ECnumber->new( -ec_string => "EC 1.1.1.1" );
35 my $EC3 = Bio::Tools::ECnumber->new();
36  
37 # Copying
38 my $EC4 = $EC1->copy();
39  
40 # Modification/canonicalization of ECnumber objects
41 print $EC3->EC_string( "1.01.01.001" ); # Prints "1.1.1.1".
42  
43 # Stringify
44 print $EC3->EC_string();
45 # or
46 print $EC3->to_string();
47  
48 # Test for equality
49 # -- Against ECnumber object:
50 if ( $EC3->is_equal( $EC2 ) ) { # Prints "equal".
51 print "equal";
52 }
53 # -- Against string representation of EC number:
54 if ( ! $EC3->is_equal( "1.1.1.-" ) ) { # Prints "not equal".
55 print "not equal";
56 }
57  
58 # Test for membership
59 my $EC5 = Bio::Tools::ECnumber->new( -ec_string => "4.3.2.-" );
60 # -- Against ECnumber object.
61 if ( $EC1->is_member( $EC5 ) ) { # Prints "member".
62 print "member";
63 }
64 # -- Against string representation of EC number.
65 if ( ! $EC1->is_member( "4.3.1.-" ) ) { # Prints "not member".
66 print "not member";
67 }
68  
69 =head1 DESCRIPTION
70  
71 L<Bio::Tools::ECnumber> is a representation of EC numbers,
72 the numerical hierarchy for Enzyme Classification.
73  
74 See L<http://www.chem.qmul.ac.uk/iubmb/enzyme/> for more details.
75  
76 =head1 FEEDBACK
77  
78 =head2 Mailing Lists
79  
80 User feedback is an integral part of the evolution of this and other
81 Bioperl modules. Send your comments and suggestions preferably to one
82 of the Bioperl mailing lists. Your participation is much appreciated.
83  
84 bioperl-l@bioperl.org - General discussion
85 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
86  
87 =head2 Support
88  
89 Please direct usage questions or support issues to the mailing list:
90  
91 I<bioperl-l@bioperl.org>
92  
93 rather than to the module maintainer directly. Many experienced and
94 reponsive experts will be able look at the problem and quickly
95 address it. Please include a thorough description of the problem
96 with code and data examples if at all possible.
97  
98 =head2 Reporting Bugs
99  
100 Report bugs to the Bioperl bug tracking system to help us keep track
101 the bugs and their resolution. Bug reports can be submitted via the
102 web:
103  
104 https://github.com/bioperl/bioperl-live/issues
105  
106 =head1 AUTHOR
107  
108 Christian M. Zmasek
109  
110 Email: czmasek-at-burnham.org or cmzmasek@yahoo.com
111  
112 WWW: http://monochrome-effect.net/
113  
114 Address:
115  
116 Genomics Institute of the Novartis Research Foundation
117 10675 John Jay Hopkins Drive
118 San Diego, CA 92121
119  
120 =head1 APPENDIX
121  
122 The rest of the documentation details each of the object
123 methods. Internal methods are usually preceded with a _
124  
125 =cut
126  
127  
128 # Let the code begin...
129  
130 package Bio::Tools::ECnumber;
131 2 $Bio::Tools::ECnumber::VERSION = '1.7.8';
132 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
133  
134 2 ▶use constant DEFAULT => "-";
Subroutine BEGIN: called CC=1 SCAR=0.0
135 2 ▶use constant TRUE => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
136 2 ▶use constant FALSE => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
137  
138 2 ▶use base qw(Bio::Root::Root);
Subroutine BEGIN: called CC=1 SCAR=0.0
139  
140 =head2 new
141  
142 Title : new
143 Usage : $EC1 = Bio::Tools::ECnumber->new( -ec_string => "4.3.2.1" );
144 or
145 $EC2 = Bio::Tools::ECnumber->new( -ec_string => "4.3.2.2",
146 -comment => "Is EC 4.3.2.2" );
147 or
148 $EC3 = Bio::Tools::ECnumber->new(); # EC3 is now "-.-.-.-"
149 Function: Creates a new ECnumber object.
150 Parses a EC number from "x.x.x.x", "EC x.x.x.x",
151 "ECx.x.x.x", or "EC:x.x.x.x";
152 x being either a positive integer or a "-".
153 Returns : A new ECnumber object.
154 Args : A string representing a EC number, e.g. "4.3.2.1"
155 or "EC 4.3.2.1" or "1.-.-.-".
156  
157 =cut
158  
159 14 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
160 14 my( $class, @args ) = @_;
161
162 14 my $self = $class->SUPER::new( @args );
163  
164 14 my ( $EC_string, $comment )
165 = $self->_rearrange( [ qw( EC_STRING COMMENT ) ], @args );
166  
167 14 $self->init();
168
169 14 ▶ $EC_string && $self->EC_string( $EC_string );
Branch: 1 branch
BranchTrueFalseTotal
$EC_string and $self->EC_string($EC_string) 13 1 14
170 14 ▶ $comment && $self->comment( $comment );
Branch: 1 branch
BranchTrueFalseTotal
$comment and $self->comment($comment) 2 12 14
171
172 14 return $self;
173
174 } # new
175  
176  
177  
178 =head2 init
179  
180 Title : init()
181 Usage : $EC1->init(); # EC1 is now "-.-.-.-"
182 Function: Initializes this ECnumber to default values.
183 Returns :
184 Args :
185  
186 =cut
187  
188 15 ▶sub init {
Subroutine init: called CC=1 SCAR=0.0
Pod documented
189 15 my( $self ) = @_;
190  
191 15 $self->enzyme_class( DEFAULT );
192 15 $self->sub_class( DEFAULT );
193 15 $self->sub_sub_class( DEFAULT );
194 15 $self->serial_number( DEFAULT );
195 15 $self->comment( "" );
196
197 } # init
198  
199  
200  
201 =head2 copy
202  
203 Title : copy()
204 Usage : $EC2 = $EC1->copy();
205 Function: Creates a new ECnumber object which is an exact copy
206 of this ECnumber.
207 Returns : A copy of this ECnumber.
208 Args :
209  
210 =cut
211  
212 1 ▶sub copy {
Subroutine copy: called CC=1 SCAR=0.0
Pod documented
213 1 my( $self ) = @_;
214
215 1 my $new_ec = $self->new();
216 1 $new_ec->enzyme_class( $self->enzyme_class() );
217 1 $new_ec->sub_class( $self->sub_class() );
218 1 $new_ec->sub_sub_class( $self->sub_sub_class() );
219 1 $new_ec->serial_number( $self->serial_number() );
220 1 $new_ec->comment( $self->comment() );
221 1 return $new_ec;
222  
223 } # copy
224  
225  
226  
227 =head2 EC_string
228  
229 Title : EC_string
230 Usage : $EC3->EC_string( "1.1.1.-" );
231 or
232 print $EC3->EC_string();
233 Function: Set/get for string representations of EC numbers.
234 Parses a EC number from "x.x.x.x", "EC x.x.x.x",
235 "ECx.x.x.x", or "EC:x.x.x.x";
236 x being either a positive integer or a "-".
237 Returns : A string representations of a EC number.
238 Args : A string representations of a EC number.
239  
240 =cut
241  
242 15 ▶sub EC_string {
Subroutine EC_string: called CC=3 SCAR=11.0
Pod documented
243 15 my ( $self, $value ) = @_;
244  
245 15 ▶ if ( defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 13 2 15
246 13 $value =~ s/\s+//g; # Removes white space.
247 13 $value =~ s/^EC//i; # Removes "EC".
248 13 $value =~ s/^://; # Removes ":".
249  
250 13 ▶ if ( $value =~ /^([\d-]*)\.([\d-]*)\.([\d-]*)\.([\d-]*)$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value =~ /^([\d-]*)\.([\d-]*)\.([\d-]*)\.([\d-]*)$/) { } 13 0 13
251 13 $self->enzyme_class( $1 );
252 13 $self->sub_class( $2 );
253 13 $self->sub_sub_class( $3 );
254 13 $self->serial_number( $4 );
255 }
256 else {
257 0 $self->throw( "Illegal format error [$value]" );
258 }
259 }
260  
261 15 return $self->to_string();
262  
263 } # EC_string
264  
265  
266  
267 =head2 to_string
268  
269 Title : to_string()
270 Usage : print $EC3->to_string();
271 Function: To string method for EC numbers
272 (equals the "get" functionality of "EC_string").
273 Returns : A string representations of a EC number.
274 Args :
275  
276 =cut
277  
278 18 ▶sub to_string {
Subroutine to_string: called CC=1 SCAR=0.0
Pod documented
279 18 my ( $self ) = @_;
280  
281 18 my $s = $self->enzyme_class() . ".";
282 18 $s .= $self->sub_class() . ".";
283 18 $s .= $self->sub_sub_class() . ".";
284 18 $s .= $self->serial_number();
285 18 return $s;
286
287 } # to_string
288  
289  
290  
291 =head2 is_equal
292  
293 Title : is_equal
294 Usage : if ( $EC3->is_equal( $EC2 ) )
295 or
296 if ( $EC3->is_equal( "1.1.1.-" ) )
297 Function: Checks whether this ECnumber is equal to the argument
298 EC number (please note: "1.1.1.1" != "1.1.1.-").
299 Returns : True (1) or false (0).
300 Args : A ECnumber object or a string representation of a EC number.
301  
302 =cut
303  
304 4 ▶sub is_equal {
Subroutine is_equal: called CC=6 SCAR=18.9
Pod documented
305 4 my ( $self, $value ) = @_;
306  
307 4 ▶ if ( $self->_is_not_reference( $value ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_is_not_reference($value)) { } 3 1 4
308 3 $value = $self->new( -ec_string => $value );
309 }
310 else {
311 1 $self->_is_ECnumber_object( $value );
312 }
313
314 4 ▶ unless ( $self->enzyme_class() eq $value->enzyme_class() ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->enzyme_class eq $value->enzyme_class) 0 4 4
315 0 return FALSE;
316 }
317 4 ▶ unless ( $self->sub_class() eq $value->sub_class() ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->sub_class eq $value->sub_class) 0 4 4
318 0 return FALSE;
319 }
320 4 ▶ unless ( $self->sub_sub_class() eq $value->sub_sub_class() ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->sub_sub_class eq $value->sub_sub_class) 0 4 4
321 0 return FALSE;
322 }
323 4 ▶ unless ( $self->serial_number() eq $value->serial_number() ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->serial_number eq $value->serial_number) 2 2 4
324 2 return FALSE;
325 }
326 2 return TRUE;
327  
328 } # is_equal
329  
330  
331  
332 =head2 is_member
333  
334 Title : is_member
335 Usage : if ( $EC1->is_member( $EC5 ) )
336 or
337 if ( $EC1->is_member( "4.3.-.-" ) )
338 Function: Checks whether this ECnumber is a member of the (incomplete)
339 argument EC number (e.g. "1.1.1.1" is a member of "1.1.1.-"
340 but not of "1.1.1.2").
341 Returns : True (1) or false (0).
342 Args : A ECnumber object or a string representation of a EC number.
343  
344 =cut
345  
346 10 ▶sub is_member {
Subroutine is_member: called CC=10 SCAR=23.2
Pod documented
347 10 my ( $self, $value ) = @_;
348  
349 10 ▶ if ( $self->_is_not_reference( $value ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_is_not_reference($value)) { } 8 2 10
350 8 $value = $self->new( -ec_string => $value );
351 }
352 else {
353 2 $self->_is_ECnumber_object( $value );
354 }
355 10 $self->_check_for_illegal_defaults();
356 10 $value->_check_for_illegal_defaults();
357  
358 10 ▶ unless ( $value->enzyme_class() eq DEFAULT
Branch: 1 branch
BranchTrueFalseTotal
unless ($value->enzyme_class eq "-" or $self->enzyme_class eq $value->enzyme_class) 1 9 10
Condition100%3/3
$value->enzyme_class eq "-" or $self->enzyme_class eq $value->enzyme_class
l!l&&r!l&&!r
271
MC/DC100%2/2
$value->enzyme_class eq "-" or $self->enzyme_class eq $value->enzyme_class
$value->enzyme_class eq "-" $self->enzyme_class eq $value->enzyme_class
Truth table100%3/3
A or B
A= $value->enzyme_class eq "-"B= $self->enzyme_class eq $value->enzyme_class
ABresult
1X1
011
000
359 || $self->enzyme_class() eq $value->enzyme_class() ) {
360 1 return FALSE;
361 }
362 9 ▶ unless ( $value->sub_class() eq DEFAULT
Branch: 1 branch
BranchTrueFalseTotal
unless ($value->sub_class eq "-" or $self->sub_class eq $value->sub_class) 0 9 9
Condition66%2/3
$value->sub_class eq "-" or $self->sub_class eq $value->sub_class
l!l&&r!l&&!r
360
MC/DC0%0/2
$value->sub_class eq "-" or $self->sub_class eq $value->sub_class
$value->sub_class eq "-" $self->sub_class eq $value->sub_class
Truth table66%2/3
A or B
A= $value->sub_class eq "-"B= $self->sub_class eq $value->sub_class
ABresult
1X1
011
000
363 || $self->sub_class() eq $value->sub_class() ) {
364 0 return FALSE;
365 }
366 9 ▶ unless ( $value->sub_sub_class() eq DEFAULT
Branch: 1 branch
BranchTrueFalseTotal
unless ($value->sub_sub_class eq "-" or $self->sub_sub_class eq $value->sub_sub_class) 1 8 9
Condition100%3/3
$value->sub_sub_class eq "-" or $self->sub_sub_class eq $value->sub_sub_class
l!l&&r!l&&!r
441
MC/DC100%2/2
$value->sub_sub_class eq "-" or $self->sub_sub_class eq $value->sub_sub_class
$value->sub_sub_class eq "-" $self->sub_sub_class eq $value->sub_sub_class
Truth table100%3/3
A or B
A= $value->sub_sub_class eq "-"B= $self->sub_sub_class eq $value->sub_sub_class
ABresult
1X1
011
000
367 || $self->sub_sub_class() eq $value->sub_sub_class() ) {
368 1 return FALSE;
369 }
370 8 ▶ unless ( $value->serial_number() eq DEFAULT
Branch: 1 branch
BranchTrueFalseTotal
unless ($value->serial_number eq "-" or $self->serial_number eq $value->serial_number) 1 7 8
Condition66%2/3
$value->serial_number eq "-" or $self->serial_number eq $value->serial_number
l!l&&r!l&&!r
701
MC/DC50%1/2
$value->serial_number eq "-" or $self->serial_number eq $value->serial_number
$value->serial_number eq "-" $self->serial_number eq $value->serial_number
Truth table66%2/3
A or B
A= $value->serial_number eq "-"B= $self->serial_number eq $value->serial_number
ABresult
1X1
011
000
371 || $self->serial_number() eq $value->serial_number() ) {
372 1 return FALSE;
373 }
374 7 return TRUE;
375  
376 } # is_member
377  
378  
379  
380 =head2 enzyme_class
381  
382 Title : enzyme_class
383 Usage : $EC1->enzyme_class( 1 );
384 or
385 print $EC1->enzyme_class();
386 Function: Set/get for the enzyme class number of ECnumbers.
387 Returns : The enzyme class number of this ECnumber.
388 Args : A positive integer or "-".
389  
390 =cut
391  
392 104 ▶sub enzyme_class {
Subroutine enzyme_class: called CC=2 SCAR=6.9
Pod documented
393 104 my ( $self, $value ) = @_;
394  
395 104 ▶ if ( defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 30 74 104
396 30 $self->{ "_enzyme_class" } = $self->_check_number( $value );
397 }
398
399 104 return $self->{ "_enzyme_class" };
400
401 } # enzyme_class
402  
403  
404  
405 =head2 sub_class
406  
407 Title : sub_class
408 Usage : $EC1->sub_class( 4 );
409 or
410 print $EC1->sub_class();
411 Function: Set/get for the enzyme sub class number of ECnumbers.
412 Returns : The enzyme sub class number of this ECnumber.
413 Args : A positive integer or "-".
414  
415 =cut
416  
417 101 ▶sub sub_class {
Subroutine sub_class: called CC=2 SCAR=6.9
Pod documented
418 101 my ( $self, $value ) = @_;
419  
420 101 ▶ if ( defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 30 71 101
421 30 $self->{ "_sub_class" } = $self->_check_number( $value );
422 }
423
424 101 return $self->{ "_sub_class" };
425
426 } # sub_class
427  
428  
429  
430 =head2 sub_sub_class
431  
432 Title : sub_sub_class
433 Usage : $EC1->sub_sub_class( 12 );
434 or
435 print $EC1->sub_sub_class();
436 Function: Set/get for the enzyme sub sub class number of ECnumbers.
437 Returns : The enzyme sub sub class number of this ECnumber.
438 Args : A positive integer or "-".
439  
440 =cut
441  
442 100 ▶sub sub_sub_class {
Subroutine sub_sub_class: called CC=2 SCAR=6.9
Pod documented
443 100 my ( $self, $value ) = @_;
444  
445 100 ▶ if ( defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 30 70 100
446 30 $self->{ "_sub_sub_class" } = $self->_check_number( $value );
447 }
448
449 100 return $self->{ "_sub_sub_class" };
450
451 } # sub_sub_class
452  
453  
454  
455 =head2 serial_number
456  
457 Title : serial_number
458 Usage : $EC1->serial_number( 482 );
459 or
460 print $EC1->serial_number();
461 Function: Set/get for the serial number of ECnumbers.
462 Returns : The serial number of this ECnumber.
463 Args : A positive integer or "-".
464  
465 =cut
466  
467 72 ▶sub serial_number {
Subroutine serial_number: called CC=2 SCAR=6.9
Pod documented
468 72 my ( $self, $value ) = @_;
469  
470 72 ▶ if ( defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 30 42 72
471 30 $self->{ "_serial_number" } = $self->_check_number( $value );
472 }
473
474 72 return $self->{ "_serial_number" };
475
476 } # serial_number
477  
478  
479  
480 =head2 comment
481  
482 Title : comment
483 Usage : $EC1->comment( "deprecated" );
484 or
485 print $EC1->comment();
486 Function: Set/get for a arbitrary comment.
487 Returns : A comment [scalar].
488 Args : A comment [scalar].
489  
490 =cut
491  
492 20 ▶sub comment {
Subroutine comment: called CC=2 SCAR=6.9
Pod documented
493 20 my ( $self, $value ) = @_;
494  
495 20 ▶ if ( defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 18 2 20
496 18 $self->{ "_comment" } = $value;
497 }
498
499 20 return $self->{ "_comment" };
500
501 } # comment
502  
503  
504  
505 # Title : _check_number
506 # Function: Checks and standardizes the individual numbers of a EC number
507 # (removes leading zeros, removes white spaces).
508 # Returns : A standardized number.
509 # Args : A string representing a number in a EC number.
510 120 ▶sub _check_number {
Subroutine _check_number: called CC=5 SCAR=18.3
511 120 my ( $self, $value ) = @_;
512
513 120 my $original_value = $value;
514 120 $value =~ s/\s+//g; # Removes white space.
515 120 ▶ if ( $value eq "" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value eq "") 0 120 120
516 0 $value = DEFAULT;
517 }
518 120 $value =~ s/^0+//; # Removes leading zeros.
519 120 ▶ if ( $value eq "" ) { # If it was "0" (or "00"), it would be "" now.
Branch: 2 branches
BranchTrueFalseTotal
if ($value eq '') { } 0 120 120
elsif ($value ne '-' and $value =~ /\D/) { } 0 196 196
520 0 $value = "0";
521 }
522 ▶ elsif ( $value ne DEFAULT
Condition66%2/3
$value ne "-" and $value =~ /\D/
!ll&&!rl&&r
76440
MC/DC0%0/2
$value ne "-" and $value =~ /\D/
$value ne "-" $value =~ /\D/
Truth table66%2/3
A and B
A= $value ne "-"B= $value =~ /\D/
ABresult
0X0
100
111
523 && $value =~ /\D/ ) {
524 0 $self->throw( "Illegal format error [$original_value]" );
525 }
526 120 return $value;
527  
528 } # _check_number
529  
530  
531  
532 # Title : _check_for_illegal_defaults()
533 # Function: Checks for situations like "1.-.1.1", which
534 # are illegal in membership tests.
535 # Returns :
536 # Args :
537 20 ▶sub _check_for_illegal_defaults {
Subroutine _check_for_illegal_defaults: called CC=7 SCAR=24.4
538 20 my ( $self ) = @_;
539
540 20 ▶ if ( ( $self->sub_sub_class() eq DEFAULT
Branch: 1 branch
BranchTrueFalseTotal
if ($self->sub_sub_class eq "-" and $self->serial_number ne "-" or $self->sub_class eq "-" and $self->sub_sub_class ne "-" or $self->enzyme_class eq "-" and $self->sub_class ne "-") 0 20 20
Condition53%8/15
$self->sub_sub_class eq "-" and $self->serial_number ne "-" or $self->sub_class eq "-" and $self->sub_sub_class ne "-" or $self->enzyme_class eq "-" and $self->sub_class ne "-"
l!l&&r!l&&!r
0020
$self->sub_sub_class eq "-" and $self->serial_number ne "-" or $self->sub_class eq "-" and $self->sub_sub_class ne "-"
l!l&&r!l&&!r
0020
$self->sub_sub_class eq "-" and $self->serial_number ne "-"
!ll&&!rl&&r
1640
$self->sub_class eq "-" and $self->sub_sub_class ne "-"
!ll&&!rl&&r
1730
$self->enzyme_class eq "-" and $self->sub_class ne "-"
!ll&&!rl&&r
1820
MC/DC0%0/6
$self->sub_sub_class eq "-" and $self->serial_number ne "-" or $self->sub_class eq "-" and $self->sub_sub_class ne "-" or $self->enzyme_class eq "-" and $self->sub_class ne "-"
$self->sub_sub_class eq "-" $self->serial_number ne "-" $self->sub_class eq "-" $self->sub_sub_class ne "-" $self->enzyme_class eq "-" $self->sub_class ne "-"
Truth table26%4/15
A and B or C and D or E and F
A= $self->sub_sub_class eq "-"B= $self->serial_number ne "-"C= $self->sub_class eq "-"D= $self->sub_sub_class ne "-"E= $self->enzyme_class eq "-"F= $self->sub_class ne "-"
ABCDEFresult
11XXXX1
0X11XX1
1011XX1
0X0X111
0X10111
100X111
1010111
0X0X0X0
0X0X100
0X100X0
0X10100
100X0X0
100X100
10100X0
1010100
541 && $self->serial_number() ne DEFAULT ) ||
542 ( $self->sub_class() eq DEFAULT
543 && $self->sub_sub_class() ne DEFAULT ) ||
544 ( $self->enzyme_class() eq DEFAULT
545 && $self->sub_class() ne DEFAULT ) ) {
546 0 $self->throw( "Illegal format error for comparison ["
547 . $self->to_string() . "]" );
548 }
549  
550 } # _check_for_illegal_defaults
551  
552  
553  
554 # Title : _is_not_reference
555 # Function: Checks whether the argument is not a reference.
556 # Returns : True or false.
557 # Args : A scalar.
558 14 ▶sub _is_not_reference {
Subroutine _is_not_reference: called CC=1 SCAR=0.0
559 14 my ( $self, $value ) = @_;
560  
561 14 return ( ! ref( $value ) );
562
563 } # _is_not_reference
564  
565  
566  
567 # Title : _is_ECnumber_object
568 # Function: Checks whether the arument is a ECnumber.
569 # Returns :
570 # Args : A reference.
571 3 ▶sub _is_ECnumber_object {
Subroutine _is_ECnumber_object: called CC=2 SCAR=8.1
572 3 my ( $self, $value ) = @_;
573  
574 3 ▶ unless( $value->isa( "Bio::Tools::ECnumber" ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($value->isa("Bio::Tools::ECnumber")) 0 3 3
575 0 $self->throw( "Found [". ref( $value )
576 ."] where [Bio::Tools::ECnumber] expected" );
577 }
578
579 } # _is_ECnumber_object
580  
581  
582  
583 2 1;
« Bio/Ontology/OBOEngine.pm ↑ Summary Bio/Tools/Sigcleave.pm »