NAME

Bio::Metabolic::Substrate::Cluster - Perl extension for lists of metabolic compounds

SYNOPSIS

use Bio::Metabolic::Substrate::Cluster;

$cl = Bio::Metabolic::Substrate::Cluster->new(@substrate_list);

$clcopy = $cl->copy;

@list = $cl->list;

if ($cl->has($substrate)) { ... }

$substrate_nr = $cl->which($substrate);

$cl->add_substrates(@substrate_list);

$removed = $cl->remove_substrates(@substrate_list);

DESCRIPTION

This class implements the object class for clusters of biochemical compounds. Essentially, a Bio::Metabolic::Substrate::Cluster object is an arrayref to list of Bio::Metabolic::Substrate objects.

EXPORT

None

OVERLOADED OPERATORS

String Conversion
  $string = "$cluster";
  print "\$cluster = '$cluster'\n";

Addition
  $clbig = $cl1 + $cl2;

CLASS METHODS

$cl = Bio::Metabolic::Substrate::Cluster->new(@substrate_list);

The constructor method creating a Bio::Metabolic::Substrate::Cluster object from a list of Bio::Metabolic::Substrate objects.

OBJECT METHODS

$clcopy = $cl->copy;

creates an exact copy of a cluster

@list = $cl->list;

returns a list of Bio::Metabolic::Substrate objects

$cl->has($substrate))

returns 1 if $substrate is a member of $cl, 0 otherwise

$substrate_nr = $cl->which($substrate);

returns the index of the element representing $substrate

EXAMPLE: @list = $cl->list;
         if ($cl->has($substrate)) {
           $ind = $cl->which($substrate);
           print "BOO!\n" if ($substrate == $list[$ind]); # prints "BOO!"
         }


 $cl->add_substrates(@substrate_list);

adds the list of Bio::Metabolic::Substrate objects to the cluster $cl

$removed = $cl->remove_substrates(@substrate_list);

removes the list of Bio::Metabolic::Substrate objects if present. Returns a cluster containing all removed substrates.

AUTHOR

Oliver Ebenhöh, oliver.ebenhoeh@rz.hu-berlin.de

SEE ALSO

Bio::Metabolic, Bio::Metabolic::Substrate.

METHODS

Constructor new

Creates a new instance of a Bio::Metabolic::Substrate::Cluster object. Can be invoked as class method or object method. In the first case returns a Bio::Metabolic::Substrate::Cluster genereted from the arguments (array or arrayref). In the second case it returns a clone.

$cl = Bio::Metabolic::Substrate::Cluster->new($substrate1, $substrate2, $substrate3 ...);

$cl = Bio::Metabolic::Substrate::Cluster->new([$substrate1, $substrate2, $substrate3 ...]);

$cl = $proto->new();

Method copy

copy() is exactly the same as $cl2 = $cl1->new();

Method list

list() returns the substrates of the objects as a list in array context, as an arrayref in scalar context.

Method cluster_to_string

cluster_to_string() returns a readable string listing the substrates in the object.

Method has

has($sub) returns 1 if the object contains $sub, 0 otherwise.

method add_substrates

this method modifies the object in-place, adding the substrates passed as arguments (array or arrayref)

method remove_substrates

this method modifies the object in-place, removing the substrates passed as arguments from the list (array or arrayref). Returns the removed substrates as Bio::Metabolic::Substrate::Cluster.

method add_clusters

this method returns a cluster containing substrates from an arbitrary large list of clusters.

method which

If $cl is Bio::Metabolic::Substrate::Cluster, which($substrate) returns the index of the list containing $substrates. I.e. $i = $cl->which($substrate); @list = $cl->list; print "TRUE\n" if $list[$i] == $substrate; # prints 'TRUE'

1 POD Error

The following errors were encountered while parsing the POD:

Around line 93:

Non-ASCII character seen before =encoding in 'Ebenhöh,'. Assuming CP1252