Scopes::Net

Module for holding a metabolic reaction network.

addRea (method)

$Net->addRea($substratesHash,$productsHash,[$reversibility,[$catalysts,[inhibitors,[inhibited,[propagators]]]]])
$Net->addRea($substrates,$products,[$reversibility,[$stoich_subs,$stoich_prds,[$catalysts,[inhibitors,[inhibited,[propagators]]]]]])

Add a reaction without specifying a reaction ID. $substrates and $products are arrays with substrate and product IDs, $reversibility is the reversibility of the reaction (indicated by -1 (backward direction), 0 (reversible=default) and 1 (forward direction), and $stoich_subs,$stoich_prds are the stoichiometric coefficients of the substrates and products given as arrays with the same order as $substrates and $products. If no stoichiometry is given, 1 is assumed for all compounds. Note: if you supply hashes, don't supply the stoichiometry arrays

Example: 2 C00002 + C02308 <=> 2 C00008 + C02307

   $Net->addRea([C02308,C00002],[C02307,C00008],0,[1,2],[1,2]);
   $Net->addRea({C02308=>1,C00002=>2},{C02307=>1,C00008=>2},0);

replaceRea (method)

$Net->replaceRea($reaID,$substratesHash,$productsHash,[$reversibility,[$catalysts,[inhibitors,[inhibited,[propagators]]]]])
$Net->replaceRea($reaID,$substrates,$products,[$reversibility,[$stoich_subs,$stoich_prds,[$catalysts,[inhibitors,[inhibited,[propagators]]]]]])

Add a reaction with specifying a reaction ID. $reaID is the ID of the added reaction. $substrates and $products are arrays with substrate and product IDs, $reversibility is the reversibility of the reaction (indicated by -1 (backward direction), 0 (reversible=default) and 1 (forward direction), and $stoich_subs,$stoich_prds are the stoichiometric coefficients of the substrates and products given as arrays with the same order as $substrates and $products. If no stoichiometry is given, 1 is assumed for all compounds. Note: if you supply hashes, don't supply the stoichiometry arrays

Example: 2 C00002 + C02308 <=> 2 C00008 + C02307

        $Net->replaceRea(R00076,[C02308,C00002],[C02307,C00008],0,[1,2],[1,2]);
   $Net->replaceRea(R00076,{C02308=>1,C00002=>2},{C02307=>1,C00008=>2},0);

create (method)

$Net->create($reaIDs,$comIDs,$reaDefs)

creates a whole network at once. $reaIDs and comIDs are arrays with reaction and compound IDs. They also determine the order (and indices) of the compounds and reactions, in particular also the order in the scope arrays. $reaDefs contains an array with definitions for each reaction. a definition is an array analogously to the paramters of replaceRea, i.e. ($reaID,$substrates,$products[,$rev[,$subs_stoich,$prods_stoich]])

Example: 2 C00002 + C02308 <=> 2 C00008 + C02307; C00002 => C00008 + C00009

   $Net->create([C00002,C00008,C00009,C02307,C02308],
                [R00076,R00022],
                   [
                     [R00076,[C02308,C00002],[C02307,C00008],0,[1,2],[1,2]],
                     [R00022,[C00002],[C00008,C00009],1,[1],[1,1]]
                   ]
                ]);

size (method)

returns the size (number of reactions, number of compounds) of the network

numR (method)

returns the number of reactions of the network

numC (method)

returns the number of compounds of the network

at (method)

$Net->at($reaIdx,$comIdx$)

returns the entry of the stoichiometric matrix at a position. The index of a reaction and of a compound have to be provided.

searchReas (method)

$Net->searchReas($query)

searches for all reactions fullfilling the condition in query. A condition is defined as follows:

condition: cond_list [ sidesep cond_list ]

cond_list: and_cond [ "|" cond_list]

and_cond : com_cond [ " " and_cond]

com_cond : comID | !comID

sidesep : "<=>"|"<="|"=>"

A condition contains compounds IDs (comID) which are linked by various AND" ", OR"|" and NOT"!" operations. The separator sidesep defines whether the left condition only on the substrate side and the right condition only at the products side of a reaction (=>) , vice versa (<=) or both (<=>). If ommitted the one condition is simply checked on both sides.

Retuns and arrayref containing the reactions which met the condition.

Example:

   $Net->searchReas("C00002<=>C00008"); #all reactions with C00002 on one side and C00008 on the otherside
   $Net->searchReas("C00002=>C00008"); #dito, but C00002 must be substrate
   $Net->searchReas("C00002<=>C00008|C00046"); #all reactions with C00002 on one side and   on the otherside
   $Net->searchReas("C00002 C00001<=>C00008|C00046"); #all reactions with (C00002 and C00001) on one side and (C00008 or C00046) on the otherside

convert... (methods)

$Net->convert[Compound|Reactions][ID|Idx|Msk]To[ID|Idx|Msk](array)
$Net->convertCompoundsIdxToMsk(array)
...

Convert Compounds or Reaction between various formats. ID represents an array-ref of compounds or reaction IDs. Idx is a list of compound or reaction indices in the network and Msk signifies a CArray containing a non-zero value at each index whose reaction/compound is present.

Example:

        $s=scope($Net->convertCompoundsIDtoMsk([C00002,C00001]));
        print @{$Net->convertCompoundsMsktoID($s);

short forms

[c|r][ID|IX|MS][ID|IX|MS](array)

where c or r indicates compounds or reactions and ID=ID, IX=Idx and MS=Msk.

        $s=scope($Net->cIDMS([C00002,C00001]));
        print @{$Net->cMSID($s);