opencobra/cobratoolbox — pull request #9 by nignatiadis (2013-07-10 23:14:46+00:00)
Title: extra options for findNeighborRxns

A couple of things were changed, in order to make the function more versatile.

Reverse compatibility is still there, with the exception of the definition of default common metabolites that should not count as an edge between reaction nodes. Previous version had hard coded 'atp', 'adp', 'h', 'h2o', 'pi' for some hard coded compartments. Now the default includes these plus 'ppi' for all compartments in the input model, but the user can change this set of common metabolites.

Note that the previous implementation searches for all metabolites of the single input reaction and then returns a cell array of cell arrays. Each of these cell arrays corresponds to a metabolite and includes the reactions that share this metabolite with the input reaction. This behaviour is preserved, if one has just one reaction as input plus the default options.

But now, one can also pool all these reactions together (asSingleArray = true), thus losing the information about the connecting metabolite, which indeed might often not be of immediate interest. If multiple reactions are used as input, the information about which neighbor reaction corresponds to which input reaction is also neglected. Under this condition, one can also search deeper inside the network for higher order neighbors.

The recursive search for higher order neighbors is not the most "efficient" one, but should be ok for the size of pretty much all metabolic networks.