Skip to content

Commit 2acd2f7

Browse files
authored
Merge pull request #1809 from opencobra/develop
Develop
2 parents 5ea3f81 + 9ae11fc commit 2acd2f7

File tree

2 files changed

+39
-24
lines changed

2 files changed

+39
-24
lines changed

.gitmodules

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,47 @@
22
path = external/base/solvers/lusol
33
url = https://github.com/nwh/lusol.git
44
ignore = dirty
5+
branch = master
56
[submodule "pdco"]
67
path = external/base/solvers/pdco
78
url = https://github.com/mxsaunders/pdco.git
89
ignore = dirty
10+
branch = master
911
[submodule "Smith-Decomposition"]
1012
path = external/base/utilities/Smith-Decomposition
1113
url = https://github.com/nbfigueroa/Smith-Decomposition.git
1214
ignore = dirty
15+
branch = master
1316
[submodule "binary"]
1417
path = binary
1518
url = https://github.com/opencobra/COBRA.binary.git
1619
ignore = none
20+
branch = master
1721
[submodule "gaimc"]
1822
path = external/analysis/gaimc
1923
url = https://github.com/dgleich/gaimc.git
2024
ignore = dirty
25+
branch = master
2126
[submodule "models"]
2227
path = test/models
2328
url = https://github.com/opencobra/COBRA.models
24-
ignore = none
29+
ignore = dirty
30+
branch = master
2531
[submodule "Volume-and-Sampling"]
2632
path = external/analysis/Volume-and-Sampling
2733
url = https://github.com/Bounciness/Volume-and-Sampling.git
2834
ignore = dirty
35+
branch = master
2936
[submodule "CnaCobraInterface"]
3037
path = external/analysis/CnaCobraInterface
3138
url = https://github.com/SteffKlamt/CnaCobraInterface.git
3239
ignore = dirty
40+
branch = master
3341
[submodule "tutorials"]
3442
path = tutorials
3543
url = https://github.com/opencobra/COBRA.tutorials.git
36-
ignore = none
44+
ignore = dirty
45+
branch = master
3746
[submodule "papers"]
3847
path = papers
3948
url = https://github.com/opencobra/COBRA.papers.git
@@ -42,13 +51,19 @@
4251
path = external/analysis/octave-networks-toolbox
4352
url = https://github.com/aeolianine/octave-networks-toolbox.git
4453
ignore = dirty
54+
branch = master
4555
[submodule "looplessFluxSampler"]
4656
path = external/base/samplers/looplessFluxSampler
4757
url = https://github.com/rmtfleming/looplessFluxSampler
4858
ignore = dirty
59+
branch = master
4960
[submodule "external/base/utilities/condalab"]
5061
path = external/base/utilities/condalab
5162
url = https://github.com/sg-s/condalab
63+
ignore = dirty
64+
branch = master
5265
[submodule "external/analysis/PolytopeSamplerMatlab"]
5366
path = external/analysis/PolytopeSamplerMatlab
5467
url = https://github.com/ConstrainedSampler/PolytopeSamplerMatlab
68+
ignore = dirty
69+
branch = master

src/analysis/topology/conservedMoieties/identifyConservedMoieties.m

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
% * .Nodes.MoietyIndex - numeric id of the corresponding moiety (arm.MTG.Nodes.MoietyIndex)
7676
% * .Nodes.Component - numeric id of the corresponding connected component (rows of C2A)
7777
% * .Nodes.IsomorphismClass - numeric id of the corresponding isomprphism class (rows of I2C)
78-
% * .Nodes.IsFirst - boolean, true if atom is within first component of an isomorphism class
78+
% * .Nodes.IsCanonical - boolean, true if atom is within first component of an isomorphism class
7979
%
8080
% * .Edges — Table of edge information, with `u` rows, one for each atom transition instance.
8181
% * .Edges.EndNodes - numeric id of head and tail atoms that defines the graph edges
@@ -87,7 +87,7 @@
8787
% * .Edges.TransIndex - unique numeric id for each atom transition
8888
% * .Edges.Component - numeric id of the corresponding connected component (columns of T2C)
8989
% * .Edges.IsomorphismClass - numeric id of the corresponding isomprphism class (columns of T2I)
90-
% * .Edges.IsFirst - boolean, true if atom transition is within first component of an isomorphism class
90+
% * .Edges.IsCanonical - boolean, true if atom transition is within first component of an isomorphism class
9191
%
9292
% arm.M2A: `m x a` matrix mapping each metabolite to one or more atoms in the (undirected) atom transition graph
9393
% arm.A2R: `u x n` matrix that maps atom transitions to reactions. An atom transition can map to multiple reactions and a reaction can map to multiple atom transitions
@@ -105,9 +105,9 @@
105105
% arm.MTG: (undirected) moitey transition graph, as a MATLAB graph structure with the following tables and variables:
106106
%
107107
% * .Nodes — Table of node information, with `p` rows, one for each moiety instance.
108-
% * .Nodes.MoietyIndex - unique numeric id of the moiety
108+
% * .Nodes.MoietyIndex - unique numeric id of the moiety instance
109109
% * .Nodes.Formula - chemical formula of the moiety (Hill notation)
110-
% * .Nodes.Met - representative metabolite containing the moiety
110+
% * .Nodes.Met - metabolite containing the moiety instance
111111
% * .Nodes.Component - numeric id of the corresponding connected component (rows of C2M)
112112
% * .Nodes.IsomorphismClass - numeric id of the corresponding isomprphism class (rows of I2M)
113113

@@ -117,7 +117,7 @@
117117
% * .Edges.Rxn - the reaction from which this moiety transition was derived
118118
% * .Edges.Component - numeric id of the corresponding connected component (columns of M2C)
119119
% * .Edges.IsomorphismClass - numeric id of the corresponding isomprphism class (columns of M2I)
120-
% * .Edges.IsFirst - boolean, true if moiety transition is within first component of an isomorphism class
120+
% * .Edges.IsCanonical - boolean, true if moiety transition is within first component of an isomorphism class
121121
% Note that M = incidence(arm.MTG); gives the p x q incidence matrix of the moitey transition graph
122122
%
123123
% arm.I2M Matrix to map each isomorphism class to one or more moiety instances
@@ -134,7 +134,7 @@
134134
% arm.ATG.Edges.orientationATM2dATM - orientation of edge with respect to the reaction from which this atom transition was derived
135135
% arm.ATG.Edges.Rxn - the reaction from which this atom transition was derived
136136
%
137-
% arm.MTG.Nodes.IsFirst - boolean, true if moiety corresponds to the first component of an isomorphism class (should be all true)
137+
% arm.MTG.Nodes.IsCanonical - boolean, true if moiety corresponds to the first component of an isomorphism class (should be all true)
138138
% arm.MTG.Nodes.Atom - alphanumeric id of the corresponding atom in the first component of an isomorphism class
139139
% arm.MTG.Nodes.AtomIndex - numeric id of the corresponding atom in the first component of an isomorphism class
140140
% arm.MTG.Edges.orientationATM2dATM - orientation of moiety transition with respect to the reaction from which this moiety transition was derived
@@ -713,31 +713,31 @@
713713
%% Moiety transition graph
714714
%create the moiety transition graph explicitly as a
715715
%subgraph of the atom transition graph
716-
[isFirst, moiety2isomorphismClass] = ismember(atoms2component,firstSubgraphIndices);
717-
moiety2isomorphismClass = moiety2isomorphismClass(isFirst);
716+
[isCanonical, moiety2isomorphismClass] = ismember(atoms2component,firstSubgraphIndices);
717+
moiety2isomorphismClass = moiety2isomorphismClass(isCanonical);
718718

719719
if sanityChecks
720-
moiety2isomorphismClass2 = atoms2isomorphismClass(isFirst);
720+
moiety2isomorphismClass2 = atoms2isomorphismClass(isCanonical);
721721
if any(moiety2isomorphismClass~=moiety2isomorphismClass2)
722722
error('Inconsistent moiety2isomorphismClass vector')
723723
end
724724
end
725725

726-
ATG.Nodes = addvars(ATG.Nodes,isFirst,'NewVariableNames','IsFirst');
726+
ATG.Nodes = addvars(ATG.Nodes,isCanonical,'NewVariableNames','IsCanonical');
727727
%size of the moiety instance transition graph
728-
nMoieties=nnz(isFirst);
729-
isFirstTransition = any(A(isFirst, :), 1)';
730-
nMoietyTransitions = nnz(isFirstTransition);
728+
nMoieties=nnz(isCanonical);
729+
isCanonicalTransition = any(A(isCanonical, :), 1)';
730+
nMoietyTransitions = nnz(isCanonicalTransition);
731731

732732
if 0
733-
ATG.Edges = addvars(ATG.Edges,isFirstTransition,'NewVariableNames','IsFirst');
733+
ATG.Edges = addvars(ATG.Edges,isCanonicalTransition,'NewVariableNames','IsCanonical');
734734
else
735-
ATG.Edges.IsFirst = isFirstTransition;
735+
ATG.Edges.IsCanonical = isCanonicalTransition;
736736
end
737737

738738
%draft moiety transition graph, before editing node and
739739
%edge information
740-
MTG = subgraph(ATG,isFirst);
740+
MTG = subgraph(ATG,isCanonical);
741741
M = incidence(MTG);
742742

743743
MTG.Nodes.MoietyIndex = (1:nMoieties)';
@@ -752,7 +752,7 @@
752752
end
753753

754754
%add moiety specific information
755-
MTG.Nodes = removevars(MTG.Nodes,{'AtomNumber','Element','IsFirst','Atom','AtomIndex'});
755+
MTG.Nodes = removevars(MTG.Nodes,{'AtomNumber','Element','IsCanonical','Atom','AtomIndex'});
756756
MTG.Nodes = addvars(MTG.Nodes,moietyFormulae(moiety2isomorphismClass),'NewVariableNames','Formula','After','MoietyIndex');
757757

758758
% * .Edges.HeadAtom - head Nodes.Atom
@@ -767,7 +767,7 @@
767767
if 1
768768
%graph.Edges cannot be directly edited in a graph object, so extract,
769769
%edit and regenerate the graph
770-
Edges = removevars(MTG.Edges,{'Trans','TransIndex','TransInstIndex','OrigTransInstIndex','HeadAtomIndex','TailAtomIndex','HeadAtom','TailAtom','orientationATM2dATM','IsFirst','Rxn'});
770+
Edges = removevars(MTG.Edges,{'Trans','TransIndex','TransInstIndex','OrigTransInstIndex','HeadAtomIndex','TailAtomIndex','HeadAtom','TailAtom','orientationATM2dATM','IsCanonical','Rxn'});
771771
%add variables
772772
Edges = addvars(Edges,MTG.Nodes.Formula(Edges.EndNodes(:,1)),'NewVariableNames','Formula');
773773
%reorder the variables
@@ -796,7 +796,7 @@
796796
% Extract moiety graph directly from atom transition
797797
% graph incidence matrix
798798
[isFirstAlso, ~] = ismember(atoms2component,firstSubgraphIndices);
799-
if ~all(isFirst == isFirstAlso)
799+
if ~all(isCanonical == isFirstAlso)
800800
error('moiety incidence matrix does not match first component')
801801
end
802802
A = incidence(ATG);
@@ -824,7 +824,7 @@
824824
%add the moiety indices for the first atoms in each moiety
825825
moietyInd=1;
826826
for i=1:nAtoms
827-
if ATG.Nodes.IsFirst(i)
827+
if ATG.Nodes.IsCanonical(i)
828828
ATG.Nodes.MoietyIndex(i)=moietyInd;
829829
moietyInd = moietyInd + 1;
830830
end
@@ -880,7 +880,7 @@
880880

881881
%% Map between moiety graph and metabolic network
882882
%map metabolite to moieties
883-
moieties2mets = atoms2mets(isFirst);
883+
moieties2mets = atoms2mets(isCanonical);
884884

885885
%matrix to map each metabolite to one or more moieties
886886
M2M = sparse(moieties2mets,(1:nMoieties)', 1,nMappedMets,nMoieties);
@@ -919,7 +919,7 @@
919919
%matrix to map moiety transitions to reactions. Multiple moiety
920920
%transitions can map to multiple reactions.
921921
%A2R = A2Ti*Ti2R;
922-
M2R = A2R(isFirstTransition,:);
922+
M2R = A2R(isCanonicalTransition,:);
923923

924924
if 0
925925
%in general it is not possible to specify the mapping from moiety

0 commit comments

Comments
 (0)