Skip to content

Commit

Permalink
Merge pull request #1631 from BenjaSanchez/feat/bound-sbo-terms
Browse files Browse the repository at this point in the history
feat: SBO terms for reaction bounds
  • Loading branch information
rmtfleming authored Oct 15, 2020
2 parents a30fe49 + 9c811fb commit 942be7d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/base/io/utilities/writeSBML.m
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@

fbc_parameter.id=listUniqueNames{i,1};
fbc_parameter.value=listUniqueValues(i);
if fbc_parameter.value == -1000 || fbc_parameter.value == +1000 || fbc_parameter.value == 0 || isinf(fbc_parameter.value)
fbc_parameter.sboTerm=626;
else
fbc_parameter.sboTerm=625;
end
if i==1
sbmlModel.parameter=fbc_parameter;
else
Expand Down
13 changes: 13 additions & 0 deletions test/verifiedTests/base/testIO/testWriteSBML.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@
% assess any potential differences
assert(~any(numDiff))

% obtain SBML structure
testSBMLstruct = writeSBML(testModelSBML,'testModelSBML.sbml');

% asses if lower/upper bounds have proper SBO terms assigned
for i = 1:length(testSBMLstruct.parameter)
value = testSBMLstruct.parameter(i).value;
if abs(value) == 1000 || isinf(value) || value == 0
assert(testSBMLstruct.parameter(i).sboTerm == 626)
else
assert(testSBMLstruct.parameter(i).sboTerm == 625)
end
end

% remove the written file to clean up
delete 'testModelSBML.sbml.xml';

Expand Down

0 comments on commit 942be7d

Please sign in to comment.