~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to Bio/Tools/ECnumber.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: ECnumber.pm,v 1.7 2002/12/12 18:27:02 czmasek Exp $
 
1
# $Id: ECnumber.pm,v 1.11.4.1 2006/10/02 23:10:31 sendu Exp $
2
2
#
3
3
# BioPerl module for Bio::Tools::ECnumber
4
4
#
22
22
 
23
23
=head1 NAME
24
24
 
25
 
ECnumber - representation of EC numbers
 
25
Bio::Tools::ECnumber - representation of EC numbers (Enzyme Classification)
26
26
 
27
27
=head1 SYNOPSIS
28
28
 
29
29
  use Bio::Tools::ECnumber;
30
30
 
31
 
 
32
31
  # Creation of ECnumber objects
33
 
  # ----------------------------
34
 
 
35
32
  my $EC1 = Bio::Tools::ECnumber->new( -ec_string => "4.3.2.1" );
36
33
  my $EC2 = Bio::Tools::ECnumber->new( -ec_string => "EC 1.1.1.1" );
37
34
  my $EC3 = Bio::Tools::ECnumber->new();
38
35
 
39
 
 
40
36
  # Copying
41
 
  # -------
42
 
 
43
37
  my $EC4 = $EC1->copy();
44
38
 
45
 
 
46
 
  # Modification of ECnumber objects
47
 
  # --------------------------------
48
 
 
 
39
  # Modification/canonicalization of ECnumber objects
49
40
  print $EC3->EC_string( "1.01.01.001" ); # Prints "1.1.1.1".
50
41
 
51
 
 
52
 
  # To string
53
 
  # ---------
54
 
 
 
42
  # Stringify
55
43
  print $EC3->EC_string();
56
 
 
57
 
  # or:
58
 
 
 
44
  # or
59
45
  print $EC3->to_string();
60
46
 
61
 
 
62
 
 
63
47
  # Test for equality
64
 
  # -----------------
65
 
 
66
 
  # Against ECnumber object:
 
48
  # -- Against ECnumber object:
67
49
  if ( $EC3->is_equal( $EC2 ) ) { # Prints "equal".
68
50
      print "equal";
69
51
  }
70
 
 
71
 
  # Against string representation of EC number:
 
52
  # -- Against string representation of EC number:
72
53
  if ( ! $EC3->is_equal( "1.1.1.-" ) ) { # Prints "not equal".
73
54
      print "not equal";
74
55
  }
75
56
 
76
 
 
77
57
  # Test for membership
78
 
  # -------------------
79
 
 
80
58
  my $EC5 = Bio::Tools::ECnumber->new( -ec_string => "4.3.2.-" ); 
81
 
 
82
 
  # Against ECnumber object.
 
59
  # -- Against ECnumber object.
83
60
  if ( $EC1->is_member( $EC5 ) ) { # Prints "member".
84
61
      print "member"; 
85
62
  }
86
 
 
87
 
 
88
 
  # Against string representation of EC number.
 
63
  # -- Against string representation of EC number.
89
64
  if ( ! $EC1->is_member( "4.3.1.-" ) ) { # Prints "not member".
90
65
      print "not member";
91
66
  }
92
67
 
93
 
 
94
 
 
95
68
=head1 DESCRIPTION
96
69
 
97
 
ECnumber is a representation of EC numbers [http://www.chem.qmul.ac.uk/iubmb/enzyme/].
 
70
L<Bio::Tools::ECnumber> is a representation of EC numbers, 
 
71
the numerical heirarchy for Enzyme Classification.
 
72
 
 
73
See L<http://www.chem.qmul.ac.uk/iubmb/enzyme/> for more details.
98
74
 
99
75
=head1 FEEDBACK
100
76
 
104
80
Bioperl modules. Send your comments and suggestions preferably to one
105
81
of the Bioperl mailing lists.  Your participation is much appreciated.
106
82
 
107
 
  bioperl-l@bioperl.org             - General discussion
108
 
  http://bio.perl.org/MailList.html - About the mailing lists
 
83
  bioperl-l@bioperl.org                  - General discussion
 
84
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
109
85
 
110
86
=head2 Reporting Bugs
111
87
 
112
88
Report bugs to the Bioperl bug tracking system to help us keep track
113
 
the bugs and their resolution.  Bug reports can be submitted via email
114
 
or the web:
 
89
the bugs and their resolution.  Bug reports can be submitted via the
 
90
web:
115
91
 
116
 
  bioperl-bugs@bio.perl.org
117
 
  http://bugzilla.bioperl.org/
 
92
  http://bugzilla.open-bio.org/
118
93
 
119
94
=head1 AUTHOR
120
95
 
141
116
# Let the code begin...
142
117
 
143
118
package Bio::Tools::ECnumber;
144
 
use vars qw( @ISA );
145
119
use strict;
146
 
use Bio::Root::Object;
147
120
 
148
121
use constant DEFAULT => "-";
149
122
use constant TRUE    => 1;
150
123
use constant FALSE   => 0;
151
124
 
152
 
@ISA = qw( Bio::Root::Root );
153
 
 
154
 
 
155
 
 
156
 
 
 
125
use base qw(Bio::Root::Root);
157
126
 
158
127
=head2 new
159
128
 
168
137
           Parses a EC number from "x.x.x.x", "EC x.x.x.x",
169
138
           "ECx.x.x.x", or "EC:x.x.x.x";
170
139
           x being either a positive integer or a "-".
171
 
 Returns : A new Ecnumber object.
 
140
 Returns : A new ECnumber object.
172
141
 Args    : A string representing a EC number, e.g. "4.3.2.1"
173
142
           or "EC 4.3.2.1" or "1.-.-.-".
174
143