[Bioperl-l] ECnumber

Chris Zmasek czmasek@gnf.org
Thu, 29 Aug 2002 16:44:32 -0700


Hi!

While getting ready to implement the GO related classes.....

I propose the following class to model EC numbers ("ECnumber"):



proposed methods:
-----------------

# new: parse EC from "x.x.x.x"-string.

# init: reset everything (to "-.-.-.-").

# copy: copy this ECnumber.

# EC_string: set/get (parse) this ECnumber through/as a "x.x.x.x"-string.

# class: set/get the 1st number (maybe "enzyme_class" to prevent confusion
         with perl classes).

# sub_class: set/get the 2nd number.

# sub_sub_class: set/get the 3rd number.

# serial_number: set/get the 4th number.

# is_equal: checks whether this ECnumber is equal to another ECnumber.

# is_member: checks whether this ECnumber is a "member" of another 
             (usually incomplete) ECnumber.
             e.g. "1.1.1.1" is a "member" of "1.1.1.-" and "1.-.-.-"
             but not of "1.1.1.23".
             e.g. "1.1.-.-" is a member of "1.-.-.-".
             furthermore, if "is_equal" is true then "is_member" is 
             true, too (i.e. EC numbers are "members" of itself). 
             all ECnumbers are members of "-.-.-.-".

# to_string: get this EC number as a "x.x.x.x"-string

# comment: set/get a arbitrary "comment"



Please let me know what you think.

Furthermore, I have two specific questions:

1. Into which namespace should "ECnumber" go?

2. A better name for method "is_member"?


Thanks,

Christian [czmasek@gnf.org]