Topology¶
- connectedComponents(model, type, figures, files)¶
Assuming two reactions are connected if they share metabolites, calculates the connected components in the stoichiometric matrix, that is, the sets of reactions that share a set of metabolites
USAGE:
[groups, orphans, R, C] = connectedComponents(model, type, figures)
- INPUT:
model:
- OPTIONAL INPUTS:
type: {(‘allComponents’), ‘largestComponent’} figures: Will generate plots of the grouping algorithm as it creates block diagonal
groups in from top left to bottom right in W.
- files: Indicator, whether several files containing indicator
matrices are generated.
- OUTPUTS:
groups: a structure array (the number of distinct groups is length(groups)) with fields:
groups(i).num_els - number of reactions in group i.
groups(i).block - sub-block identity of group i.
groups(i).elements - reactions of W that are in group i.
groups(i).degrees - degrees of connection for each reaction in group i.
orphans: elements of W that were not in any group, becasue they did not meet the constraints. R: reaction adjacency C: compound adjacency
All components require: Connected Component Analysis on an Undirected Graph by Tristan Ursell http://www.mathworks.com/matlabcentral/fileexchange/35442-connected-component-analysis-on-an-undirected-graph.
Largest component requires: gaimc : Graph Algorithms In Matlab Code by David Gleich http://www.mathworks.com/matlabcentral/fileexchange/24134-gaimc-graph-algorithms-in-matlab-code.
- findCyclicRxns(model, printLevel)¶
Computes the reactions that are part of one or more stoichiometrically balanced cycles in the network
USAGE:
[cyclicRxnBool, rankS] = findCyclicRxns(model, printLevel)
- INPUT:
model: model structure printLevel: verbose level
- OUTPUTS:
cyclicRxnBool: boolean value rankS: scalar giving rank of S
- getCorrespondingCols(S, rowBool, colBool, mode)¶
Returns a boolean vector that is true for a subset of the true cols in colBool according to whether the cols ‘exclusive’, ‘inclusive’, or ‘partial’ -ly correspond to true entries in rowBool
USAGE:
restrictedColBool = getCorrespondingCols(S, rowBool, colBool, mode)
- INPUTS:
S: m x n stoichiometric matrix rowBool: m x 1 boolean vector colBool: n x 1 boolean vector mode: ‘exclusive’ or ‘inclusive’ or ‘partial’
- OUTPUT:
restrictedColBool: n x 1 boolean vector
Example
- S =
- -1
0 0 0 0 2 -3 0 0 0 0 4 -5 0 0 0 0 6 -7 0 0 0 0 0 0
rowBool = [1; 1; 1; 0; 0]; colBool = [1; 1; 1; 1; 1];
%Therefore, the subset of rows and columns considered for inclusion are % -1 0 0 0 0 % 2 -3 0 0 0 % 0 4 -5 0 0
%If mode = ‘exclusive’ then restrictedColBool corresponds to this subset % -1 0 % 2 -3 % 0 4 %i.e. subset of colBool reactions exclusively involving rowBool metabolites
%If mode = ‘inclusive’ then restrictedColBool corresponds to this subset % -1 0 0 % 2 -3 0 % 0 4 -5 %i.e. subset of colBool reactions involving at least one rowBool metabolite
%If mode =’partial’ then restrictedColBool corresponds to the extra cols %with inclusive that are not present with exclusive.
- getCorrespondingRows(S, rowBool, colBool, mode)¶
Returns a boolean vector that is true for a subset of the true rows in rowBool according to whether the rows ‘exclusive’, ‘inclusive’, or ‘partial’ -ly correspond to true entries in colBool
USAGE:
restricedRowBool = getCorrespondingRows(S, rowBool, colBool, mode)
- INPUTS:
S: m x n stoichiometric matrix rowBool: m x 1 boolean vector colBool: n x 1 boolean vector mode: ‘exclusive’ , ‘inclusive’ or ‘partial’
- OUTPUT:
restrictedRowBool: m x 1 boolean vector
Example
- S =
- -1
0 0 0 0 2 -3 0 0 0 0 4 -5 0 0 0 0 6 -7 0 0 0 0 0 0
rowBool = [1; 1; 1; 1; 1]; colBool = [1; 1; 1; 0; 0];
% Therefore, the subset of rows and columns considered for inclusion are % -1 0 0 % 2 -3 0 % 0 4 -5 % 0 0 6 % 0 0 0
% If mode = ‘exclusive’ then restrictedRowBool corresponds to this subset % -1 0 0 % 2 -3 0 % 0 4 -5 % i.e subset of rowBool metabolites exclusively involved in the colBool % reactions
% If mode = ‘inclusive’ then restrictedRowBool corresponds to this subset % -1 0 0 % 2 -3 0 % 0 4 -5 % 0 0 6 % i.e subset of rowBool metabolites involved in colBool reactions
% If mode =’partial’ then restrictedRowBool corresponds to the extra rows % with inclusive that are not present with exclusive.
- integerizeS(S, SIntRxnBool)¶
convert an S matrix with some non integer coefficients into an S matrix with all integer coefficients assumes that there are a maximum of six significant digits in the biomass reaction
- INPUT
S stoichiometric matrix
- OPTIONAL INPUT
- SIntRxnBool Boolean of internal (mass balanced) reactions.
If provided, only these reactions are integerised
- OUTPUT
SInteger stoichiometric matrix of integers G scaling matrix, SInteger=S*G;
- matrixCoherence(A)¶
Computes the coherence of a matrix A, that is the maximum absolute value of the cross correlations between the columns of A
USAGE:
[mu, Q] = matrixCoherence(A)
- INPUT:
A: Matrix
- OUTPUTS:
mu: coherence Q: matrix used by mu
- testForTypeIIIPathways(model, ListExch, filename)¶
Sets up the model to run extreme pathway analysis (expa) for identifying loops in the model (Type III pathways) and runs expa.
USAGE:
testForTypeIIIPathways(model, ListExch, filename)
- INPUTS:
model: COBRA model structure ListExch: List of position of exchange reactions in S matrix filename: name of the file