Bio::Metabolic::Substrate::Cluster - Perl extension for lists of metabolic compounds
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);
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.
None
String Conversion $string = "$cluster"; print "\$cluster = '$cluster'\n"; Addition $clbig = $cl1 + $cl2;
$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.
$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.
Oliver Ebenhöh, oliver.ebenhoeh@rz.hu-berlin.de
Bio::Metabolic, Bio::Metabolic::Substrate.
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();
copy() is exactly the same as $cl2 = $cl1->new();
list() returns the substrates of the objects as a list in array context, as an arrayref in scalar context.
cluster_to_string() returns a readable string listing the substrates in the object.
has($sub) returns 1 if the object contains $sub, 0 otherwise.
this method modifies the object in-place, adding the substrates passed as arguments (array or arrayref)
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.
this method returns a cluster containing substrates from an arbitrary large list of clusters.
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:
Non-ASCII character seen before =encoding in 'Ebenhöh,'. Assuming CP1252
To install Bio::Metabolic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::Metabolic
CPAN shell
perl -MCPAN -e shell install Bio::Metabolic
For more information on module installation, please visit the detailed CPAN module installation guide.