SBMLToolbox-4.1.0/ 0000755 0000000 0000000 00000000000 11704572216 012323 5 ustar root root SBMLToolbox-4.1.0/VERSION.txt 0000644 0000000 0000000 00000000006 11701315266 014202 0 ustar root root 4.1.0
SBMLToolbox-4.1.0/toolbox/ 0000755 0000000 0000000 00000000000 11704572220 014004 5 ustar root root SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/ 0000755 0000000 0000000 00000000000 11704572222 021637 5 ustar root root SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/ 0000755 0000000 0000000 00000000000 11704572222 022556 5 ustar root root SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/test_valid.m 0000644 0000000 0000000 00000044527 11703270126 025103 0 ustar root root function y = test_valid()
%
test = 0;
Totalfail = 0;
test = test + 9;
fail = TestIsSBML_AlgebraicRule;
if (fail > 0)
disp('isSBML_AlgebraicRule failed');
end;
Totalfail = Totalfail + fail;
test = test + 9;
fail = TestIsSBML_AssignmentRule;
if (fail > 0)
disp('isSBML_AssignmentRule failed');
end;
Totalfail = Totalfail + fail;
test = test + 13;
fail = TestIsSBML_Compartment;
if (fail > 0)
disp('isSBML_Compartment failed');
end;
Totalfail = Totalfail + fail;
test = test + 5;
fail = TestIsSBML_CompartmentVolumeRule;
if (fail > 0)
disp('isSBML_CompartmentVolumeRule failed');
end;
Totalfail = Totalfail + fail;
test = test + 15;
fail = TestIsSBML_Event;
if (fail > 0)
disp('isSBML_Event failed');
end;
Totalfail = Totalfail + fail;
test = test + 8;
fail = TestIsSBML_EventAssignment;
if (fail > 0)
disp('isSBML_EventAssignment failed');
end;
Totalfail = Totalfail + fail;
test = test + 8;
fail = TestIsSBML_FunctionDefinition;
if (fail > 0)
disp('isSBML_FunctionDefinition failed');
end;
Totalfail = Totalfail + fail;
test = test + 12;
fail = TestIsSBML_KineticLaw;
if (fail > 0)
disp('isSBML_KineticLaw failed');
end;
Totalfail = Totalfail + fail;
test = test + 7;
fail = TestIsSBML_LocalParameter;
if (fail > 0)
disp('isSBML_LocalParameter failed');
end;
Totalfail = Totalfail + fail;
test = test + 8;
fail = TestIsSBML_ModifierSpeciesReference;
if (fail > 0)
disp('isSBML_ModifierSpeciesReference failed');
end;
Totalfail = Totalfail + fail;
test = test + 9;
fail = TestIsSBML_Parameter;
if (fail > 0)
disp('isSBML_Parameter failed');
end;
Totalfail = Totalfail + fail;
test = test + 5;
fail = TestIsSBML_ParameterRule;
if (fail > 0)
disp('isSBML_ParameterRule failed');
end;
Totalfail = Totalfail + fail;
test = test + 10;
fail = TestIsSBML_Priority;
if (fail > 0)
disp('isSBML_Priority failed');
end;
Totalfail = Totalfail + fail;
test = test + 9;
fail = TestIsSBML_RateRule;
if (fail > 0)
disp('isSBML_RateRule failed');
end;
Totalfail = Totalfail + fail;
test = test + 10;
fail = TestIsSBML_Reaction;
if (fail > 0)
disp('isSBML_Reaction failed');
end;
Totalfail = Totalfail + fail;
test = test + 11;
fail = TestIsSBML_Species;
if (fail > 0)
disp('isSBML_Species failed');
end;
Totalfail = Totalfail + fail;
test = test + 5;
fail = TestIsSBML_SpeciesConcentrationRule;
if (fail > 0)
disp('isSBML_SpeciesConcentrationRule failed');
end;
Totalfail = Totalfail + fail;
test = test + 10;
fail = TestIsSBML_SpeciesReference;
if (fail > 0)
disp('isSBML_SpeciesReference failed');
end;
Totalfail = Totalfail + fail;
test = test + 10;
fail = TestIsSBML_UnitDefinition;
if (fail > 0)
disp('isSBML_UnitDefinition failed');
end;
Totalfail = Totalfail + fail;
test = test + 10;
fail = TestIsSBML_Unit;
if (fail > 0)
disp('isSBML_Unit failed');
end;
Totalfail = Totalfail + fail;
test = test + 10;
fail = TestIsSBML_CompartmentType;
if (fail > 0)
disp('isSBML_CompartmentType failed');
end;
Totalfail = Totalfail + fail;
test = test + 8;
fail = TestIsSBML_SpeciesType;
if (fail > 0)
disp('isSBML_SpeciesType failed');
end;
Totalfail = Totalfail + fail;
test = test + 7;
fail = TestIsSBML_InitialAssignment;
if (fail > 0)
disp('isSBML_InitialAssignment failed');
end;
Totalfail = Totalfail + fail;
test = test + 7;
fail = TestIsSBML_Constraint;
if (fail > 0)
disp('isSBML_Constraint failed');
end;
Totalfail = Totalfail + fail;
test = test + 13;
fail = TestIsSBML_Trigger;
if (fail > 0)
disp('isSBML_Trigger failed');
end;
Totalfail = Totalfail + fail;
test = test + 8;
fail = TestIsSBML_Delay;
if (fail > 0)
disp('isSBML_Delay failed');
end;
Totalfail = Totalfail + fail;
test = test + 8;
fail = TestIsSBML_StoichiometryMath;
if (fail > 0)
disp('isSBML_StoichiometryMath failed');
end;
Totalfail = Totalfail + fail;
if isBindingInstalled() == 1
m = TranslateSBML('../../Test/test-data/l1v1.xml');
ud = m.unitDefinition(1);
c = m.compartment(1);
s = m.species(1);
p = m.parameter(1);
r = m.reaction(1);
test = test + 6;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l1v1 Model failed');
end;
pass = isSBML_UnitDefinition(ud, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l1v1 UnitDefinition failed');
end;
pass = isSBML_Compartment(c, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l1v1 Compartment failed');
end;
pass = isSBML_Species(s, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l1v1 Species failed');
end;
pass = isSBML_Parameter(p, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l1v1 Parameter failed');
end;
pass = isSBML_Reaction(r, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l1v1 Reaction failed');
end;
Totalfail = Totalfail + fail;
m = TranslateSBML('../../Test/test-data/l1v2-all.xml');
ud = m.unitDefinition(1);
c = m.compartment(1);
s = m.species(1);
p = m.parameter(1);
ar = m.rule(1);
scr = m.rule(2);
cvr = m.rule(3);
pr = m.rule(4);
r = m.reaction(1);
test = test + 10;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Model failed');
end;
pass = isSBML_UnitDefinition(ud, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 UnitDefinition failed');
end;
pass = isSBML_Compartment(c, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Compartment failed');
end;
pass = isSBML_Species(s, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Species failed');
end;
pass = isSBML_Parameter(p, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Parameter failed');
end;
pass = isSBML_AlgebraicRule(ar, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Rule 1 failed');
end;
pass = isSBML_SpeciesConcentrationRule(scr, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Rule 2 failed');
end;
pass = isSBML_CompartmentVolumeRule(cvr, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Rule 3 failed');
end;
pass = isSBML_ParameterRule(pr, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Rule 4 failed');
end;
pass = isSBML_Reaction(r, 1, 2);
if (pass == 0)
fail = fail + 1;
disp('l1v2 Reaction failed');
end;
Totalfail = Totalfail + fail;
m = TranslateSBML('../../Test/test-data/l2v1-all.xml');
fd = m.functionDefinition(1);
ud = m.unitDefinition(1);
c = m.compartment(1);
s = m.species(1);
p = m.parameter(1);
ar = m.rule(1);
asr = m.rule(2);
rr = m.rule(3);
r = m.reaction(1);
e = m.event(1);
test = test + 11;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Model failed');
end;
pass = isSBML_FunctionDefinition(fd, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 FunctionDefinition failed');
end;
pass = isSBML_UnitDefinition(ud, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 UnitDefinition failed');
end;
pass = isSBML_Compartment(c, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Compartment failed');
end;
pass = isSBML_Species(s, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Species failed');
end;
pass = isSBML_Parameter(p, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Parameter failed');
end;
pass = isSBML_AlgebraicRule(ar, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Rule 1 failed');
end;
pass = isSBML_AssignmentRule(asr, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Rule 2 failed');
end;
pass = isSBML_RateRule(rr, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Rule 3 failed');
end;
pass = isSBML_Reaction(r, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Reaction failed');
end;
pass = isSBML_Event(e, 2, 1);
if (pass == 0)
fail = fail + 1;
disp('l2v1 Event failed');
end;
Totalfail = Totalfail + fail;
m = TranslateSBML('../../Test/test-data/l2v2-all.xml');
fd = m.functionDefinition(1);
ud = m.unitDefinition(1);
ct = m.compartmentType(1);
st = m.speciesType(1);
c = m.compartment(1);
s = m.species(1);
p = m.parameter(1);
ia = m.initialAssignment(1);
ar = m.rule(1);
asr = m.rule(2);
rr = m.rule(3);
con = m.constraint(1);
r = m.reaction(1);
e = m.event(1);
test = test + 15;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Model failed');
end;
pass = isSBML_FunctionDefinition(fd,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 FunctionDefinition failed');
end;
pass = isSBML_UnitDefinition(ud,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 UnitDefinition failed');
end;
pass = isSBML_CompartmentType(ct,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 CompartmentType failed');
end;
pass = isSBML_SpeciesType(st,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 SpeciesType failed');
end;
pass = isSBML_Compartment(c,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Compartment failed');
end;
pass = isSBML_Species(s,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Species failed');
end;
pass = isSBML_Parameter(p,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Parameter failed');
end;
pass = isSBML_InitialAssignment(ia,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 InitialAssignment failed');
end;
pass = isSBML_AlgebraicRule(ar,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Rule 1 failed');
end;
pass = isSBML_AssignmentRule(asr,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Rule 2 failed');
end;
pass = isSBML_RateRule(rr,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Rule 3 failed');
end;
pass = isSBML_Constraint(con,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Constraint failed');
end;
pass = isSBML_Reaction(r,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Reaction failed');
end;
pass = isSBML_Event(e,2, 2);
if (pass == 0)
fail = fail + 1;
disp('l2v2 Event failed');
end;
Totalfail = Totalfail + fail;
m = TranslateSBML('../../Test/test-data/l2v3-all.xml');
fd = m.functionDefinition(1);
ud = m.unitDefinition(1);
ct = m.compartmentType(1);
st = m.speciesType(1);
c = m.compartment(1);
s = m.species(1);
p = m.parameter(1);
ia = m.initialAssignment(1);
ar = m.rule(1);
asr = m.rule(2);
rr = m.rule(3);
con = m.constraint(1);
r = m.reaction(1);
e = m.event(1);
test = test + 15;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Model failed');
end;
pass = isSBML_FunctionDefinition(fd,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 FunctionDefinition failed');
end;
pass = isSBML_UnitDefinition(ud,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 UnitDefinition failed');
end;
pass = isSBML_CompartmentType(ct,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 CompartmentType failed');
end;
pass = isSBML_SpeciesType(st,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 SpeciesType failed');
end;
pass = isSBML_Compartment(c,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Compartment failed');
end;
pass = isSBML_Species(s,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Species failed');
end;
pass = isSBML_Parameter(p,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Parameter failed');
end;
pass = isSBML_InitialAssignment(ia,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 InitialAssignment failed');
end;
pass = isSBML_AlgebraicRule(ar,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Rule 1 failed');
end;
pass = isSBML_AssignmentRule(asr,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Rule 2 failed');
end;
pass = isSBML_RateRule(rr,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Rule 3 failed');
end;
pass = isSBML_Constraint(con,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Constraint failed');
end;
pass = isSBML_Reaction(r,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Reaction failed');
end;
pass = isSBML_Event(e,2, 3);
if (pass == 0)
fail = fail + 1;
disp('l2v3 Event failed');
end;
Totalfail = Totalfail + fail;
m = TranslateSBML('../../Test/test-data/l2v4-all.xml');
fd = m.functionDefinition(1);
ud = m.unitDefinition(1);
ct = m.compartmentType(1);
st = m.speciesType(1);
c = m.compartment(1);
s = m.species(1);
p = m.parameter(1);
ia = m.initialAssignment(1);
ar = m.rule(1);
asr = m.rule(2);
rr = m.rule(3);
con = m.constraint(1);
r = m.reaction(1);
e = m.event(1);
test = test + 15;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Model failed');
end;
pass = isSBML_FunctionDefinition(fd,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 FunctionDefinition failed');
end;
pass = isSBML_UnitDefinition(ud,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 UnitDefinition failed');
end;
pass = isSBML_CompartmentType(ct,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 CompartmentType failed');
end;
pass = isSBML_SpeciesType(st,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 SpeciesType failed');
end;
pass = isSBML_Compartment(c,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Compartment failed');
end;
pass = isSBML_Species(s,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Species failed');
end;
pass = isSBML_Parameter(p,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Parameter failed');
end;
pass = isSBML_InitialAssignment(ia,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 InitialAssignment failed');
end;
pass = isSBML_AlgebraicRule(ar,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Rule 1 failed');
end;
pass = isSBML_AssignmentRule(asr,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Rule 2 failed');
end;
pass = isSBML_RateRule(rr,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Rule 3 failed');
end;
pass = isSBML_Constraint(con,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Constraint failed');
end;
pass = isSBML_Reaction(r,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Reaction failed');
end;
pass = isSBML_Event(e,2, 4);
if (pass == 0)
fail = fail + 1;
disp('l2v4 Event failed');
end;
Totalfail = Totalfail + fail;
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
fd = m.functionDefinition(1);
ud = m.unitDefinition(1);
c = m.compartment(1);
s = m.species(1);
p = m.parameter(1);
ia = m.initialAssignment(1);
ar = m.rule(1);
asr = m.rule(2);
rr = m.rule(3);
con = m.constraint(1);
r = m.reaction(1);
e = m.event(1);
test = test + 15;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Model failed');
end;
pass = isSBML_FunctionDefinition(fd,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 FunctionDefinition failed');
end;
pass = isSBML_UnitDefinition(ud,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 UnitDefinition failed');
end;
pass = isSBML_Compartment(c,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Compartment failed');
end;
pass = isSBML_Species(s,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Species failed');
end;
pass = isSBML_Parameter(p,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Parameter failed');
end;
pass = isSBML_InitialAssignment(ia,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 InitialAssignment failed');
end;
pass = isSBML_AlgebraicRule(ar,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Rule 1 failed');
end;
pass = isSBML_AssignmentRule(asr,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Rule 2 failed');
end;
pass = isSBML_RateRule(rr,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Rule 3 failed');
end;
pass = isSBML_Constraint(con,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Constraint failed');
end;
pass = isSBML_Reaction(r,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Reaction failed');
end;
pass = isSBML_Event(e,3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Event failed');
end;
Totalfail = Totalfail + fail;
else
disp('LibSBML binding not installed - some tests could not be run');
end;
try
m = Model_create();
catch
Totalfail = Totalfail + 1;
disp('creating model failed');
end;
if (isempty(m))
Totalfail = Totalfail + 1;
disp('creating model failed');
end;
disp(sprintf('Number tests: %d', test));
disp(sprintf('Number fails: %d', Totalfail));
disp(sprintf('Pass rate: %d%%', ((test-Totalfail)/test)*100));
y = Totalfail;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_UnitDefinition.m 0000644 0000000 0000000 00000005332 11703262402 027633 0 ustar root root function fail = TestIsSBML_UnitDefinition
%
ud_l1 = struct('typecode', {'SBML_UNIT_DEFINITION'}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'unit', {''});
ud_l2 = struct('typecode', {'SBML_UNIT_DEFINITION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'id', {''}, 'unit', {''});
ud_l2v2 = struct('typecode', {'SBML_UNIT_DEFINITION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'id', {''}, 'unit', {''});
ud_l2v3 = struct('typecode', {'SBML_UNIT_DEFINITION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'id', {''}, 'sboTerm', {''}, 'unit', {''});
fail = TestFunction('isSBML_UnitDefinition', 2, 1, ud_l1, 1, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 3, 1, ud_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 3, 1, ud_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 2, 1, ud_l2, 2, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 3, 1, ud_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 3, 1, ud_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 3, 1, ud_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 3, 1, ud_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_UnitDefinition', 3, 1, ud_l2v3, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ud_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, ud_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, ud_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, ud_l2v3, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Unit.m 0000644 0000000 0000000 00000005264 11703262402 025626 0 ustar root root function fail = TestIsSBML_Unit
%
u_l1 = struct('typecode', {'SBML_UNIT'}, 'notes', {''}, 'annotation', {''},'kind', ...
{''}, 'exponent', {''}, 'scale', {''});
u_l2 = struct('typecode', {'SBML_UNIT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'kind', ...
{''}, 'exponent', {''}, 'scale', {''}, 'multiplier', {''}, 'offset', {''});
u_l2v2 = struct('typecode', {'SBML_UNIT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'kind', ...
{''}, 'exponent', {''}, 'scale', {''}, 'multiplier', {''});
u_l2v3 = struct('typecode', {'SBML_UNIT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, ...
'sboTerm', {''}, 'kind', ...
{''}, 'exponent', {''}, 'scale', {''}, 'multiplier', {''});
fail = TestFunction('isSBML_Unit', 2, 1, u_l1, 1, 1);
fail = fail + TestFunction('isSBML_Unit', 3, 1, u_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_Unit', 3, 1, u_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_Unit', 2, 1, u_l2, 2, 1);
fail = fail + TestFunction('isSBML_Unit', 3, 1, u_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_Unit', 3, 1, u_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_Unit', 3, 1, u_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_Unit', 3, 1, u_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_Unit', 3, 1, u_l2v3, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, u_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, u_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, u_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, u_l2v3, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Trigger.m 0000644 0000000 0000000 00000004632 11703262402 026310 0 ustar root root function fail = TestIsSBML_Trigger
%
ct_l2v3 = struct('typecode', {'SBML_TRIGGER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
ct_l3v1 = struct('typecode', {'SBML_TRIGGER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'persistent', {''}, 'initialValue', {''}, 'math', {''});
fail = TestFunction('isSBML_Trigger', 2, 1, ct_l2v3, 1, 0);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l2v3, 1, 1, 0);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l2v3, 1, 2, 0);
fail = fail + TestFunction('isSBML_Trigger', 2, 1, ct_l2v3, 2, 0);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l2v3, 2, 1, 0);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l2v3, 2, 2, 0);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l2v3, 3, 1, 0);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l3v1, 2, 4, 1);
fail = fail + TestFunction('isSBML_Trigger', 3, 1, ct_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ct_l2v3, 1);
fail = fail + TestFunction('isValid', 1, 1, ct_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_StoichiometryMath.m 0000644 0000000 0000000 00000004337 11703262402 030363 0 ustar root root function fail = TestIsSBML_StoichiometryMath
%
ct_l2v3 = struct('typecode', {'SBML_STOICHIOMETRY_MATH'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
fail = TestFunction('isSBML_StoichiometryMath', 2, 1, ct_l2v3, 1, 0);
fail = fail + TestFunction('isSBML_StoichiometryMath', 3, 1, ct_l2v3, 1, 1, 0);
fail = fail + TestFunction('isSBML_StoichiometryMath', 3, 1, ct_l2v3, 1, 2, 0);
fail = fail + TestFunction('isSBML_StoichiometryMath', 2, 1, ct_l2v3, 2, 0);
fail = fail + TestFunction('isSBML_StoichiometryMath', 3, 1, ct_l2v3, 2, 1, 0);
fail = fail + TestFunction('isSBML_StoichiometryMath', 3, 1, ct_l2v3, 2, 2, 0);
fail = fail + TestFunction('isSBML_StoichiometryMath', 3, 1, ct_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_StoichiometryMath', 3, 1, ct_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_StoichiometryMath', 2, 1, ct_l2v3, 3, 0);
fail = fail + TestFunction('isSBML_StoichiometryMath', 3, 1, ct_l2v3, 3, 1, 0);
fail = fail + TestFunction('isValid', 1, 1, ct_l2v3, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_SpeciesType.m 0000644 0000000 0000000 00000004547 11703262402 027147 0 ustar root root function fail = TestIsSBML_SpeciesType
%
st_l2v2 = struct('typecode', {'SBML_SPECIES_TYPE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'id', {''});
st_l2v3 = struct('typecode', {'SBML_SPECIES_TYPE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'id', {''}, 'sboTerm', {''});
fail = TestFunction('isSBML_SpeciesType', 2, 1, st_l2v2, 1, 0);
fail = fail + TestFunction('isSBML_SpeciesType', 3, 1, st_l2v2, 1, 1, 0);
fail = fail + TestFunction('isSBML_SpeciesType', 3, 1, st_l2v2, 1, 2, 0);
fail = fail + TestFunction('isSBML_SpeciesType', 2, 1, st_l2v2, 2, 0);
fail = fail + TestFunction('isSBML_SpeciesType', 3, 1, st_l2v2, 2, 1, 0);
fail = fail + TestFunction('isSBML_SpeciesType', 3, 1, st_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_SpeciesType', 3, 1, st_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_SpeciesType', 3, 1, st_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_SpeciesType', 3, 1, st_l2v3, 3, 1, 0);
fail = fail + TestFunction('isSBML_SpeciesType', 2, 1, st_l2v3, 3, 0);
fail = fail + TestFunction('isValid', 1, 1, st_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, st_l2v3, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_SpeciesReference.m 0000644 0000000 0000000 00000005725 11703262402 030123 0 ustar root root function fail = TestIsSBML_SpeciesReference
%
sr_l1 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'stoichiometry', {''}, 'denominator', {''});
sr_l2 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'stoichiometry', {''}, 'denominator', {''}, 'stoichiometryMath', {''});
sr_l2v2 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'id', {''}, 'name', {''}, 'sboTerm', {''}, 'stoichiometry', {''}, 'stoichiometryMath', {''});
sr_l3v1 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'id', {''}, 'name', {''}, 'sboTerm', {''}, 'stoichiometry', {''}, 'constant', {''}, 'isSetStoichiometry', {''});
fail = TestFunction('isSBML_SpeciesReference', 2, 1, sr_l1, 1, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 3, 1, sr_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 3, 1, sr_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 2, 1, sr_l2, 2, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 3, 1, sr_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 3, 1, sr_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 3, 1, sr_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 3, 1, sr_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_SpeciesReference', 3, 1, sr_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, sr_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, sr_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, sr_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, sr_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_SpeciesConcentrationRule.m0000644 0000000 0000000 00000004557 11703262402 031665 0 ustar root root function fail = TestIsSBML_SpeciesConcentrationRule
%
scr_l1 = struct('typecode', {'SBML_SPECIES_CONCENTRATION_RULE'}, 'notes', {''}, 'annotation', {''}, 'type', ...
{''}, 'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
fail = TestFunction('isSBML_SpeciesConcentrationRule', 2, 1, scr_l1, 1, 1);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 3, 1, scr_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 3, 1, scr_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 2, 1, scr_l1, 2, 0);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 2, 1, scr_l1, 3, 0);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 3, 1, scr_l1, 2, 1, 0);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 3, 1, scr_l1, 2, 2, 0);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 3, 1, scr_l1, 2, 3, 0);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 3, 1, scr_l1, 2, 4, 0);
fail = fail + TestFunction('isSBML_SpeciesConcentrationRule', 3, 1, scr_l1, 3, 1, 0);
fail = fail + TestFunction('isValid', 1, 1, scr_l1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Species.m 0000644 0000000 0000000 00000010164 11703262402 026275 0 ustar root root function fail = TestIsSBML_Species
%
s_l1 = struct('typecode', {'SBML_SPECIES'}, 'notes', {''}, 'annotation', {''},'name', {''}, 'compartment', {''}, ...
'initialAmount', {''}, 'units', {''}, 'boundaryCondition', {''}, 'charge', {''}, 'isSetInitialAmount', {''}, ...
'isSetCharge', {''});
s_l2 = struct('typecode', {'SBML_SPECIES'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, 'id', {''}, ...
'compartment', {''}, 'initialAmount', {''}, 'initialConcentration', {''}, 'substanceUnits', {''}, ...
'spatialSizeUnits', {''}, 'hasOnlySubstanceUnits', {''}, 'boundaryCondition', {''}, 'charge', {''}, ...
'constant', {''}, 'isSetInitialAmount', {''}, 'isSetInitialConcentration', {''}, 'isSetCharge', {''});
s_l2v2 = struct('typecode', {'SBML_SPECIES'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'speciesType', {''}, 'compartment', {''}, 'initialAmount', {''}, 'initialConcentration', {''}, ...
'substanceUnits', {''}, 'spatialSizeUnits', {''}, 'hasOnlySubstanceUnits', {''}, 'boundaryCondition', {''}, ...
'charge', {''}, 'constant', {''}, 'isSetInitialAmount', {''}, 'isSetInitialConcentration', {''}, 'isSetCharge', {''});
s_l2v3 = struct('typecode', {'SBML_SPECIES'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'name', {''}, ...
'id', {''}, 'speciesType', {''}, 'compartment', {''}, 'initialAmount', {''}, 'initialConcentration', {''}, ...
'substanceUnits', {''}, 'hasOnlySubstanceUnits', {''}, 'boundaryCondition', {''}, ...
'charge', {''}, 'constant', {''}, 'isSetInitialAmount', {''}, 'isSetInitialConcentration', {''}, 'isSetCharge', {''});
s_l3v1 = struct('typecode', {'SBML_SPECIES'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'name', {''}, ...
'id', {''}, 'compartment', {''}, 'initialAmount', {''}, 'initialConcentration', {''}, ...
'substanceUnits', {''}, 'hasOnlySubstanceUnits', {''}, 'boundaryCondition', {''}, ...
'constant', {''}, 'isSetInitialAmount', {''}, 'isSetInitialConcentration', {''}, 'conversionFactor', {''});
fail = TestFunction('isSBML_Species', 2, 1, s_l1, 1, 1);
fail = fail + TestFunction('isSBML_Species', 3, 1, s_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_Species', 3, 1, s_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_Species', 2, 1, s_l2, 2, 1);
fail = fail + TestFunction('isSBML_Species', 3, 1, s_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_Species', 3, 1, s_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_Species', 3, 1, s_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_Species', 3, 1, s_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_Species', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l2v3, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Reaction.m 0000644 0000000 0000000 00000014022 11703262402 026443 0 ustar root root function fail = TestIsSBML_Reaction
%
p_l3 = struct('typecode', {'SBML_LOCAL_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'sboTerm', {''}, 'isSetValue', {''});
p_l1 = struct('typecode', {'SBML_PARAMETER'}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'value', {''}, 'units', {''}, 'isSetValue', {''});
p_l2 = struct('typecode', {'SBML_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'constant', {''}, 'isSetValue', {''});
p_l2v2 = struct('typecode', {'SBML_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'constant', {''}, 'sboTerm', {''}, 'isSetValue', {''});
kl_l1 = struct('typecode', {'SBML_KINETIC_LAW'}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'parameter', p_l1, 'timeUnits', {''}, 'substanceUnits', {''});
kl_l2 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'math', {''},'parameter', p_l2, 'timeUnits', {''}, 'substanceUnits', {''});
kl_l2v2 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'math', {''},'parameter', p_l2v2, 'sboTerm', {''});
kl_l2v3 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'math', {''},'parameter', p_l2v2, 'sboTerm', {''});
kl_l3v1 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, ...
'math', {''},'localParameter', p_l3, 'sboTerm', {''});
msr_l2 = struct('typecode', {'SBML_MODIFIER_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'species', {''});
msr_l2v2 = struct('typecode', {'SBML_MODIFIER_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'species', {''}, ...
'id', {''}, 'name', {''}, 'sboTerm', {''});
sm_l2v3 = struct('typecode', {'SBML_STOICHIOMETRY_MATH'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
sr_l1 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'stoichiometry', {''}, 'denominator', {''});
sr_l2 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'stoichiometry', {''}, 'denominator', {''}, 'stoichiometryMath', {''});
sr_l2v2 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'id', {''}, 'name', {''}, 'sboTerm', {''}, 'stoichiometry', {''}, 'stoichiometryMath', {''});
sr_l3v1 = struct('typecode', {'SBML_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'species', ...
{''}, 'id', {''}, 'name', {''}, 'sboTerm', {''}, 'stoichiometry', {''}, 'constant', {''}, 'isSetStoichiometry', {''});
r_l1 = struct('typecode', {'SBML_REACTION'}, 'notes', {''}, 'annotation', {''},'name', {''}, 'reactant', sr_l1, ...
'product', sr_l1, 'kineticLaw', kl_l1, 'reversible', {''}, 'fast', {''});
r_l2 = struct('typecode', {'SBML_REACTION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, 'id', {''}, ...
'reactant', sr_l2, 'product', sr_l2, 'modifier', msr_l2, 'kineticLaw', kl_l2, 'reversible', {''}, ...
'fast', {''}, 'isSetFast', {''});
r_l2v2 = struct('typecode', {'SBML_REACTION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'reactant', sr_l2v2, 'product', sr_l2v2, 'modifier', msr_l2v2, 'kineticLaw', kl_l2v2, 'reversible', ...
{''}, 'fast', {''}, 'sboTerm', {''}, 'isSetFast', {''});
r_l3v1 = struct('typecode', {'SBML_REACTION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'reactant', sr_l3v1, 'product', sr_l3v1, 'modifier', msr_l2v2, 'kineticLaw', kl_l3v1, 'reversible', ...
{''}, 'fast', {''}, 'sboTerm', {''}, 'compartment', {''}, 'isSetFast', {''});
fail = TestFunction('isSBML_Reaction', 2, 1, r_l1, 1, 1);
fail = fail + TestFunction('isSBML_Reaction', 3, 1, r_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_Reaction', 3, 1, r_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_Reaction', 2, 1, r_l2, 2, 1);
fail = fail + TestFunction('isSBML_Reaction', 3, 1, r_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_Reaction', 3, 1, r_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_Reaction', 3, 1, r_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_Reaction', 3, 1, r_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_Reaction', 3, 1, r_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, r_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, r_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, r_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, r_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_RateRule.m 0000644 0000000 0000000 00000005231 11703262402 026424 0 ustar root root function fail = TestIsSBML_RateRule
%
rr_l1 = struct('typecode', {'SBML_PARAMETER_RULE'}, 'notes', {''}, 'annotation', {''}, 'type', ...
{'rate'}, 'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
rr_l2 = struct('typecode', {'SBML_RATE_RULE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, ...
'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
rr_l2v2 = struct('typecode', {'SBML_RATE_RULE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, ...
'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
fail = TestFunction('isSBML_RateRule', 2, 1, rr_l1, 1, 1);
fail = fail + TestFunction('isSBML_RateRule', 3, 1, rr_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_RateRule', 3, 1, rr_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_RateRule', 2, 1, rr_l2, 2, 1);
fail = fail + TestFunction('isSBML_RateRule', 3, 1, rr_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_RateRule', 3, 1, rr_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_RateRule', 3, 1, rr_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_RateRule', 3, 1, rr_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_RateRule', 3, 1, rr_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, rr_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, rr_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, rr_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Priority.m 0000644 0000000 0000000 00000004056 11703262402 026526 0 ustar root root function fail = TestIsSBML_Priority
%
pr_l3v1 = struct('typecode', {'SBML_PRIORITY'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
fail = TestFunction('isSBML_Priority', 2, 1, pr_l3v1, 1, 0);
fail = fail + TestFunction('isSBML_Priority', 3, 1, pr_l3v1, 1, 1, 0);
fail = fail + TestFunction('isSBML_Priority', 3, 1, pr_l3v1, 1, 2, 0);
fail = fail + TestFunction('isSBML_Priority', 2, 1, pr_l3v1, 2, 0);
fail = fail + TestFunction('isSBML_Priority', 3, 1, pr_l3v1, 2, 1, 0);
fail = fail + TestFunction('isSBML_Priority', 3, 1, pr_l3v1, 2, 2, 0);
fail = fail + TestFunction('isSBML_Priority', 3, 1, pr_l3v1, 2, 3, 0);
fail = fail + TestFunction('isSBML_Priority', 3, 1, pr_l3v1, 2, 4, 0);
fail = fail + TestFunction('isSBML_Priority', 3, 1, pr_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, pr_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_ParameterRule.m 0000644 0000000 0000000 00000004336 11703262402 027456 0 ustar root root function fail = TestIsSBML_ParameterRule
%
pr_l1 = struct('typecode', {'SBML_PARAMETER_RULE'}, 'notes', {''}, 'annotation', {''}, 'type', ...
{''}, 'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
fail = TestFunction('isSBML_ParameterRule', 2, 1, pr_l1, 1, 1);
fail = fail + TestFunction('isSBML_ParameterRule', 3, 1, pr_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_ParameterRule', 3, 1, pr_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_ParameterRule', 2, 1, pr_l1, 2, 0);
fail = fail + TestFunction('isSBML_ParameterRule', 2, 1, pr_l1, 3, 0);
fail = fail + TestFunction('isSBML_ParameterRule', 3, 1, pr_l1, 2, 1, 0);
fail = fail + TestFunction('isSBML_ParameterRule', 3, 1, pr_l1, 2, 2, 0);
fail = fail + TestFunction('isSBML_ParameterRule', 3, 1, pr_l1, 2, 3, 0);
fail = fail + TestFunction('isSBML_ParameterRule', 3, 1, pr_l1, 2, 4, 0);
fail = fail + TestFunction('isSBML_ParameterRule', 3, 1, pr_l1, 3, 1, 0);
fail = fail + TestFunction('isValid', 1, 1, pr_l1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Parameter.m 0000644 0000000 0000000 00000005103 11703262402 026617 0 ustar root root function fail = TestIsSBML_Parameter
%
p_l1 = struct('typecode', {'SBML_PARAMETER'}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'value', {''}, 'units', {''}, 'isSetValue', {''});
p_l2 = struct('typecode', {'SBML_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'constant', {''}, 'isSetValue', {''});
p_l2v2 = struct('typecode', {'SBML_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'constant', {''}, 'sboTerm', {''}, 'isSetValue', {''});
fail = TestFunction('isSBML_Parameter', 2, 1, p_l1, 1, 1);
fail = fail + TestFunction('isSBML_Parameter', 3, 1, p_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_Parameter', 3, 1, p_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_Parameter', 2, 1, p_l2, 2, 1);
fail = fail + TestFunction('isSBML_Parameter', 3, 1, p_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_Parameter', 3, 1, p_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_Parameter', 3, 1, p_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_Parameter', 3, 1, p_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_Parameter', 3, 1, p_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, p_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, p_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, p_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_ModifierSpeciesReference.m0000644 0000000 0000000 00000004677 11703262402 031607 0 ustar root root function fail = TestIsSBML_ModifierSpeciesReference
%
msr_l2 = struct('typecode', {'SBML_MODIFIER_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'species', {''});
msr_l2v2 = struct('typecode', {'SBML_MODIFIER_SPECIES_REFERENCE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'species', {''}, ...
'id', {''}, 'name', {''}, 'sboTerm', {''});
fail = TestFunction('isSBML_ModifierSpeciesReference', 2, 1, msr_l2, 1, 0);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 3, 1, msr_l2, 1, 1, 0);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 3, 1, msr_l2, 1, 2, 0);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 2, 1, msr_l2, 2, 1);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 3, 1, msr_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 3, 1, msr_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 3, 1, msr_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 3, 1, msr_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_ModifierSpeciesReference', 3, 1, msr_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, msr_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, msr_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_LocalParameter.m 0000644 0000000 0000000 00000004217 11703262402 027577 0 ustar root root function fail = TestIsSBML_LocalParameter
%
p_l3 = struct('typecode', {'SBML_LOCAL_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'sboTerm', {''}, 'isSetValue', {''});
fail = TestFunction('isSBML_LocalParameter', 2, 1, p_l3, 1, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 3, 1, p_l3, 1, 1, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 3, 1, p_l3, 1, 2, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 2, 1, p_l3, 2, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 3, 1, p_l3, 2, 1, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 3, 1, p_l3, 2, 2, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 3, 1, p_l3, 2, 3, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 3, 1, p_l3, 2, 4, 0);
fail = fail + TestFunction('isSBML_LocalParameter', 3, 1, p_l3, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, p_l3, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_KineticLaw.m 0000644 0000000 0000000 00000007430 11703262402 026736 0 ustar root root function fail = TestIsSBML_KineticLaw
%
p_l3 = struct('typecode', {'SBML_LOCAL_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'sboTerm', {''}, 'isSetValue', {''});
p_l1 = struct('typecode', {'SBML_PARAMETER'}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'value', {''}, 'units', {''}, 'isSetValue', {''});
p_l2 = struct('typecode', {'SBML_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'constant', {''}, 'isSetValue', {''});
p_l2v2 = struct('typecode', {'SBML_PARAMETER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'id', {''}, 'value', {''}, 'units', {''}, 'constant', {''}, 'sboTerm', {''}, 'isSetValue', {''});
kl_l1 = struct('typecode', {'SBML_KINETIC_LAW'}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'parameter', p_l1, 'timeUnits', {''}, 'substanceUnits', {''});
kl_l2 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'math', {''},'parameter', p_l2, 'timeUnits', {''}, 'substanceUnits', {''});
kl_l2v2 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'math', {''},'parameter', p_l2v2, 'sboTerm', {''});
kl_l2v3 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'formula', {''}, ...
'math', {''},'parameter', p_l2v2, 'sboTerm', {''});
kl_l3v1 = struct('typecode', {'SBML_KINETIC_LAW'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, ...
'math', {''},'localParameter', p_l3, 'sboTerm', {''});
fail = TestFunction('isSBML_KineticLaw', 2, 1, kl_l1, 1, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 3, 1, kl_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 3, 1, kl_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 2, 1, kl_l2, 2, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 3, 1, kl_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 3, 1, kl_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 3, 1, kl_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 3, 1, kl_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_KineticLaw', 3, 1, kl_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, kl_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, kl_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, kl_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, kl_l2v3, 1);
fail = fail + TestFunction('isValid', 1, 1, kl_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_InitialAssignment.m 0000644 0000000 0000000 00000004244 11703262402 030326 0 ustar root root function fail = TestIsSBML_InitialAssignment
%
ct_l2v2 = struct('typecode', {'SBML_INITIAL_ASSIGNMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'symbol', ...
{''}, 'sboTerm', {''}, 'math', {''});
fail = TestFunction('isSBML_InitialAssignment', 2, 1, ct_l2v2, 1, 0);
fail = fail + TestFunction('isSBML_InitialAssignment', 3, 1, ct_l2v2, 1, 1, 0);
fail = fail + TestFunction('isSBML_InitialAssignment', 3, 1, ct_l2v2, 1, 2, 0);
fail = fail + TestFunction('isSBML_InitialAssignment', 2, 1, ct_l2v2, 2, 0);
fail = fail + TestFunction('isSBML_InitialAssignment', 3, 1, ct_l2v2, 2, 1, 0);
fail = fail + TestFunction('isSBML_InitialAssignment', 3, 1, ct_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_InitialAssignment', 3, 1, ct_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_InitialAssignment', 3, 1, ct_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_InitialAssignment', 3, 1, ct_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ct_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_FunctionDefinition.m 0000644 0000000 0000000 00000004604 11703262402 030502 0 ustar root root function fail = TestIsSBML_FunctionDefinition
%
fd_l2 = struct('typecode', {'SBML_FUNCTION_DEFINITION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'name', {''}, ...
'id', {''}, 'math', {''});
fd_l2v2 = struct('typecode', {'SBML_FUNCTION_DEFINITION'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'name', {''}, ...
'id', {''}, 'math', {''});
fail = TestFunction('isSBML_FunctionDefinition', 2, 1, fd_l2, 1, 0);
fail = fail + TestFunction('isSBML_FunctionDefinition', 3, 1, fd_l2, 1, 1, 0);
fail = fail + TestFunction('isSBML_FunctionDefinition', 3, 1, fd_l2, 1, 2, 0);
fail = fail + TestFunction('isSBML_FunctionDefinition', 2, 1, fd_l2, 2, 1);
fail = fail + TestFunction('isSBML_FunctionDefinition', 3, 1, fd_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_FunctionDefinition', 3, 1, fd_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_FunctionDefinition', 3, 1, fd_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_FunctionDefinition', 3, 1, fd_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_FunctionDefinition', 3, 1, fd_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, fd_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, fd_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_EventAssignment.m 0000644 0000000 0000000 00000004521 11703262402 030014 0 ustar root root function fail = TestIsSBML_EventAssignment
%
ea_l2 = struct('typecode', {'SBML_EVENT_ASSIGNMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'variable', {''}, ...
'math', {''});
ea_l2v2 = struct('typecode', {'SBML_EVENT_ASSIGNMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'variable', {''}, ...
'sboTerm', {''}, 'math', {''});
fail = TestFunction('isSBML_EventAssignment', 2, 1, ea_l2, 1, 0);
fail = fail + TestFunction('isSBML_EventAssignment', 3, 1, ea_l2, 1, 1, 0);
fail = fail + TestFunction('isSBML_EventAssignment', 3, 1, ea_l2, 1, 2, 0);
fail = fail + TestFunction('isSBML_EventAssignment', 2, 1, ea_l2, 2, 1);
fail = fail + TestFunction('isSBML_EventAssignment', 3, 1, ea_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_EventAssignment', 3, 1, ea_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_EventAssignment', 3, 1, ea_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_EventAssignment', 3, 1, ea_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_EventAssignment', 3, 1, ea_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ea_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, ea_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Event.m 0000644 0000000 0000000 00000010254 11703262402 025763 0 ustar root root function fail = TestIsSBML_Event
%
pr_l3v1 = struct('typecode', {'SBML_PRIORITY'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
t_l2v3 = struct('typecode', {'SBML_TRIGGER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
t_l3v1 = struct('typecode', {'SBML_TRIGGER'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'persistent', {''}, 'initialValue', {''}, 'math', {''});
del_l2v3 = struct('typecode', {'SBML_DELAY'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
ea_l2 = struct('typecode', {'SBML_EVENT_ASSIGNMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'variable', {''}, ...
'math', {''});
ea_l2v2 = struct('typecode', {'SBML_EVENT_ASSIGNMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'variable', {''}, ...
'sboTerm', {''}, 'math', {''});
e_l2 = struct('typecode', {'SBML_EVENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'name', {''}, 'id', {''}, ...
'trigger', {''}, 'delay', {''}, 'timeUnits', {''}, 'eventAssignment', ea_l2);
e_l2v2 = struct('typecode', {'SBML_EVENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'name', {''}, 'id', {''}, ...
'trigger', {''}, 'delay', {''}, 'timeUnits', {''}, 'sboTerm', {''}, 'eventAssignment', ea_l2v2);
e_l2v3 = struct('typecode', {'SBML_EVENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'name', {''}, 'id', {''}, ...
'trigger',t_l2v3, 'delay', del_l2v3, 'sboTerm', {''}, 'eventAssignment', ea_l2v2);
e_l2v4 = struct('typecode', {'SBML_EVENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'name', {''}, 'id', {''}, ...
'useValuesFromTriggerTime', {''}, 'trigger', t_l2v3, 'delay', del_l2v3, 'sboTerm', {''}, 'eventAssignment', ea_l2v2);
e_l3v1 = struct('typecode', {'SBML_EVENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'name', {''}, 'id', {''}, ...
'useValuesFromTriggerTime', {''}, 'trigger', t_l3v1, 'delay', del_l2v3, 'priority',pr_l3v1, 'sboTerm', {''}, 'eventAssignment', ea_l2v2);
fail = TestFunction('isSBML_Event', 2, 1, e_l2, 1, 0);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2, 1, 1, 0);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2, 1, 2, 0);
fail = fail + TestFunction('isSBML_Event', 2, 1, e_l2, 2, 1);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2v4, 2, 3, 1);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2v4, 2, 2, 0);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2v4, 2, 4, 1);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l2v4, 3, 1, 0);
fail = fail + TestFunction('isSBML_Event', 3, 1, e_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, e_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, e_l2v3, 1);
fail = fail + TestFunction('isValid', 1, 1, e_l2v4, 1);
fail = fail + TestFunction('isValid', 1, 1, e_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Delay.m 0000644 0000000 0000000 00000004015 11703262402 025736 0 ustar root root function fail = TestIsSBML_Delay
%
ct_l2v3 = struct('typecode', {'SBML_DELAY'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},...
'sboTerm', {''}, 'math', {''});
fail = TestFunction('isSBML_Delay', 2, 1, ct_l2v3, 1, 0);
fail = fail + TestFunction('isSBML_Delay', 3, 1, ct_l2v3, 1, 1, 0);
fail = fail + TestFunction('isSBML_Delay', 3, 1, ct_l2v3, 1, 2, 0);
fail = fail + TestFunction('isSBML_Delay', 2, 1, ct_l2v3, 2, 0);
fail = fail + TestFunction('isSBML_Delay', 3, 1, ct_l2v3, 2, 1, 0);
fail = fail + TestFunction('isSBML_Delay', 3, 1, ct_l2v3, 2, 2, 0);
fail = fail + TestFunction('isSBML_Delay', 3, 1, ct_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_Delay', 3, 1, ct_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_Delay', 3, 1, ct_l2v3, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ct_l2v3, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Constraint.m 0000644 0000000 0000000 00000004127 11703262402 027030 0 ustar root root function fail = TestIsSBML_Constraint
%
ct_l2v2 = struct('typecode', {'SBML_CONSTRAINT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'sboTerm', ...
{''}, 'math', {''}, 'message', {''});
fail = TestFunction('isSBML_Constraint', 2, 1, ct_l2v2, 1, 0);
fail = fail + TestFunction('isSBML_Constraint', 3, 1, ct_l2v2, 1, 1, 0);
fail = fail + TestFunction('isSBML_Constraint', 3, 1, ct_l2v2, 1, 2, 0);
fail = fail + TestFunction('isSBML_Constraint', 2, 1, ct_l2v2, 2, 0);
fail = fail + TestFunction('isSBML_Constraint', 3, 1, ct_l2v2, 2, 1, 0);
fail = fail + TestFunction('isSBML_Constraint', 3, 1, ct_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_Constraint', 3, 1, ct_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_Constraint', 3, 1, ct_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_Constraint', 3, 1, ct_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ct_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_CompartmentVolumeRule.m 0000644 0000000 0000000 00000004513 11703262402 031214 0 ustar root root function fail = TestIsSBML_CompartmentVolumeRule
%
cvr_l1 = struct('typecode', {'SBML_COMPARTMENT_VOLUME_RULE'}, 'notes', {''}, 'annotation', {''}, 'type', ...
{''}, 'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
fail = TestFunction('isSBML_CompartmentVolumeRule', 2, 1, cvr_l1, 1, 1);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 3, 1, cvr_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 3, 1, cvr_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 2, 1, cvr_l1, 2, 0);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 2, 1, cvr_l1, 3, 0);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 3, 1, cvr_l1, 2, 1, 0);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 3, 1, cvr_l1, 2, 2, 0);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 3, 1, cvr_l1, 2, 3, 0);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 3, 1, cvr_l1, 2, 4, 0);
fail = fail + TestFunction('isSBML_CompartmentVolumeRule', 3, 1, cvr_l1, 3, 1, 0);
fail = fail + TestFunction('isValid', 1, 1, cvr_l1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_CompartmentType.m 0000644 0000000 0000000 00000004636 11703262402 030044 0 ustar root root function fail = TestIsSBML_CompartmentType
%
ct_l2v2 = struct('typecode', {'SBML_COMPARTMENT_TYPE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'id', {''});
ct_l2v3 = struct('typecode', {'SBML_COMPARTMENT_TYPE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', ...
{''}, 'id', {''}, 'sboTerm', {''});
fail = TestFunction('isSBML_CompartmentType', 2, 1, ct_l2v2, 1, 0);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v2, 1, 1, 0);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v2, 1, 2, 0);
fail = fail + TestFunction('isSBML_CompartmentType', 2, 1, ct_l2v2, 2, 0);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v2, 2, 1, 0);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v3, 2, 2, 1);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v3, 2, 4, 1);
fail = fail + TestFunction('isSBML_CompartmentType', 3, 1, ct_l2v3, 3, 1, 0);
fail = fail + TestFunction('isValid', 1, 1, ct_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, ct_l2v3, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_Compartment.m 0000644 0000000 0000000 00000007501 11703262402 027174 0 ustar root root function fail = TestIsSBML_Compartment
%
c_l1 = struct('typecode', {'SBML_COMPARTMENT'}, 'notes', {''}, 'annotation', {''},'name', {''}, ...
'volume', {''}, 'units', {''}, 'outside', {''}, 'isSetVolume', {''});
c_l2 = struct('typecode', {'SBML_COMPARTMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, 'id', {''}, ...
'spatialDimensions', {''}, 'size', {''}, 'units', {''}, 'outside', {''}, 'constant', {''}, ...
'isSetSize', {''},'isSetVolume', {''});
c_l2v2 = struct('typecode', {'SBML_COMPARTMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, 'id', {''}, ...
'compartmentType', {''}, 'spatialDimensions', {''}, 'size', {''}, 'units', {''}, 'outside', {''}, ...
'constant', {''}, 'isSetSize', {''},'isSetVolume', {''});
c_l2v3 = struct('typecode', {'SBML_COMPARTMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, 'id', {''}, ...
'compartmentType', {''}, 'spatialDimensions', {''}, 'size', {''}, 'units', {''}, 'outside', {''}, ...
'constant', {''}, 'isSetSize', {''},'isSetVolume', {''}, 'sboTerm', {''});
c_l2v4 = struct('typecode', {'SBML_COMPARTMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, 'id', {''}, ...
'compartmentType', {''}, 'spatialDimensions', {''}, 'size', {''}, 'units', {''}, 'outside', {''}, ...
'constant', {''}, 'isSetSize', {''},'isSetVolume', {''}, 'sboTerm', {''});
c_l3v1 = struct('typecode', {'SBML_COMPARTMENT'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''},'name', {''}, 'id', {''}, ...
'spatialDimensions', {''}, 'size', {''}, 'units', {''}, ...
'constant', {''}, 'isSetSize', {''},'isSetSpatialDimensions', {''}, 'sboTerm', {''});
fail = TestFunction('isSBML_Compartment', 2, 1, c_l1, 1, 1);
fail = fail + TestFunction('isSBML_Compartment', 3, 1, c_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_Compartment', 3, 1, c_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_Compartment', 2, 1, c_l2, 2, 1);
fail = fail + TestFunction('isSBML_Compartment', 3, 1, c_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_Compartment', 3, 1, c_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_Compartment', 3, 1, c_l2v3, 2, 3, 1);
fail = fail + TestFunction('isSBML_Compartment', 3, 1, c_l2v4, 2, 4, 1);
fail = fail + TestFunction('isSBML_Compartment', 3, 1, c_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, c_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, c_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, c_l2v2, 1);
fail = fail + TestFunction('isValid', 1, 1, c_l2v3, 1);
fail = fail + TestFunction('isValid', 1, 1, c_l2v4, 1);
fail = fail + TestFunction('isValid', 1, 1, c_l3v1, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_AssignmentRule.m 0000644 0000000 0000000 00000005355 11703262402 027650 0 ustar root root function fail = TestIsSBML_AssignmentRule
%
ar_l1 = struct('typecode', {'SBML_COMPARTMENT_VOLUME_RULE'}, 'notes', {''}, 'annotation', {''}, 'type', ...
{'scalar'}, 'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
ar_l2 = struct('typecode', {'SBML_ASSIGNMENT_RULE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, ...
'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
ar_l2v2 = struct('typecode', {'SBML_ASSIGNMENT_RULE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, ...
'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
fail = TestFunction('isSBML_AssignmentRule', 2, 1, ar_l1, 1, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 3, 1, ar_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 3, 1, ar_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 2, 1, ar_l2, 2, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 3, 1, ar_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 3, 1, ar_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 3, 1, ar_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 3, 1, ar_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_AssignmentRule', 3, 1, ar_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ar_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, ar_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, ar_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/TestIsSBML_AlgebraicRule.m 0000644 0000000 0000000 00000005321 11703262402 027402 0 ustar root root function fail = TestIsSBML_AlgebraicRule
%
ar_l1 = struct('typecode', {'SBML_ALGEBRAIC_RULE'}, 'notes', {''}, 'annotation', {''}, 'type', ...
{''}, 'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
ar_l2 = struct('typecode', {'SBML_ALGEBRAIC_RULE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, ...
'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
ar_l2v2 = struct('typecode', {'SBML_ALGEBRAIC_RULE'}, 'metaid', {''}, 'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, ...
'formula', {''}, 'variable', {''}, 'species', {''}, 'compartment', {''}, 'name', {''}, 'units', {''});
fail = TestFunction('isSBML_AlgebraicRule', 2, 1, ar_l1, 1, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 3, 1, ar_l1, 1, 1, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 3, 1, ar_l1, 1, 2, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 2, 1, ar_l2, 2, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 3, 1, ar_l2, 2, 1, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 3, 1, ar_l2v2, 2, 2, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 3, 1, ar_l2v2, 2, 3, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 3, 1, ar_l2v2, 2, 4, 1);
fail = fail + TestFunction('isSBML_AlgebraicRule', 3, 1, ar_l2v2, 3, 1, 1);
fail = fail + TestFunction('isValid', 1, 1, ar_l1, 1);
fail = fail + TestFunction('isValid', 1, 1, ar_l2, 1);
fail = fail + TestFunction('isValid', 1, 1, ar_l2v2, 1);
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Test/Contents.m 0000644 0000000 0000000 00000105234 11603337042 024533 0 ustar root root % toolbox\Validate_MATLAB_SBML_Structures\Test
%
% write info here
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isValidSBML_Model.m 0000644 0000000 0000000 00000015422 11703262404 025207 0 ustar root root function [valid, message] = isValidSBML_Model(SBMLStructure)
% [valid, message] = isValidSBML_Model(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Model structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML Model structure of the appropriate
% level and version can be found using getModelFieldnames(level, version)
%
%check the input arguments are appropriate
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
if ~isempty(SBMLStructure)
if isfield(SBMLStructure, 'SBML_level')
level = SBMLStructure.SBML_level;
else
level = 3;
end;
if isfield(SBMLStructure, 'SBML_version')
version = SBMLStructure.SBML_version;
else
version = 1;
end;
else
level = 3;
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_MODEL';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_MODEL', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% functionDefinitions
if (valid == 1 && level > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.functionDefinition))
[valid, message] = isSBML_FunctionDefinition( ...
SBMLStructure.functionDefinition(index), ...
level, version);
index = index + 1;
end;
end;
% unitDefinitions
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.unitDefinition))
[valid, message] = isSBML_UnitDefinition( ...
SBMLStructure.unitDefinition(index), ...
level, version);
index = index + 1;
end;
end;
% compartments
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.compartment))
[valid, message] = isSBML_Compartment(SBMLStructure.compartment(index), ...
level, version);
index = index + 1;
end;
end;
% species
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.species))
[valid, message] = isSBML_Species(SBMLStructure.species(index), ...
level, version);
index = index + 1;
end;
end;
% compartmentTypes
if (valid == 1 && level == 2 && version > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.compartmentType))
[valid, message] = isSBML_CompartmentType(SBMLStructure.compartmentType(index), ...
level, version);
index = index + 1;
end;
end;
% speciesTypes
if (valid == 1 && level == 2 && version > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.speciesType))
[valid, message] = isSBML_SpeciesType(SBMLStructure.speciesType(index), ...
level, version);
index = index + 1;
end;
end;
% parameter
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.parameter))
[valid, message] = isSBML_Parameter(SBMLStructure.parameter(index), ...
level, version);
index = index + 1;
end;
end;
% initialAssignment
if (valid == 1 && (level > 2 || (level == 2 && version > 1)))
index = 1;
while (valid == 1 && index <= length(SBMLStructure.initialAssignment))
[valid, message] = isSBML_InitialAssignment( ...
SBMLStructure.initialAssignment(index), ...
level, version);
index = index + 1;
end;
end;
% rule
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.rule))
[valid, message] = isSBML_Rule(SBMLStructure.rule(index), ...
level, version);
index = index + 1;
end;
end;
% constraints
if (valid == 1 && (level > 2 || (level == 2 && version > 1)))
index = 1;
while (valid == 1 && index <= length(SBMLStructure.constraint))
[valid, message] = isSBML_Constraint( ...
SBMLStructure.constraint(index), ...
level, version);
index = index + 1;
end;
end;
% reaction
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.reaction))
[valid, message] = isSBML_Reaction(SBMLStructure.reaction(index), ...
level, version);
index = index + 1;
end;
end;
% event
if (valid == 1 && level > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.event))
[valid, message] = isSBML_Event(SBMLStructure.event(index), ...
level, version);
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Model structure\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isValid.m 0000644 0000000 0000000 00000013050 11703262404 023404 0 ustar root root function y = isValid(varargin)
% [valid, message] = isValid(SBMLStruct, level(optional), version(optional))
%
% Takes
%
% 1. SBMLStruct, an SBML structure
% 2. level (optional), an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional level defaults to a value of 3
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML structure of the appropriate
% level and version can be found using getFieldnames(typecode, level, version)
%
if (nargin < 1)
error('need input argument');
end;
switch nargin
case 1
sbml_struct = varargin{1};
level = 3;
version = 1;
fbc_version = 1;
case 2
sbml_struct = varargin{1};
level = varargin{2};
version = 1;
fbc_version = 1;
case 3
sbml_struct = varargin{1};
level = varargin{2};
version = varargin{3};
fbc_version = 1;
case 4
sbml_struct = varargin{1};
level = varargin{2};
version = varargin{3};
fbc_version = varargin{4};
otherwise
error('too many input arguments');
end;
if (length(sbml_struct) > 1)
error('cannot deal with arrays of structures');
end;
if ~isstruct(sbml_struct) || isempty(fieldnames(sbml_struct))
y = 0;
return;
end;
isValidLevelVersionCombination(level, version);
if isfield(sbml_struct, 'fbc_version') == 1
y = isValidFBC(sbml_struct, level, version, fbc_version);
return;
end;
typecode = sbml_struct.typecode;
switch (typecode)
case 'SBML_ALGEBRAIC_RULE'
fhandle = str2func('isSBML_AlgebraicRule');
case 'SBML_ASSIGNMENT_RULE'
fhandle = str2func('isSBML_AssignmentRule');
case 'SBML_COMPARTMENT'
fhandle = str2func('isSBML_Compartment');
case 'SBML_COMPARTMENT_TYPE'
fhandle = str2func('isSBML_CompartmentType');
case 'SBML_COMPARTMENT_VOLUME_RULE'
fhandle = str2func('isSBML_CompartmentVolumeRule');
case 'SBML_CONSTRAINT'
fhandle = str2func('isSBML_Constraint');
case 'SBML_DELAY'
fhandle = str2func('isSBML_Delay');
case 'SBML_EVENT'
fhandle = str2func('isSBML_Event');
case 'SBML_EVENT_ASSIGNMENT'
fhandle = str2func('isSBML_EventAssignment');
case 'SBML_FUNCTION_DEFINITION'
fhandle = str2func('isSBML_FunctionDefinition');
case 'SBML_INITIAL_ASSIGNMENT'
fhandle = str2func('isSBML_InitialAssignment');
case 'SBML_KINETIC_LAW'
fhandle = str2func('isSBML_KineticLaw');
case 'SBML_LOCAL_PARAMETER'
fhandle = str2func('isSBML_LocalParameter');
case 'SBML_MODIFIER_SPECIES_REFERENCE'
fhandle = str2func('isSBML_ModifierSpeciesReference');
case 'SBML_PARAMETER'
fhandle = str2func('isSBML_Parameter');
case 'SBML_PARAMETER_RULE'
fhandle = str2func('isSBML_ParameterRule');
case 'SBML_PRIORITY'
fhandle = str2func('isSBML_Priority');
case 'SBML_RATE_RULE'
fhandle = str2func('isSBML_RateRule');
case 'SBML_REACTION'
fhandle = str2func('isSBML_Reaction');
case 'SBML_SPECIES'
fhandle = str2func('isSBML_Species');
case 'SBML_SPECIES_CONCENTRATION_RULE'
fhandle = str2func('isSBML_SpeciesConcentrationRule');
case 'SBML_SPECIES_REFERENCE'
fhandle = str2func('isSBML_SpeciesReference');
case 'SBML_SPECIES_TYPE'
fhandle = str2func('isSBML_SpeciesType');
case 'SBML_STOICHIOMETRY_MATH'
fhandle = str2func('isSBML_StoichiometryMath');
case 'SBML_TRIGGER'
fhandle = str2func('isSBML_Trigger');
case 'SBML_UNIT'
fhandle = str2func('isSBML_Unit');
case 'SBML_UNIT_DEFINITION'
fhandle = str2func('isSBML_UnitDefinition');
case 'SBML_MODEL'
fhandle = str2func('isValidSBML_Model');
otherwise
y = 0;
return;
end;
if (nargin == 1)
if strcmp(typecode, 'SBML_MODEL')
y = feval(fhandle, sbml_struct);
else
y = (feval(fhandle, sbml_struct, 1, 1) ...
|| feval(fhandle, sbml_struct, 1, 2) ...
|| feval(fhandle, sbml_struct, 2, 1) ...
|| feval(fhandle, sbml_struct, 2, 2) ...
|| feval(fhandle, sbml_struct, 2, 3) ...
|| feval(fhandle, sbml_struct, 2, 4) ...
|| feval(fhandle, sbml_struct, 3, 1));
end;
else
if strcmp(typecode, 'SBML_MODEL')
y = feval(fhandle, sbml_struct);
else
y = feval(fhandle, sbml_struct, level, version);
end;
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_UnitDefinition.m 0000644 0000000 0000000 00000010026 11703262404 026112 0 ustar root root function [valid, message] = isSBML_UnitDefinition(varargin)
% [valid, message] = isSBML_UnitDefinition(SBMLUnitDefinition, level, version(optional))
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML UnitDefinition structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML UnitDefinition structure of the appropriate
% level and version can be found using getUnitDefinitionFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_UNIT_DEFINITION';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_UNIT_DEFINITION', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% unit
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.unit))
[valid, message] = isSBML_Unit(SBMLStructure.unit(index), ...
level, version);
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid UnitDefinition\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Unit.m 0000644 0000000 0000000 00000007171 11703262404 024110 0 ustar root root function [valid, message] = isSBML_Unit(varargin)
% [valid, message] = isSBML_Unit(SBMLUnit, level, version(optional))
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Unit structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Unit structure of the appropriate
% level and version can be found using getUnitFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_UNIT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_UNIT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Unit\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Trigger.m 0000644 0000000 0000000 00000007232 11703262404 024572 0 ustar root root function [valid, message] = isSBML_Trigger(varargin)
% [valid, message] = isSBML_Trigger(SBMLTrigger, level, version(optional))
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Trigger structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Trigger structure of the appropriate
% level and version can be found using getTriggerFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_TRIGGER';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_TRIGGER', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Trigger\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_StoichiometryMath.m 0000644 0000000 0000000 00000007412 11703262404 026643 0 ustar root root function [valid, message] = isSBML_StoichiometryMath(varargin)
% [valid, message] = isSBML_StoichiometryMath(SBMLStoichiometryMath, level, version(optional))
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML StoichiometryMath structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML StoichiometryMath structure of the appropriate
% level and version can be found using getStoichiometryMathFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_STOICHIOMETRY_MATH';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_STOICHIOMETRY_MATH', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid StoichiometryMath\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_SpeciesType.m 0000644 0000000 0000000 00000007310 11703262404 025421 0 ustar root root function [valid, message] = isSBML_SpeciesType(varargin)
% [valid, message] = isSBML_SpeciesType(SBMLSpeciesType, level, version(optional))
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML SpeciesType structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML SpeciesType structure of the appropriate
% level and version can be found using getSpeciesTypeFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES_TYPE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES_TYPE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid SpeciesType\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_SpeciesReference.m 0000644 0000000 0000000 00000007377 11703262404 026413 0 ustar root root function [valid, message] = isSBML_SpeciesReference(varargin)
% [valid, message] = isSBML_SpeciesReference(SBMLSpeciesReference, level, version(optional))
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML SpeciesReference structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML SpeciesReference structure of the appropriate
% level and version can be found using getSpeciesReferenceFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES_REFERENCE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES_REFERENCE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid SpeciesReference\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_SpeciesConcentrationRule.m 0000644 0000000 0000000 00000007531 11703262404 030143 0 ustar root root function [valid, message] = isSBML_SpeciesConcentrationRule(varargin)
% [valid, message] = isSBML_SpeciesConcentrationRule(SBMLSpeciesConcentrationRule, level, version(optional))
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML SpeciesConcentrationRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML SpeciesConcentrationRule structure of the appropriate
% level and version can be found using getSpeciesConcentrationRuleFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES_CONCENTRATION_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES_CONCENTRATION_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid SpeciesConcentrationRule\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Species.m 0000644 0000000 0000000 00000007232 11703262404 024562 0 ustar root root function [valid, message] = isSBML_Species(varargin)
% [valid, message] = isSBML_Species(SBMLSpecies, level, version(optional))
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Species structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Species structure of the appropriate
% level and version can be found using getSpeciesFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Species\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Rule.m 0000644 0000000 0000000 00000011157 11703262404 024077 0 ustar root root function [valid, message] = isSBML_Rule(varargin)
% [valid, message] = isSBML_Rule(SBMLRule, level, version(optional))
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Rule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Rule structure of the appropriate
% level and version can be found using getRuleFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
if ~isempty(SBMLStructure)
if isfield(SBMLStructure, 'typecode')
typecode = SBMLStructure.typecode;
else
valid = 0;
message = 'missing typecode';
return;
end;
else
typecode = 'SBML_ASSIGNMENT_RULE';
end;
switch (typecode)
case 'SBML_ALGEBRAIC_RULE'
[valid, message] = isSBML_AlgebraicRule(SBMLStructure, level, version);
case 'SBML_ASSIGNMENT_RULE'
[valid, message] = isSBML_AssignmentRule(SBMLStructure, level, version);
case 'SBML_COMPARTMENT_VOLUME_RULE'
[valid, message] = isSBML_CompartmentVolumeRule(SBMLStructure, level, version);
case 'SBML_PARAMETER_RULE'
[valid, message] = isSBML_ParameterRule(SBMLStructure, level, version);
case 'SBML_RATE_RULE'
[valid, message] = isSBML_RateRule(SBMLStructure, level, version);
case 'SBML_SPECIES_CONCENTRATION_RULE'
[valid, message] = isSBML_SpeciesConcentrationRule(SBMLStructure, level, version);
case 'SBML_RULE'
[valid, message] = checkRule(SBMLStructure, level, version);
otherwise
valid = 0;
message = 'Incorrect rule typecode';
end;
function [valid, message] = checkRule(SBMLStructure, level, version)
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getAlgebraicRuleFieldnames(level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Rule\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Reaction.m 0000644 0000000 0000000 00000011346 11703262404 024734 0 ustar root root function [valid, message] = isSBML_Reaction(varargin)
% [valid, message] = isSBML_Reaction(SBMLReaction, level, version(optional))
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Reaction structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Reaction structure of the appropriate
% level and version can be found using getReactionFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_REACTION';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_REACTION', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% reactants
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.reactant))
[valid, message] = isSBML_SpeciesReference(SBMLStructure.reactant(index), ...
level, version);
index = index + 1;
end;
end;
% products
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.product))
[valid, message] = isSBML_SpeciesReference(SBMLStructure.product(index), ...
level, version);
index = index + 1;
end;
end;
% modifiers
if (valid == 1 && level > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.modifier))
[valid, message] = isSBML_ModifierSpeciesReference( ...
SBMLStructure.modifier(index), ...
level, version);
index = index + 1;
end;
end;
% kineticLaw
if (valid == 1 && length(SBMLStructure.kineticLaw) == 1)
[valid, message] = isSBML_KineticLaw(SBMLStructure.kineticLaw, level, version);
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Reaction\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_RateRule.m 0000644 0000000 0000000 00000010303 11703262404 024703 0 ustar root root function [valid, message] = isSBML_RateRule(varargin)
% [valid, message] = isSBML_RateRule(SBMLRateRule, level, version(optional))
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML RateRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML RateRule structure of the appropriate
% level and version can be found using getRateRuleFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_RATE_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (level > 1)
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
% check L1 types
typecode = SBMLStructure.typecode;
cvr = strcmp(typecode, 'SBML_COMPARTMENT_VOLUME_RULE');
pr = strcmp(typecode, 'SBML_PARAMETER_RULE');
scr = strcmp(typecode, 'SBML_SPECIES_CONCENTRATION_RULE');
if (cvr ~= 1 && pr ~= 1 && scr ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
elseif (strcmp(SBMLStructure.type, 'rate') ~= 1)
valid = 0;
message = 'expected rate type';
return;
end;
end;
else
valid = 0;
message = 'missing typecode';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames(typecode, level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid RateRule\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Priority.m 0000644 0000000 0000000 00000007245 11703262404 025014 0 ustar root root function [valid, message] = isSBML_Priority(varargin)
% [valid, message] = isSBML_Priority(SBMLPriority, level, version(optional))
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Priority structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Priority structure of the appropriate
% level and version can be found using getPriorityFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_PRIORITY';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_PRIORITY', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Priority\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_ParameterRule.m 0000644 0000000 0000000 00000007336 11703262404 025744 0 ustar root root function [valid, message] = isSBML_ParameterRule(varargin)
% [valid, message] = isSBML_ParameterRule(SBMLParameterRule, level, version(optional))
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML ParameterRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML ParameterRule structure of the appropriate
% level and version can be found using getParameterRuleFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_PARAMETER_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_PARAMETER_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid ParameterRule\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Parameter.m 0000644 0000000 0000000 00000007260 11703262404 025110 0 ustar root root function [valid, message] = isSBML_Parameter(varargin)
% [valid, message] = isSBML_Parameter(SBMLParameter, level, version(optional))
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Parameter structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Parameter structure of the appropriate
% level and version can be found using getParameterFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_PARAMETER';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_PARAMETER', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Parameter\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_ModifierSpeciesReference.m 0000644 0000000 0000000 00000007531 11703262404 030062 0 ustar root root function [valid, message] = isSBML_ModifierSpeciesReference(varargin)
% [valid, message] = isSBML_ModifierSpeciesReference(SBMLModifierSpeciesReference, level, version(optional))
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML ModifierSpeciesReference structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML ModifierSpeciesReference structure of the appropriate
% level and version can be found using getModifierSpeciesReferenceFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_MODIFIER_SPECIES_REFERENCE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_MODIFIER_SPECIES_REFERENCE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid ModifierSpeciesReference\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_LocalParameter.m 0000644 0000000 0000000 00000007351 11703262404 026064 0 ustar root root function [valid, message] = isSBML_LocalParameter(varargin)
% [valid, message] = isSBML_LocalParameter(SBMLLocalParameter, level, version(optional))
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML LocalParameter structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML LocalParameter structure of the appropriate
% level and version can be found using getLocalParameterFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_LOCAL_PARAMETER';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_LOCAL_PARAMETER', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid LocalParameter\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_KineticLaw.m 0000644 0000000 0000000 00000010556 11703262404 025224 0 ustar root root function [valid, message] = isSBML_KineticLaw(varargin)
% [valid, message] = isSBML_KineticLaw(SBMLKineticLaw, level, version(optional))
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML KineticLaw structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML KineticLaw structure of the appropriate
% level and version can be found using getKineticLawFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_KINETIC_LAW';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_KINETIC_LAW', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% parameters
if (valid == 1 && level < 3)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.parameter))
[valid, message] = isSBML_Parameter(SBMLStructure.parameter(index), ...
level, version);
index = index + 1;
end;
end;
%check that any nested structures are appropriate
% localParameters
if (valid == 1 && level > 2)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.localParameter))
[valid, message] = isSBML_LocalParameter(SBMLStructure.localParameter(index), ...
level, version);
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid KineticLaw\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_InitialAssignment.m 0000644 0000000 0000000 00000007412 11703262404 026611 0 ustar root root function [valid, message] = isSBML_InitialAssignment(varargin)
% [valid, message] = isSBML_InitialAssignment(SBMLInitialAssignment, level, version(optional))
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML InitialAssignment structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML InitialAssignment structure of the appropriate
% level and version can be found using getInitialAssignmentFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_INITIAL_ASSIGNMENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_INITIAL_ASSIGNMENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid InitialAssignment\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_FunctionDefinition.m 0000644 0000000 0000000 00000007425 11703262404 026771 0 ustar root root function [valid, message] = isSBML_FunctionDefinition(varargin)
% [valid, message] = isSBML_FunctionDefinition(SBMLFunctionDefinition, level, version(optional))
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FunctionDefinition structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML FunctionDefinition structure of the appropriate
% level and version can be found using getFunctionDefinitionFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_FUNCTION_DEFINITION';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_FUNCTION_DEFINITION', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid FunctionDefinition\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_EventAssignment.m 0000644 0000000 0000000 00000007364 11703262404 026307 0 ustar root root function [valid, message] = isSBML_EventAssignment(varargin)
% [valid, message] = isSBML_EventAssignment(SBMLEventAssignment, level, version(optional))
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML EventAssignment structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML EventAssignment structure of the appropriate
% level and version can be found using getEventAssignmentFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_EVENT_ASSIGNMENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_EVENT_ASSIGNMENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid EventAssignment\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Event.m 0000644 0000000 0000000 00000012717 11703262404 024254 0 ustar root root function [valid, message] = isSBML_Event(varargin)
% [valid, message] = isSBML_Event(SBMLEvent, level, version(optional))
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Event structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Event structure of the appropriate
% level and version can be found using getEventFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_EVENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_EVENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% eventAssignments
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.eventAssignment))
[valid, message] = isSBML_EventAssignment( ...
SBMLStructure.eventAssignment(index), ...
level, version);
index = index + 1;
end;
end;
% trigger/delay/priority
% these are level and version dependent
if (valid == 1)
if (level == 2 && version > 2)
if (length(SBMLStructure.trigger) > 1)
valid = 0;
message = 'multiple trigger elements encountered';
elseif (length(SBMLStructure.delay) > 1)
valid = 0;
message = 'multiple delay elements encountered';
end;
if (valid == 1 && length(SBMLStructure.trigger) == 1)
[valid, message] = isSBML_Trigger(SBMLStructure.trigger, level, version);
end;
if (valid == 1 && length(SBMLStructure.delay) == 1)
[valid, message] = isSBML_Delay(SBMLStructure.delay, level, version);
end;
elseif (level > 2)
if (length(SBMLStructure.trigger) > 1)
valid = 0;
message = 'multiple trigger elements encountered';
elseif (length(SBMLStructure.delay) > 1)
valid = 0;
message = 'multiple delay elements encountered';
elseif (length(SBMLStructure.priority) > 1)
valid = 0;
message = 'multiple priority elements encountered';
end;
if (valid == 1 && length(SBMLStructure.trigger) == 1)
[valid, message] = isSBML_Trigger(SBMLStructure.trigger, level, version);
end;
if (valid == 1 && length(SBMLStructure.delay) == 1)
[valid, message] = isSBML_Delay(SBMLStructure.delay, level, version);
end;
if (valid == 1 && length(SBMLStructure.priority) == 1)
[valid, message] = isSBML_Priority(SBMLStructure.priority, level, version);
end;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Event\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Delay.m 0000644 0000000 0000000 00000007204 11703262404 024224 0 ustar root root function [valid, message] = isSBML_Delay(varargin)
% [valid, message] = isSBML_Delay(SBMLDelay, level, version(optional))
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Delay structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Delay structure of the appropriate
% level and version can be found using getDelayFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_DELAY';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_DELAY', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Delay\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Constraint.m 0000644 0000000 0000000 00000007273 11703262404 025320 0 ustar root root function [valid, message] = isSBML_Constraint(varargin)
% [valid, message] = isSBML_Constraint(SBMLConstraint, level, version(optional))
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Constraint structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Constraint structure of the appropriate
% level and version can be found using getConstraintFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_CONSTRAINT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_CONSTRAINT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Constraint\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_CompartmentVolumeRule.m 0000644 0000000 0000000 00000007470 11703262404 027504 0 ustar root root function [valid, message] = isSBML_CompartmentVolumeRule(varargin)
% [valid, message] = isSBML_CompartmentVolumeRule(SBMLCompartmentVolumeRule, level, version(optional))
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML CompartmentVolumeRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML CompartmentVolumeRule structure of the appropriate
% level and version can be found using getCompartmentVolumeRuleFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_COMPARTMENT_VOLUME_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_COMPARTMENT_VOLUME_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid CompartmentVolumeRule\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_CompartmentType.m 0000644 0000000 0000000 00000007364 11703262404 026330 0 ustar root root function [valid, message] = isSBML_CompartmentType(varargin)
% [valid, message] = isSBML_CompartmentType(SBMLCompartmentType, level, version(optional))
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML CompartmentType structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML CompartmentType structure of the appropriate
% level and version can be found using getCompartmentTypeFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_COMPARTMENT_TYPE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_COMPARTMENT_TYPE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid CompartmentType\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_Compartment.m 0000644 0000000 0000000 00000007306 11703262404 025462 0 ustar root root function [valid, message] = isSBML_Compartment(varargin)
% [valid, message] = isSBML_Compartment(SBMLCompartment, level, version(optional))
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Compartment structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML Compartment structure of the appropriate
% level and version can be found using getCompartmentFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_COMPARTMENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_COMPARTMENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Compartment\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_AssignmentRule.m 0000644 0000000 0000000 00000010403 11703262404 026121 0 ustar root root function [valid, message] = isSBML_AssignmentRule(varargin)
% [valid, message] = isSBML_AssignmentRule(SBMLAssignmentRule, level, version(optional))
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML AssignmentRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML AssignmentRule structure of the appropriate
% level and version can be found using getAssignmentRuleFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_ASSIGNMENT_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (level > 1)
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
% check L1 types
typecode = SBMLStructure.typecode;
cvr = strcmp(typecode, 'SBML_COMPARTMENT_VOLUME_RULE');
pr = strcmp(typecode, 'SBML_PARAMETER_RULE');
scr = strcmp(typecode, 'SBML_SPECIES_CONCENTRATION_RULE');
if (cvr ~= 1 && pr ~= 1 && scr ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
elseif (strcmp(SBMLStructure.type, 'scalar') ~= 1)
valid = 0;
message = 'expected scalar type';
return;
end;
end;
else
valid = 0;
message = 'missing typecode';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames(typecode, level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid AssignmentRule\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/isSBML_AlgebraicRule.m 0000644 0000000 0000000 00000007336 11703262404 025675 0 ustar root root function [valid, message] = isSBML_AlgebraicRule(varargin)
% [valid, message] = isSBML_AlgebraicRule(SBMLAlgebraicRule, level, version(optional))
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML AlgebraicRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* the optional version defaults to a value of 1
%
% *NOTE:* The fields present in a MATLAB_SBML AlgebraicRule structure of the appropriate
% level and version can be found using getAlgebraicRuleFieldnames(level, version)
%
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_ALGEBRAIC_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_ALGEBRAIC_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid AlgebraicRule\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/hasUnknownFields.m 0000644 0000000 0000000 00000000711 11674114414 025277 0 ustar root root function [unknown, message] = hasUnknownFields(SBMLStruct, SBMLFieldnames)
unknown = 0;
message = '';
currentFields = fieldnames(SBMLStruct);
for i = 1:length(currentFields)
if ((sum(ismember(SBMLFieldnames, currentFields(i))) == 0) ...
&& (strcmp(currentFields(i), 'level') == 0) ...
&& (strcmp(currentFields(i), 'version') == 0))
unknown = 1;
message = sprintf('%s is an unrecognised field', currentFields{i});
return;
end;
end; SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/Contents.m 0000644 0000000 0000000 00000050752 11703262404 023620 0 ustar root root % toolbox\Validate_MATLAB_SBML_Structures
%
% This folder contains tests that checks that the structure supplied as argument
% is of the appropriate form to represent the intended element of an SBML model.
%
%======================================================================================
% [valid, message] = isSBML_AlgebraicRule(SBMLAlgebraicRule, level, version(optional))
%======================================================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML AlgebraicRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%========================================================================================
% [valid, message] = isSBML_AssignmentRule(SBMLAssignmentRule, level, version(optional))
%========================================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML AssignmentRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==================================================================================
% [valid, message] = isSBML_Compartment(SBMLCompartment, level, version(optional))
%==================================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Compartment structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==========================================================================================
% [valid, message] = isSBML_CompartmentType(SBMLCompartmentType, level, version(optional))
%==========================================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML CompartmentType structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%======================================================================================================
% [valid, message] = isSBML_CompartmentVolumeRule(SBMLCompartmentVolumeRule, level, version(optional))
%======================================================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML CompartmentVolumeRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%================================================================================
% [valid, message] = isSBML_Constraint(SBMLConstraint, level, version(optional))
%================================================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Constraint structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%======================================================================
% [valid, message] = isSBML_Delay(SBMLDelay, level, version(optional))
%======================================================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Delay structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%======================================================================
% [valid, message] = isSBML_Event(SBMLEvent, level, version(optional))
%======================================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Event structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==========================================================================================
% [valid, message] = isSBML_EventAssignment(SBMLEventAssignment, level, version(optional))
%==========================================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML EventAssignment structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%================================================================================================
% [valid, message] = isSBML_FunctionDefinition(SBMLFunctionDefinition, level, version(optional))
%================================================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FunctionDefinition structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==============================================================================================
% [valid, message] = isSBML_InitialAssignment(SBMLInitialAssignment, level, version(optional))
%==============================================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML InitialAssignment structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%================================================================================
% [valid, message] = isSBML_KineticLaw(SBMLKineticLaw, level, version(optional))
%================================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML KineticLaw structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%========================================================================================
% [valid, message] = isSBML_LocalParameter(SBMLLocalParameter, level, version(optional))
%========================================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML LocalParameter structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================
% [valid, message] = isValidSBML_Model(SBMLModel)
%============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Model structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================================================================================
% [valid, message] = isSBML_ModifierSpeciesReference(SBMLModifierSpeciesReference, level, version(optional))
%============================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML ModifierSpeciesReference structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==============================================================================
% [valid, message] = isSBML_Parameter(SBMLParameter, level, version(optional))
%==============================================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Parameter structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%======================================================================================
% [valid, message] = isSBML_ParameterRule(SBMLParameterRule, level, version(optional))
%======================================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML ParameterRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================================================
% [valid, message] = isSBML_Priority(SBMLPriority, level, version(optional))
%============================================================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Priority structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================================================
% [valid, message] = isSBML_RateRule(SBMLRateRule, level, version(optional))
%============================================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML RateRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================================================
% [valid, message] = isSBML_Reaction(SBMLReaction, level, version(optional))
%============================================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Reaction structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%====================================================================
% [valid, message] = isSBML_Rule(SBMLRule, level, version(optional))
%====================================================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Rule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==========================================================================
% [valid, message] = isSBML_Species(SBMLSpecies, level, version(optional))
%==========================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Species structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================================================================================
% [valid, message] = isSBML_SpeciesConcentrationRule(SBMLSpeciesConcentrationRule, level, version(optional))
%============================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML SpeciesConcentrationRule structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================================================================
% [valid, message] = isSBML_SpeciesReference(SBMLSpeciesReference, level, version(optional))
%============================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML SpeciesReference structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==================================================================================
% [valid, message] = isSBML_SpeciesType(SBMLSpeciesType, level, version(optional))
%==================================================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML SpeciesType structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==============================================================================================
% [valid, message] = isSBML_StoichiometryMath(SBMLStoichiometryMath, level, version(optional))
%==============================================================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML StoichiometryMath structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%==========================================================================
% [valid, message] = isSBML_Trigger(SBMLTrigger, level, version(optional))
%==========================================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Trigger structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%====================================================================
% [valid, message] = isSBML_Unit(SBMLUnit, level, version(optional))
%====================================================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Unit structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%========================================================================================
% [valid, message] = isSBML_UnitDefinition(SBMLUnitDefinition, level, version(optional))
%========================================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. level, an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML UnitDefinition structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================================================
% [valid, message] = isValid(SBMLStruct, level(optional), version(optional))
%============================================================================
% Takes
% 1. SBMLStruct, an SBML structure
% 2. level (optional), an integer representing an SBML level
% 3. version (optional), an integer representing an SBML version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%============================================
% [valid, message] = isValidSBML_Model(SBMLModel)
%============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Model structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%
SBMLToolbox-4.1.0/toolbox/Validate_MATLAB_SBML_Structures/bind_isSBML_Model.m 0000644 0000000 0000000 00000421126 11662457332 025237 0 ustar root root function [valid, message] = isValidSBML_Model(SBMLStructure)
% [valid, message] = isValidSBML_Model(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML Model structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML Model structure of the appropriate
% level and version can be found using getModelFieldnames(level, version)
%
%check the input arguments are appropriate
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
if ~isempty(SBMLStructure)
if isfield(SBMLStructure, 'SBML_level')
level = SBMLStructure.SBML_level;
else
level = 3;
end;
if isfield(SBMLStructure, 'SBML_version')
version = SBMLStructure.SBML_version;
else
version = 1;
end;
else
level = 3;
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_MODEL';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_MODEL', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% functionDefinitions
if (valid == 1 && level > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.functionDefinition))
[valid, message] = isSBML_FunctionDefinition( ...
SBMLStructure.functionDefinition(index), ...
level, version);
index = index + 1;
end;
end;
% unitDefinitions
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.unitDefinition))
[valid, message] = isSBML_UnitDefinition( ...
SBMLStructure.unitDefinition(index), ...
level, version);
index = index + 1;
end;
end;
% compartments
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.compartment))
[valid, message] = isSBML_Compartment(SBMLStructure.compartment(index), ...
level, version);
index = index + 1;
end;
end;
% species
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.species))
[valid, message] = isSBML_Species(SBMLStructure.species(index), ...
level, version);
index = index + 1;
end;
end;
% compartmentTypes
if (valid == 1 && level == 2 && version > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.compartmentType))
[valid, message] = isSBML_CompartmentType(SBMLStructure.compartmentType(index), ...
level, version);
index = index + 1;
end;
end;
% speciesTypes
if (valid == 1 && level == 2 && version > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.speciesType))
[valid, message] = isSBML_SpeciesType(SBMLStructure.speciesType(index), ...
level, version);
index = index + 1;
end;
end;
% parameter
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.parameter))
[valid, message] = isSBML_Parameter(SBMLStructure.parameter(index), ...
level, version);
index = index + 1;
end;
end;
% initialAssignment
if (valid == 1 && (level > 2 || (level == 2 && version > 1)))
index = 1;
while (valid == 1 && index <= length(SBMLStructure.initialAssignment))
[valid, message] = isSBML_InitialAssignment( ...
SBMLStructure.initialAssignment(index), ...
level, version);
index = index + 1;
end;
end;
% rule
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.rule))
[valid, message] = isSBML_Rule(SBMLStructure.rule(index), ...
level, version);
index = index + 1;
end;
end;
% constraints
if (valid == 1 && (level > 2 || (level == 2 && version > 1)))
index = 1;
while (valid == 1 && index <= length(SBMLStructure.constraint))
[valid, message] = isSBML_Constraint( ...
SBMLStructure.constraint(index), ...
level, version);
index = index + 1;
end;
end;
% reaction
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.reaction))
[valid, message] = isSBML_Reaction(SBMLStructure.reaction(index), ...
level, version);
index = index + 1;
end;
end;
% event
if (valid == 1 && level > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.event))
[valid, message] = isSBML_Event(SBMLStructure.event(index), ...
level, version);
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Model structure\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_AlgebraicRule(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_ALGEBRAIC_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_ALGEBRAIC_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid AlgebraicRule\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_AssignmentRule(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_ASSIGNMENT_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (level > 1)
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
% check L1 types
typecode = SBMLStructure.typecode;
cvr = strcmp(typecode, 'SBML_COMPARTMENT_VOLUME_RULE');
pr = strcmp(typecode, 'SBML_PARAMETER_RULE');
scr = strcmp(typecode, 'SBML_SPECIES_CONCENTRATION_RULE');
if (cvr ~= 1 && pr ~= 1 && scr ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
elseif (strcmp(SBMLStructure.type, 'scalar') ~= 1)
valid = 0;
message = 'expected scalar type';
return;
end;
end;
else
valid = 0;
message = 'missing typecode';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames(typecode, level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid AssignmentRule\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Compartment(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_COMPARTMENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_COMPARTMENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Compartment\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_CompartmentType(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_COMPARTMENT_TYPE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_COMPARTMENT_TYPE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid CompartmentType\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_CompartmentVolumeRule(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_COMPARTMENT_VOLUME_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_COMPARTMENT_VOLUME_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid CompartmentVolumeRule\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Constraint(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_CONSTRAINT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_CONSTRAINT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Constraint\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Delay(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_DELAY';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_DELAY', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Delay\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Event(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_EVENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_EVENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% eventAssignments
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.eventAssignment))
[valid, message] = isSBML_EventAssignment( ...
SBMLStructure.eventAssignment(index), ...
level, version);
index = index + 1;
end;
end;
% trigger/delay/priority
% these are level and version dependent
if (valid == 1)
if (level == 2 && version > 2)
if (length(SBMLStructure.trigger) > 1)
valid = 0;
message = 'multiple trigger elements encountered';
elseif (length(SBMLStructure.delay) > 1)
valid = 0;
message = 'multiple delay elements encountered';
end;
if (valid == 1 && length(SBMLStructure.trigger) == 1)
[valid, message] = isSBML_Trigger(SBMLStructure.trigger, level, version);
end;
if (valid == 1 && length(SBMLStructure.delay) == 1)
[valid, message] = isSBML_Delay(SBMLStructure.delay, level, version);
end;
elseif (level > 2)
if (length(SBMLStructure.trigger) > 1)
valid = 0;
message = 'multiple trigger elements encountered';
elseif (length(SBMLStructure.delay) > 1)
valid = 0;
message = 'multiple delay elements encountered';
elseif (length(SBMLStructure.priority) > 1)
valid = 0;
message = 'multiple priority elements encountered';
end;
if (valid == 1 && length(SBMLStructure.trigger) == 1)
[valid, message] = isSBML_Trigger(SBMLStructure.trigger, level, version);
end;
if (valid == 1 && length(SBMLStructure.delay) == 1)
[valid, message] = isSBML_Delay(SBMLStructure.delay, level, version);
end;
if (valid == 1 && length(SBMLStructure.priority) == 1)
[valid, message] = isSBML_Priority(SBMLStructure.priority, level, version);
end;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Event\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_EventAssignment(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_EVENT_ASSIGNMENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_EVENT_ASSIGNMENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid EventAssignment\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_FunctionDefinition(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_FUNCTION_DEFINITION';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_FUNCTION_DEFINITION', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid FunctionDefinition\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_InitialAssignment(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_INITIAL_ASSIGNMENT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_INITIAL_ASSIGNMENT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid InitialAssignment\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_KineticLaw(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_KINETIC_LAW';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_KINETIC_LAW', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% parameters
if (valid == 1 && level < 3)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.parameter))
[valid, message] = isSBML_Parameter(SBMLStructure.parameter(index), ...
level, version);
index = index + 1;
end;
end;
%check that any nested structures are appropriate
% localParameters
if (valid == 1 && level > 2)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.localParameter))
[valid, message] = isSBML_LocalParameter(SBMLStructure.localParameter(index), ...
level, version);
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid KineticLaw\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_LocalParameter(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_LOCAL_PARAMETER';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_LOCAL_PARAMETER', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid LocalParameter\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_ModifierSpeciesReference(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_MODIFIER_SPECIES_REFERENCE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_MODIFIER_SPECIES_REFERENCE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid ModifierSpeciesReference\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Parameter(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_PARAMETER';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_PARAMETER', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Parameter\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_ParameterRule(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_PARAMETER_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_PARAMETER_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid ParameterRule\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Priority(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_PRIORITY';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_PRIORITY', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Priority\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_RateRule(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_RATE_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (level > 1)
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
% check L1 types
typecode = SBMLStructure.typecode;
cvr = strcmp(typecode, 'SBML_COMPARTMENT_VOLUME_RULE');
pr = strcmp(typecode, 'SBML_PARAMETER_RULE');
scr = strcmp(typecode, 'SBML_SPECIES_CONCENTRATION_RULE');
if (cvr ~= 1 && pr ~= 1 && scr ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
elseif (strcmp(SBMLStructure.type, 'rate') ~= 1)
valid = 0;
message = 'expected rate type';
return;
end;
end;
else
valid = 0;
message = 'missing typecode';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames(typecode, level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid RateRule\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Reaction(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_REACTION';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_REACTION', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% reactants
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.reactant))
[valid, message] = isSBML_SpeciesReference(SBMLStructure.reactant(index), ...
level, version);
index = index + 1;
end;
end;
% products
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.product))
[valid, message] = isSBML_SpeciesReference(SBMLStructure.product(index), ...
level, version);
index = index + 1;
end;
end;
% modifiers
if (valid == 1 && level > 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.modifier))
[valid, message] = isSBML_ModifierSpeciesReference( ...
SBMLStructure.modifier(index), ...
level, version);
index = index + 1;
end;
end;
% kineticLaw
if (valid == 1 && length(SBMLStructure.kineticLaw) == 1)
[valid, message] = isSBML_KineticLaw(SBMLStructure.kineticLaw, level, version);
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Reaction\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Rule(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
if ~isempty(SBMLStructure)
if isfield(SBMLStructure, 'typecode')
typecode = SBMLStructure.typecode;
else
valid = 0;
message = 'missing typecode';
return;
end;
else
typecode = 'SBML_ASSIGNMENT_RULE';
end;
switch (typecode)
case 'SBML_ALGEBRAIC_RULE'
[valid, message] = isSBML_AlgebraicRule(SBMLStructure, level, version);
case 'SBML_ASSIGNMENT_RULE'
[valid, message] = isSBML_AssignmentRule(SBMLStructure, level, version);
case 'SBML_COMPARTMENT_VOLUME_RULE'
[valid, message] = isSBML_CompartmentVolumeRule(SBMLStructure, level, version);
case 'SBML_PARAMETER_RULE'
[valid, message] = isSBML_ParameterRule(SBMLStructure, level, version);
case 'SBML_RATE_RULE'
[valid, message] = isSBML_RateRule(SBMLStructure, level, version);
case 'SBML_SPECIES_CONCENTRATION_RULE'
[valid, message] = isSBML_SpeciesConcentrationRule(SBMLStructure, level, version);
case 'SBML_RULE'
[valid, message] = checkRule(SBMLStructure, level, version);
otherwise
valid = 0;
message = 'Incorrect rule typecode';
end;
function [valid, message] = checkRule(SBMLStructure, level, version)
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getAlgebraicRuleFieldnames(level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Rule\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Species(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Species\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_SpeciesConcentrationRule(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES_CONCENTRATION_RULE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES_CONCENTRATION_RULE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid SpeciesConcentrationRule\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_SpeciesReference(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES_REFERENCE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES_REFERENCE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid SpeciesReference\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_SpeciesType(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES_TYPE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_SPECIES_TYPE', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid SpeciesType\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_StoichiometryMath(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_STOICHIOMETRY_MATH';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_STOICHIOMETRY_MATH', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid StoichiometryMath\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Trigger(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_TRIGGER';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_TRIGGER', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Trigger\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_Unit(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_UNIT';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_UNIT', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid Unit\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [valid, message] = isSBML_UnitDefinition(varargin)
%check the input arguments are appropriate
if (nargin < 2 || nargin > 3)
error('wrong number of input arguments');
end;
SBMLStructure = varargin{1};
if (length(SBMLStructure) > 1)
valid = 0;
message = 'cannot deal with arrays of structures';
return;
end;
level = varargin{2};
if (nargin == 3)
version = varargin{3};
else
version = 1;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_UNIT_DEFINITION';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'missing typecode field';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_UNIT_DEFINITION', level, version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% unit
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.unit))
[valid, message] = isSBML_Unit(SBMLStructure.unit(index), ...
level, version);
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid UnitDefinition\n%s\n', message);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function valid = isValidLevelVersionCombination(level, version)
valid = 1;
if ~isIntegralNumber(level)
error('level must be an integer');
elseif ~isIntegralNumber(version)
error('version must be an integer');
end;
if (level < 1 || level > 3)
error('current SBML levels are 1, 2 or 3');
end;
if (level == 1)
if (version < 1 || version > 2)
error('SBMLToolbox supports versions 1-2 of SBML Level 1');
end;
elseif (level == 2)
if (version < 1 || version > 4)
error('SBMLToolbox supports versions 1-4 of SBML Level 2');
end;
elseif (level == 3)
if (version ~= 1)
error('SBMLToolbox supports only version 1 of SBML Level 3');
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function value = isIntegralNumber(number)
value = 0;
integerClasses = {'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'};
% since the function isinteger does not exist in MATLAB Rel 13
% this is not used
%if (isinteger(number))
if (ismember(class(number), integerClasses))
value = 1;
elseif (isnumeric(number))
% if it is an integer
if (number == fix(number))
value = 1;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getAlgebraicRuleFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getAssignmentRuleFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getCompartmentFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'volume', ...
'units', ...
'outside', ...
'isSetVolume', ...
};
nNumberFields = 8;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 13;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'compartmentType', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 14;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'compartmentType', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 15;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'compartmentType', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 15;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'spatialDimensions', ...
'size', ...
'units', ...
'constant', ...
'isSetSize', ...
'isSetSpatialDimensions', ...
};
nNumberFields = 13;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getCompartmentTypeFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
};
nNumberFields = 6;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getCompartmentVolumeRuleFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 4)
SBMLfieldnames = [];
nNumberFields = 0;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getConstraintFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getDelayFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getEventAssignmentFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'variable', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'variable', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'variable', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'variable', ...
'math', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'variable', ...
'math', ...
};
nNumberFields = 7;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getEventFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'trigger', ...
'delay', ...
'timeUnits', ...
'eventAssignment', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'trigger', ...
'delay', ...
'timeUnits', ...
'sboTerm', ...
'eventAssignment', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'trigger', ...
'delay', ...
'eventAssignment', ...
};
nNumberFields = 10;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'useValuesFromTriggerTime', ...
'trigger', ...
'delay', ...
'eventAssignment', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'useValuesFromTriggerTime', ...
'trigger', ...
'delay', ...
'priority', ...
'eventAssignment', ...
};
nNumberFields = 12;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getFieldnames(typecode, ...
level, version)
done = 1;
switch (typecode)
case {'SBML_ALGEBRAIC_RULE', 'AlgebraicRule', 'algebraicRule'}
fhandle = str2func('getAlgebraicRuleFieldnames');
case {'SBML_ASSIGNMENT_RULE', 'AssignmentRule', 'assignmentRule'}
fhandle = str2func('getAssignmentRuleFieldnames');
case {'SBML_COMPARTMENT', 'Compartment', 'compartment'}
fhandle = str2func('getCompartmentFieldnames');
case {'SBML_COMPARTMENT_TYPE', 'CompartmentType', 'compartmentType'}
fhandle = str2func('getCompartmentTypeFieldnames');
case {'SBML_COMPARTMENT_VOLUME_RULE', 'CompartmentVolumeRule', 'compartmentVolumeRule'}
fhandle = str2func('getCompartmentVolumeRuleFieldnames');
case {'SBML_CONSTRAINT', 'Constraint', 'constraint'}
fhandle = str2func('getConstraintFieldnames');
case {'SBML_DELAY', 'Delay', 'delay'}
fhandle = str2func('getDelayFieldnames');
case {'SBML_EVENT', 'Event', 'event'}
fhandle = str2func('getEventFieldnames');
case {'SBML_EVENT_ASSIGNMENT', 'EventAssignment', 'eventAssignment'}
fhandle = str2func('getEventAssignmentFieldnames');
case {'SBML_FUNCTION_DEFINITION', 'FunctionDefinition', 'functionDefinition'}
fhandle = str2func('getFunctionDefinitionFieldnames');
case {'SBML_INITIAL_ASSIGNMENT', 'InitialAssignment', 'initialAssignment'}
fhandle = str2func('getInitialAssignmentFieldnames');
case {'SBML_KINETIC_LAW', 'KineticLaw', 'kineticLaw'}
fhandle = str2func('getKineticLawFieldnames');
case {'SBML_LOCAL_PARAMETER', 'LocalParameter', 'localParameter'}
fhandle = str2func('getLocalParameterFieldnames');
case {'SBML_MODEL', 'Model', 'model'}
fhandle = str2func('getModelFieldnames');
case {'SBML_MODIFIER_SPECIES_REFERENCE', 'ModifierSpeciesReference', 'modifierSpeciesReference'}
fhandle = str2func('getModifierSpeciesReferenceFieldnames');
case {'SBML_PARAMETER', 'Parameter', 'parameter'}
fhandle = str2func('getParameterFieldnames');
case {'SBML_PARAMETER_RULE', 'ParameterRule', 'parameterRule'}
fhandle = str2func('getParameterRuleFieldnames');
case {'SBML_PRIORITY', 'Priority', 'priority'}
fhandle = str2func('getPriorityFieldnames');
case {'SBML_RATE_RULE', 'RateRule', 'ruleRule'}
fhandle = str2func('getRateRuleFieldnames');
case {'SBML_REACTION', 'Reaction', 'reaction'}
fhandle = str2func('getReactionFieldnames');
case {'SBML_SPECIES', 'Species', 'species'}
fhandle = str2func('getSpeciesFieldnames');
case {'SBML_SPECIES_CONCENTRATION_RULE', 'SpeciesConcentrationRule', 'speciesConcentrationRule'}
fhandle = str2func('getSpeciesConcentrationRuleFieldnames');
case {'SBML_SPECIES_REFERENCE', 'SpeciesReference', 'speciesReference'}
fhandle = str2func('getSpeciesReferenceFieldnames');
case {'SBML_SPECIES_TYPE', 'SpeciesType', 'speciesType'}
fhandle = str2func('getSpeciesTypeFieldnames');
case {'SBML_STOICHIOMETRY_MATH', 'StoichiometryMath', 'stoichiometryMath'}
fhandle = str2func('getStoichiometryMathFieldnames');
case {'SBML_TRIGGER', 'Trigger', 'trigger'}
fhandle = str2func('getTriggerFieldnames');
case {'SBML_UNIT', 'Unit', 'unit'}
fhandle = str2func('getUnitFieldnames');
case {'SBML_UNIT_DEFINITION', 'UnitDefinition', 'unitDefinition'}
fhandle = str2func('getUnitDefinitionFieldnames');
otherwise
done = 0;
end;
if done == 1
[SBMLfieldnames, nNumberFields] = feval(fhandle, level, version);
else
switch (typecode)
case {'SBML_FBC_FLUXBOUND', 'FluxBound', 'fluxBound'}
fhandle = str2func('getFluxBoundFieldnames');
case {'SBML_FBC_FLUXOBJECTIVE', 'FluxObjective', 'fluxObjective'}
fhandle = str2func('getFluxObjectiveFieldnames');
case {'SBML_FBC_OBJECTIVE', 'Objective', 'objective'}
fhandle = str2func('getObjectiveFieldnames');
case {'SBML_FBC_MODEL', 'FBCModel'}
fhandle = str2func('getFBCModelFieldnames');
case {'SBML_FBC_SPECIES', 'FBCSpecies'}
fhandle = str2func('getFBCSpeciesFieldnames');
otherwise
error('%s\n%s', ...
'getFieldnames(typecode, level, version', ...
'typecode not recognised');
end;
[SBMLfieldnames, nNumberFields] = feval(fhandle, level, version, 1);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getFunctionDefinitionFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getInitialAssignmentFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getKineticLawFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'formula', ...
'parameter', ...
'timeUnits', ...
'substanceUnits', ...
};
nNumberFields = 7;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'math', ...
'parameter', ...
'timeUnits', ...
'substanceUnits', ...
};
nNumberFields = 9;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'math', ...
'parameter', ...
'sboTerm', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'math', ...
'parameter', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'math', ...
'parameter', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'localParameter', ...
};
nNumberFields = 7;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getLocalParameterFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'isSetValue', ...
};
nNumberFields = 10;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getModelFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'unitDefinition', ...
'compartment', ...
'species', ...
'parameter', ...
'rule', ...
'reaction', ...
};
nNumberFields = 12;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'functionDefinition', ...
'unitDefinition', ...
'compartment', ...
'species', ...
'parameter', ...
'rule', ...
'reaction', ...
'event', ...
};
nNumberFields = 16;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartmentType', ...
'speciesType', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
};
nNumberFields = 21;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartmentType', ...
'speciesType', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
};
nNumberFields = 21;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartmentType', ...
'speciesType', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
};
nNumberFields = 21;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
'substanceUnits', ...
'timeUnits', ...
'lengthUnits', ...
'areaUnits', ...
'volumeUnits', ...
'extentUnits', ...
'conversionFactor', ...
};
nNumberFields = 26;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getModifierSpeciesReferenceFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
};
nNumberFields = 5;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
'id', ...
'name', ...
'sboTerm', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
};
nNumberFields = 8;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getParameterFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'value', ...
'units', ...
'isSetValue', ...
};
nNumberFields = 7;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'sboTerm', ...
'isSetValue', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 11;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getParameterRuleFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 4)
SBMLfieldnames = [];
nNumberFields = 0;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getPriorityFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getRateRuleFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getReactionFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'reactant', ...
'product', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
};
nNumberFields = 9;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
};
nNumberFields = 13;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'sboTerm', ...
'isSetFast', ...
};
nNumberFields = 14;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
};
nNumberFields = 14;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
};
nNumberFields = 14;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
'compartment', ...
};
nNumberFields = 15;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getRuleFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getSpeciesConcentrationRuleFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 4)
SBMLfieldnames = [];
nNumberFields = 0;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getSpeciesFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'compartment', ...
'initialAmount', ...
'units', ...
'boundaryCondition', ...
'charge', ...
'isSetInitialAmount', ...
'isSetCharge', ...
};
nNumberFields = 11;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'spatialSizeUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 18;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'speciesType', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'spatialSizeUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 19;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'speciesType', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 19;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'speciesType', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 19;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'conversionFactor', ...
};
nNumberFields = 17;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getSpeciesReferenceFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'species', ...
'stoichiometry', ...
'denominator', ...
};
nNumberFields = 6;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
'stoichiometry', ...
'denominator', ...
'stoichiometryMath', ...
};
nNumberFields = 8;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
'id', ...
'name', ...
'sboTerm', ...
'stoichiometry', ...
'stoichiometryMath', ...
};
nNumberFields = 10;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
'stoichiometry', ...
'stoichiometryMath', ...
};
nNumberFields = 10;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
'stoichiometry', ...
'stoichiometryMath', ...
};
nNumberFields = 10;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
'stoichiometry', ...
'constant', ...
'isSetStoichiometry', ...
};
nNumberFields = 11;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getSpeciesTypeFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
};
nNumberFields = 6;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getStoichiometryMathFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getTriggerFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'persistent', ...
'initialValue', ...
'math', ...
};
nNumberFields = 8;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getUnitDefinitionFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'unit', ...
};
nNumberFields = 5;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 7;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 8;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SBMLfieldnames, nNumberFields] = getUnitFieldnames(level, ...
version)
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'kind', ...
'exponent', ...
'scale', ...
};
nNumberFields = 6;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
'offset', ...
};
nNumberFields = 9;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 9;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 9;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 9;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SBMLToolbox-4.1.0/toolbox/test.xml 0000644 0000000 0000000 00000005446 11703274536 015526 0 ustar root root
Simple branch system.
The reaction looks like this:
reaction-1: X0 -> S1; k1*X0;
reaction-2: S1 -> X1; k2*S1;
reaction-3: S1 -> X2; k3*S1;
SBMLToolbox-4.1.0/toolbox/Test/ 0000755 0000000 0000000 00000000000 11704572220 014723 5 ustar root root SBMLToolbox-4.1.0/toolbox/Test/TestFunction.m 0000644 0000000 0000000 00000011217 11655460060 017533 0 ustar root root function y = TestFunction(varargin)
%
y = 0;
if (nargin < 3)
error('Need at least 3 inputs');
end;
func = varargin{1};
fhandle = str2func(func);
number_in = varargin{2};
number_out = varargin{3};
if (nargin < 3+number_in+number_out)
error('incorrect number of arguments');
end;
start_out = 4 + number_in;
fail = 0;
switch number_out
case 0
switch number_in
case 1
[a] = feval(fhandle, varargin{4});
case 2
[a] = feval(fhandle, varargin{4}, varargin{5});
case 3
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6});
case 4
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6}, varargin{7});
end;
fail = fail + ~testEquality(a);
case 1
switch number_in
case 1
[a] = feval(fhandle, varargin{4});
case 2
[a] = feval(fhandle, varargin{4}, varargin{5});
case 3
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6});
case 4
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6}, varargin{7});
end;
fail = fail + ~testEquality(a, varargin{start_out});
case 2
switch number_in
case 1
[a, b] = feval(fhandle, varargin{4});
case 2
[a, b] = feval(fhandle, varargin{4}, varargin{5});
case 3
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6});
case 4
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6}, varargin{7});
end;
fail = fail + ~testEquality(a, varargin{start_out});
fail = fail + ~testEquality(b, varargin{start_out+1});
case 3
switch number_in
case 1
[a, b, c] = feval(fhandle, varargin{4});
case 2
[a, b, c] = feval(fhandle, varargin{4}, varargin{5});
case 3
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6});
case 4
[a] = feval(fhandle, varargin{4}, varargin{5}, varargin{6}, varargin{7});
end;
fail = fail + ~testEquality(a, varargin{start_out});
fail = fail + ~testEquality(b, varargin{start_out+1});
fail = fail + ~testEquality(c, varargin{start_out+2});
otherwise
error('too many output');
end;
if (fail > 0)
y = 1;
end;
function y = testEquality(array1, array2)
y = isequal(array1, array2);
if y == 1
return;
elseif length(array1) ~= length(array2)
y = 0;
return;
elseif issparse(array1)
array1_full = full(array1);
array2_full = full(array2);
y = testEquality(array1_full, array2_full);
else
y = 1;
i = 1;
% check whether we are dealing with a nan which will always fail equality
while (y == 1 && i <= length(array1))
if ~isstruct(array1)
if isnan(array1(i))
y = isnan(array2(i));
else
y = isequal(array1(i), array2(i));
end;
else
fields = fieldnames(array1(i));
j = 1;
while( y == 1 && j <= length(fields))
ff1 = getfield(array1(i), fields{j});
ff2 = getfield(array2(i), fields{j});
if (iscell(ff1))
ff1 = ff1{1};
ff2 = ff2{1};
end;
if isnan(ff1)
y = isnan(ff2);
else
y = isequal(ff1, ff2);
end;
j = j+1;
end;
end;
i = i + 1;
end;
end;
SBMLToolbox-4.1.0/toolbox/Test/test-data/ 0000755 0000000 0000000 00000000000 11704572222 016613 5 ustar root root SBMLToolbox-4.1.0/toolbox/Test/test-data/varyingParameters.xml 0000644 0000000 0000000 00000002613 11541621274 023043 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/testNegativeLocalParameter.xml 0000644 0000000 0000000 00000004521 11625135174 024620 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/testIsInRules.xml 0000644 0000000 0000000 00000007705 11602043352 022115 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/species.xml 0000644 0000000 0000000 00000010014 11540617526 020771 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/sparseStoichiometry.xml 0000644 0000000 0000000 00000004205 11540617526 023423 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/rateRules.xml 0000644 0000000 0000000 00000003326 11540617526 021314 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/piecewise.xml 0000644 0000000 0000000 00000003025 11540617526 021317 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/nestedPiecewise.xml 0000644 0000000 0000000 00000003630 11540617526 022464 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l3v1core.xml 0000644 0000000 0000000 00000014751 11557476040 021012 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l2v4-all.xml 0000644 0000000 0000000 00000011301 11540617526 020673 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l2v3-all.xml 0000644 0000000 0000000 00000010663 11575652072 020707 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l2v2-newComponents.xml 0000644 0000000 0000000 00000004325 11540617526 022770 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l2v2-all.xml 0000644 0000000 0000000 00000010301 11540617526 020670 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l2v1-all.xml 0000644 0000000 0000000 00000007177 11540617526 020710 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l1v2-all.xml 0000644 0000000 0000000 00000004747 11540617526 020710 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/l1v1.xml 0000644 0000000 0000000 00000004470 11540617526 020132 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/initialAssignments.xml 0000644 0000000 0000000 00000010203 11540617526 023203 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/functionDefinition.xml 0000644 0000000 0000000 00000005227 11540662356 023207 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/funcDefsWithInitialAssignments.xml 0000644 0000000 0000000 00000010034 11540617526 025457 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/csymbolTime.xml 0000644 0000000 0000000 00000002156 11540617526 021635 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/csymbolDelay.xml 0000644 0000000 0000000 00000001640 11540617526 021772 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/convertedFormulas.xml 0000644 0000000 0000000 00000011242 11540617526 023044 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/test-data/algebraicRules.xml 0000644 0000000 0000000 00000006472 11540617526 022277 0 ustar root root
SBMLToolbox-4.1.0/toolbox/Test/RunTest.m 0000644 0000000 0000000 00000006160 11703270364 016513 0 ustar root root function RunTest
%
cd ..;
cd AccessModel;
cd Test;
disp('Performing tests in AccessModel directory');
am = test_am;
cd ..;
% % NEED work to get these to pass in octave
% v = ver('symbolic');
% % only run if symbolic toolbox is intalled
% if (~isempty(v) && isoctave == '0')
% cd ..;
% cd AccessToSymbols;
% cd Test;
% disp('Performing tests in AccessToSymbols directory');
% RunTest;
% cd ..;
% end;
cd ..;
cd Convenience;
cd Test;
disp('Performing tests in Convenience directory');
conv = test_conv;
cd ..;
cd ..;
cd MATLAB_SBML_Structure_Functions;
cd Test;
disp('Performing tests in MATLAB_SBML_Structure_Functions directory');
st = testStructures;
cd ..;
cd ..;
cd Simulation;
cd Test;
disp('Performing tests in Simulation directory');
sim = test_sim;
cd ..;
cd ..;
cd Validate_MATLAB_SBML_Structures;
cd Test;
disp('Performing tests in Validate_MATLAB_SBML_Structures directory');
valid = test_valid;
cd ..;
cd ..;
cd fbc_package;
cd test;
disp('Performing tests in fbc_package directory');
fbc = runFBCTest;
cd ..;
cd ..;
cd Test;
disp('Overall tests:');
if (am == 0)
disp('AccessModel: PASS');
else
disp('AccessModel: FAILED');
end;
if (conv == 0)
disp('Convenience: PASS');
else
disp('Convenience: FAILED');
end;
if (st == 0)
disp('Structures: PASS');
else
disp('Structures: FAILED');
end;
if (sim == 0)
disp('Simulation: PASS');
else
disp('Simulation: FAILED');
end;
if (valid == 0)
disp('Validation: PASS');
else
disp('Validation: FAILED');
end;
if (fbc == 0)
disp('FBC functions: PASS');
else
disp('FBC functions: FAILED');
end;
if (am+conv+st+sim+valid+fbc) == 0
disp('ALL TESTS PASSED');
else
disp('Some errors encountered; refer to above');
end;
if isBindingInstalled() == 0
disp('***********************************************************');
disp('LibSBML binding not installed - some tests could not be run');
disp('***********************************************************');
end;
SBMLToolbox-4.1.0/toolbox/Simulation/ 0000755 0000000 0000000 00000000000 11704572220 016130 5 ustar root root SBMLToolbox-4.1.0/toolbox/Simulation/WriteODEFunction.m 0000644 0000000 0000000 00000072267 11704012540 021446 0 ustar root root function WriteODEFunction(varargin)
% WriteODEFunction(SBMLModel, name(optional))
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. name, an optional string representing the name of the ode function to be used
%
% Outputs
%
% 1. a file 'name.m' defining a function that defines the ode equations of
% the model for use with the ode solvers
% (if no name supplied the model id will be used)
%
switch (nargin)
case 0
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'must have at least one argument');
case 1
SBMLModel = varargin{1};
filename = '';
case 2
SBMLModel = varargin{1};
filename = varargin{2};
otherwise
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'does not take more than two arguments');
end;
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'first argument must be an SBMLModel structure');
end;
% -------------------------------------------------------------
% check that we can deal with the model
% for i=1:length(SBMLModel.parameter)
% if (SBMLModel.parameter(i).constant == 0)
% error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with varying parameters');
% end;
% end;
if SBMLModel.SBML_level > 2
if ~isempty(SBMLModel.conversionFactor)
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with conversion factors');
end;
for i=1:length(SBMLModel.species)
if ~isempty(SBMLModel.species(i).conversionFactor)
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with conversion factors');
end;
end;
end;
for i=1:length(SBMLModel.compartment)
if (SBMLModel.compartment(i).constant == 0)
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with varying compartments');
end;
end;
% if (length(SBMLModel.species) == 0)
% error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with models with no species');
% end;
for i=1:length(SBMLModel.event)
if exist('OCTAVE_VERSION') && length(SBMLModel.event) > 0
error('Octave cannot deal with events');
end;
if (~isempty(SBMLModel.event(i).delay))
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with delayed events');
end;
if SBMLModel.SBML_level > 2
if (~isempty(SBMLModel.event(i).priority))
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with event priorities');
end;
if (~isempty(SBMLModel.event(i).trigger) && ...
(SBMLModel.event(i).trigger.initialValue == 1 || SBMLModel.event(i).trigger.persistent == 1))
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with persistent trigger');
end;
end;
end;
for i=1:length(SBMLModel.reaction)
if (SBMLModel.reaction(i).fast == 1)
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with fast reactions');
end;
end;
if (length(SBMLModel.compartment) > 1)
error('WriteODEFunction(SBMLModel, (optional) filename)\n%s', 'Cannot deal with multiple compartments');
end;
if (SBMLModel.SBML_level > 1 && ~isempty(SBMLModel.time_symbol))
for i=1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_ASSIGNMENT_RULE'))
if (~isempty(matchName(SBMLModel.rule(i).formula, SBMLModel.time_symbol)))
error('Cannot deal with time in an assignment rule');
end;
end;
end;
end;
if (SBMLModel.SBML_level > 1 && ~isempty(SBMLModel.delay_symbol))
for i=1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_ASSIGNMENT_RULE'))
if (~isempty(matchName(SBMLModel.rule(i).formula, SBMLModel.delay_symbol)))
error('Cannot deal with delay in an assignment rule');
end;
end;
end;
end;
%--------------------------------------------------------------
% get information from the model
[ParameterNames, ParameterValues] = GetAllParametersUnique(SBMLModel);
[VarParams, VarInitValues] = GetVaryingParameters(SBMLModel);
NumberParams = length(VarParams);
NumberSpecies = length(SBMLModel.species);
if NumberSpecies > 0
Species = AnalyseSpecies(SBMLModel);
Speciesnames = GetSpecies(SBMLModel);
end;
if NumberParams > 0
Parameters = AnalyseVaryingParameters(SBMLModel);
end;
if length(SBMLModel.compartment) > 0
[CompartmentNames, CompartmentValues] = GetCompartments(SBMLModel);
else
CompartmentNames = [];
end;
if (NumberParams + NumberSpecies) == 0
error('Cannot detect any variables');
end;
if (SBMLModel.SBML_level > 1)
NumEvents = length(SBMLModel.event);
NumFuncs = length(SBMLModel.functionDefinition);
% version 2.0.2 adds the time_symbol field to the model structure
% need to check that it exists
if (isfield(SBMLModel, 'time_symbol'))
if (~isempty(SBMLModel.time_symbol))
timeVariable = SBMLModel.time_symbol;
else
timeVariable = 'time';
end;
else
timeVariable = 'time';
end;
if ((SBMLModel.SBML_level == 2 &&SBMLModel.SBML_version > 1) || ...
(SBMLModel.SBML_level > 2))
if (length(SBMLModel.constraint) > 0)
error('Cannot deal with constraints.');
end;
end;
else
NumEvents = 0;
NumFuncs = 0;
timeVariable = 'time';
end;
%---------------------------------------------------------------
% get the name/id of the model
Name = '';
if (SBMLModel.SBML_level == 1)
Name = SBMLModel.name;
else
if (isempty(SBMLModel.id))
Name = SBMLModel.name;
else
Name = SBMLModel.id;
end;
end;
if (~isempty(filename))
Name = filename;
elseif (length(Name) > 63)
Name = Name(1:60);
end;
fileName = strcat(Name, '.m');
%--------------------------------------------------------------------
% open the file for writing
fileID = fopen(fileName, 'w');
% write the function declaration
% if no events and using octave
if (exist('OCTAVE_VERSION') && NumEvents == 0)
fprintf(fileID, 'function xdot = %s(x_values, %s)\n', Name, timeVariable);
else
fprintf(fileID, 'function xdot = %s(%s, x_values)\n', Name, timeVariable);
end;
% need to add comments to output file
fprintf(fileID, '%% function %s takes\n', Name);
fprintf(fileID, '%%\n');
fprintf(fileID, '%% either\t1) no arguments\n');
fprintf(fileID, '%% \t and returns a vector of the initial values\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% or \t2) time - the elapsed time since the beginning of the reactions\n');
fprintf(fileID, '%% \t x_values - vector of the current values of the variables\n');
fprintf(fileID, '%% \t and returns a vector of the rate of change of value of each of the variables\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% %s can be used with MATLABs odeN functions as \n', Name);
fprintf(fileID, '%%\n');
fprintf(fileID, '%%\t[t,x] = ode23(@%s, [0, t_end], %s)\n', Name, Name);
fprintf(fileID, '%%\n');
fprintf(fileID, '%%\t\t\twhere t_end is the end time of the simulation\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%%The variables in this model are related to the output vectors with the following indices\n');
fprintf(fileID, '%%\tIndex\tVariable name\n');
for i = 1:NumberSpecies
fprintf(fileID, '%%\t %u \t %s\n', i, char(Species(i).Name));
end;
for i = 1:NumberParams
fprintf(fileID, '%%\t %u \t %s\n', i+NumberSpecies, char(VarParams{i}));
end;
fprintf(fileID, '%%\n');
% write the variable vector
fprintf(fileID, '%%--------------------------------------------------------\n');
fprintf(fileID, '%% output vector\n\n');
fprintf(fileID, 'xdot = zeros(%u, 1);\n', NumberSpecies+NumberParams);
% write the compartment values
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% compartment values\n\n');
for i = 1:length(CompartmentNames)
fprintf(fileID, '%s = %g;\n', CompartmentNames{i}, CompartmentValues(i));
end;
% write the parameter values
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% parameter values\n\n');
for i = 1:length(ParameterNames)
fprintf(fileID, '%s = %g;\n', ParameterNames{i}, ParameterValues(i));
end;
% write the initial concentration values for the species
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% initial values of variables - these may be overridden by assignment rules\n');
fprintf(fileID, '%% NOTE: any use of initialAssignments has been considered in calculating the initial values\n\n');
fprintf(fileID, 'if (nargin == 0)\n');
% if time symbol is used in any subsequent formula it is undeclared
% for the initial execution of the function
% which would only happen when time = 0
fprintf(fileID, '\n\t%% initial time\n');
fprintf(fileID, '\t%s = 0;\n', timeVariable);
fprintf(fileID, '\n\t%% initial values\n');
for i = 1:NumberSpecies
if (Species(i).isConcentration == 1)
fprintf(fileID, '\t%s = %g;\n', char(Species(i).Name), Species(i).initialValue);
elseif (Species(i).hasAmountOnly == 1)
fprintf(fileID, '\t%s = %g;\n', char(Species(i).Name), Species(i).initialValue);
else
fprintf(fileID, '\t%s = %g/%s;\n', char(Species(i).Name), Species(i).initialValue, Species(i).compartment);
end;
end;
for i = 1:NumberParams
fprintf(fileID, '\t%s = %g;\n', char(Parameters(i).Name), Parameters(i).initialValue);
end;
fprintf(fileID, '\nelse\n');
fprintf(fileID, '\t%% floating variable values\n');
for i = 1:NumberSpecies
fprintf(fileID, '\t%s = x_values(%u);\n', char(Species(i).Name), i);
end;
for i = 1:NumberParams
fprintf(fileID, '\t%s = x_values(%u);\n', char(Parameters(i).Name), i+NumberSpecies);
end;
fprintf(fileID, '\nend;\n');
% write assignment rules
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% assignment rules\n');
AssignRules = Model_getListOfAssignmentRules(SBMLModel);
for i = 1:length(AssignRules)
rule = WriteRule(AssignRules(i));
fprintf(fileID, '%s\n', rule);
end;
% write algebraic rules
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% algebraic rules\n');
for i = 1:NumberSpecies
if (Species(i).ConvertedToAssignRule == 1)
fprintf(fileID, '%s = %s;\n', char(Species(i).Name), Species(i).ConvertedRule);
end;
end;
for i = 1:NumberParams
if (Parameters(i).ConvertedToAssignRule == 1)
fprintf(fileID, '%s = %s;\n', char(Parameters(i).Name), Parameters(i).ConvertedRule);
end;
end;
% write code to calculate concentration values
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% calculate concentration values\n\n');
fprintf(fileID, 'if (nargin == 0)\n');
fprintf(fileID, '\n\t%% initial values\n');
% need to catch any initial concentrations that are not set
% and case where an initial concentration is set but is incosistent with a
% later rule
for i = 1:NumberSpecies
if (Species(i).ChangedByAssignmentRule == 0)
% not set by rule - use value given
if (isnan(Species(i).initialValue))
error('WriteODEFunction(SBMLModel)\n%s', 'species concentration not provided or assigned by rule');
else
if (Species(i).isConcentration == 1)
fprintf(fileID, '\txdot(%u) = %g;\n', i, Species(i).initialValue);
elseif (Species(i).hasAmountOnly == 1)
fprintf(fileID, '\txdot(%u) = %g;\n', i, Species(i).initialValue);
else
fprintf(fileID, '\txdot(%u) = %g/%s;\n', i, Species(i).initialValue, Species(i).compartment);
end;
% fprintf(fileID, '\txdot(%u) = %g;\n', i, Species(i).initialValue);
end;
else
% initial concentration set by rule
fprintf(fileID, '\txdot(%u) = %s;\n', i, char(Species(i).Name));
end;
end; % for NumSpecies
% parameters
for i = 1:NumberParams
if (Parameters(i).ChangedByAssignmentRule == 0 && Parameters(i).ConvertedToAssignRule == 0)
% not set by rule - use value given
if (isnan(Parameters(i).initialValue))
error('WriteODEFunction(SBMLModel)\n%s', 'parameter not provided or assigned by rule');
else
fprintf(fileID, '\txdot(%u) = %g;\n', i+NumberSpecies, Parameters(i).initialValue);
end;
else
% initial concentration set by rule
fprintf(fileID, '\txdot(%u) = %s;\n', i+NumberSpecies, char(Parameters(i).Name));
end;
end; % for NumParams
fprintf(fileID, '\nelse\n');
fprintf(fileID, '\n\t%% rate equations\n');
NeedToOrderArray = 0;
for i = 1:NumberSpecies
if (Species(i).ChangedByReaction == 1)
% need to look for piecewise functions
if (isempty(matchFunctionName(char(Species(i).KineticLaw), 'piecewise')))
if (Species(i).hasAmountOnly == 0)
Array{i} = sprintf('\txdot(%u) = (%s)/%s;\n', i, char(Species(i).KineticLaw), Species(i).compartment);
else
Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(Species(i).KineticLaw));
end;
else
var = sprintf('xdot(%u)', i);
Array{i} = WriteOutPiecewise(var, char(Species(i).KineticLaw));
end;
elseif (Species(i).ChangedByRateRule == 1)
% a rule will be in concentration by default
% if (Species(i).isConcentration == 1)
Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(Species(i).RateRule));
% else
% Array{i} = sprintf('\txdot(%u) = (%s)*%s;\n', i, char(Species(i).RateRule), Species(i).compartment);
% end;
% Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(Species(i).RateRule));
elseif (Species(i).ChangedByAssignmentRule == 1)
% here no rate law has been provided by either kinetic law or rate
% rule - need to check whether the species is in an
% assignment rule which may impact on the rate
%%% Checking for a piecewise in the assignment rule and
%%% handling it
%%% Change made by Sumant Turlapati, Entelos, Inc. on June 8th, 2005
if (isempty(matchFunctionName(char(Species(i).AssignmentRule), 'piecewise')))
DifferentiatedRule = DifferentiateRule(char(Species(i).AssignmentRule), Speciesnames, SBMLModel);
Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(DifferentiatedRule));
NeedToOrderArray = 1;
else
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% TO DO NESTED PIECEWISE
Args = DealWithPiecewise(char(Species(i).AssignmentRule));
DiffRule1 = DifferentiateRule(char(Args{1}), Speciesnames, SBMLModel);
DiffRule2 = DifferentiateRule(char(Args{3}), Speciesnames, SBMLModel);
Array{i} = sprintf('\tif (%s) \n\t\txdot(%d) = %s;\n\telse\n\t\txdot(%u) = %s;\n\tend;\n', ...
Args{2}, i, char(DiffRule1), i, char(DiffRule2));
% NeedToOrderArray = 1;
end;
%DifferentiatedRule = DifferentiateRule(char(Species(i).AssignmentRule), Speciesnames);
%Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(DifferentiatedRule));
%NeedToOrderArray = 1;
elseif (Species(i).ConvertedToAssignRule == 1)
% here no rate law has been provided by either kinetic law or rate
% rule - need to check whether the species is in an
% algebraic rule which may impact on the rate
DifferentiatedRule = DifferentiateRule(char(Species(i).ConvertedRule), Speciesnames, SBMLModel);
Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(DifferentiatedRule));
NeedToOrderArray = 1;
else
% not set by anything
Array{i} = sprintf('\txdot(%u) = 0;\n', i);
end;
end; % for Numspecies
for i = 1:NumberParams
if (Parameters(i).ChangedByRateRule == 1)
Array{i+NumberSpecies} = sprintf('\txdot(%u) = %s;\n', i+NumberSpecies, char(Parameters(i).RateRule));
elseif (Parameters(i).ChangedByAssignmentRule == 1)
if (isempty(matchFunctionName(char(Parameters(i).AssignmentRule), 'piecewise')))
DifferentiatedRule = DifferentiateRule(char(Parameters(i).AssignmentRule), VarParams, SBMLModel);
Array{i+NumberSpecies} = sprintf('\txdot(%u) = %s;\n', i+NumberSpecies, char(DifferentiatedRule));
NeedToOrderArray = 1;
else
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% TO DO NESTED PIECEWISE
Args = DealWithPiecewise(char(Parameters(i).AssignmentRule));
DiffRule1 = DifferentiateRule(char(Args{1}), VarParams, SBMLModel);
DiffRule2 = DifferentiateRule(char(Args{3}), VarParams, SBMLModel);
Array{i+NumberSpecies} = sprintf('\tif (%s) \n\t\txdot(%d) = %s;\n\telse\n\t\txdot(%u) = %s;\n\tend;\n', ...
Args{2}, i+NumberSpecies, char(DiffRule1), i+NumberSpecies, char(DiffRule2));
% NeedToOrderArray = 1;
end;
elseif (Parameters(i).ConvertedToAssignRule == 1)
% here no rate law has been provided by either kinetic law or rate
% rule - need to check whether the species is in an
% algebraic rule which may impact on the rate
DifferentiatedRule = DifferentiateRule(char(Parameters(i).ConvertedRule), VarParams, SBMLModel);
Array{i+NumberSpecies} = sprintf('\txdot(%u) = %s;\n', i+NumberSpecies, char(DifferentiatedRule));
NeedToOrderArray = 1;
else
% not set by anything
Array{i+NumberSpecies} = sprintf('\txdot(%u) = 0;\n', i+NumberSpecies);
end;
end; % for Numparams
% need to check that assignments are made in appropriate order
% deals with rules that have been differentiated where xdot may occur on
% both sides of an equation
if (NeedToOrderArray == 1)
Array = OrderArray(Array);
end;
if (NumberSpecies + NumberParams) > 0
for i = 1:length(Array)
fprintf(fileID, '%s', Array{i});
end;
end;
fprintf(fileID, '\nend;\n');
% -----------------------------------------------------------------
if (NumEvents > 0)
% write two additional files for events
WriteEventHandlerFunction(SBMLModel, Name);
WriteEventAssignmentFunction(SBMLModel, Name);
end;
% ------------------------------------------------------------------
% put in any function definitions
if (NumFuncs > 0)
fprintf(fileID, '\n\n%%---------------------------------------------------\n%%Function definitions\n\n');
for i = 1:NumFuncs
Name = SBMLModel.functionDefinition(i).id;
Elements = GetArgumentsFromLambdaFunction(SBMLModel.functionDefinition(i).math);
fprintf(fileID, '%%function %s\n\n', Name);
fprintf(fileID, 'function returnValue = %s(', Name);
for j = 1:length(Elements)-1
if (j == length(Elements)-1)
fprintf(fileID, '%s', Elements{j});
else
fprintf(fileID, '%s, ', Elements{j});
end;
end;
if (isempty(matchFunctionName(Elements{end}, 'piecewise')))
fprintf(fileID, ')\n\nreturnValue = %s;\n\n\n', Elements{end});
else
pw = WriteOutPiecewise('returnValue', Elements{end});
fprintf(fileID, ')\n\n%s\n\n', pw);
end;
end;
end;
fclose(fileID);
%--------------------------------------------------------------------------
function y = WriteRule(SBMLRule)
y = '';
switch (SBMLRule.typecode)
case 'SBML_ASSIGNMENT_RULE'
if (isempty(matchFunctionName(char(SBMLRule.formula), 'piecewise')))
y = sprintf('%s = %s;', SBMLRule.variable, SBMLRule.formula);
else
var = sprintf('%s', SBMLRule.variable);
y = WriteOutPiecewise(var, char(SBMLRule.formula));
end;
case 'SBML_SPECIES_CONCENTRATION_RULE'
y = sprintf('%s = %s;', SBMLRule.species, SBMLRule.formula);
case 'SBML_PARAMETER_RULE'
y = sprintf('%s = %s;', SBMLRule.name, SBMLRule.formula);
case 'SBML_COMPARTMENT_VOLUME_RULE'
y = sprintf('%s = %s;', SBMLRule.compartment, SBMLRule.formula);
otherwise
error('No assignment rules');
end;
%--------------------------------------------------------------------------
function formula = DifferentiateRule(f, SpeciesNames, model)
if (model.SBML_level > 1 && ~isempty(model.time_symbol))
if (~isempty(matchName(f, model.time_symbol)))
error('Cannot deal with time in an assignment rule');
end;
end;
if (~isempty(matchFunctionName(f, 'piecewise')))
error('Cannot deal with nested piecewise in an assignment rule');
end;
% if the formula contains a functionDefinition
% need to get rid of it first
for i=1:length(model.functionDefinition)
id = model.functionDefinition(i).id;
if (~isempty(matchFunctionName(f, id)))
f = SubstituteFunction(f, model.functionDefinition(i));
% remove surrounding brackets
if (strcmp(f(1), '(') && strcmp(f(end), ')'))
f = f(2:end-1);
end;
end;
end;
Brackets = PairBrackets(f);
Dividers = '+-';
Divide = ismember(f, Dividers);
% dividers between brackets do not count
if (Brackets ~= 0)
[NumPairs,y] = size(Brackets);
for i = 1:length(Divide)
if (Divide(i) == 1)
for j = 1:NumPairs
if ((i > Brackets(j,1)) && (i < Brackets(j, 2)))
Divide(i) = 0;
end;
end;
end;
end;
end;
Divider = '';
NoElements = 1;
element = '';
for i = 1:length(f)
if (Divide(i) == 0)
element = strcat(element, f(i));
else
Divider = strcat(Divider, f(i));
Elements{NoElements} = element;
NoElements = NoElements + 1;
element = '';
end;
% catch last element
if (i == length(f))
Elements{NoElements} = element;
end;
end;
for i = 1:NoElements
% check whether element contains a species name
% need to catch case where element is number and
% species names use numbers eg s3 element '3'
found = 0;
for j = 1:length(SpeciesNames)
% j = 1;
A = matchName(Elements{i}, SpeciesNames{j});
if (~isempty(A))
if (length(Elements{i}) == length(SpeciesNames{j}))
found = 1; % exact match
else
% need to check what has been found
poscharAfter = A(1) + length(SpeciesNames{j});
poscharBefore = A(1) - 1;
if (poscharBefore > 0)
charBefore = Elements{i}(poscharBefore);
else
charBefore = '*';
end;
if (poscharAfter <= length(Elements{i}))
charAfter = Elements{i}(poscharAfter);
else
charAfter = '*';
end;
if ((charBefore == '*' || charBefore == '/') && ...
(charAfter == '*' || charAfter == '/'))
found = 1;
end;
end;
if (found == 1)
break;
end;
end;
end;
if (found == 0)
% this element does not contain a species
Elements{i} = strrep(Elements{i}, Elements{i}, '0');
else
% this element does contain a species
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% WHAT IF MORE THAN ONE SPECIES
% for moment assume this would not happen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Power = strfind(Elements{i}, '^');
if (~isempty(Power))
Number = '';
Digits = isstrprop(Elements{i}, 'digit');
k = Power+1;
while ((k < (length(Elements{i})+1)) & (Digits(k) == 1))
Number = strcat(Number, Elements{i}(k));
k = k + 1;
end;
Index = str2num(Number);
Replace = sprintf('%u * %s^%u*xdot(%u)', Index, SpeciesNames{j}, Index-1, j);
Initial = sprintf('%s^%u', SpeciesNames{j}, Index);
Elements{i} = strrep(Elements{i}, Initial, Replace);
else
Replace = sprintf('xdot(%u)', j);
Elements{i} = strrep(Elements(i), SpeciesNames{j}, Replace);
end;
end;
end;
% put the formula back together
formula = '';
for i = 1:NoElements-1
formula = strcat(formula, Elements{i}, Divider(i));
end;
formula = strcat(formula, Elements{NoElements});
%--------------------------------------------------------------------------
% function to put rate assignments in appropriate order
% eg
% xdot(2) = 3
% xdot(1) = 3* xdot(2)
function Output = OrderArray(Array)
% if (length(Array) > 9)
% error('cannot deal with more than 10 species yet');
% end;
NewArrayIndex = 1;
TempArrayIndex = 1;
TempArray2Index = 1;
NumberInNewArray = 0;
NumberInTempArray = 0;
NumberInTempArray2 = 0;
TempArray2 = {};
% put any formula withoutxdot on RHS into new array
for i = 1:length(Array)
if (length(strfind(Array{i}, 'xdot'))> 2)
% xdot occurs more than once
% put in temp array
TempArray{TempArrayIndex} = Array{i};
TempArrayIndices(TempArrayIndex) = i;
% update
TempArrayIndex = TempArrayIndex + 1;
NumberInTempArray = NumberInTempArray + 1;
elseif (length(strfind(Array{i}, 'xdot'))==2)
% if it is piecewise it will be of form if x xdot() = else xdot()
% so xdot will occur twice but not necessarily on RHS
if (length(strfind(Array{i}, 'if (')) == 1 ...
&& strfind(Array{i}, 'if (') < 3)
% put in New array
NewArray{NewArrayIndex} = Array{i};
NewArrayIndices(NewArrayIndex) = i;
% update
NewArrayIndex = NewArrayIndex + 1;
NumberInNewArray = NumberInNewArray + 1;
else
TempArray{TempArrayIndex} = Array{i};
TempArrayIndices(TempArrayIndex) = i;
% update
TempArrayIndex = TempArrayIndex + 1;
NumberInTempArray = NumberInTempArray + 1;
% error('cannot deal with this function %s', Array{i});
end;
else
% no xdot on RHS
% put in New array
NewArray{NewArrayIndex} = Array{i};
NewArrayIndices(NewArrayIndex) = i;
% update
NewArrayIndex = NewArrayIndex + 1;
NumberInNewArray = NumberInNewArray + 1;
end;
end;
while (NumberInTempArray > 0)
% go thru temp array
for i = 1:NumberInTempArray
% find positions of xdot
Xdot = strfind(TempArray{i}, 'xdot');
% check whether indices of xdot on RHS are already in new array
Found = 0;
for j = 2:length(Xdot)
Number = str2num(TempArray{i}(Xdot(j)+5));
if (sum(ismember(NewArrayIndices, Number)) == 1)
Found = 1;
else
Found = 0;
end;
end;
% if all have been found put in new array
if (Found == 1)
% put in New array
NewArray{NewArrayIndex} = TempArray{i};
NewArrayIndices(NewArrayIndex) = TempArrayIndices(i);
% update
NewArrayIndex = NewArrayIndex + 1;
NumberInNewArray = NumberInNewArray + 1;
else
% put in temp array2
TempArray2{TempArray2Index} = TempArray{i};
TempArray2Indices(TempArray2Index) = TempArrayIndices(i);
% update
TempArray2Index = TempArray2Index + 1;
NumberInTempArray2 = NumberInTempArray2 + 1;
end;
end;
%Realloctate temp arrays
if (~isempty(TempArray2))
TempArray = TempArray2;
TempArrayIndices = TempArray2Indices;
NumberInTempArray = NumberInTempArray2;
TempArray2Index = 1;
NumberInTempArray2 = 0;
else
NumberInTempArray = 0;
end;
end; % of while NumInTempArray > 0
Output = NewArray;
function output = WriteOutPiecewise(var, formula)
Arguments = DealWithPiecewise(formula);
if (strfind('piecewise', Arguments{2}))
error('Cant do this yet!');
end;
Text1{1} = sprintf('\n\tif (%s)', Arguments{2});
if (matchFunctionName(Arguments{1}, 'piecewise'))
Text1{2} = WriteOutPiecewise(var, Arguments{1});
else
Text1{2} = sprintf('\n\t\t%s = %s;', var, Arguments{1});
end;
Text1{3} = sprintf('\n\telse');
if (matchFunctionName('piecewise', Arguments{3}))
Text1{4} = WriteOutPiecewise(var, Arguments{3});
else
Text1{4} = sprintf('\n\t\t%s = %s;\n\tend;\n', var, Arguments{3});
end;
output = Text1{1};
for (i = 2:4)
output = strcat(output, Text1{i});
end;
SBMLToolbox-4.1.0/toolbox/Simulation/WriteEventHandlerFunction.m 0000644 0000000 0000000 00000027620 11703262256 023421 0 ustar root root function WriteEventHandlerFunction(SBMLModel, Name)
% WriteEventHandlerFunction(SBMLModel, name)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. name, a string representing the name of the ode function being used
%
% Outputs
%
% 1. a file 'name_events.m' defining a function that tests whether events
% have been triggered
% (for use with the event option of MATLABs ode solvers)
%
% *NOTE:* This function is called from WriteODEFunction when a model with
% events is encountered.
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('WriteEventHandlerFunction(SBMLModel)\n%s', 'argument must be an SBMLModel structure');
end;
% -------------------------------------------------------------
% get information from the model
[ParameterNames, ParameterValues] = GetAllParametersUnique(SBMLModel);
[VarParams, VarInitValues] = GetVaryingParameters(SBMLModel);
NumberParams = length(VarParams);
[SpeciesNames, SpeciesValues] = GetSpecies(SBMLModel);
NumberSpecies = length(SBMLModel.species);
VarNames = [SpeciesNames, VarParams];
VarValues = [SpeciesValues, VarInitValues];
NumberVars = NumberSpecies + NumberParams;
arrayVariable = 'var1';
if ismember(arrayVariable, VarNames)
arrayVariable = 'xyz_var1';
end;
if ismember(arrayVariable, VarNames)
error ('Unbelievable clash of variable names between model and event handling functions');
end;
%---------------------------------------------------------------
% get the name/id of the model
% Name = '';
% if (SBMLModel.SBML_level == 1)
% Name = SBMLModel.name;
% else
% if (isempty(SBMLModel.id))
% Name = SBMLModel.name;
% else
% Name = SBMLModel.id;
% end;
% end;
% version 2.0.2 adds the time_symbol field to the model structure
% need to check that it exists
if (isfield(SBMLModel, 'time_symbol'))
if (~isempty(SBMLModel.time_symbol))
timeVariable = SBMLModel.time_symbol;
else
timeVariable = 'time';
end;
else
timeVariable = 'time';
end;
if (min(VarValues) == 0)
degree = 1;
else
degree = round(log10(min(VarValues)));
end;
tol = 1e-10 * power(10, degree);
Name = strcat(Name, '_events');
fileName = strcat(Name, '.m');
%--------------------------------------------------------------------
% open the file for writing
fileID = fopen(fileName, 'w');
% write the function declaration
fprintf(fileID, 'function [value,isterminal,direction] = %s(%s, %s)\n', ...
Name, timeVariable, arrayVariable);
% need to add comments to output file
fprintf(fileID, '%% function %s takes\n', Name);
fprintf(fileID, '%%\n');
fprintf(fileID, '%%\t1) current elapsed time of integration\n');
fprintf(fileID, '%%\t2) vector of current output values\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% and stops the integration if the value calculated is zero\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% %s should be used with MATLABs odeN functions as \n', Name);
fprintf(fileID, '%% the events function option\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%%\ti.e. options = odeset(''Events'', @%s)\n', Name);
fprintf(fileID, '%%\n');
fprintf(fileID, '%%\t[t,x] = ode23(@function, [0, t_end], function, options)\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '\n');
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% constant for use with < or >\neps = %g;\n\n', tol);
% write the parameter values
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% parameter values\n\n');
for i = 1:length(ParameterNames)
fprintf(fileID, '%s = %g;\n', ParameterNames{i}, ParameterValues(i));
end;
% write the current species concentrations
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% floating variables\n');
for i = 1:NumberVars
fprintf(fileID, '%s = %s(%u);\n', VarNames{i}, arrayVariable, i);
end;
% write the events
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% events - point at which value will return 0\n\n');
numOfFunctions = 0 ;
fprintf(fileID, 'value = [');
for i = 1:length(SBMLModel.event)
[Funcs, Ignored] = ParseTriggerFunction(SBMLModel.event(i).trigger,[]);
for j = 1:length(Funcs)
numOfFunctions = numOfFunctions + 1;
%fprintf(1, '%s\n', Funcs{j});
if ((i > 1) || (j > 1))
fprintf(fileID, ', %s', Funcs{j});
else
fprintf(fileID, '%s', Funcs{j});
end;
end;
end;
fprintf(fileID, '];\n');
fprintf(fileID, '\n%%stop integration\n');
fprintf(fileID, 'isterminal = [1');
for i = 2:numOfFunctions
fprintf(fileID, ', 1');
end;
fprintf(fileID, '];\n\n');
% this may depend on model
fprintf(fileID, '%%set direction at which event should be looked for\n');
fprintf(fileID, 'direction = [-1');
for i = 2:numOfFunctions
fprintf(fileID, ', -1');
end;
fprintf(fileID, '];\n\n');
fclose(fileID);
%--------------------------------------------------------------------------
% other functions
function [FunctionStrings, Trigger] = ParseTriggerFunction(Trigger, FunctionStrings)
%fprintf(1,'parsing: %s\n', Trigger);
if (isstruct(Trigger))
Trigger = LoseLeadingWhiteSpace(Trigger.math);
else
Trigger = LoseLeadingWhiteSpace(Trigger);
end;
% trigger has the form function(function(variable,constant), function(v,c))
% need to isolate each
OpenBracket = strfind(Trigger, '(');
Func = Trigger(1:OpenBracket-1);
Trigger = Trigger(OpenBracket+1:length(Trigger));
%fprintf(1,'got function: %s\n', Func);
switch (Func)
case 'and'
[FunctionStrings, Trigger] = ParseTwoArgumentsAndClose(Trigger, FunctionStrings);
case 'or'
[FunctionStrings, Trigger] = ParseTwoArgumentsAndClose(Trigger, FunctionStrings);
case 'lt'
[left, right, Trigger] = ParseTwoNumericArgumentsAndClose(Trigger);
FunctionString = sprintf('(%s) - (%s) + eps', left, right);
FunctionStrings{length(FunctionStrings)+1} = FunctionString;
case 'le'
[left, right, Trigger] = ParseTwoNumericArgumentsAndClose(Trigger);
FunctionString = sprintf('(%s) - (%s) + eps', left, right);
FunctionStrings{length(FunctionStrings)+1} = FunctionString;
case 'gt'
[left, right, Trigger] = ParseTwoNumericArgumentsAndClose(Trigger);
FunctionString = sprintf('(%s) - (%s) + eps', right, left);
FunctionStrings{length(FunctionStrings)+1} = FunctionString;
case 'ge'
[left, right, Trigger] = ParseTwoNumericArgumentsAndClose(Trigger);
FunctionString = sprintf('(%s) - (%s) + eps', right, left);
FunctionStrings{length(FunctionStrings)+1} = FunctionString;
otherwise
error(sprintf('unrecognised function %s in trigger', Func));
end;
function [FunctionStrings, Trigger] = ParseTwoArgumentsAndClose(Trigger, FunctionStrings)
%fprintf(1, 'In ParseTwoArgumentsAndClose parsing: %s\n', Trigger);
[FunctionStrings, Trigger] = ParseTriggerFunction(Trigger, FunctionStrings);
comma = strfind(Trigger, ',');
[FunctionStrings, Trigger] = ParseTriggerFunction(Trigger(comma+1:length(Trigger)), FunctionStrings);
closeBracket = strfind(Trigger, ')');
Trigger = Trigger(closeBracket+1:length(Trigger));
function [left, right, Trigger] = ParseTwoNumericArgumentsAndClose(Trigger)
[left, Trigger] = ParseNumericFunction(Trigger);
comma = strfind(Trigger, ',');
[right, Trigger] = ParseNumericFunction(Trigger(comma+1:length(Trigger)));
closeBracket = strfind(Trigger, ')');
Trigger = Trigger(closeBracket+1:length(Trigger));
function [func, Trigger] = ParseNumericFunction(Trigger)
%fprintf(1,'In ParseNumericFunction parsing: %s\n', Trigger);
openBracket = strfind(Trigger, '(');
comma = strfind(Trigger, ',');
closeBracket = strfind(Trigger, ')');
if (isempty(openBracket) || (length(comma)~=0 && comma(1) < openBracket(1)) ...
|| (length(closeBracket)~=0 && closeBracket(1) < openBracket(1)))
% simple case where no nesting
if (length(comma)~=0 && comma(1) < closeBracket(1))
% terminated by comma
func = Trigger(1:comma(1)-1);
Trigger = Trigger(comma(1):length(Trigger));
else
if (length(closeBracket)~=0)
% terminated by close bracket
func = Trigger(1:closeBracket(1)-1);
Trigger=Trigger(closeBracket(1):length(Trigger));
else
func=Trigger;
Trigger='';
end;
end;
else
% nested case
func = Trigger(1:openBracket-1);
Trigger = Trigger(openBracket+1:length(Trigger));
[subfunc, Trigger] = ParseNumericFunction(Trigger);
func = sprintf('%s(%s', func, subfunc);
Trigger = LoseLeadingWhiteSpace(Trigger);
comma = strfind(Trigger, ',');
while (length(comma) ~= 0 && comma(1) == 1)
[subfunc, Trigger] = ParseNumericFunction(Trigger);
func = sprintf('%s,%s', func, subfunc);
Trigger = LoseLeadingWhiteSpace(Trigger);
comma = strfind(Trigger, ',');
end
func=sprintf('%s)',func);
closeBracket=strfind(Trigger, ')');
Trigger = Trigger(closeBracket(1)+1:length(Trigger));
end;
%fprintf(1,'at end of ParseNumericFunction function: %s\n', func);
%fprintf(1,'at end of ParseNumericFunction parsing: %s\n', Trigger);
function y = LoseLeadingWhiteSpace(charArray)
% LoseLeadingWhiteSpace(charArray) takes an array of characters
% and returns the array with any leading white space removed
%
%----------------------------------------------------------------
% EXAMPLE:
% y = LoseLeadingWhiteSpace(' example')
% y = 'example'
%
%------------------------------------------------------------
% check input is an array of characters
if (~ischar(charArray))
error('LoseLeadingWhiteSpace(input)\n%s', 'input must be an array of characters');
end;
%-------------------------------------------------------------
% get the length of the array
NoChars = length(charArray);
%-------------------------------------------------------------
% determine the number of leading spaces
% create an array that indicates whether the elements of charArray are
% spaces
% e.g. WSpace = isspace(' v b') = [1, 1, 0, 1, 0]
WSpace = isspace(charArray);
% find the indices of elements that are 0
% no spaces equals the index of the first zero minus 1
% e.g. Zeros = find(WSpace == 0) = [3,5]
% NoSpaces = 2;
Zeros = find(WSpace == 0);
if (isempty(Zeros))
NoSpaces = 0;
else
NoSpaces = Zeros(1)-1;
end;
%-----------------------------------------------------------
% if there is leading white spaces rewrite the array to leave these out
if (NoSpaces > 0)
for i = 1: NoChars-NoSpaces
y(i) = charArray(i+NoSpaces);
end;
else
y = charArray;
end;
SBMLToolbox-4.1.0/toolbox/Simulation/WriteEventAssignmentFunction.m 0000644 0000000 0000000 00000021615 11703262256 024152 0 ustar root root function WriteEventAssignmentFunction(SBMLModel, Name)
% WriteEventAssignmentFunction(SBMLModel, name)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. name, a string representing the name of the ode function being used
%
% Outputs
%
% 1. a file 'name_eventAssign.m' defining a function that assigns values following an event
% (for use with the event option of MATLABs ode solvers)
%
% *NOTE:* This function is called from WriteODEFunction when a model with
% events is encountered.
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('WriteEventAssignmentFunction(SBMLModel)\n%s', 'argument must be an SBMLModel structure');
end;
% -------------------------------------------------------------
% get information from the model
% get information from the model
[ParameterNames, ParameterValues] = GetAllParametersUnique(SBMLModel);
[VarParams, VarInitValues] = GetVaryingParameters(SBMLModel);
NumberParams = length(VarParams);
[SpeciesNames, SpeciesValues] = GetSpecies(SBMLModel);
NumberSpecies = length(SBMLModel.species);
VarNames = [SpeciesNames, VarParams];
VarValues = [SpeciesValues, VarInitValues];
NumberVars = NumberSpecies + NumberParams;
NumFuncs = length(SBMLModel.functionDefinition);
Species = AnalyseSpecies(SBMLModel);
Params = AnalyseVaryingParameters(SBMLModel);
%---------------------------------------------------------------
% get the name/id of the model
% Name = '';
% if (SBMLModel.SBML_level == 1)
% Name = SBMLModel.name;
% else
% if (isempty(SBMLModel.id))
% Name = SBMLModel.name;
% else
% Name = SBMLModel.id;
% end;
% end;
% version 2.0.2 adds the time_symbol field to the model structure
% need to check that it exists
if (isfield(SBMLModel, 'time_symbol'))
if (~isempty(SBMLModel.time_symbol))
timeVariable = SBMLModel.time_symbol;
else
timeVariable = 'time';
end;
else
timeVariable = 'time';
end;
Name = strcat(Name, '_eventAssign');
fileName = strcat(Name, '.m');
%--------------------------------------------------------------------
% open the file for writing
fileID = fopen(fileName, 'w');
% write the function declaration
fprintf(fileID, 'function Values = %s(%s, VarValues, eventNo)\n', Name, timeVariable);
% need to add comments to output file
fprintf(fileID, '%% function %s takes\n', Name);
fprintf(fileID, '%%\n');
fprintf(fileID, '%% current simulation time\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% vector of current species values\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% the number of the event that has triggered\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% and returns the values assigned by an event assignment\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '%% %s should be used with MATLABs odeN functions\n', Name);
fprintf(fileID, '%% and called to reinitialise values when an event has stopped the integration\n');
fprintf(fileID, '%%\n');
fprintf(fileID, '\n');
% write the parameter values
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% parameter values\n\n');
for i = 1:length(ParameterNames)
fprintf(fileID, '%s = %g;\n', ParameterNames{i}, ParameterValues(i));
end;
% write the current species concentrations
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% floating variables\n');
for i = 1:NumberVars
fprintf(fileID, '%s = VarValues(%u);\n', VarNames{i}, i);
end;
% write the event assignments
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% event assignments\n\n');
fprintf(fileID, 'switch(eventNo)\n');
for i = 1:length(SBMLModel.event)
fprintf(fileID, '\tcase %u\n', i);
for j = 1:length(SBMLModel.event(i).eventAssignment)
% if a variable being assigned occurs in the math of a subsequent event
% assignment the value should be the original
assignment = SBMLModel.event(i).eventAssignment(j).math;
for s=1:NumberVars
if (~isempty(matchName(SBMLModel.event(i).eventAssignment(j).math, VarNames{s})))
speciesV = sprintf('VarValues(%u)', s);
assignment = strrep(assignment, VarNames{s}, speciesV);
end;
end;
fprintf(fileID, '\t\t%s = %s;\n', SBMLModel.event(i).eventAssignment(j).variable, assignment);
end;
end;
fprintf(fileID, '\totherwise\nend;\n');
% write assignment rules
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% assignment rules\n');
AssignRules = Model_getListOfAssignmentRules(SBMLModel);
for i = 1:length(AssignRules)
rule = WriteRule(AssignRules(i));
fprintf(fileID, '%s\n', rule);
end;
% write algebraic rules
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% algebraic rules\n');
for i = 1:NumberSpecies
if (Species(i).ConvertedToAssignRule == 1)
fprintf(fileID, '%s = %s;\n', char(Species(i).Name), Species(i).ConvertedRule);
end;
end;
for i = 1:NumberParams
if (Params(i).ConvertedToAssignRule == 1)
fprintf(fileID, '%s = %s;\n', char(Params(i).Name), Params(i).ConvertedRule);
end;
end;
% output values
fprintf(fileID, '\n%%--------------------------------------------------------\n');
fprintf(fileID, '%% output values\n\n');
for i = 1:NumberVars
fprintf(fileID, 'Values(%u) = %s;\n', i, VarNames{i});
end;
% put in any function definitions
if (NumFuncs > 0)
fprintf(fileID, '\n\n%%---------------------------------------------------\n%%Function definitions\n\n');
for i = 1:NumFuncs
Name = SBMLModel.functionDefinition(i).id;
Elements = GetArgumentsFromLambdaFunction(SBMLModel.functionDefinition(i).math);
fprintf(fileID, '%%function %s\n\n', Name);
fprintf(fileID, 'function returnValue = %s(', Name);
for j = 1:length(Elements)-1
if (j == length(Elements)-1)
fprintf(fileID, '%s', Elements{j});
else
fprintf(fileID, '%s, ', Elements{j});
end;
end;
fprintf(fileID, ')\n\nreturnValue = %s;\n\n\n', Elements{end});
end;
end;
fclose(fileID);
%--------------------------------------------------------------------------
function y = WriteRule(SBMLRule)
y = '';
switch (SBMLRule.typecode)
case 'SBML_ASSIGNMENT_RULE'
if (isempty(matchFunctionName(char(SBMLRule.formula), 'piecewise')))
y = sprintf('%s = %s;', SBMLRule.variable, SBMLRule.formula);
else
var = sprintf('%s', SBMLRule.variable);
y = WriteOutPiecewise(var, char(SBMLRule.formula));
end;
case 'SBML_SPECIES_CONCENTRATION_RULE'
y = sprintf('%s = %s;', SBMLRule.species, SBMLRule.formula);
case 'SBML_PARAMETER_RULE'
y = sprintf('%s = %s;', SBMLRule.name, SBMLRule.formula);
case 'SBML_COMPARTMENT_VOLUME_RULE'
y = sprintf('%s = %s;', SBMLRule.compartment, SBMLRule.formula);
otherwise
error('No assignment rules');
end;
%------------------------------------------------------------------------------
function output = WriteOutPiecewise(var, formula)
Arguments = DealWithPiecewise(formula);
if (strfind('piecewise', Arguments{2}))
error('Cant do this yet!');
end;
Text1{1} = sprintf('\n\tif (%s)', Arguments{2});
if (matchFunctionName(Arguments{1}, 'piecewise'))
Text1{2} = WriteOutPiecewise(var, Arguments{1});
else
Text1{2} = sprintf('\n\t\t%s = %s;', var, Arguments{1});
end;
Text1{3} = sprintf('\n\telse');
if (strfind('piecewise', Arguments{3}))
Text1{4} = WriteOutPiecewise(var, Arguments{3});
else
Text1{4} = sprintf('\n\t\t%s = %s;\n\tend;\n', var, Arguments{3});
end;
output = Text1{1};
for (i = 2:4)
output = strcat(output, Text1{i});
end;
SBMLToolbox-4.1.0/toolbox/Simulation/Test/ 0000755 0000000 0000000 00000000000 11704572220 017047 5 ustar root root SBMLToolbox-4.1.0/toolbox/Simulation/Test/test_sim.m 0000644 0000000 0000000 00000004406 11703267632 021067 0 ustar root root function y = test_sim()
%
test = 0;
Totalfail = 0;
if isBindingInstalled() == 1
test = test + 6;
fail = TestAnalyseSpecies;
if (fail > 0)
disp('AnalyseSpecies failed');
end;
Totalfail = Totalfail + fail;
test = test + 4;
fail = TestDealWithPiecewise;
if (fail > 0)
disp('DealWithPiecewise failed');
end;
Totalfail = Totalfail + fail;
test = test + 3;
fail = TestGetArgumentsFromLambdaFunction;
if (fail > 0)
disp('GetArgumentsFromLambdaFunction failed');
end;
Totalfail = Totalfail + fail;
test = test + 1;
fail = TestAnalyseVaryingParameters;
if (fail > 0)
disp('AnalyseSVaryingParameters failed');
end;
Totalfail = Totalfail + fail;
test = test + 1;
fail = test_fbc_sim;
if (fail > 0)
disp('test_fbc_sim failed');
end;
Totalfail = Totalfail + fail;
disp(sprintf('Number tests: %d', test));
disp(sprintf('Number fails: %d', Totalfail));
disp(sprintf('Pass rate: %d%%', ((test-Totalfail)/test)*100));
else
disp('LibSBML binding not installed - no tests could be run');
end;
y = Totalfail;
SBMLToolbox-4.1.0/toolbox/Simulation/Test/test_fbc_sim.m 0000644 0000000 0000000 00000010653 11704012540 021665 0 ustar root root function y = test_fbc_sim()
%
fbcBindingEnabled = 1;
if isBindingFbcEnabled() == 0
fbcBindingEnabled = 0;
end;
if (fbcBindingEnabled == 0)
y = 0;
else
fail = 0;
m = TranslateSBML('../../fbc_package/test/test-data/fbc.xml');
output_2(1).Name = {'S'};
output_2(1).constant = 0;
output_2(1).boundaryCondition = 0;
output_2(1).initialValue = 1;
output_2(1).hasAmountOnly = 0;
output_2(1).isConcentration = 0;
output_2(1).compartment = 'c';
output_2(1).ChangedByReaction = 0;
output_2(1).KineticLaw = '';
output_2(1).ChangedByRateRule = 0;
output_2(1).RateRule = '';
output_2(1).ChangedByAssignmentRule = 0;
output_2(1).AssignmentRule = '';
output_2(1).InAlgebraicRule = 0;
output_2(1).AlgebraicRule = '';
output_2(1).ConvertedToAssignRule = 0;
output_2(1).ConvertedRule = '';
output_2(2).Name = {'S1'};
output_2(2).constant = 0;
output_2(2).boundaryCondition = 0;
output_2(2).initialValue = 1;
output_2(2).hasAmountOnly = 0;
output_2(2).isConcentration = 0;
output_2(2).compartment = 'c';
output_2(2).ChangedByReaction = 1;
output_2(2).KineticLaw = {' - (k_R1*S1)'};
output_2(2).ChangedByRateRule = 0;
output_2(2).RateRule = '';
output_2(2).ChangedByAssignmentRule = 0;
output_2(2).AssignmentRule = '';
output_2(2).InAlgebraicRule = 0;
output_2(2).AlgebraicRule = '';
output_2(2).ConvertedToAssignRule = 0;
output_2(2).ConvertedRule = '';
output_2(3).Name = {'S2'};
output_2(3).constant = 0;
output_2(3).boundaryCondition = 0;
output_2(3).initialValue = 1;
output_2(3).hasAmountOnly = 0;
output_2(3).isConcentration = 0;
output_2(3).compartment = 'c';
output_2(3).ChangedByReaction = 1;
output_2(3).KineticLaw = {' + (k_R1*S1) - (k_R2*S2)'};
output_2(3).ChangedByRateRule = 0;
output_2(3).RateRule = '';
output_2(3).ChangedByAssignmentRule = 0;
output_2(3).AssignmentRule = '';
output_2(3).InAlgebraicRule = 0;
output_2(3).AlgebraicRule = '';
output_2(3).ConvertedToAssignRule = 0;
output_2(3).ConvertedRule = '';
output_2(4).Name = {'S3'};
output_2(4).constant = 0;
output_2(4).boundaryCondition = 0;
output_2(4).initialValue = 1;
output_2(4).hasAmountOnly = 0;
output_2(4).isConcentration = 0;
output_2(4).compartment = 'c';
output_2(4).ChangedByReaction = 0;
output_2(4).KineticLaw = '';
output_2(4).ChangedByRateRule = 0;
output_2(4).RateRule = '';
output_2(4).ChangedByAssignmentRule = 0;
output_2(4).AssignmentRule = '';
output_2(4).InAlgebraicRule = 0;
output_2(4).AlgebraicRule = '';
output_2(4).ConvertedToAssignRule = 0;
output_2(4).ConvertedRule = '';
output_2(5).Name = {'S4'};
output_2(5).constant = 0;
output_2(5).boundaryCondition = 0;
output_2(5).initialValue = 1;
output_2(5).hasAmountOnly = 0;
output_2(5).isConcentration = 0;
output_2(5).compartment = 'c';
output_2(5).ChangedByReaction = 1;
output_2(5).KineticLaw = {' + (k_R2*S2)'};
output_2(5).ChangedByRateRule = 0;
output_2(5).RateRule = '';
output_2(5).ChangedByAssignmentRule = 0;
output_2(5).AssignmentRule = '';
output_2(5).InAlgebraicRule = 0;
output_2(5).AlgebraicRule = '';
output_2(5).ConvertedToAssignRule = 0;
output_2(5).ConvertedRule = '';
fail = fail + TestFunction('AnalyseSpecies', 1, 1, m, output_2);
y = fail;
end;
SBMLToolbox-4.1.0/toolbox/Simulation/Test/TestGetArgumentsFromLambdaFunction.m 0000644 0000000 0000000 00000003351 11703262256 026133 0 ustar root root function fail = TestGetArgumentsFromLambdaFunction
%
input1 = 'lambda(x, x+0.5)';
output1 = {'x', 'x+0.5'};
input2 = 'lambda(x, y, x + y)';
output2 = {'x', 'y', 'x+y'};
fail = TestFunction('GetArgumentsFromLambdaFunction', 1, 1, input1, output1);
fail = fail + TestFunction('GetArgumentsFromLambdaFunction', 1, 1, input2, output2);
m = TranslateSBML('../../Test/test-data/l2v1-all.xml');
input = m.functionDefinition.math;
output = {'x', 'power(x,3)'};
fail = fail + TestFunction('GetArgumentsFromLambdaFunction', 1, 1, input, output);
SBMLToolbox-4.1.0/toolbox/Simulation/Test/TestDealWithPiecewise.m 0000644 0000000 0000000 00000003725 11703262256 023437 0 ustar root root function fail = TestDealWithPiecewise
%
input = 'piecewise(le(s2,4),1.5,0.05)';
output = {'le(s2,4)', '1.5', '0.05'};
fail = TestFunction('DealWithPiecewise', 1, 1, input, output);
input = 'piecewise(piecewise(1, a<5, 2), 3, 4)';
output= {'piecewise(1,a<5,2)', '3', '4'};
fail = fail + TestFunction('DealWithPiecewise', 1, 1, input, output);
m = TranslateSBML('../../Test/test-data/piecewise.xml');
input = m.reaction.kineticLaw.math;
output = {'p1', 'leq(kf,4)', 'p2'};
fail = fail + TestFunction('DealWithPiecewise', 1, 1, input, output);
m = TranslateSBML('../../Test/test-data/nestedPiecewise.xml');
input = m.reaction.kineticLaw.math;
output = {'piecewise(p1,leq(kf,4),p2)', 'leq(kf,4)', 'p2'};
fail = fail + TestFunction('DealWithPiecewise', 1, 1, input, output);
SBMLToolbox-4.1.0/toolbox/Simulation/Test/TestAnalyseVaryingParameters.m 0000644 0000000 0000000 00000007501 11703262256 025054 0 ustar root root function fail = TestAnalyseVaryingParameters
%
m = TranslateSBML('../../Test/test-data/varyingParameters.xml');
output_1(1).Name = {'v1'};
output_1(1).initialValue = 4;
output_1(1).ChangedByRateRule = 0;
output_1(1).RateRule = '';
output_1(1).ChangedByAssignmentRule = 1;
output_1(1).AssignmentRule = {'k1+k'};
output_1(1).InAlgebraicRule = 0;
output_1(1).AlgebraicRule = '';
output_1(1).ConvertedToAssignRule = 0;
output_1(1).ConvertedRule = '';
output_1(2).Name = {'v2'};
output_1(2).initialValue = 4;
output_1(2).ChangedByRateRule = 1;
output_1(2).RateRule = {'v1/t'};
output_1(2).ChangedByAssignmentRule = 0;
output_1(2).AssignmentRule = '';
output_1(2).InAlgebraicRule = 1;
output_1(2).AlgebraicRule = {{'v3+k1-v2'}};
output_1(2).ConvertedToAssignRule = 0;
output_1(2).ConvertedRule = '';
output_1(3).Name = {'v3'};
output_1(3).initialValue = 4;
output_1(3).ChangedByRateRule = 0;
output_1(3).RateRule = '';
output_1(3).ChangedByAssignmentRule = 0;
output_1(3).AssignmentRule = '';
output_1(3).InAlgebraicRule = 1;
output_1(3).AlgebraicRule = {{'v3+k1-v2'}};
output_1(3).ConvertedToAssignRule = 1;
output_1(3).ConvertedRule = '-k1+v2';
fail = TestFunction('AnalyseVaryingParameters', 1, 1, m, output_1);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
output_2(1).Name = {'p'};
output_2(1).initialValue = 2;
output_2(1).ChangedByRateRule = 0;
output_2(1).RateRule = '';
output_2(1).ChangedByAssignmentRule = 0;
output_2(1).AssignmentRule = '';
output_2(1).InAlgebraicRule = 0;
output_2(1).AlgebraicRule = '';
output_2(1).ConvertedToAssignRule = 0;
output_2(1).ConvertedRule = '';
output_2(2).Name = {'p1'};
output_2(2).initialValue = 4;
output_2(2).ChangedByRateRule = 0;
output_2(2).RateRule = '';
output_2(2).ChangedByAssignmentRule = 0;
output_2(2).AssignmentRule = '';
output_2(2).InAlgebraicRule = 0;
output_2(2).AlgebraicRule = '';
output_2(2).ConvertedToAssignRule = 0;
output_2(2).ConvertedRule = '';
output_2(3).Name = {'p2'};
output_2(3).initialValue = 4;
output_2(3).ChangedByRateRule = 0;
output_2(3).RateRule = '';
output_2(3).ChangedByAssignmentRule = 1;
output_2(3).AssignmentRule = {'x*p3'};
output_2(3).InAlgebraicRule = 0;
output_2(3).AlgebraicRule = '';
output_2(3).ConvertedToAssignRule = 0;
output_2(3).ConvertedRule = '';
output_2(4).Name = {'p3'};
output_2(4).initialValue = 2;
output_2(4).ChangedByRateRule = 1;
output_2(4).RateRule = {'p1/p'};
output_2(4).ChangedByAssignmentRule = 0;
output_2(4).AssignmentRule = '';
output_2(4).InAlgebraicRule = 0;
output_2(4).AlgebraicRule = '';
output_2(4).ConvertedToAssignRule = 0;
output_2(4).ConvertedRule = '';
fail = fail + TestFunction('AnalyseVaryingParameters', 1, 1, m, output_2);
SBMLToolbox-4.1.0/toolbox/Simulation/Test/TestAnalyseSpecies.m 0000644 0000000 0000000 00000025572 11704013776 023016 0 ustar root root function fail = TestAnalyseSpecies
%
m = TranslateSBML('../../Test/test-data/l1v1.xml');
output_1(1).Name = {'S1'};
output_1(1).constant = 0;
output_1(1).boundaryCondition = 0;
output_1(1).initialValue = 1.5;
output_1(1).isConcentration = 0;
output_1(1).compartment = 'compartment';
output_1(1).ChangedByReaction = 1;
output_1(1).KineticLaw = {' - (k_1_R1*S1) + (k_2_R2*S2)'};
output_1(1).ChangedByRateRule = 0;
output_1(1).RateRule = '';
output_1(1).ChangedByAssignmentRule = 0;
output_1(1).AssignmentRule = '';
output_1(1).InAlgebraicRule = 0;
output_1(1).AlgebraicRule = '';
output_1(1).ConvertedToAssignRule = 0;
output_1(1).ConvertedRule = '';
output_1(2).Name = {'S2'};
output_1(2).constant = 0;
output_1(2).boundaryCondition = 0;
output_1(2).initialValue = 1.45;
output_1(2).isConcentration = 0;
output_1(2).compartment = 'compartment';
output_1(2).ChangedByReaction = 1;
output_1(2).KineticLaw = {' + (k_1_R1*S1) - (k_2_R2*S2)'};
output_1(2).ChangedByRateRule = 0;
output_1(2).RateRule = '';
output_1(2).ChangedByAssignmentRule = 0;
output_1(2).AssignmentRule = '';
output_1(2).InAlgebraicRule = 0;
output_1(2).AlgebraicRule = '';
output_1(2).ConvertedToAssignRule = 0;
output_1(2).ConvertedRule = '';
output_1(3).Name = {'x0'};
output_1(3).constant = 0;
output_1(3).boundaryCondition = 0;
output_1(3).initialValue = 1;
output_1(3).isConcentration = 0;
output_1(3).compartment = 'compartment';
output_1(3).ChangedByReaction = 0;
output_1(3).KineticLaw = '';
output_1(3).ChangedByRateRule = 0;
output_1(3).RateRule = '';
output_1(3).ChangedByAssignmentRule = 0;
output_1(3).AssignmentRule = '';
output_1(3).InAlgebraicRule = 0;
output_1(3).AlgebraicRule = '';
output_1(3).ConvertedToAssignRule = 0;
output_1(3).ConvertedRule = '';
fail = TestFunction('AnalyseSpecies', 1, 1, m, output_1);
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
output_2(1).Name = {'S1'};
output_2(1).constant = 0;
output_2(1).boundaryCondition = 0;
output_2(1).initialValue = 0.0300;
output_2(1).hasAmountOnly = 0;
output_2(1).isConcentration = 0;
output_2(1).compartment = 'compartment';
output_2(1).ChangedByReaction = 1;
output_2(1).KineticLaw = {' - (k*S1)'};
output_2(1).ChangedByRateRule = 0;
output_2(1).RateRule = '';
output_2(1).ChangedByAssignmentRule = 0;
output_2(1).AssignmentRule = '';
output_2(1).InAlgebraicRule = 1;
output_2(1).AlgebraicRule = {{'X+S1-S3'}};
output_2(1).ConvertedToAssignRule = 0;
output_2(1).ConvertedRule = '';
output_2(2).Name = {'S2'};
output_2(2).constant = 0;
output_2(2).boundaryCondition = 0;
output_2(2).initialValue = 0;
output_2(2).hasAmountOnly = 0;
output_2(2).isConcentration = 0;
output_2(2).compartment = 'compartment';
output_2(2).ChangedByReaction = 1;
output_2(2).KineticLaw = {' + (k*S1) - (k_R2*S2)'};
output_2(2).ChangedByRateRule = 0;
output_2(2).RateRule = '';
output_2(2).ChangedByAssignmentRule = 0;
output_2(2).AssignmentRule = '';
output_2(2).InAlgebraicRule = 1;
output_2(2).AlgebraicRule = {{'S2+S3-s2'}};
output_2(2).ConvertedToAssignRule = 0;
output_2(2).ConvertedRule = '';
output_2(3).Name = {'S3'};
output_2(3).constant = 0;
output_2(3).boundaryCondition = 0;
output_2(3).initialValue = 7;
output_2(3).hasAmountOnly = 0;
output_2(3).isConcentration = 1;
output_2(3).compartment = 'compartment';
output_2(3).ChangedByReaction = 0;
output_2(3).KineticLaw = '';
output_2(3).ChangedByRateRule = 0;
output_2(3).RateRule = '';
output_2(3).ChangedByAssignmentRule = 1;
output_2(3).AssignmentRule = {'s1+s2'};
output_2(3).InAlgebraicRule = 1;
output_2(3).AlgebraicRule = {{'X+S1-S3', 'S2+S3-s2'}};
output_2(3).ConvertedToAssignRule = 0;
output_2(3).ConvertedRule = '';
output_2(4).Name = {'X'};
output_2(4).constant = 0;
output_2(4).boundaryCondition = 0;
output_2(4).initialValue = 0;
output_2(4).hasAmountOnly = 0;
output_2(4).isConcentration = 0;
output_2(4).compartment = 'compartment';
output_2(4).ChangedByReaction = 0;
output_2(4).KineticLaw = '';
output_2(4).ChangedByRateRule = 0;
output_2(4).RateRule = '';
output_2(4).ChangedByAssignmentRule = 0;
output_2(4).AssignmentRule = '';
output_2(4).InAlgebraicRule = 1;
output_2(4).AlgebraicRule = {{'X+S1-S3'}};
output_2(4).ConvertedToAssignRule = 1;
output_2(4).ConvertedRule = '-S1+(s1+s2)';
output_2(5).Name = {'S4'};
output_2(5).constant = 0;
output_2(5).boundaryCondition = 0;
output_2(5).initialValue = 0;
output_2(5).hasAmountOnly = 0;
output_2(5).isConcentration = 0;
output_2(5).compartment = 'compartment';
output_2(5).ChangedByReaction = 1;
output_2(5).KineticLaw = {' + (k_R2*S2)'};
output_2(5).ChangedByRateRule = 0;
output_2(5).RateRule = '';
output_2(5).ChangedByAssignmentRule = 0;
output_2(5).AssignmentRule = '';
output_2(5).InAlgebraicRule = 0;
output_2(5).AlgebraicRule = '';
output_2(5).ConvertedToAssignRule = 0;
output_2(5).ConvertedRule = '';
fail = fail + TestFunction('AnalyseSpecies', 1, 1, m, output_2);
m = TranslateSBML('../../Test/test-data/rateRules.xml');
output(1).Name = {'s1'};
output(1).constant = 0;
output(1).boundaryCondition = 1;
output(1).initialValue = 0;
output(1).hasAmountOnly = 0;
output(1).isConcentration = 0;
output(1).compartment = 'c';
output(1).ChangedByReaction = 0;
output(1).KineticLaw = '';
output(1).ChangedByRateRule = 1;
output(1).RateRule = {'k'};
output(1).ChangedByAssignmentRule = 0;
output(1).AssignmentRule = '';
output(1).InAlgebraicRule = 0;
output(1).AlgebraicRule = '';
output(1).ConvertedToAssignRule = 0;
output(1).ConvertedRule = '';
output(2).Name = {'s2'};
output(2).constant = 0;
output(2).boundaryCondition = 0;
output(2).initialValue = 0;
output(2).hasAmountOnly = 0;
output(2).isConcentration = 0;
output(2).compartment = 'c';
output(2).ChangedByReaction = 1;
output(2).KineticLaw = {' + (kt*s1)'};
output(2).ChangedByRateRule = 0;
output(2).RateRule = '';
output(2).ChangedByAssignmentRule = 0;
output(2).AssignmentRule = '';
output(2).InAlgebraicRule = 0;
output(2).AlgebraicRule = '';
output(2).ConvertedToAssignRule = 0;
output(2).ConvertedRule = '';
fail = fail + TestFunction('AnalyseSpecies', 1, 1, m, output);
m = TranslateSBML('../../Test/test-data/l2v2-newComponents.xml');
output_3(1).Name = {'X0'};
output_3(1).speciesType='Glucose';
output_3(1).constant = 0;
output_3(1).boundaryCondition = 0;
output_3(1).initialValue = 0.026;
output_3(1).hasAmountOnly = 0;
output_3(1).isConcentration = 1;
output_3(1).compartment = 'cell';
output_3(1).ChangedByReaction = 1;
output_3(1).KineticLaw = {' - (v_in*X0/t_in)'};
output_3(1).ChangedByRateRule = 0;
output_3(1).RateRule = '';
output_3(1).ChangedByAssignmentRule = 0;
output_3(1).AssignmentRule = '';
output_3(1).InAlgebraicRule = 0;
output_3(1).AlgebraicRule = '';
output_3(1).ConvertedToAssignRule = 0;
output_3(1).ConvertedRule = '';
output_3(2).Name = {'X1'};
output_3(2).speciesType='';
output_3(2).constant = 0;
output_3(2).boundaryCondition = 0;
output_3(2).initialValue = 0.013;
output_3(2).hasAmountOnly = 0;
output_3(2).isConcentration = 1;
output_3(2).compartment = 'cell';
output_3(2).ChangedByReaction = 0;
output_3(2).KineticLaw = '';
output_3(2).ChangedByRateRule = 0;
output_3(2).RateRule = '';
output_3(2).ChangedByAssignmentRule = 0;
output_3(2).AssignmentRule = '';
output_3(2).InAlgebraicRule = 0;
output_3(2).AlgebraicRule = '';
output_3(2).ConvertedToAssignRule = 0;
output_3(2).ConvertedRule = '';
fail = fail + TestFunction('AnalyseSpecies', 1, 1, m, output_3);
m = TranslateSBML('../../Test/test-data/functionDefinition.xml');
output_4(1).Name = {'s'};
output_4(1).speciesType='';
output_4(1).constant = 0;
output_4(1).boundaryCondition = 0;
output_4(1).initialValue = 0;
output_4(1).hasAmountOnly = 0;
output_4(1).isConcentration = 0;
output_4(1).compartment = 'a';
output_4(1).ChangedByReaction = 1;
output_4(1).KineticLaw = {' - (s*fd(k_r,x)/t)'};
output_4(1).ChangedByRateRule = 0;
output_4(1).RateRule = '';
output_4(1).ChangedByAssignmentRule = 0;
output_4(1).AssignmentRule = '';
output_4(1).InAlgebraicRule = 0;
output_4(1).AlgebraicRule = '';
output_4(1).ConvertedToAssignRule = 0;
output_4(1).ConvertedRule = '';
fail = fail + TestFunction('AnalyseSpecies', 1, 1, m, output_4);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
output_5(1).Name = {'s'};
output_5(1).constant = 0;
output_5(1).boundaryCondition = 0;
output_5(1).initialValue = 0;
output_5(1).hasAmountOnly = 0;
output_5(1).isConcentration = 0;
output_5(1).compartment = 'a';
output_5(1).ChangedByReaction = 1;
output_5(1).KineticLaw = {' - (s*p) * (s*k_r/p)'};
output_5(1).ChangedByRateRule = 0;
output_5(1).RateRule = '';
output_5(1).ChangedByAssignmentRule = 0;
output_5(1).AssignmentRule = '';
output_5(1).InAlgebraicRule = 0;
output_5(1).AlgebraicRule = '';
output_5(1).ConvertedToAssignRule = 0;
output_5(1).ConvertedRule = '';
output_5(2).Name = {'s1'};
output_5(2).constant = 1;
output_5(2).boundaryCondition = 1;
output_5(2).initialValue = 2.2;
output_5(2).hasAmountOnly = 1;
output_5(2).isConcentration = 0;
output_5(2).compartment = 'a';
output_5(2).ChangedByReaction = 0;
output_5(2).KineticLaw = '';
output_5(2).ChangedByRateRule = 0;
output_5(2).RateRule = '';
output_5(2).ChangedByAssignmentRule = 0;
output_5(2).AssignmentRule = '';
output_5(2).InAlgebraicRule = 0;
output_5(2).AlgebraicRule = '';
output_5(2).ConvertedToAssignRule = 0;
output_5(2).ConvertedRule = '';
output_5(3).Name = {'s2'};
output_5(3).constant = 0;
output_5(3).boundaryCondition = 0;
output_5(3).initialValue = NaN;
output_5(3).hasAmountOnly = 0;
output_5(3).isConcentration = 1;
output_5(3).compartment = 'a';
output_5(3).ChangedByReaction = 1;
output_5(3).KineticLaw = {' + (s*k_r/p)'};
output_5(3).ChangedByRateRule = 0;
output_5(3).RateRule = '';
output_5(3).ChangedByAssignmentRule = 0;
output_5(3).AssignmentRule = '';
output_5(3).InAlgebraicRule = 0;
output_5(3).AlgebraicRule = '';
output_5(3).ConvertedToAssignRule = 0;
output_5(3).ConvertedRule = '';
fail = fail + TestFunction('AnalyseSpecies', 1, 1, m, output_5);
SBMLToolbox-4.1.0/toolbox/Simulation/SolveODEFunction.m 0000644 0000000 0000000 00000031435 11704550170 021442 0 ustar root root function [t, data] = SolveODEFunction(varargin)
% SolveODEFunction(varargin)
%
% Takes
%
% 1. a MATLAB_SBML model structure (required argument)
% 2. time limit (default = 10)
% 3. number of time steps (default lets the solver decide)
% 4. a flag to indicate whether to output species values in amount/concentration
% 1 amount, 0 concentration (default)
% 5. a flag to indicate whether to output the simulation data as
% a comma separated variable (csv) file
% 1 output 0 no output (default)
% 6. a filename (this is needed if WriteODEFunction was used with a
% filename)
%
% Returns
%
% 1. an array of time values
% 2. an array of the values of variables at each time point; species will
% be in concentration or amount as specified by input arguments
%
% Outputs
%
% 1. a file 'name.csv' with the data results (if the flag to output such a
% file is set to 1.
%
% *NOTE:* the results are generated using ode45 solver (MATLAB) or lsode
% (Octave)
%
% get inputs
if (nargin < 1)
error('SolveODEFunction(SBMLModel, ...)\n%s', 'must have at least one argument');
elseif (nargin > 6)
error('SolveODEFunction(SBMLModel, ...)\n%s', 'cannot have more than six arguments');
end;
% first argument
SBMLModel = varargin{1};
% check first input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('SolveODEFunction(SBMLModel)\n%s', 'first argument must be an SBMLModel structure');
end;
% put in default values
Time_limit = 10;
NoSteps = -1;
outAmt = 0;
outCSV = 1;
if (SBMLModel.SBML_level == 1)
Name = SBMLModel.name;
else
Name = SBMLModel.id;
end;
if (length(Name) > 63)
Name = Name(1:60);
end;
switch nargin
case 2
Time_limit = varargin{2};
case 3
Time_limit = varargin{2};
NoSteps = varargin{3};
case 4
Time_limit = varargin{2};
NoSteps = varargin{3};
outAmt = varargin{4};
case 5
Time_limit = varargin{2};
NoSteps = varargin{3};
outAmt = varargin{4};
outCSV = varargin{5};
case 6
Time_limit = varargin{2};
NoSteps = varargin{3};
outAmt = varargin{4};
outCSV = varargin{5};
if ~isempty(varargin{6})
Name = varargin{6};
end;
end;
% check values are sensible
if ((length(Time_limit) ~= 1) || (~isnumeric(Time_limit)))
error('SolveODEFunction(SBMLModel, time)\n%s', ...
'time must be a single real number indicating a time limit');
end;
if ((length(NoSteps) ~= 1) || (~isnumeric(NoSteps)))
error('SolveODEFunction(SBMLModel, time, steps)\n%s', ...
'steps must be a single real number indicating the number of steps');
end;
if (~isIntegralNumber(outAmt) || outAmt < 0 || outAmt > 1)
error('SolveODEFunction(SBMLModel, time, steps, concFlag)\n%s', ...
'concFlag must be 0 or 1');
end;
if (~isIntegralNumber(outCSV) || outCSV < 0 || outCSV > 1)
error('SolveODEFunction(SBMLModel, time, steps, concFlag, csvFlag)\n%s', ...
'csvFlag must be 0 or 1');
end;
if (~ischar(Name))
error('SolveODEFunction(SBMLModel, time, steps, concFlag, csvFlag, name)\n%s', ...
'name must be a string');
end;
fileName = strcat(Name, '.m');
%--------------------------------------------------------------
% check that a .m file of this name exists
% check whether file exists
fId = fopen(fileName);
if (fId == -1)
if (nargin < 6)
error('SolveODEFunction(SBMLModel)\n%s\n%s', ...
'You must use WriteODEFunction to output an ode function for this', ...
'model before using this function');
else
error('SolveODEFunction(SBMLModel)\n%s', 'You have not used this filename with WriteODEFunction');
end;
else
fclose(fId);
end;
%------------------------------------------------------------
% calculate values to use in iterative process
if (NoSteps ~= -1)
delta_t = Time_limit/NoSteps;
Time_span = [0:delta_t:Time_limit];
else
Time_span = [0, Time_limit];
end;
%--------------------------------------------------------------
% get variables from the model
[VarParams, VarInitValues] = GetVaryingParameters(SBMLModel);
NumberParams = length(VarParams);
[SpeciesNames, SpeciesValues] = GetSpecies(SBMLModel);
NumberSpecies = length(SBMLModel.species);
VarNames = [SpeciesNames, VarParams];
NumVars = NumberSpecies + NumberParams;
%---------------------------------------------------------------
% get function handle
fhandle = str2func(Name);
% get initial conditions
InitConds = feval(fhandle);
% set the tolerances of the odesolver to appropriate values
RelTol = min(InitConds(find(InitConds > 0))) * 1e-4;
if isempty(RelTol)
RelTol = 1e-6;
end;
if (RelTol > 1e-6)
RelTol = 1e-6;
end;
AbsTol = RelTol * 1e-4;
if exist('OCTAVE_VERSION')
[t, data] = runSimulationOctave(RelTol, AbsTol, fhandle, Time_span, InitConds);
else
if Model_getNumEvents(SBMLModel) == 0
[t, data] = runSimulation(RelTol, AbsTol, fhandle, Time_span, InitConds);
else
[t, data] = runEventSimulation(Name, NumVars, RelTol, AbsTol, fhandle, Time_span, InitConds);
end;
end;
if (outAmt == 1)
data = calculateAmount(SBMLModel, t, data);
end;
if (outCSV == 1)
outputData(t, data, Name, VarNames);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [TimeCourse, VarsCourse] = runSimulation(RelTol, AbsTol, ...
fhandle, Time_span, InitConds)
options = odeset('RelTol', RelTol, 'AbsTol', AbsTol);
[TimeCourse, VarsCourse] = runSimulator(options, fhandle, Time_span, InitConds);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [TimeCourse, VarsCourse] = runEventSimulation(Name, NumVars, RelTol, AbsTol, ...
fhandle, Time_span, InitConds)
eventName = strcat(Name, '_events');
afterEvent = strcat(Name, '_eventAssign');
eventHandle = str2func(eventName);
AfterEventHandle = str2func(afterEvent);
options = odeset('Events', eventHandle, 'RelTol', RelTol, 'AbsTol', AbsTol);
TimeCourse = [];
VarsCourse = [];
while ((~isempty(Time_span)) && (Time_span(1) < Time_span(end)))
[TimeCourse, VarsCourse, InitConds, Time_span] = ...
runEventSimulator(options, fhandle, Time_span, ...
InitConds, TimeCourse, VarsCourse, NumVars, ...
AfterEventHandle, Time_span(end));
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [TimeCourse, VarsCourse, InitConds, Time_span] ...
= runEventSimulator(options, fhandle, Time_span, InitConds, TimeCourse, ...
VarsCourse, NumVars, AfterEventHandle, Time_limit)
[TimeCourseA, VarsCourseA, eventTime, ab, eventNo] = ode45(fhandle, Time_span, InitConds, options);
% need to catch case where the time span entered was two sequential
% times from the original time-span
% e.g. original Time_span = [0, 0.1, ..., 4.9, 5.0]
% Time_span = [4.9, 5.0]
%
% ode solver will output points between
if (length(Time_span) == 2)
NewTimeCourse = [TimeCourseA(1); TimeCourseA(end)];
TimeCourseA = NewTimeCourse;
for i = 1:NumVars
NewVar(1,i) = VarsCourseA(1, i);
NewVar(2,i) = VarsCourseA(end, i);
end;
VarsCourseA = NewVar;
end;
% store current values of the varaiables at the time simulation ended
for i = 1:NumVars
CurrentValues(i) = VarsCourseA(end, i);
end;
% if we are not at the end of the time span remove the last point from
% each
if (TimeCourseA(end) ~= Time_span(end))
TimeCourseA = TimeCourseA(1:length(TimeCourseA)-1);
for i = 1:NumVars
VarsCourseB(:,i) = VarsCourseA(1:end-1, i);
end;
else
VarsCourseB = VarsCourseA;
end;
% adjust the time span
Time_spanA = Time_span - TimeCourseA(length(TimeCourseA));
Time_span_new = Time_spanA((find(Time_spanA==0)+1): length(Time_spanA));
Time_span = [];
Time_span = Time_span_new + TimeCourseA(length(TimeCourseA));
% if time span has not finished get new initial conditions
% need to integrate from the time the event stopped the solver to the
% next starting point to determine the new initial conditions
if (~isempty(Time_span))
InitConds = runCatchUpSimulation(AfterEventHandle, eventTime(end), ...
CurrentValues, eventNo(end), Time_span(1), Time_limit, options, fhandle, NumVars);
end;
% add the values from this iteration
TimeCourse = [TimeCourse;TimeCourseA];
VarsCourse = [VarsCourse;VarsCourseB];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function InitConds = runCatchUpSimulation(AfterEventHandle, eventTime, ...
CurrentValues, eventNo, endTime, Time_limit, options, fhandle, NumVars)
CurrentValues = feval(AfterEventHandle, eventTime, CurrentValues, eventNo);
[t,NewValues, eventTime, ab, eventNo] = ode45(fhandle, ...
[eventTime, endTime], CurrentValues, options);
if ~isempty(eventTime)
% an event has been triggered in this small time span
for i = 1:NumVars
CurrentValues(i) = NewValues(end, i);
end;
InitConds = runCatchUpSimulation(AfterEventHandle, eventTime(end), ...
CurrentValues, eventNo(end), endTime, Time_limit, options, fhandle, NumVars);
else
for i = 1:NumVars
InitConds(i) = NewValues(length(NewValues), i);
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [TimeCourse, VarsCourse] = runSimulator(options, fhandle, ...
Time_span, InitConds)
[TimeCourse, VarsCourse] = ode45(fhandle, Time_span, InitConds, options);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [TimeCourse, VarsCourse] = runSimulationOctave(RelTol, AbsTol, ...
fhandle, Time_span, InitConds)
lsode_options('relative tolerance', RelTol);
lsode_options('absolute tolerance', AbsTol);
VarsCourse = lsode(fhandle, InitConds, Time_span);
TimeCourse = Time_span;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function amtData = calculateAmount(SBMLModel, TimeCourse, SpeciesCourse)
[compartments, comp_values] = GetCompartments(SBMLModel);
allOnes = 1;
for i=1:length(comp_values)
if comp_values(i) ~= 1
allOnes = 0;
end;
end;
amtData = SpeciesCourse;
if allOnes == 1
return;
else
for i = 1:length(TimeCourse)
for j = 1:length(SBMLModel.species)
% if the species hasOnlySubstanceUnits then it is already in amount
if (SBMLModel.species(j).hasOnlySubstanceUnits == 1)
amtData(i, j) = SpeciesCourse(i, j);
else
% need to deal with mutliple compartments
comp = Model_getCompartmentById(SBMLModel, SBMLModel.species(j).compartment);
comp_size = comp.size;
% catch any anomalies
if (isnan(comp_size))
comp_size = 1;
end;
amtData(i, j) = SpeciesCourse(i,j)*comp_size;
end;
end;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function outputData(TimeCourse, VarsCourse, Name, Vars)
fileName = strcat(Name, '.csv');
%--------------------------------------------------------------------
% open the file for writing
fileID = fopen(fileName, 'w');
numVars = length(Vars);
numdata = size(VarsCourse);
if (numVars ~= numdata(2)) || (length(TimeCourse) ~= numdata(1))
error ('%s\n%s', 'Incorrect numbers of data points from simulation', ...
'Please report the problem to libsbml-team @caltech.edu')
end;
% write the header
fprintf(fileID, 'time');
for i = 1: length(Vars)
fprintf(fileID, ',%s', Vars{i});
end;
fprintf(fileID, '\n');
% write each time course step values
for i = 1:length(TimeCourse)
fprintf(fileID, '%0.5g', TimeCourse(i));
for j = 1:length(Vars)
fprintf(fileID, ',%1.16g', VarsCourse(i,j));
end;
fprintf(fileID, '\n');
end;
fclose(fileID);
SBMLToolbox-4.1.0/toolbox/Simulation/OutputODEFunction.m 0000644 0000000 0000000 00000004513 11703262256 021653 0 ustar root root function OutputODEFunction(varargin)
% OutputODEFunction
%
% *NOTE:* This function is deprecated. Use SolveODEFunction instead.
%
if (nargin < 1)
error('OutputODEFunction(SBMLModel, ...)\n%s', 'must have at least one argument');
elseif (nargin > 7)
error('OutputODEFunction(SBMLModel, ...)\n%s', 'cannot have more than seven arguments');
end;
if nargin > 1
if (varargin{2} == 1)
error(sprintf('The plot feature is no longer available.\nOutputODEFunction is deprecated.\nUse SolveODEFunction instead.'));
end;
end;
m = varargin{1};
Time_limit = 10;
NoSteps = -1;
outAmt = 0;
outCSV = 1;
Name = '';
switch nargin
case 3
Time_limit = varargin{3};
case 4
Time_limit = varargin{3};
NoSteps = varargin{4};
case 5
Time_limit = varargin{3};
NoSteps = varargin{4};
outCSV = varargin{5};
case 6
Time_limit = varargin{3};
NoSteps = varargin{4};
Name = varargin{6};
outCSV = varargin{5};
case 7
Time_limit = varargin{3};
NoSteps = varargin{4};
outAmt = varargin{7};
outCSV = varargin{5};
Name = varargin{6};
end;
SolveODEFunction(m, Time_limit, NoSteps, outAmt, outCSV, Name);
SBMLToolbox-4.1.0/toolbox/Simulation/GetArgumentsFromLambdaFunction.m 0000644 0000000 0000000 00000006346 11703262256 024363 0 ustar root root function Elements = GetArgumentsFromLambdaFunction(OriginalFormula)
% elements = GetArgumentsFromLambdaFunction(formula)
%
% Takes
%
% 1. formula, a string representation of a math expression that contains the MathML lambda function
%
% Returns
%
% 1. an array of the components of the lambda function
%
% *EXAMPLE:*
%
% elements = GetArgumentsFromLambdaFunction('lambda(x, x+0.5)')
%
% = 'x' 'x+0.5'
%
% elements = GetArgumentsFromLambdaFunction('lambda(x, y, x + y)')
%
% = 'x' 'y' 'x+y'
%
OriginalFormula = LoseWhiteSpace(OriginalFormula);
OpeningBracketIndex = find((ismember(OriginalFormula, '(')) == 1);
ClosingBracketIndex = find((ismember(OriginalFormula, ')')) == 1);
CommaIndex = find((ismember(OriginalFormula, ',')) == 1);
%pair the brackets
Pairs = PairBrackets(OriginalFormula);
Start = findstr(OriginalFormula, 'lambda');
if ((length(Start) ~= 1) || (Start ~= 1))
error ('lambda either does not occur or cannot be dealt with');
end;
% find commas between arguments of lambda
for i = 1:length(CommaIndex)
for j = 2:length(OpeningBracketIndex)
if ((CommaIndex(i) > Pairs(j,1)) && (CommaIndex(i) < Pairs(j,2)))
CommaIndex(i) = 0;
end;
end;
end;
NonZeros = find(CommaIndex ~= 0);
% get elements that represent the arguments of the lambda expression
% as an array of character arrays
% e.g. first element is between opening bracket and first relevant comma
% next elements are between relevant commas
% last element is between last relevant comma and closing bracket
j = Pairs(1, 1);
ElementNumber = 1;
for i = 1:length(NonZeros)
element = '';
j = j+1;
while (j <= CommaIndex(NonZeros(i)) - 1)
element = strcat(element, OriginalFormula(j));
j = j + 1;
end;
Elements{ElementNumber} = element;
ElementNumber = ElementNumber + 1;
end;
element = '';
j = j+1;
while (j < Pairs(1, 2))
element = strcat(element, OriginalFormula(j));
j = j + 1;
end;
Elements{ElementNumber} = element;
SBMLToolbox-4.1.0/toolbox/Simulation/DealWithPiecewise.m 0000644 0000000 0000000 00000011707 11703262256 021657 0 ustar root root function Elements = DealWithPiecewise(OriginalFormula)
% elements = DealWithPiecewise(formula)
%
% Takes
%
% 1. formula, a string representation of a math expression that contains the MathML piecewise function
%
% Returns
%
% 1. an array of the three components of the piecewise function
%
% *EXAMPLE:*
%
% elements = DealWithPiecewise('piecewise(le(s2,4),1.5,0.05)')
%
% = 'le(s2,4)' '1.5' '0.05'
%
% *NOTE:* The function cannot deal with a piecewise statement with more
% than three elements.
%
OriginalFormula = LoseWhiteSpace(OriginalFormula);
OpeningBracketIndex = find((ismember(OriginalFormula, '(')) == 1);
ClosingBracketIndex = find((ismember(OriginalFormula, ')')) == 1);
CommaIndex = find((ismember(OriginalFormula, ',')) == 1);
%pair the brackets
Pairs = PairBrackets(OriginalFormula);
Start = findstr(OriginalFormula, 'piecewise');
if (length(Start) == 0)
error('DealWithPiecewise(formula)\n%s', 'piecewise either does not occur in the formula');
end;
% find the commas that are between the arguments of the piecwise expression
% not those that may be part of the argument
% e.g. 'piecewise(gt(d,e),lt(2,e),gt(f,d))'
% | |
% relevant commas
piecewiseBrackets = 1;
while(piecewiseBrackets <= length(OpeningBracketIndex))
if (Pairs(piecewiseBrackets, 1) > Start(1))
break;
else
piecewiseBrackets = piecewiseBrackets + 1;
end;
end;
for i = 1:length(CommaIndex)
% if comma is outside the piecwise brackets not relevant
if (CommaIndex(i) < Pairs(piecewiseBrackets, 1))
CommaIndex(i) = 0;
elseif(CommaIndex(i) > Pairs(piecewiseBrackets, 2))
CommaIndex(i) = 0;
end;
for j = piecewiseBrackets+1:length(OpeningBracketIndex)
if ((CommaIndex(i) > Pairs(j, 1)) && (CommaIndex(i) < Pairs(j, 2)))
CommaIndex(i) = 0;
end;
end;
end;
NonZeros = find(CommaIndex ~= 0);
% if there is only one relevant comma
% implies only two arguments
% MATLAB can deal with the OriginalFormula
if (length(NonZeros) ~= 2)
error('Not enough arguments passed')
end;
% get elements that represent the arguments of the piecewise expression
% as an array of character arrays
% e.g. first element is between opening bracket and first relevant comma
% next elements are between relevant commas
% last element is between last relevant comma and closing bracket
j = Pairs(piecewiseBrackets, 1);
ElementNumber = 1;
for i = 1:length(NonZeros)
element = '';
j = j+1;
while (j <= CommaIndex(NonZeros(i)) - 1)
element = strcat(element, OriginalFormula(j));
j = j + 1;
end;
% if (findstr(element, 'piecewise'))
% element = DealWithPiecewise(element);
% end;
Elements{ElementNumber} = element;
ElementNumber = ElementNumber + 1;
end;
element = '';
j = j+1;
while (j < Pairs(piecewiseBrackets, 2))
element = strcat(element, OriginalFormula(j));
j = j + 1;
end;
% if (findstr(element, 'piecewise'))
% element = DealWithPiecewise(element);
% end;
Elements{ElementNumber} = element;
% check for a sign in front of leading brackets
% if (Pairs (1,1) ~= 1)
% if strcmp(OriginalFormula(1), '-')
% Elements{1} = strcat('-',Elements{1});
% Elements{3} = strcat('-',Elements{3});
% end;
% end;
%
% what if there is smething before or after the piecewise bit
before = '';
after = '';
pw = matchFunctionName(OriginalFormula, 'piecewise');
if (pw(1) ~= 1)
before = OriginalFormula(1:pw(1)-1);
end;
if (Pairs(piecewiseBrackets, 2) ~= length(OriginalFormula))
after = OriginalFormula(Pairs(piecewiseBrackets, 2)+1:end);
end;
Elements{1} = strcat(before ,Elements{1}, after);
Elements{3} = strcat(before ,Elements{3}, after);
SBMLToolbox-4.1.0/toolbox/Simulation/Contents.m 0000644 0000000 0000000 00000011475 11703262256 020117 0 ustar root root % toolbox\Simulation
%
% The functions allow users to simulate SBML models.
%
%========================================
% [analysis] = AnalyseSpecies(SBMLModel)
%========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. a structure detailing the species and how they are manipulated
% within the model
%
%==================================================
% [analysis] = AnalyseVaryingParameters(SBMLModel)
%==================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. a structure detailing any parameters that are not constant and how they are manipulated
% within the model
%
%=======================================
% elements = DealWithPiecewise(formula)
%=======================================
% Takes
% 1. formula, a string representation of a math expression that contains the MathML piecewise function
% Returns
% 1. an array of the three components of the piecewise function
%
%
%====================================================
% elements = GetArgumentsFromLambdaFunction(formula)
%====================================================
% Takes
% 1. formula, a string representation of a math expression that contains the MathML lambda function
% Returns
% 1. an array of the components of the lambda function
%
%====================
% OutputODEFunction
%====================
% DEPRECATED
%
%=============================
% SolveODEFunction(varargin)
%=============================
% Takes
%
% 1. a MATLAB_SBML model structure (required argument)
% 2. time limit (default = 10)
% 3. number of time steps (default lets the solver decide)
% 4. a flag to indicate whether to output species values in amount/concentration
% 1 amount, 0 concentration (default)
% 5. a flag to indicate whether to output the simulation data as
% a comma separated variable (csv) file
% 1 output 0 no output (default)
% 6. a filename (this is needed if WriteODEFunction was used with a
% filename)
% Returns
% 1. an array of time values
% 2. an array of the values of variables at each time point; species will
% be in concentration or amount as specified by input arguments
% Outputs
% 1. a file 'name.csv' with the data results (if the flag to output such a
% file is set to 1.
%
%===============================================
% WriteEventAssignmentFunction(SBMLModel, name)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. name, a string representing the name of the ode function being used
% Outputs
% 1. a file 'name_eventAssign.m' defining a function that assigns values following an event
% (for use with the event option of MATLABs ode solvers)
%
%============================================
% WriteEventHandlerFunction(SBMLModel, name)
%============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. name, a string representing the name of the ode function being used
% Outputs
% 1. a file 'name_events.m' defining a function that tests whether events
% have been triggered
% (for use with the event option of MATLABs ode solvers)
%
%=============================================
% WriteODEFunction(SBMLModel, name(optional))
%=============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. name, an optional string representing the name of the ode function to be used
% Outputs
% 1. a file 'name.m' defining a function that defines the ode equations of
% the model for use with the ode solvers
% (if no name supplied the model id will be used)
%
%
SBMLToolbox-4.1.0/toolbox/Simulation/AnalyseVaryingParameters.m 0000644 0000000 0000000 00000025331 11703262256 023276 0 ustar root root function VaryingParameters = AnalyseVaryingParameters(SBMLModel)
% [analysis] = AnalyseVaryingParameters(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. a structure detailing any parameters that are not constant and how they are manipulated
% within the model
%
% *EXAMPLE:*
%
% Using the model from toolbox/Test/test-data/algebraicRules.xml
%
% analysis = AnalyseVaryingParameters(m)
%
% analysis =
% Name: {'s2'}
% initialValue: 4
% ChangedByRateRule: 0
% RateRule: ''
% ChangedByAssignmentRule: 0
% AssignmentRule: ''
% InAlgebraicRule: 1
% AlgebraicRule: {{1x1 cell}}
% ConvertedToAssignRule: 1
% ConvertedRule: '-(-S2-S3)'
%
if (~isValidSBML_Model(SBMLModel))
error('AnalyseVaryingParameters(SBMLModel)\n%s', ...
'argument must be an SBMLModel structure');
end;
VaryingParameters = [];
if length(SBMLModel.parameter) == 0
return;
end;
[names, Values] = GetVaryingParameters(SBMLModel);
[n, AssignRule] = GetParameterAssignmentRules(SBMLModel);
[n, RateRule] = GetParameterRateRules(SBMLModel);
[n, AlgRules] = GetParameterAlgebraicRules(SBMLModel);
% create the output structure
index = 1;
for i = 1:length(SBMLModel.parameter)
% skip constant parameters
if SBMLModel.parameter(i).constant == 1
continue;
end;
VaryingParameters(index).Name = names(index);
VaryingParameters(index).initialValue = Values(index);
if (strcmp(RateRule(i), '0'))
VaryingParameters(index).ChangedByRateRule = 0;
VaryingParameters(index).RateRule = '';
else
VaryingParameters(index).ChangedByRateRule = 1;
VaryingParameters(index).RateRule = RateRule(i);
end;
if (strcmp(AssignRule(i), '0'))
VaryingParameters(index).ChangedByAssignmentRule = 0;
VaryingParameters(index).AssignmentRule = '';
else
VaryingParameters(index).ChangedByAssignmentRule = 1;
VaryingParameters(index).AssignmentRule = AssignRule(i);
end;
if (strcmp(AlgRules(i), '0'))
VaryingParameters(index).InAlgebraicRule = 0;
VaryingParameters(index).AlgebraicRule = '';
else
VaryingParameters(index).InAlgebraicRule = 1;
VaryingParameters(index).AlgebraicRule = AlgRules(i);
end;
if ((VaryingParameters(index).ChangedByRateRule == 0) && (VaryingParameters(index).ChangedByAssignmentRule == 0))
if (VaryingParameters(index).InAlgebraicRule == 1)
VaryingParameters(index).ConvertedToAssignRule = 1;
Rule = VaryingParameters(index).AlgebraicRule{1};
% need to look at whether rule contains a user definined
% function
FunctionIds = Model_getFunctionIds(SBMLModel);
for f = 1:length(FunctionIds)
if (matchFunctionName(char(Rule), FunctionIds{f}))
Rule = SubstituteFunction(char(Rule), SBMLModel.functionDefinition(f));
end;
end;
SubsRule = SubsAssignmentRules(SBMLModel, char(Rule));
VaryingParameters(index).ConvertedRule = Rearrange(SubsRule, names{index});
else
VaryingParameters(index).ConvertedToAssignRule = 0;
VaryingParameters(index).ConvertedRule = '';
end;
else
VaryingParameters(index).ConvertedToAssignRule = 0;
VaryingParameters(index).ConvertedRule = '';
end;
index = index + 1;
end;
function form = SubsAssignmentRules(SBMLModel, rule)
[VaryingParameters, AssignRule] = GetParameterAssignmentRules(SBMLModel);
form = rule;
% bracket the VaryingParameters to be replaced
for i = 1:length(VaryingParameters)
if (matchName(rule, VaryingParameters{i}))
if (~strcmp(AssignRule{i}, '0'))
form = strrep(form, VaryingParameters{i}, strcat('(', VaryingParameters{i}, ')'));
end;
end;
end;
for i = 1:length(VaryingParameters)
if (matchName(rule, VaryingParameters{i}))
if (~strcmp(AssignRule{i}, '0'))
form = strrep(form, VaryingParameters{i}, AssignRule{i});
end;
end;
end;
function output = Arrange(formula, x, vars)
ops = '+-';
f = LoseWhiteSpace(formula);
operators = ismember(f, ops);
OpIndex = find(operators == 1);
%--------------------------------------------------
% divide formula up into elements seperated by +/-
if (OpIndex(1) == 1)
% leading sign i.e. +x-y
NumElements = length(OpIndex);
j = 2;
index = 2;
else
NumElements = length(OpIndex) + 1;
j = 1;
index = 1;
end;
for i = 1:NumElements-1
element = '';
while (j < OpIndex(index))
element = strcat(element, f(j));
j = j+1;
end;
Elements{i} = element;
j = j + 1;
index = index + 1;
end;
% get last element
j = OpIndex(end)+1;
element = '';
while (j <= length(f))
element = strcat(element, f(j));
j = j+1;
end;
Elements{NumElements} = element;
%--------------------------------------------------
% check whether element contains x
% if does keep on lhs else move to rhs changing sign
output = '';
lhs = 1;
for i = 1:NumElements
if (matchName(Elements{i}, x))
% element contains x
LHSElements{lhs} = Elements{i};
if (OpIndex(1) == 1)
LHSOps(lhs) = f(OpIndex(i));
elseif (i == 1)
LHSOps(lhs) = '+';
else
LHSOps(lhs) = f(OpIndex(i-1));
end;
lhs = lhs + 1;
elseif (i == 1)
% first element does not contain x
if (OpIndex(1) == 1)
if (strcmp(f(1), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
else
% no sign so +
output = strcat(output, '-');
end;
output = strcat(output, Elements{i});
else
% element not first and does not contain x
if (OpIndex(1) == 1)
if (strcmp(f(OpIndex(i)), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
else
if (strcmp(f(OpIndex(i-1)), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
end;
output = strcat(output, Elements{i});
end;
end;
%------------------------------------------------------
% look at remaining LHS
for i = 1:length(LHSElements)
Mult{i} = ParseElement(LHSElements{i}, x);
end;
if (length(LHSElements) == 1)
% only one element with x
% check signs and multipliers
if (strcmp(LHSOps(1), '-'))
output = strcat('-(', output, ')');
end;
if (~strcmp(Mult{1}, '1'))
output = strcat(output, '/', Mult{1});
end;
else
divisor = '';
if (strcmp(LHSOps(1), '+'))
divisor = strcat(divisor, '(', Mult{1});
else
divisor = strcat(divisor, '(-', Mult{1});
end;
for i = 2:length(LHSElements)
divisor = strcat(divisor, LHSOps(i), Mult{i});
end;
divisor = strcat(divisor, ')');
output = strcat('(', output, ')/', divisor);
end;
function multiplier = ParseElement(element, x)
% assumes that the element is of the form n*x/m
% and returns n/m in simplest form
if (strcmp(element, x))
multiplier = '1';
return;
end;
VarIndex = matchName(element, x);
MultIndex = strfind(element, '*');
DivIndex = strfind(element, '/');
if (isempty(MultIndex))
MultIndex = 1;
end;
if (isempty(DivIndex))
DivIndex = length(element);
end;
if ((DivIndex < MultIndex) ||(VarIndex < MultIndex) || (VarIndex > DivIndex))
error('Cannot deal with formula in this form: %s', element);
end;
n = '';
m = '';
for i = 1:MultIndex-1
n = strcat(n, element(i));
end;
if (isempty(n))
n = '1';
end;
for i = DivIndex+1:length(element)
m = strcat(m, element(i));
end;
if (isempty(m))
m = '1';
end;
% if both m and n represenet numbers then they can be simplified
Num_n = str2num(n);
Num_m = str2num(m);
if (~isempty(Num_n) && ~isempty(Num_m))
multiplier = num2str(Num_n/Num_m);
else
if (strcmp(m, '1'))
multiplier = n;
else
multiplier = strcat(n, '/', m);
end;
end;
function y = LoseWhiteSpace(charArray)
% LoseWhiteSpace(charArray) takes an array of characters
% and returns the array with any white space removed
%
%----------------------------------------------------------------
% EXAMPLE:
% y = LoseWhiteSpace(' exa mp le')
% y = 'example'
%
%------------------------------------------------------------
% check input is an array of characters
if (~ischar(charArray))
error('LoseWhiteSpace(input)\n%s', 'input must be an array of characters');
end;
%-------------------------------------------------------------
% get the length of the array
NoChars = length(charArray);
%-------------------------------------------------------------
% create an array that indicates whether the elements of charArray are
% spaces
% e.g. WSpace = isspace(' v b') = [1, 1, 0, 1, 0]
% and determine how many
WSpace = isspace(charArray);
NoSpaces = sum(WSpace);
%-----------------------------------------------------------
% rewrite the array to leaving out any spaces
% remove any numbers from the array of symbols
if (NoSpaces > 0)
NewArrayCount = 1;
for i = 1:NoChars
if (~isspace(charArray(i)))
y(NewArrayCount) = charArray(i);
NewArrayCount = NewArrayCount + 1;
end;
end;
else
y = charArray;
end;
SBMLToolbox-4.1.0/toolbox/Simulation/AnalyseSpecies.m 0000644 0000000 0000000 00000034573 11704012540 021224 0 ustar root root function Species = AnalyseSpecies(SBMLModel)
% [analysis] = AnalyseSpecies(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. a structure detailing the species and how they are manipulated
% within the model
%
%
% *EXAMPLE:*
%
% Using the model from toolbox/Test/test-data/algebraicRules.xml
%
% analysis = AnalyseSpecies(m)
%
% analysis =
%
% 1x5 struct array with fields:
% Name
% constant
% boundaryCondition
% initialValue
% hasAmountOnly
% isConcentration
% compartment
% ChangedByReaction
% KineticLaw
% ChangedByRateRule
% RateRule
% ChangedByAssignmentRule
% AssignmentRule
% InAlgebraicRule
% AlgebraicRule
% ConvertedToAssignRule
% ConvertedRule
%
% analysis(1) =
%
%
% Name: {'S1'}
% constant: 0
% boundaryCondition: 0
% initialValue: 0.0300
% hasAmountOnly: 0
% isConcentration: 0
% compartment: 'compartment'
% ChangedByReaction: 1
% KineticLaw: {' - (k*S1)'}
% ChangedByRateRule: 0
% RateRule: ''
% ChangedByAssignmentRule: 0
% AssignmentRule: ''
% InAlgebraicRule: 1
% AlgebraicRule: {{1x1 cell}}
% ConvertedToAssignRule: 0
% ConvertedRule: ''
%
%
if (~isValidSBML_Model(SBMLModel))
error('AnalyseSpecies(SBMLModel)\n%s', 'argument must be an SBMLModel structure');
end;
if length(SBMLModel.species) == 0
Species = [];
return;
end;
[name, KineticLaw] = GetRateLawsFromReactions(SBMLModel);
[n, RateRule] = GetRateLawsFromRules(SBMLModel);
[n, AssignRule] = GetSpeciesAssignmentRules(SBMLModel);
[n, AlgRules] = GetSpeciesAlgebraicRules(SBMLModel);
[n, Values] = GetSpecies(SBMLModel);
% create the output structure
for i = 1:length(SBMLModel.species)
Species(i).Name = name(i);
% species Type
if (SBMLModel.SBML_level == 2 && SBMLModel.SBML_version > 1)
if exist('OCTAVE_VERSION')
if isempty(SBMLModel.species(i).speciesType)
Species(i).speciesType = '';
else
Species(i).speciesType = SBMLModel.species(i).speciesType;
end;
else
Species(i).speciesType = SBMLModel.species(i).speciesType;
end;
end;
% boundary condition and constant
bc = SBMLModel.species(i).boundaryCondition;
if (SBMLModel.SBML_level > 1)
const = SBMLModel.species(i).constant;
else
const = 0;
end;
Species(i).constant = const;
Species(i).boundaryCondition = bc;
%initial value / amount/ concentration
Species(i).initialValue = Values(i);
if (SBMLModel.SBML_level > 1)
comp = Model_getCompartmentById(SBMLModel, SBMLModel.species(i).compartment);
if (comp.spatialDimensions == 0)
Species(i).hasAmountOnly = 1;
else
if (SBMLModel.species(i).hasOnlySubstanceUnits == 1)
Species(i).hasAmountOnly = 1;
else
Species(i).hasAmountOnly = 0;
end;
end;
if (SBMLModel.species(i).isSetInitialConcentration == 0 ...
&& SBMLModel.species(i).isSetInitialAmount == 0)
% value is set by rule/assignment thus will be concentration
% unless the compartment is 0D or species hasOnlySubstanceUnits
if (comp.spatialDimensions == 0 ...
|| SBMLModel.species(i).hasOnlySubstanceUnits == 1)
Species(i).isConcentration = 0;
else
Species(i).isConcentration = 1;
end;
elseif (SBMLModel.species(i).isSetInitialAmount == 1)
% species has a value given as amount
% but if overridden by assignment it will be in conc
if (abs(SBMLModel.species(i).initialAmount - Values(i)) > 1e-16)
Species(i).isConcentration = 1;
else
Species(i).isConcentration = 0;
end;
else
% here species has a value given as concentration
% if comp is 0D or species hasOnlySubstanceUnits this is not
% correct and needs to be converted
if (comp.spatialDimensions == 0 ...
|| SBMLModel.species(i).hasOnlySubstanceUnits == 1)
Species(i).isConcentration = 0;
if isnan(comp.size)
Species(i).initialvalue = NaN;
else
Species(i).initialValue = Values(i)/comp.size;
end;
else
Species(i).isConcentration = 1;
end;
end;
else
% level 1 species were in amounts
Species(i).isConcentration = 0;
end;
Species(i).compartment = SBMLModel.species(i).compartment;
if (strcmp(KineticLaw(i), '0'))
Species(i).ChangedByReaction = 0;
Species(i).KineticLaw = '';
else
Species(i).ChangedByReaction = 1;
Species(i).KineticLaw = KineticLaw(i);
end;
if (strcmp(RateRule(i), '0'))
Species(i).ChangedByRateRule = 0;
Species(i).RateRule = '';
else
Species(i).ChangedByRateRule = 1;
Species(i).RateRule = RateRule(i);
end;
if (strcmp(AssignRule(i), '0'))
Species(i).ChangedByAssignmentRule = 0;
Species(i).AssignmentRule = '';
else
Species(i).ChangedByAssignmentRule = 1;
Species(i).AssignmentRule = AssignRule(i);
end;
if (strcmp(AlgRules(i), '0'))
Species(i).InAlgebraicRule = 0;
Species(i).AlgebraicRule = '';
else
Species(i).InAlgebraicRule = 1;
Species(i).AlgebraicRule = AlgRules(i);
end;
if ((Species(i).constant == 0) ...
&& (Species(i).ChangedByReaction == 0) ...
&& (Species(i).ChangedByRateRule == 0) ...
&& (Species(i).ChangedByAssignmentRule == 0))
if (Species(i).InAlgebraicRule == 1)
Species(i).ConvertedToAssignRule = 1;
Rule = Species(i).AlgebraicRule{1};
% need to look at whether rule contains a user definined
% function
FunctionIds = Model_getFunctionIds(SBMLModel);
for f = 1:length(FunctionIds)
if (matchFunctionName(char(Rule), FunctionIds{f}))
Rule = SubstituteFunction(char(Rule), SBMLModel.functionDefinition(f));
end;
end;
SubsRule = SubsAssignmentRules(SBMLModel, char(Rule));
Species(i).ConvertedRule = Rearrange(SubsRule, name{i});
else
Species(i).ConvertedToAssignRule = 0;
Species(i).ConvertedRule = '';
end;
elseif ((isnan(Species(i).initialValue)) ...
&& (Species(i).InAlgebraicRule == 1) ...
&& (Species(i).ChangedByAssignmentRule == 0))
error ('The model is over parameterised and the simulation cannot make decisions regarding rules');
else
Species(i).ConvertedToAssignRule = 0;
Species(i).ConvertedRule = '';
end;
end;
function form = SubsAssignmentRules(SBMLModel, rule)
[species, AssignRule] = GetSpeciesAssignmentRules(SBMLModel);
form = rule;
% bracket the species to be replaced
for i = 1:length(species)
if (matchName(rule, species{i}))
if (~strcmp(AssignRule{i}, '0'))
form = strrep(form, species{i}, strcat('(', species{i}, ')'));
end;
end;
end;
for i = 1:length(species)
if (matchName(rule, species{i}))
if (~strcmp(AssignRule{i}, '0'))
form = strrep(form, species{i}, AssignRule{i});
end;
end;
end;
function output = Arrange(formula, x, vars)
ops = '+-';
f = LoseWhiteSpace(formula);
operators = ismember(f, ops);
OpIndex = find(operators == 1);
%--------------------------------------------------
% divide formula up into elements seperated by +/-
if (OpIndex(1) == 1)
% leading sign i.e. +x-y
NumElements = length(OpIndex);
j = 2;
index = 2;
else
NumElements = length(OpIndex) + 1;
j = 1;
index = 1;
end;
for i = 1:NumElements-1
element = '';
while (j < OpIndex(index))
element = strcat(element, f(j));
j = j+1;
end;
Elements{i} = element;
j = j + 1;
index = index + 1;
end;
% get last element
j = OpIndex(end)+1;
element = '';
while (j <= length(f))
element = strcat(element, f(j));
j = j+1;
end;
Elements{NumElements} = element;
%--------------------------------------------------
% check whether element contains x
% if does keep on lhs else move to rhs changing sign
output = '';
lhs = 1;
for i = 1:NumElements
if (matchName(Elements{i}, x))
% element contains x
LHSElements{lhs} = Elements{i};
if (OpIndex(1) == 1)
LHSOps(lhs) = f(OpIndex(i));
elseif (i == 1)
LHSOps(lhs) = '+';
else
LHSOps(lhs) = f(OpIndex(i-1));
end;
lhs = lhs + 1;
elseif (i == 1)
% first element does not contain x
if (OpIndex(1) == 1)
if (strcmp(f(1), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
else
% no sign so +
output = strcat(output, '-');
end;
output = strcat(output, Elements{i});
else
% element not first and does not contain x
if (OpIndex(1) == 1)
if (strcmp(f(OpIndex(i)), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
else
if (strcmp(f(OpIndex(i-1)), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
end;
output = strcat(output, Elements{i});
end;
end;
%------------------------------------------------------
% look at remaining LHS
for i = 1:length(LHSElements)
Mult{i} = ParseElement(LHSElements{i}, x);
end;
if (length(LHSElements) == 1)
% only one element with x
% check signs and multipliers
if (strcmp(LHSOps(1), '-'))
output = strcat('-(', output, ')');
end;
if (~strcmp(Mult{1}, '1'))
output = strcat(output, '/', Mult{1});
end;
else
divisor = '';
if (strcmp(LHSOps(1), '+'))
divisor = strcat(divisor, '(', Mult{1});
else
divisor = strcat(divisor, '(-', Mult{1});
end;
for i = 2:length(LHSElements)
divisor = strcat(divisor, LHSOps(i), Mult{i});
end;
divisor = strcat(divisor, ')');
output = strcat('(', output, ')/', divisor);
end;
function multiplier = ParseElement(element, x)
% assumes that the element is of the form n*x/m
% and returns n/m in simplest form
if (strcmp(element, x))
multiplier = '1';
return;
end;
VarIndex = matchName(element, x);
MultIndex = strfind(element, '*');
DivIndex = strfind(element, '/');
if (isempty(MultIndex))
MultIndex = 1;
end;
if (isempty(DivIndex))
DivIndex = length(element);
end;
if ((DivIndex < MultIndex) ||(VarIndex < MultIndex) || (VarIndex > DivIndex))
error('Cannot deal with formula in this form; %s', element);
end;
n = '';
m = '';
for i = 1:MultIndex-1
n = strcat(n, element(i));
end;
if (isempty(n))
n = '1';
end;
for i = DivIndex+1:length(element)
m = strcat(m, element(i));
end;
if (isempty(m))
m = '1';
end;
% if both m and n represenet numbers then they can be simplified
Num_n = str2num(n);
Num_m = str2num(m);
if (~isempty(Num_n) && ~isempty(Num_m))
multiplier = num2str(Num_n/Num_m);
else
if (strcmp(m, '1'))
multiplier = n;
else
multiplier = strcat(n, '/', m);
end;
end;
function y = LoseWhiteSpace(charArray)
% LoseWhiteSpace(charArray) takes an array of characters
% and returns the array with any white space removed
%
%----------------------------------------------------------------
% EXAMPLE:
% y = LoseWhiteSpace(' exa mp le')
% y = 'example'
%
%------------------------------------------------------------
% check input is an array of characters
if (~ischar(charArray))
error('LoseWhiteSpace(input)\n%s', 'input must be an array of characters');
end;
%-------------------------------------------------------------
% get the length of the array
NoChars = length(charArray);
%-------------------------------------------------------------
% create an array that indicates whether the elements of charArray are
% spaces
% e.g. WSpace = isspace(' v b') = [1, 1, 0, 1, 0]
% and determine how many
WSpace = isspace(charArray);
NoSpaces = sum(WSpace);
%-----------------------------------------------------------
% rewrite the array to leaving out any spaces
% remove any numbers from the array of symbols
if (NoSpaces > 0)
NewArrayCount = 1;
for i = 1:NoChars
if (~isspace(charArray(i)))
y(NewArrayCount) = charArray(i);
NewArrayCount = NewArrayCount + 1;
end;
end;
else
y = charArray;
end;
SBMLToolbox-4.1.0/toolbox/SBMLToolbox.m 0000644 0000000 0000000 00000005142 11703262252 016270 0 ustar root root % SBMLToolbox
%
% SBMLToolbox is an open-source MATLAB/Octave toolbox that
% provides both MATLAB and Octave users with functions for
% reading, writing and manipulation data expressed in the
% Systems Biology Markup Language (SBML).
%
% It works on Windows, Linux, and MacOS systems.
%
% The SBMLToolbox supports reading and writing of all levels
% and versions of SBML up to Level 3 Version 1 Core.
%
%
% FUNCTIONS include:
%
%
% toolbox\AccessModel
%
% This directory contains functions that allow the user to
% derive information from an SBML Model.
%
% toolbox\Convenience
%
% This directory contains a number of convenience functions
% for checking information or manipulating math expressions.
%
% toolbox\fbc_package
%
% This directory contains functions that allow the user to
% manipulate the additional elements of a MATLAB_SBML Model
% structure introduced to support the SBML L3 'fbc' package.
%
% toolbox\MATLAB_SBML_Structure_Functions
%
% This directory contains functions that allow the user to
% manipulate a MATLAB_SBML Model structure. The majority of
% functions mimic their equivalent within the libSBML C API.
%
% toolbox\Simulation
%
% This directory contains functions to simulate an SBML model.
%
% toolbox\Validate_MATLAB_SBML_Structures
%
% This directory contains functions to validate the MATLAB_SBML
% structures.
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ 0000755 0000000 0000000 00000000000 11704572222 021673 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/ 0000755 0000000 0000000 00000000000 11704572246 024631 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_unsetSBOTerm0000644 0000000 0000000 00000003446 11703262314 032114 0 ustar root root function SBMLUnitDefinition = UnitDefinition_unsetSBOTerm(SBMLUnitDefinition)
% SBMLUnitDefinition = UnitDefinition_unsetSBOTerm(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML UnitDefinition structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'sboTerm')
SBMLUnitDefinition.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_unsetName.m 0000644 0000000 0000000 00000003424 11703262314 031750 0 ustar root root function SBMLUnitDefinition = UnitDefinition_unsetName(SBMLUnitDefinition)
% SBMLUnitDefinition = UnitDefinition_unsetName(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML UnitDefinition structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'name')
SBMLUnitDefinition.name = '';
else
error('name not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_unsetMetaid.0000644 0000000 0000000 00000003440 11703262314 032114 0 ustar root root function SBMLUnitDefinition = UnitDefinition_unsetMetaid(SBMLUnitDefinition)
% SBMLUnitDefinition = UnitDefinition_unsetMetaid(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML UnitDefinition structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'metaid')
SBMLUnitDefinition.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_unsetId.m 0000644 0000000 0000000 00000003410 11703262314 031417 0 ustar root root function SBMLUnitDefinition = UnitDefinition_unsetId(SBMLUnitDefinition)
% SBMLUnitDefinition = UnitDefinition_unsetId(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML UnitDefinition structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'id')
SBMLUnitDefinition.id = '';
else
error('id not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_setSBOTerm.m0000644 0000000 0000000 00000003725 11703262314 032004 0 ustar root root function SBMLUnitDefinition = UnitDefinition_setSBOTerm(SBMLUnitDefinition, sboTerm)
% SBMLUnitDefinition = UnitDefinition_setSBOTerm(SBMLUnitDefinition, sboTerm)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML UnitDefinition structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLUnitDefinition.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_setName.m 0000644 0000000 0000000 00000003647 11703262314 031414 0 ustar root root function SBMLUnitDefinition = UnitDefinition_setName(SBMLUnitDefinition, name)
% SBMLUnitDefinition = UnitDefinition_setName(SBMLUnitDefinition, name)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML UnitDefinition structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLUnitDefinition.name = name;
end;
else
error('name not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_setMetaid.m 0000644 0000000 0000000 00000003701 11703262314 031726 0 ustar root root function SBMLUnitDefinition = UnitDefinition_setMetaid(SBMLUnitDefinition, metaid)
% SBMLUnitDefinition = UnitDefinition_setMetaid(SBMLUnitDefinition, metaid)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML UnitDefinition structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLUnitDefinition.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_setId.m 0000644 0000000 0000000 00000003615 11703262314 031063 0 ustar root root function SBMLUnitDefinition = UnitDefinition_setId(SBMLUnitDefinition, id)
% SBMLUnitDefinition = UnitDefinition_setId(SBMLUnitDefinition, id)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML UnitDefinition structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLUnitDefinition.id = id;
end;
else
error('id not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_isSetSBOTerm0000644 0000000 0000000 00000003422 11703262314 032037 0 ustar root root function value = UnitDefinition_isSetSBOTerm(SBMLUnitDefinition)
% value = UnitDefinition_isSetSBOTerm(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'sboTerm')
value = (SBMLUnitDefinition.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_isSetName.m 0000644 0000000 0000000 00000003405 11703262314 031700 0 ustar root root function value = UnitDefinition_isSetName(SBMLUnitDefinition)
% value = UnitDefinition_isSetName(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'name')
value = ~isempty(SBMLUnitDefinition.name);
else
error('name not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_isSetMetaid.0000644 0000000 0000000 00000003421 11703262314 032044 0 ustar root root function value = UnitDefinition_isSetMetaid(SBMLUnitDefinition)
% value = UnitDefinition_isSetMetaid(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'metaid')
value = ~isempty(SBMLUnitDefinition.metaid);
else
error('metaid not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_isSetId.m 0000644 0000000 0000000 00000003371 11703262314 031356 0 ustar root root function value = UnitDefinition_isSetId(SBMLUnitDefinition)
% value = UnitDefinition_isSetId(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'id')
value = ~isempty(SBMLUnitDefinition.id);
else
error('id not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getUnit.m 0000644 0000000 0000000 00000003771 11703262314 031435 0 ustar root root function unit = UnitDefinition_getUnit(SBMLUnitDefinition, index)
% unit = UnitDefinition_getUnit(SBMLUnitDefinition, index)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. index, an integer representing the index of SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'unit')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLUnitDefinition.unit)
unit = SBMLUnitDefinition.unit(index);
else
error('index is out of range');
end;
else
error('unit not an element on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getSBOTerm.m0000644 0000000 0000000 00000003361 11703262314 031764 0 ustar root root function sboTerm = UnitDefinition_getSBOTerm(SBMLUnitDefinition)
% sboTerm = UnitDefinition_getSBOTerm(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'sboTerm')
sboTerm = SBMLUnitDefinition.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getNumUnits.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getNumUnits.0000644 0000000 0000000 00000003352 11703262314 032116 0 ustar root root function num = UnitDefinition_getNumUnits(SBMLUnitDefinition)
% numUnits = UnitDefinition_getNumUnits(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the value of the numUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'unit')
num = length(SBMLUnitDefinition.unit);
else
error('unit not an element on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getName.m 0000644 0000000 0000000 00000003326 11703262314 031372 0 ustar root root function name = UnitDefinition_getName(SBMLUnitDefinition)
% name = UnitDefinition_getName(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'name')
name = SBMLUnitDefinition.name;
else
error('name not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getMetaid.m 0000644 0000000 0000000 00000003350 11703262314 031712 0 ustar root root function metaid = UnitDefinition_getMetaid(SBMLUnitDefinition)
% metaid = UnitDefinition_getMetaid(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'metaid')
metaid = SBMLUnitDefinition.metaid;
else
error('metaid not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getListOfUnits.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getListOfUni0000644 0000000 0000000 00000003342 11703262314 032131 0 ustar root root function unit = UnitDefinition_getListOfUnits(SBMLUnitDefinition)
% unit = UnitDefinition_getListOfUnits(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. an array of the unit structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'unit')
unit = SBMLUnitDefinition.unit;
else
error('unit not an element on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_getId.m 0000644 0000000 0000000 00000003304 11703262314 031042 0 ustar root root function id = UnitDefinition_getId(SBMLUnitDefinition)
% id = UnitDefinition_getId(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'id')
id = SBMLUnitDefinition.id;
else
error('id not an attribute on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_createUnit.m0000644 0000000 0000000 00000003700 11703262314 032111 0 ustar root root function SBMLUnitDefinition = UnitDefinition_createUnit(SBMLUnitDefinition)
% SBMLUnitDefinition = UnitDefinition_createUnit(SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML UnitDefinition structure with a new SBML Unit structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
if isfield(SBMLUnitDefinition, 'unit')
index = length(SBMLUnitDefinition.unit);
SBMLUnit = Unit_create(level, version);
if index == 0
SBMLUnitDefinition.unit = SBMLUnit;
else
SBMLUnitDefinition.unit(index+1) = SBMLUnit;
end;
else
error('unit not an element on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_create.m 0000644 0000000 0000000 00000005632 11703262314 031257 0 ustar root root function UnitDefinition = UnitDefinition_create(varargin)
% UnitDefinition = UnitDefinition_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML UnitDefinition structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getUnitDefinitionFieldnames(level, version);
if (num > 0)
values = getUnitDefinitionDefaultValues(level, version);
UnitDefinition = cell2struct(values, fieldnames, 2);
UnitDefinition.unit = Unit_create(level, version);
UnitDefinition.unit(1:end) = [];
%add level and version
UnitDefinition.level = level;
UnitDefinition.version = version;
%check correct structure
if ~isSBML_UnitDefinition(UnitDefinition, level, version)
UnitDefinition = struct();
warning('Warn:BadStruct', 'Failed to create UnitDefinition');
end;
else
UnitDefinition = [];
warning('Warn:InvalidLV', 'UnitDefinition not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/UnitDefinition_addUnit.m 0000644 0000000 0000000 00000004172 11703262314 031402 0 ustar root root function SBMLUnitDefinition = UnitDefinition_addUnit(SBMLUnitDefinition, SBMLUnit)
% SBMLUnitDefinition = UnitDefinition_addUnit(SBMLUnitDefinition, SBMLUnit)
%
% Takes
%
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML UnitDefinition structure with the SBML Unit structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnitDefinition);
[unit_level, unit_version] = GetLevelVersion(SBMLUnit);
if level ~= unit_level
error('mismatch in levels');
elseif version ~= unit_version
error('mismatch in versions');
end;
if isfield(SBMLUnitDefinition, 'unit')
index = length(SBMLUnitDefinition.unit);
if index == 0
SBMLUnitDefinition.unit = SBMLUnit;
else
SBMLUnitDefinition.unit(index+1) = SBMLUnit;
end;
else
error('unit not an element on SBML L%dV%d UnitDefinition', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/UnitDefinition/Contents.m 0000644 0000000 0000000 00000021660 11703262314 026600 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\UnitDefinition
%
% The functions allow users to create and work with the SBML UnitDefinition structure.
%
%===========================================================================
% SBMLUnitDefinition = UnitDefinition_addUnit(SBMLUnitDefinition, SBMLUnit)
%===========================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML UnitDefinition structure with the SBML Unit structure added
%
%=============================================================================
% UnitDefinition = UnitDefinition_create(level(optional), version(optional) )
%=============================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML UnitDefinition structure of the appropriate level and version
%
%====================================================================
% SBMLUnitDefinition = UnitDefinition_createUnit(SBMLUnitDefinition)
%====================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the SBML UnitDefinition structure with a new SBML Unit structure added
%
%===============================================
% id = UnitDefinition_getId(SBMLUnitDefinition)
%===============================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the value of the id attribute
%
%==========================================================
% unit = UnitDefinition_getListOfUnits(SBMLUnitDefinition)
%==========================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. an array of the unit structures
%
%=======================================================
% metaid = UnitDefinition_getMetaid(SBMLUnitDefinition)
%=======================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the value of the metaid attribute
%
%===================================================
% name = UnitDefinition_getName(SBMLUnitDefinition)
%===================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the value of the name attribute
%
%===========================================================
% numUnits = UnitDefinition_getNumUnits(SBMLUnitDefinition)
%===========================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the value of the numUnits attribute
%
%=========================================================
% sboTerm = UnitDefinition_getSBOTerm(SBMLUnitDefinition)
%=========================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the value of the sboTerm attribute
%
%==========================================================
% unit = UnitDefinition_getUnit(SBMLUnitDefinition, index)
%==========================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. index, an integer representing the index of SBML Unit structure
% Returns
% 1. the SBML Unit structure at the indexed position
%
%====================================================
% value = UnitDefinition_isSetId(SBMLUnitDefinition)
%====================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%========================================================
% value = UnitDefinition_isSetMetaid(SBMLUnitDefinition)
%========================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%======================================================
% value = UnitDefinition_isSetName(SBMLUnitDefinition)
%======================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%=========================================================
% value = UnitDefinition_isSetSBOTerm(SBMLUnitDefinition)
%=========================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%===================================================================
% SBMLUnitDefinition = UnitDefinition_setId(SBMLUnitDefinition, id)
%===================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML UnitDefinition structure with the new value for the id attribute
%
%===========================================================================
% SBMLUnitDefinition = UnitDefinition_setMetaid(SBMLUnitDefinition, metaid)
%===========================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML UnitDefinition structure with the new value for the metaid attribute
%
%=======================================================================
% SBMLUnitDefinition = UnitDefinition_setName(SBMLUnitDefinition, name)
%=======================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML UnitDefinition structure with the new value for the name attribute
%
%=============================================================================
% SBMLUnitDefinition = UnitDefinition_setSBOTerm(SBMLUnitDefinition, sboTerm)
%=============================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML UnitDefinition structure with the new value for the sboTerm attribute
%
%=================================================================
% SBMLUnitDefinition = UnitDefinition_unsetId(SBMLUnitDefinition)
%=================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the SBML UnitDefinition structure with the id attribute unset
%
%=====================================================================
% SBMLUnitDefinition = UnitDefinition_unsetMetaid(SBMLUnitDefinition)
%=====================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the SBML UnitDefinition structure with the metaid attribute unset
%
%===================================================================
% SBMLUnitDefinition = UnitDefinition_unsetName(SBMLUnitDefinition)
%===================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the SBML UnitDefinition structure with the name attribute unset
%
%======================================================================
% SBMLUnitDefinition = UnitDefinition_unsetSBOTerm(SBMLUnitDefinition)
%======================================================================
% Takes
% 1. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the SBML UnitDefinition structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/ 0000755 0000000 0000000 00000000000 11704572244 022616 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_unsetScale.m 0000644 0000000 0000000 00000003322 11703262346 026077 0 ustar root root function SBMLUnit = Unit_unsetScale(SBMLUnit)
% SBMLUnit = Unit_unsetScale(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure with the scale attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'scale')
if level > 2
SBMLUnit.scale = NaN;
else
SBMLUnit.scale = 0;
end;
else
error('offset not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_unsetSBOTerm.m 0000644 0000000 0000000 00000003244 11703262346 026326 0 ustar root root function SBMLUnit = Unit_unsetSBOTerm(SBMLUnit)
% SBMLUnit = Unit_unsetSBOTerm(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'sboTerm')
SBMLUnit.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_unsetOffset.m 0000644 0000000 0000000 00000003235 11703262346 026301 0 ustar root root function SBMLUnit = Unit_unsetOffset(SBMLUnit)
% SBMLUnit = Unit_unsetOffset(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure with the offset attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'offset')
SBMLUnit.offset = 0;
else
error('offset not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_unsetMultiplier.m 0000644 0000000 0000000 00000003365 11703262346 027205 0 ustar root root function SBMLUnit = Unit_unsetMultiplier(SBMLUnit)
% SBMLUnit = Unit_unsetMultiplier(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure with the multiplier attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'multiplier')
if (level > 2)
SBMLUnit.multiplier = NaN;
else
SBMLUnit.multiplier = 1;
end;
else
error('multiplier not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_unsetMetaid.m 0000644 0000000 0000000 00000003236 11703262346 026257 0 ustar root root function SBMLUnit = Unit_unsetMetaid(SBMLUnit)
% SBMLUnit = Unit_unsetMetaid(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'metaid')
SBMLUnit.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_unsetKind.m 0000644 0000000 0000000 00000003222 11703262346 025734 0 ustar root root function SBMLUnit = Unit_unsetKind(SBMLUnit)
% SBMLUnit = Unit_unsetKind(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure with the kind attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'kind')
SBMLUnit.kind = '';
else
error('kind not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_unsetExponent.m 0000644 0000000 0000000 00000003350 11703262346 026651 0 ustar root root function SBMLUnit = Unit_unsetExponent(SBMLUnit)
% SBMLUnit = Unit_unsetExponent(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the SBML Unit structure with the exponent attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'exponent')
if (level > 2)
SBMLUnit.exponent = NaN;
else
SBMLUnit.exponent = 1;
end;
else
error('exponent not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_setScale.m 0000644 0000000 0000000 00000003500 11703262346 025532 0 ustar root root function SBMLUnit = Unit_setScale(SBMLUnit, scale)
% SBMLUnit = Unit_setScale(SBMLUnit, scale)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. scale; number representing the value of scale to be set
%
% Returns
%
% 1. the SBML Unit structure with the new value for the scale attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'scale')
if (~isIntegralNumber(scale))
error('scale must be an integer') ;
else
SBMLUnit.scale = scale;
end;
else
error('scale not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_setSBOTerm.m 0000644 0000000 0000000 00000003523 11703262346 025763 0 ustar root root function SBMLUnit = Unit_setSBOTerm(SBMLUnit, sboTerm)
% SBMLUnit = Unit_setSBOTerm(SBMLUnit, sboTerm)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Unit structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLUnit.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_setOffset.m 0000644 0000000 0000000 00000003474 11703262346 025743 0 ustar root root function SBMLUnit = Unit_setOffset(SBMLUnit, offset)
% SBMLUnit = Unit_setOffset(SBMLUnit, offset)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. offset, an integer representing the offset to be set
%
% Returns
%
% 1. the SBML Unit structure with the new value for the offset attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'offset')
if ~isnumeric(offset)
error('offset must be numeric') ;
else
SBMLUnit.offset = offset;
end;
else
error('offset not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_setMultiplier.m 0000644 0000000 0000000 00000003565 11703262346 026644 0 ustar root root function SBMLUnit = Unit_setMultiplier(SBMLUnit, multiplier)
% SBMLUnit = Unit_setMultiplier(SBMLUnit, multiplier)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. multiplier; number representing the value of multiplier to be set
%
% Returns
%
% 1. the SBML Unit structure with the new value for the multiplier attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'multiplier')
if ~isnumeric(multiplier)
error('multiplier must be numeric') ;
else
SBMLUnit.multiplier = multiplier;
end;
else
error('multiplier not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_setMetaid.m 0000644 0000000 0000000 00000003477 11703262346 025723 0 ustar root root function SBMLUnit = Unit_setMetaid(SBMLUnit, metaid)
% SBMLUnit = Unit_setMetaid(SBMLUnit, metaid)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Unit structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLUnit.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_setKind.m 0000644 0000000 0000000 00000003445 11703262346 025400 0 ustar root root function SBMLUnit = Unit_setKind(SBMLUnit, kind)
% SBMLUnit = Unit_setKind(SBMLUnit, kind)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. kind; a string representing the kind to be set
%
% Returns
%
% 1. the SBML Unit structure with the new value for the kind attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'kind')
if ~ischar(kind)
error('kind must be character array') ;
else
SBMLUnit.kind = kind;
end;
else
error('kind not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_setExponent.m 0000644 0000000 0000000 00000004022 11703262346 026303 0 ustar root root function SBMLUnit = Unit_setExponent(SBMLUnit, exponent)
% SBMLUnit = Unit_setExponent(SBMLUnit, exponent)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
% 2. exponent; number representing the value of exponent to be set
%
% Returns
%
% 1. the SBML Unit structure with the new value for the exponent attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'exponent')
if level < 3
if ~isIntegralNumber(exponent)
error('exponent must be an integer') ;
else
SBMLUnit.exponent = exponent;
end;
else
if ~isnumeric(exponent)
error('exponent must be numeric') ;
else
SBMLUnit.exponent = exponent;
end;
end;
else
error('exponent not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_isSetScale.m 0000644 0000000 0000000 00000003252 11703262346 026032 0 ustar root root function value = Unit_isSetScale(SBMLUnit)
% value = Unit_isSetScale(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. value =
% - 1 if the scale attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'scale')
value = ~isnan(SBMLUnit.scale);
else
error('isSetScale not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_isSetSBOTerm.m 0000644 0000000 0000000 00000003256 11703262346 026262 0 ustar root root function value = Unit_isSetSBOTerm(SBMLUnit)
% value = Unit_isSetSBOTerm(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'sboTerm')
value = (SBMLUnit.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_isSetOffset.m 0000644 0000000 0000000 00000003260 11703262346 026230 0 ustar root root function value = Unit_isSetOffset(SBMLUnit)
% value = Unit_isSetOffset(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. value =
% - 1 if the offset attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'offset')
value = ~isnan(SBMLUnit.offset);
else
error('isSetOffset not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_isSetMultiplier.m 0000644 0000000 0000000 00000003310 11703262346 027124 0 ustar root root function value = Unit_isSetMultiplier(SBMLUnit)
% value = Unit_isSetMultiplier(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. value =
% - 1 if the multiplier attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'multiplier')
value = ~isnan(SBMLUnit.multiplier);
else
error('isSetMultiplier not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_isSetMetaid.m 0000644 0000000 0000000 00000003255 11703262346 026211 0 ustar root root function value = Unit_isSetMetaid(SBMLUnit)
% value = Unit_isSetMetaid(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'metaid')
value = ~isempty(SBMLUnit.metaid);
else
error('metaid not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_isSetKind.m 0000644 0000000 0000000 00000003241 11703262346 025666 0 ustar root root function value = Unit_isSetKind(SBMLUnit)
% value = Unit_isSetKind(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. value =
% - 1 if the kind attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'kind')
value = ~isempty(SBMLUnit.kind);
else
error('kind not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_isSetExponent.m 0000644 0000000 0000000 00000003274 11703262346 026607 0 ustar root root function value = Unit_isSetExponent(SBMLUnit)
% value = Unit_isSetExponent(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. value =
% - 1 if the exponent attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'exponent')
value = ~isnan(SBMLUnit.exponent);
else
error('isSetExponent not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_getScale.m 0000644 0000000 0000000 00000003173 11703262346 025524 0 ustar root root function scale = Unit_getScale(SBMLUnit)
% scale = Unit_getScale(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the value of the scale attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'scale')
scale = SBMLUnit.scale;
else
error('scale not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_getSBOTerm.m 0000644 0000000 0000000 00000003215 11703262346 025745 0 ustar root root function sboTerm = Unit_getSBOTerm(SBMLUnit)
% sboTerm = Unit_getSBOTerm(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'sboTerm')
sboTerm = SBMLUnit.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_getOffset.m 0000644 0000000 0000000 00000003204 11703262346 025716 0 ustar root root function offset = Unit_getOffset(SBMLUnit)
% offset = Unit_getOffset(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the value of the offset attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'offset')
offset = SBMLUnit.offset;
else
error('offset not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_getMultiplier.m 0000644 0000000 0000000 00000003250 11703262346 026617 0 ustar root root function multiplier = Unit_getMultiplier(SBMLUnit)
% multiplier = Unit_getMultiplier(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the value of the multiplier attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'multiplier')
multiplier = SBMLUnit.multiplier;
else
error('multiplier not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_getMetaid.m 0000644 0000000 0000000 00000003204 11703262346 025673 0 ustar root root function metaid = Unit_getMetaid(SBMLUnit)
% metaid = Unit_getMetaid(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'metaid')
metaid = SBMLUnit.metaid;
else
error('metaid not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_getKind.m 0000644 0000000 0000000 00000003162 11703262346 025360 0 ustar root root function kind = Unit_getKind(SBMLUnit)
% kind = Unit_getKind(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the value of the kind attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'kind')
kind = SBMLUnit.kind;
else
error('kind not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_getExponent.m 0000644 0000000 0000000 00000003226 11703262346 026274 0 ustar root root function exponent = Unit_getExponent(SBMLUnit)
% exponent = Unit_getExponent(SBMLUnit)
%
% Takes
%
% 1. SBMLUnit, an SBML Unit structure
%
% Returns
%
% 1. the value of the exponent attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLUnit);
if isfield(SBMLUnit, 'exponent')
exponent = SBMLUnit.exponent;
else
error('exponent not an attribute on SBML L%dV%d Unit', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Unit_create.m 0000644 0000000 0000000 00000005242 11703262346 025237 0 ustar root root function Unit = Unit_create(varargin)
% Unit = Unit_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Unit structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getUnitFieldnames(level, version);
if (num > 0)
values = getUnitDefaultValues(level, version);
Unit = cell2struct(values, fieldnames, 2);
%add level and version
Unit.level = level;
Unit.version = version;
%check correct structure
if ~isSBML_Unit(Unit, level, version)
Unit = struct();
warning('Warn:BadStruct', 'Failed to create Unit');
end;
else
Unit = [];
warning('Warn:InvalidLV', 'Unit not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Unit/Contents.m 0000644 0000000 0000000 00000021415 11703262346 024572 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Unit
%
% The functions allow users to create and work with the SBML Unit structure.
%
%=========================================================
% Unit = Unit_create(level(optional), version(optional) )
%=========================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Unit structure of the appropriate level and version
%
%=======================================
% exponent = Unit_getExponent(SBMLUnit)
%=======================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the value of the exponent attribute
%
%===============================
% kind = Unit_getKind(SBMLUnit)
%===============================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the value of the kind attribute
%
%===================================
% metaid = Unit_getMetaid(SBMLUnit)
%===================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the value of the metaid attribute
%
%===========================================
% multiplier = Unit_getMultiplier(SBMLUnit)
%===========================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the value of the multiplier attribute
%
%===================================
% offset = Unit_getOffset(SBMLUnit)
%===================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the value of the offset attribute
%
%=====================================
% sboTerm = Unit_getSBOTerm(SBMLUnit)
%=====================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the value of the sboTerm attribute
%
%=================================
% scale = Unit_getScale(SBMLUnit)
%=================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the value of the scale attribute
%
%======================================
% value = Unit_isSetExponent(SBMLUnit)
%======================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. value =
% - 1 if the exponent attribute is set
% - 0 otherwise
%
%==================================
% value = Unit_isSetKind(SBMLUnit)
%==================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. value =
% - 1 if the kind attribute is set
% - 0 otherwise
%
%====================================
% value = Unit_isSetMetaid(SBMLUnit)
%====================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%========================================
% value = Unit_isSetMultiplier(SBMLUnit)
%========================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. value =
% - 1 if the multiplier attribute is set
% - 0 otherwise
%
%====================================
% value = Unit_isSetOffset(SBMLUnit)
%====================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. value =
% - 1 if the offset attribute is set
% - 0 otherwise
%
%=====================================
% value = Unit_isSetSBOTerm(SBMLUnit)
%=====================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%===================================
% value = Unit_isSetScale(SBMLUnit)
%===================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. value =
% - 1 if the scale attribute is set
% - 0 otherwise
%
%=================================================
% SBMLUnit = Unit_setExponent(SBMLUnit, exponent)
%=================================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. exponent; number representing the value of exponent to be set
% Returns
% 1. the SBML Unit structure with the new value for the exponent attribute
%
%=========================================
% SBMLUnit = Unit_setKind(SBMLUnit, kind)
%=========================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. kind; a string representing the kind to be set
% Returns
% 1. the SBML Unit structure with the new value for the kind attribute
%
%=============================================
% SBMLUnit = Unit_setMetaid(SBMLUnit, metaid)
%=============================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Unit structure with the new value for the metaid attribute
%
%=====================================================
% SBMLUnit = Unit_setMultiplier(SBMLUnit, multiplier)
%=====================================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. multiplier; number representing the value of multiplier to be set
% Returns
% 1. the SBML Unit structure with the new value for the multiplier attribute
%
%=============================================
% SBMLUnit = Unit_setOffset(SBMLUnit, offset)
%=============================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. offset, an integer representing the offset to be set
% Returns
% 1. the SBML Unit structure with the new value for the offset attribute
%
%===============================================
% SBMLUnit = Unit_setSBOTerm(SBMLUnit, sboTerm)
%===============================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Unit structure with the new value for the sboTerm attribute
%
%===========================================
% SBMLUnit = Unit_setScale(SBMLUnit, scale)
%===========================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% 2. scale; number representing the value of scale to be set
% Returns
% 1. the SBML Unit structure with the new value for the scale attribute
%
%=========================================
% SBMLUnit = Unit_unsetExponent(SBMLUnit)
%=========================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML Unit structure with the exponent attribute unset
%
%=====================================
% SBMLUnit = Unit_unsetKind(SBMLUnit)
%=====================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML Unit structure with the kind attribute unset
%
%=======================================
% SBMLUnit = Unit_unsetMetaid(SBMLUnit)
%=======================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML Unit structure with the metaid attribute unset
%
%===========================================
% SBMLUnit = Unit_unsetMultiplier(SBMLUnit)
%===========================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML Unit structure with the multiplier attribute unset
%
%=======================================
% SBMLUnit = Unit_unsetOffset(SBMLUnit)
%=======================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML Unit structure with the offset attribute unset
%
%========================================
% SBMLUnit = Unit_unsetSBOTerm(SBMLUnit)
%========================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML Unit structure with the sboTerm attribute unset
%
%======================================
% SBMLUnit = Unit_unsetScale(SBMLUnit)
%======================================
% Takes
% 1. SBMLUnit, an SBML Unit structure
% Returns
% 1. the SBML Unit structure with the scale attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/ 0000755 0000000 0000000 00000000000 11704572244 023302 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_unsetSBOTerm.m 0000644 0000000 0000000 00000003313 11703262336 027472 0 ustar root root function SBMLTrigger = Trigger_unsetSBOTerm(SBMLTrigger)
% SBMLTrigger = Trigger_unsetSBOTerm(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the SBML Trigger structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'sboTerm')
SBMLTrigger.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_unsetMetaid.m 0000644 0000000 0000000 00000003305 11703262336 027423 0 ustar root root function SBMLTrigger = Trigger_unsetMetaid(SBMLTrigger)
% SBMLTrigger = Trigger_unsetMetaid(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the SBML Trigger structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'metaid')
SBMLTrigger.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_unsetMath.m 0000644 0000000 0000000 00000003271 11703262336 027113 0 ustar root root function SBMLTrigger = Trigger_unsetMath(SBMLTrigger)
% SBMLTrigger = Trigger_unsetMath(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the SBML Trigger structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'math')
SBMLTrigger.math = '';
else
error('math not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_setSBOTerm.m 0000644 0000000 0000000 00000003572 11703262336 027136 0 ustar root root function SBMLTrigger = Trigger_setSBOTerm(SBMLTrigger, sboTerm)
% SBMLTrigger = Trigger_setSBOTerm(SBMLTrigger, sboTerm)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Trigger structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLTrigger.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_setPersistent.m 0000644 0000000 0000000 00000003774 11703262336 030027 0 ustar root root function SBMLTrigger = Trigger_setPersistent(SBMLTrigger, persistentValue)
% SBMLTrigger = Trigger_setPersistent(SBMLTrigger, persistent)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
% 2. persistent, an integer (0/1) representing the value of persistent to be set
%
% Returns
%
% 1. the SBML Trigger structure with the new value for the persistent attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'persistent')
if (~isIntegralNumber(persistentValue) || persistentValue < 0 || persistentValue > 1)
error('persistent must be an integer of value 0/1') ;
else
SBMLTrigger.persistent = persistentValue;
end;
else
error('persistent not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_setMetaid.m 0000644 0000000 0000000 00000003546 11703262336 027067 0 ustar root root function SBMLTrigger = Trigger_setMetaid(SBMLTrigger, metaid)
% SBMLTrigger = Trigger_setMetaid(SBMLTrigger, metaid)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Trigger structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLTrigger.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_setMath.m 0000644 0000000 0000000 00000003532 11703262336 026550 0 ustar root root function SBMLTrigger = Trigger_setMath(SBMLTrigger, math)
% SBMLTrigger = Trigger_setMath(SBMLTrigger, math)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML Trigger structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLTrigger.math = math;
end;
else
error('math not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_setInitialValue.m 0000644 0000000 0000000 00000004001 11703262336 030235 0 ustar root root function SBMLTrigger = Trigger_setInitialValue(SBMLTrigger, initialValue)
% SBMLTrigger = Trigger_setInitialValue(SBMLTrigger, initialValue)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
% 2. initialValue, an integer (0/1) representing the value of initialValue to be set
%
% Returns
%
% 1. the SBML Trigger structure with the new value for the initialValue attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'initialValue')
if (~isIntegralNumber(initialValue) || initialValue < 0 || initialValue > 1)
error('initialValue must be an integer of value 0/1') ;
else
SBMLTrigger.initialValue = initialValue;
end;
else
error('initialValue not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_isSetSBOTerm.m 0000644 0000000 0000000 00000003314 11703262336 027424 0 ustar root root function value = Trigger_isSetSBOTerm(SBMLTrigger)
% value = Trigger_isSetSBOTerm(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'sboTerm')
value = (SBMLTrigger.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_isSetMetaid.m 0000644 0000000 0000000 00000003313 11703262336 027353 0 ustar root root function value = Trigger_isSetMetaid(SBMLTrigger)
% value = Trigger_isSetMetaid(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'metaid')
value = ~isempty(SBMLTrigger.metaid);
else
error('metaid not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_isSetMath.m 0000644 0000000 0000000 00000003277 11703262336 027052 0 ustar root root function value = Trigger_isSetMath(SBMLTrigger)
% value = Trigger_isSetMath(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'math')
value = ~isempty(SBMLTrigger.math);
else
error('math not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_getSBOTerm.m 0000644 0000000 0000000 00000003253 11703262336 027116 0 ustar root root function sboTerm = Trigger_getSBOTerm(SBMLTrigger)
% sboTerm = Trigger_getSBOTerm(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'sboTerm')
sboTerm = SBMLTrigger.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_getPersistent.m 0000644 0000000 0000000 00000003320 11703262336 027776 0 ustar root root function persistentValue = Trigger_getPersistent(SBMLTrigger)
% persistent = Trigger_getPersistent(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the value of the persistent attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'persistent')
persistentValue = SBMLTrigger.persistent;
else
error('persistent not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_getMetaid.m 0000644 0000000 0000000 00000003242 11703262336 027044 0 ustar root root function metaid = Trigger_getMetaid(SBMLTrigger)
% metaid = Trigger_getMetaid(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'metaid')
metaid = SBMLTrigger.metaid;
else
error('metaid not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_getMath.m 0000644 0000000 0000000 00000003220 11703262336 026526 0 ustar root root function math = Trigger_getMath(SBMLTrigger)
% math = Trigger_getMath(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'math')
math = SBMLTrigger.math;
else
error('math not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_getInitialValue.m 0000644 0000000 0000000 00000003330 11703262336 030225 0 ustar root root function initialValue = Trigger_getInitialValue(SBMLTrigger)
% initialValue = Trigger_getInitialValue(SBMLTrigger)
%
% Takes
%
% 1. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the value of the initialValue attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLTrigger);
if isfield(SBMLTrigger, 'initialValue')
initialValue = SBMLTrigger.initialValue;
else
error('initialValue not an attribute on SBML L%dV%d Trigger', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Trigger_create.m 0000644 0000000 0000000 00000005322 11703262336 026405 0 ustar root root function Trigger = Trigger_create(varargin)
% Trigger = Trigger_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Trigger structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getTriggerFieldnames(level, version);
if (num > 0)
values = getTriggerDefaultValues(level, version);
Trigger = cell2struct(values, fieldnames, 2);
%add level and version
Trigger.level = level;
Trigger.version = version;
%check correct structure
if ~isSBML_Trigger(Trigger, level, version)
Trigger = struct();
warning('Warn:BadStruct', 'Failed to create Trigger');
end;
else
Trigger = [];
warning('Warn:InvalidLV', 'Trigger not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Trigger/Contents.m 0000644 0000000 0000000 00000014631 11703262336 025257 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Trigger
%
% The functions allow users to create and work with the SBML Trigger structure.
%
%===============================================================
% Trigger = Trigger_create(level(optional), version(optional) )
%===============================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Trigger structure of the appropriate level and version
%
%=====================================================
% initialValue = Trigger_getInitialValue(SBMLTrigger)
%=====================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the value of the initialValue attribute
%
%=====================================
% math = Trigger_getMath(SBMLTrigger)
%=====================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the value of the math attribute
%
%=========================================
% metaid = Trigger_getMetaid(SBMLTrigger)
%=========================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the value of the metaid attribute
%
%=================================================
% persistent = Trigger_getPersistent(SBMLTrigger)
%=================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the value of the persistent attribute
%
%===========================================
% sboTerm = Trigger_getSBOTerm(SBMLTrigger)
%===========================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the value of the sboTerm attribute
%
%========================================
% value = Trigger_isSetMath(SBMLTrigger)
%========================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%==========================================
% value = Trigger_isSetMetaid(SBMLTrigger)
%==========================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%===========================================
% value = Trigger_isSetSBOTerm(SBMLTrigger)
%===========================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==================================================================
% SBMLTrigger = Trigger_setInitialValue(SBMLTrigger, initialValue)
%==================================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% 2. initialValue, an integer (0/1) representing the value of initialValue to be set
% Returns
% 1. the SBML Trigger structure with the new value for the initialValue attribute
%
%==================================================
% SBMLTrigger = Trigger_setMath(SBMLTrigger, math)
%==================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML Trigger structure with the new value for the math attribute
%
%======================================================
% SBMLTrigger = Trigger_setMetaid(SBMLTrigger, metaid)
%======================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Trigger structure with the new value for the metaid attribute
%
%==============================================================
% SBMLTrigger = Trigger_setPersistent(SBMLTrigger, persistent)
%==============================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% 2. persistent, an integer (0/1) representing the value of persistent to be set
% Returns
% 1. the SBML Trigger structure with the new value for the persistent attribute
%
%========================================================
% SBMLTrigger = Trigger_setSBOTerm(SBMLTrigger, sboTerm)
%========================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Trigger structure with the new value for the sboTerm attribute
%
%==============================================
% SBMLTrigger = Trigger_unsetMath(SBMLTrigger)
%==============================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the SBML Trigger structure with the math attribute unset
%
%================================================
% SBMLTrigger = Trigger_unsetMetaid(SBMLTrigger)
%================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the SBML Trigger structure with the metaid attribute unset
%
%=================================================
% SBMLTrigger = Trigger_unsetSBOTerm(SBMLTrigger)
%=================================================
% Takes
% 1. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the SBML Trigger structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/ 0000755 0000000 0000000 00000000000 11704572244 022616 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testUnitDefinition.m 0000644 0000000 0000000 00000007044 11703262262 026624 0 ustar root root function [fail, num, message] = testUnitDefinition()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing UnitDefinition');
disp('Testing L1V1');
obj = UnitDefinition_create(1, 1);
attributes = {...
{'Name', 1}...
{'Unit', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'UnitDefinition', fail, num, message);
disp('Testing L1V2');
obj = UnitDefinition_create(1, 2);
attributes = {...
{'Name', 1}...
{'Unit', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'UnitDefinition', fail, num, message);
disp('Testing L2V1');
obj = UnitDefinition_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Unit', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'UnitDefinition', fail, num, message);
disp('Testing L2V2');
obj = UnitDefinition_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Unit', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'UnitDefinition', fail, num, message);
disp('Testing L2V3');
obj = UnitDefinition_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Unit', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'UnitDefinition', fail, num, message);
disp('Testing L2V4');
obj = UnitDefinition_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Unit', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'UnitDefinition', fail, num, message);
disp('Testing L3V1');
obj = UnitDefinition_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Unit', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'UnitDefinition', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testUnit.m 0000644 0000000 0000000 00000007271 11703262262 024615 0 ustar root root function [fail, num, message] = testUnit()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Unit');
disp('Testing L1V1');
obj = Unit_create(1, 1);
attributes = {...
{'Kind', 1}...
{'Exponent', 6}...
{'Scale', 6}...
};
[fail, num, message] = testObject(obj, attributes, 'Unit', fail, num, message);
disp('Testing L1V2');
obj = Unit_create(1, 2);
attributes = {...
{'Kind', 1}...
{'Exponent', 6}...
{'Scale', 6}...
};
[fail, num, message] = testObject(obj, attributes, 'Unit', fail, num, message);
disp('Testing L2V1');
obj = Unit_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Kind', 1}...
{'Exponent', 6}...
{'Scale', 6}...
{'Multiplier', 4}...
{'Offset', 4}...
};
[fail, num, message] = testObject(obj, attributes, 'Unit', fail, num, message);
disp('Testing L2V2');
obj = Unit_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Kind', 1}...
{'Exponent', 6}...
{'Scale', 6}...
{'Multiplier', 4}...
};
[fail, num, message] = testObject(obj, attributes, 'Unit', fail, num, message);
disp('Testing L2V3');
obj = Unit_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Kind', 1}...
{'Exponent', 6}...
{'Scale', 6}...
{'Multiplier', 4}...
};
[fail, num, message] = testObject(obj, attributes, 'Unit', fail, num, message);
disp('Testing L2V4');
obj = Unit_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Kind', 1}...
{'Exponent', 6}...
{'Scale', 6}...
{'Multiplier', 4}...
};
[fail, num, message] = testObject(obj, attributes, 'Unit', fail, num, message);
disp('Testing L3V1');
obj = Unit_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Kind', 1}...
{'Exponent', 3}...
{'Scale', 2}...
{'Multiplier', 3}...
};
[fail, num, message] = testObject(obj, attributes, 'Unit', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testTrigger.m 0000644 0000000 0000000 00000005664 11703262262 025305 0 ustar root root function [fail, num, message] = testTrigger()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Trigger');
disp('Testing L1V1');
obj = Trigger_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Trigger', fail, num, message);
disp('Testing L1V2');
obj = Trigger_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Trigger', fail, num, message);
disp('Testing L2V1');
obj = Trigger_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Trigger', fail, num, message);
disp('Testing L2V2');
obj = Trigger_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Trigger', fail, num, message);
disp('Testing L2V3');
obj = Trigger_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Trigger', fail, num, message);
disp('Testing L2V4');
obj = Trigger_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Trigger', fail, num, message);
disp('Testing L3V1');
obj = Trigger_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Persistent', 7}...
{'InitialValue', 7}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Trigger', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testStructures.m 0000644 0000000 0000000 00000003023 11703267342 026054 0 ustar root root function y = testStructures()
%
fail = 0;
fail = fail + TestCreate();
fail = fail + testComponents();
if isBindingInstalled() == 1
fail = fail + testModelGetById();
fail = fail + testModelGetByNum();
fail = fail + testIsInRules();
else
disp('LibSBML binding not installed - some tests could not be run');
end;
y = fail;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testStoichiometryMath.m 0000644 0000000 0000000 00000005637 11703262262 027356 0 ustar root root function [fail, num, message] = testStoichiometryMath()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing StoichiometryMath');
disp('Testing L1V1');
obj = StoichiometryMath_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'StoichiometryMath', fail, num, message);
disp('Testing L1V2');
obj = StoichiometryMath_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'StoichiometryMath', fail, num, message);
disp('Testing L2V1');
obj = StoichiometryMath_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'StoichiometryMath', fail, num, message);
disp('Testing L2V2');
obj = StoichiometryMath_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'StoichiometryMath', fail, num, message);
disp('Testing L2V3');
obj = StoichiometryMath_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'StoichiometryMath', fail, num, message);
disp('Testing L2V4');
obj = StoichiometryMath_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'StoichiometryMath', fail, num, message);
disp('Testing L3V1');
obj = StoichiometryMath_create(3, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'StoichiometryMath', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testSpeciesType.m 0000644 0000000 0000000 00000005735 11703262262 026136 0 ustar root root function [fail, num, message] = testSpeciesType()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing SpeciesType');
disp('Testing L1V1');
obj = SpeciesType_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesType', fail, num, message);
disp('Testing L1V2');
obj = SpeciesType_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesType', fail, num, message);
disp('Testing L2V1');
obj = SpeciesType_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesType', fail, num, message);
disp('Testing L2V2');
obj = SpeciesType_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesType', fail, num, message);
disp('Testing L2V3');
obj = SpeciesType_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesType', fail, num, message);
disp('Testing L2V4');
obj = SpeciesType_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesType', fail, num, message);
disp('Testing L3V1');
obj = SpeciesType_create(3, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesType', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testSpeciesReference.m 0000644 0000000 0000000 00000010106 11703262262 027077 0 ustar root root function [fail, num, message] = testSpeciesReference()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing SpeciesReference');
disp('Testing L1V1');
obj = SpeciesReference_create(1, 1);
attributes = {...
{'Species', 1}...
{'Stoichiometry', 6}...
{'Denominator', 6}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesReference', fail, num, message);
disp('Testing L1V2');
obj = SpeciesReference_create(1, 2);
attributes = {...
{'Species', 1}...
{'Stoichiometry', 6}...
{'Denominator', 6}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesReference', fail, num, message);
disp('Testing L2V1');
obj = SpeciesReference_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Species', 1}...
{'Stoichiometry', 6}...
{'Denominator', 6}...
{'StoichiometryMath', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesReference', fail, num, message);
disp('Testing L2V2');
obj = SpeciesReference_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
{'SBOTerm', 2}...
{'Stoichiometry', 6}...
{'StoichiometryMath', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesReference', fail, num, message);
disp('Testing L2V3');
obj = SpeciesReference_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
{'Stoichiometry', 6}...
{'StoichiometryMath', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesReference', fail, num, message);
disp('Testing L2V4');
obj = SpeciesReference_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
{'Stoichiometry', 6}...
{'StoichiometryMath', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesReference', fail, num, message);
disp('Testing L3V1');
obj = SpeciesReference_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
{'Stoichiometry', 3}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesReference', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testSpeciesConcentrationRule.m 0000644 0000000 0000000 00000006021 11703262262 030640 0 ustar root root function [fail, num, message] = testSpeciesConcentrationRule()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing SpeciesConcentrationRule');
disp('Testing L1V1');
obj = SpeciesConcentrationRule_create(1, 1);
attributes = {...
{'Type', 8}...
{'Formula', 1}...
{'Species', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesConcentrationRule', fail, num, message);
disp('Testing L1V2');
obj = SpeciesConcentrationRule_create(1, 2);
attributes = {...
{'Type', 8}...
{'Formula', 1}...
{'Species', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'SpeciesConcentrationRule', fail, num, message);
disp('Testing L2V1');
obj = SpeciesConcentrationRule_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesConcentrationRule', fail, num, message);
disp('Testing L2V2');
obj = SpeciesConcentrationRule_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesConcentrationRule', fail, num, message);
disp('Testing L2V3');
obj = SpeciesConcentrationRule_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesConcentrationRule', fail, num, message);
disp('Testing L2V4');
obj = SpeciesConcentrationRule_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesConcentrationRule', fail, num, message);
disp('Testing L3V1');
obj = SpeciesConcentrationRule_create(3, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'SpeciesConcentrationRule', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testSpecies.m 0000644 0000000 0000000 00000012441 11703262262 025264 0 ustar root root function [fail, num, message] = testSpecies()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Species');
disp('Testing L1V1');
obj = Species_create(1, 1);
attributes = {...
{'Name', 1}...
{'Compartment', 1}...
{'InitialAmount', 3}...
{'Units', 1}...
{'BoundaryCondition', 7}...
{'Charge', 5}...
};
[fail, num, message] = testObject(obj, attributes, 'Species', fail, num, message);
disp('Testing L1V2');
obj = Species_create(1, 2);
attributes = {...
{'Name', 1}...
{'Compartment', 1}...
{'InitialAmount', 3}...
{'Units', 1}...
{'BoundaryCondition', 7}...
{'Charge', 5}...
};
[fail, num, message] = testObject(obj, attributes, 'Species', fail, num, message);
disp('Testing L2V1');
obj = Species_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Compartment', 1}...
{'InitialAmount', 3}...
{'InitialConcentration', 3}...
{'SubstanceUnits', 1}...
{'SpatialSizeUnits', 1}...
{'HasOnlySubstanceUnits', 7}...
{'BoundaryCondition', 7}...
{'Charge', 5}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Species', fail, num, message);
disp('Testing L2V2');
obj = Species_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'SpeciesType', 1}...
{'Compartment', 1}...
{'InitialAmount', 3}...
{'InitialConcentration', 3}...
{'SubstanceUnits', 1}...
{'SpatialSizeUnits', 1}...
{'HasOnlySubstanceUnits', 7}...
{'BoundaryCondition', 7}...
{'Charge', 5}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Species', fail, num, message);
disp('Testing L2V3');
obj = Species_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'SpeciesType', 1}...
{'Compartment', 1}...
{'InitialAmount', 3}...
{'InitialConcentration', 3}...
{'SubstanceUnits', 1}...
{'HasOnlySubstanceUnits', 7}...
{'BoundaryCondition', 7}...
{'Charge', 5}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Species', fail, num, message);
disp('Testing L2V4');
obj = Species_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'SpeciesType', 1}...
{'Compartment', 1}...
{'InitialAmount', 3}...
{'InitialConcentration', 3}...
{'SubstanceUnits', 1}...
{'HasOnlySubstanceUnits', 7}...
{'BoundaryCondition', 7}...
{'Charge', 5}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Species', fail, num, message);
disp('Testing L3V1');
obj = Species_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Compartment', 1}...
{'InitialAmount', 3}...
{'InitialConcentration', 3}...
{'SubstanceUnits', 1}...
{'HasOnlySubstanceUnits', 7}...
{'BoundaryCondition', 7}...
{'Constant', 7}...
{'ConversionFactor', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Species', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testReaction.m 0000644 0000000 0000000 00000011136 11703262262 025435 0 ustar root root function [fail, num, message] = testReaction()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Reaction');
disp('Testing L1V1');
obj = Reaction_create(1, 1);
attributes = {...
{'Name', 1}...
{'Reactant', 9}...
{'Product', 9}...
{'KineticLaw', 9}...
{'Reversible', 7}...
{'Fast', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Reaction', fail, num, message);
disp('Testing L1V2');
obj = Reaction_create(1, 2);
attributes = {...
{'Name', 1}...
{'Reactant', 9}...
{'Product', 9}...
{'KineticLaw', 9}...
{'Reversible', 7}...
{'Fast', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Reaction', fail, num, message);
disp('Testing L2V1');
obj = Reaction_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Reactant', 9}...
{'Product', 9}...
{'Modifier', 9}...
{'KineticLaw', 9}...
{'Reversible', 7}...
{'Fast', 5}...
};
[fail, num, message] = testObject(obj, attributes, 'Reaction', fail, num, message);
disp('Testing L2V2');
obj = Reaction_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Reactant', 9}...
{'Product', 9}...
{'Modifier', 9}...
{'KineticLaw', 9}...
{'Reversible', 7}...
{'Fast', 5}...
{'SBOTerm', 2}...
};
[fail, num, message] = testObject(obj, attributes, 'Reaction', fail, num, message);
disp('Testing L2V3');
obj = Reaction_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Reactant', 9}...
{'Product', 9}...
{'Modifier', 9}...
{'KineticLaw', 9}...
{'Reversible', 7}...
{'Fast', 5}...
};
[fail, num, message] = testObject(obj, attributes, 'Reaction', fail, num, message);
disp('Testing L2V4');
obj = Reaction_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Reactant', 9}...
{'Product', 9}...
{'Modifier', 9}...
{'KineticLaw', 9}...
{'Reversible', 7}...
{'Fast', 5}...
};
[fail, num, message] = testObject(obj, attributes, 'Reaction', fail, num, message);
disp('Testing L3V1');
obj = Reaction_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Reactant', 9}...
{'Product', 9}...
{'Modifier', 9}...
{'KineticLaw', 9}...
{'Reversible', 7}...
{'Fast', 5}...
{'Compartment', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Reaction', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testRateRule.m 0000644 0000000 0000000 00000006352 11703262262 025420 0 ustar root root function [fail, num, message] = testRateRule()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing RateRule');
disp('Testing L1V1');
obj = RateRule_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'RateRule', fail, num, message);
disp('Testing L1V2');
obj = RateRule_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'RateRule', fail, num, message);
disp('Testing L2V1');
obj = RateRule_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'RateRule', fail, num, message);
disp('Testing L2V2');
obj = RateRule_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'RateRule', fail, num, message);
disp('Testing L2V3');
obj = RateRule_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'RateRule', fail, num, message);
disp('Testing L2V4');
obj = RateRule_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'RateRule', fail, num, message);
disp('Testing L3V1');
obj = RateRule_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'RateRule', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testPriority.m 0000644 0000000 0000000 00000005242 11703262262 025513 0 ustar root root function [fail, num, message] = testPriority()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Priority');
disp('Testing L1V1');
obj = Priority_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Priority', fail, num, message);
disp('Testing L1V2');
obj = Priority_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Priority', fail, num, message);
disp('Testing L2V1');
obj = Priority_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Priority', fail, num, message);
disp('Testing L2V2');
obj = Priority_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Priority', fail, num, message);
disp('Testing L2V3');
obj = Priority_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Priority', fail, num, message);
disp('Testing L2V4');
obj = Priority_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Priority', fail, num, message);
disp('Testing L3V1');
obj = Priority_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Priority', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testParameterRule.m 0000644 0000000 0000000 00000005627 11703262262 026451 0 ustar root root function [fail, num, message] = testParameterRule()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing ParameterRule');
disp('Testing L1V1');
obj = ParameterRule_create(1, 1);
attributes = {...
{'Type', 8}...
{'Formula', 1}...
{'Name', 1}...
{'Units', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'ParameterRule', fail, num, message);
disp('Testing L1V2');
obj = ParameterRule_create(1, 2);
attributes = {...
{'Type', 8}...
{'Formula', 1}...
{'Name', 1}...
{'Units', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'ParameterRule', fail, num, message);
disp('Testing L2V1');
obj = ParameterRule_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'ParameterRule', fail, num, message);
disp('Testing L2V2');
obj = ParameterRule_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'ParameterRule', fail, num, message);
disp('Testing L2V3');
obj = ParameterRule_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'ParameterRule', fail, num, message);
disp('Testing L2V4');
obj = ParameterRule_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'ParameterRule', fail, num, message);
disp('Testing L3V1');
obj = ParameterRule_create(3, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'ParameterRule', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testParameter.m 0000644 0000000 0000000 00000007562 11703262262 025621 0 ustar root root function [fail, num, message] = testParameter()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Parameter');
disp('Testing L1V1');
obj = Parameter_create(1, 1);
attributes = {...
{'Name', 1}...
{'Value', 3}...
{'Units', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Parameter', fail, num, message);
disp('Testing L1V2');
obj = Parameter_create(1, 2);
attributes = {...
{'Name', 1}...
{'Value', 3}...
{'Units', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Parameter', fail, num, message);
disp('Testing L2V1');
obj = Parameter_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Value', 3}...
{'Units', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Parameter', fail, num, message);
disp('Testing L2V2');
obj = Parameter_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Value', 3}...
{'Units', 1}...
{'Constant', 7}...
{'SBOTerm', 2}...
};
[fail, num, message] = testObject(obj, attributes, 'Parameter', fail, num, message);
disp('Testing L2V3');
obj = Parameter_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Value', 3}...
{'Units', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Parameter', fail, num, message);
disp('Testing L2V4');
obj = Parameter_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Value', 3}...
{'Units', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Parameter', fail, num, message);
disp('Testing L3V1');
obj = Parameter_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Value', 3}...
{'Units', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Parameter', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testObject.m 0000644 0000000 0000000 00000023702 11703262262 025101 0 ustar root root function [fail, num, message] = testObject(obj, attributes, component, fail, num, message)
%
% different cases which indicate what type of attribute is being tested
% 1 string
% 2 sboTerm - ie integer with unset value = -1
% 3 double whose unset value is NaN
% 4 double - always set
% 5 boolean - with issetvalue
% 6 int - always set
% 7 boolean - no issetvalue
% 8 L1RuleType - always set
% 9 another structure - test add functions
% 10 SBMLlevel/version - always set - ignore
% if no attributes obj should be empty
if length(attributes) == 0
if (~isempty(obj))
fail = fail + 1;
num = num + 1;
m = sprintf('create%s created an invalid object', component);
disp(m);
message{length(message)+1} = m;
end;
end;
%remove any fbc prefix
for i = 1:length(attributes)
name = attributes{i}{1};
if length(name) > 4
if strcmp(name(1:4), 'Fbc_')
attributes{i}{1} = strcat(upper(name(5:5)), name(6:end));
end;
end;
end;
for i = 1:length(attributes)
switch (attributes{i}{2})
case 7
f = 0;
case 9
[f, m] = testEmpty(component, attributes{i}{1}, obj);
case {4, 6, 8, 10}
[f, m] = testAlwaysSet(component, attributes{i}{1}, obj);
otherwise
[f, m] = testIsNotSet(component, attributes{i}{1}, obj);
end;
num = num + 1;
if f > 0
fail = fail + f;
disp(m);
message{length(message)+1} = m;
end;
end;
for i = 1:length(attributes)
[f, m] = testSet(component, attributes{i}{1}, obj, attributes{i}{2});
num = num + 3;
if f > 0
fail = fail + f;
disp(m);
len = length(message);
for j = 1:length(m)
message{len+j} = m{j};
end;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [fail, message] = testEmpty(component, attribute, obj)
message = {};
singles = {'KineticLaw', 'Trigger', 'Delay', 'Priority', 'StoichiometryMath'};
if isIn(singles, attribute)
fhandle = sprintf('%s_isSet%s', component, attribute);
else
fhandle = sprintf('%s_getNum%ss', component, attribute);
end;
result = feval(fhandle, obj);
if result == 0
fail = 0;
else
fail = 1;
message{1} = sprintf('%s should return 0', fhandle);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [fail, message] = testIsNotSet(component, attribute, obj)
message = {};
fhandle = sprintf('%s_isSet%s', component, attribute);
result = feval(fhandle, obj);
if result == 0
fail = 0;
else
fail = 1;
message{1} = sprintf('%s_isSet%s should return 0', component, attribute);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [fail, message] = testAlwaysSet(component, attribute, obj)
message = {};
fhandle = sprintf('%s_isSet%s', component, attribute);
result = feval(fhandle, obj);
if result == 1
fail = 0;
else
fail = 1;
message{1} = sprintf('%s_isSet%s should return 1', component, attribute);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [fail, message] = testSet(component, attribute, obj, type)
testStr = 'abc';
testDouble = 3.3;
testInt = 2;
testBool = 1;
testL1RuleType = 'rate';
message = {};
fail = 0;
if (type == 9)
[fail, message] = testAdd(component, attribute, obj);
return;
elseif (type == 10) % level/version
return;
end;
fhandle_isSet = sprintf('%s_isSet%s', component, attribute);
fhandle_set = sprintf('%s_set%s', component, attribute);
fhandle_get = sprintf('%s_get%s', component, attribute);
fhandle_unset = sprintf('%s_unset%s', component, attribute);
% set and test that attribute is set
switch (type)
case 1
obj = feval(fhandle_set, obj, testStr);
case 2
obj = feval(fhandle_set, obj, testInt);
case 3
obj = feval(fhandle_set, obj, testDouble);
case 4
obj = feval(fhandle_set, obj, testDouble);
case 5
obj = feval(fhandle_set, obj, testBool);
case 6
obj = feval(fhandle_set, obj, testInt);
case 7
obj = feval(fhandle_set, obj, testBool);
case 8
obj = feval(fhandle_set, obj, testL1RuleType);
otherwise
end;
switch (type)
case 7
result = 1;
otherwise
result = feval(fhandle_isSet, obj);
end;
if result ~= 1
fail = fail + 1;
m = sprintf('%s_set%s failed', component, attribute);
message{length(message)+1} = m;
end;
%get the attribute and check it is correct
result = feval(fhandle_get, obj);
switch (type)
case 1
if ~strcmp(result, testStr)
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
case 2
if result ~= testInt
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
case 3
if result ~= testDouble
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
case 4
if result ~= testDouble
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
case 5
if result ~= testBool
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
case 6
if result ~= testInt
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
case 7
if result ~= testBool
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
case 8
if ~strcmp(result, testL1RuleType)
fail = fail + 1;
m = sprintf('%s_get%s failed', component, attribute);
message{length(message)+1} = m;
end;
otherwise
end;
% unset and check it is unset
switch (type)
case {4, 6, 7, 8}
result = 0;
otherwise
obj = feval(fhandle_unset, obj);
result = feval(fhandle_isSet, obj);
end;
if result ~= 0
fail = fail + 1;
m = sprintf('%s_unset%s failed', component, attribute);
message{length(message)+1} = m;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [fail, message] = testAdd(component, attribute, obj)
fail = 0;
message = {};
singles = {'KineticLaw', 'Trigger', 'Delay', 'Priority', 'StoichiometryMath'};
if isIn(singles, attribute)
single = 1;
else
single = 0;
end;
if strcmp(attribute, 'Rule')
fhandle_create = 'AlgebraicRule_create';
elseif strcmp(attribute, 'Product') || strcmp(attribute, 'Reactant')
fhandle_create = 'SpeciesReference_create';
elseif strcmp(attribute, 'Modifier')
fhandle_create = 'ModifierSpeciesReference_create';
else
fhandle_create = sprintf('%s_create', attribute);
end;
fhandle_get = sprintf('%s_get%s', component, attribute);
if single == 1
fhandle_set = sprintf('%s_set%s', component, attribute);
fhandle_isset = sprintf('%s_isSet%s', component, attribute);
fhandle_unset = sprintf('%s_unset%s', component, attribute);
else
fhandle_set = sprintf('%s_add%s', component, attribute);
fhandle_isset = sprintf('%s_getNum%ss', component, attribute);
fhandle_getLO = sprintf('%s_getListOf%ss', component, attribute);
end;
fhandle_createSub = sprintf('%s_create%s', component, attribute);
if strcmp(obj.typecode, 'SBML_MODEL')
newObj = feval(fhandle_create, obj.SBML_level, obj.SBML_version);
else
newObj = feval(fhandle_create, obj.level, obj.version);
end;
% add new obj and check is now set
obj = feval(fhandle_set, obj, newObj);
result = feval(fhandle_isset, obj);
if result == 1
fail = 0;
else
fail = 1;
message{1} = sprintf('%s failed', fhandle_set);
end;
% get the obj and test
if single == 1
returnObj = feval(fhandle_get, obj);
else
returnObj = feval(fhandle_get, obj, 1);
end;
if areIdentical(returnObj, newObj)
fail = 0;
else
fail = 1;
message{1} = sprintf('%s failed', fhandle_set);
end;
% test unset single obj
if single
obj = feval(fhandle_unset, obj);
result = feval(fhandle_isset, obj);
if result == 0
fail = 0;
else
fail = 1;
message{1} = sprintf('%s failed', fhandle_unset);
end;
else
obj = feval(fhandle_set, obj, newObj);
lo = feval(fhandle_getLO, obj);
result = length(lo);
if result == 2
fail = 0;
else
fail = 1;
message{1} = sprintf('%s failed', fhandle_getLO);
end;
end;
% test create
if single
obj = feval(fhandle_createSub, obj);
result = feval(fhandle_isset, obj);
if result == 1
fail = 0;
else
fail = 1;
message{1} = sprintf('%s failed', fhandle_createSub);
end;
else
obj = feval(fhandle_createSub, obj);
lo = feval(fhandle_getLO, obj);
result = length(lo);
if result == 3
fail = 0;
else
fail = 1;
message{1} = sprintf('%s failed', fhandle_createSub);
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function value = isIn(array, thing)
value = sum(ismember(array, thing));
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testModifierSpeciesReference.m 0000644 0000000 0000000 00000007045 11703262262 030566 0 ustar root root function [fail, num, message] = testModifierSpeciesReference()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing ModifierSpeciesReference');
disp('Testing L1V1');
obj = ModifierSpeciesReference_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'ModifierSpeciesReference', fail, num, message);
disp('Testing L1V2');
obj = ModifierSpeciesReference_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'ModifierSpeciesReference', fail, num, message);
disp('Testing L2V1');
obj = ModifierSpeciesReference_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Species', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'ModifierSpeciesReference', fail, num, message);
disp('Testing L2V2');
obj = ModifierSpeciesReference_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
{'SBOTerm', 2}...
};
[fail, num, message] = testObject(obj, attributes, 'ModifierSpeciesReference', fail, num, message);
disp('Testing L2V3');
obj = ModifierSpeciesReference_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'ModifierSpeciesReference', fail, num, message);
disp('Testing L2V4');
obj = ModifierSpeciesReference_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'ModifierSpeciesReference', fail, num, message);
disp('Testing L3V1');
obj = ModifierSpeciesReference_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Species', 1}...
{'Id', 1}...
{'Name', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'ModifierSpeciesReference', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testModelGetByNum.m 0000644 0000000 0000000 00000006143 11703262262 026346 0 ustar root root function [fail, num, message] = testModelGetByNum()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing ModelGetByNum');
m = TranslateSBML('../../Test/test-data/l2v3-all.xml');
fd = Model_getFunctionDefinition(m, 1);
m1 = Model_addFunctionDefinition(m, fd);
fail = fail + ~areIdentical(fd, Model_getFunctionDefinition(m1, 2));
fd = Model_getUnitDefinition(m, 1);
m1 = Model_addUnitDefinition(m, fd);
fail = fail + ~areIdentical(fd, Model_getUnitDefinition(m1, 2));
fd = Model_getCompartment(m, 1);
m1 = Model_addCompartment(m, fd);
fail = fail + ~areIdentical(fd, Model_getCompartment(m1, 2));
fd = Model_getSpecies(m, 1);
m1 = Model_addSpecies(m, fd);
fail = fail + ~areIdentical(fd, Model_getSpecies(m1, 2));
fd = Model_getCompartmentType(m, 1);
m1 = Model_addCompartmentType(m, fd);
fail = fail + ~areIdentical(fd, Model_getCompartmentType(m1, 2));
fd = Model_getSpeciesType(m, 1);
m1 = Model_addSpeciesType(m, fd);
fail = fail + ~areIdentical(fd, Model_getSpeciesType(m1, 2));
fd = Model_getParameter(m, 1);
m1 = Model_addParameter(m, fd);
fail = fail + ~areIdentical(fd, Model_getParameter(m1, 6));
fd = Model_getInitialAssignment(m, 1);
m1 = Model_addInitialAssignment(m, fd);
fail = fail + ~areIdentical(fd, Model_getInitialAssignment(m1, 2));
fd = Model_getRule(m, 1);
m1 = Model_addRule(m, fd);
fail = fail + ~areIdentical(fd, Model_getRule(m1, 4));
fd = Model_getConstraint(m, 1);
m1 = Model_addConstraint(m, fd);
fail = fail + ~areIdentical(fd, Model_getConstraint(m1, 2));
fd = Model_getReaction(m, 1);
m1 = Model_addReaction(m, fd);
fail = fail + ~areIdentical(fd, Model_getReaction(m1, 2));
fd = Model_getEvent(m, 1);
m1 = Model_addEvent(m, fd);
fail = fail + ~areIdentical(fd, Model_getEvent(m1, 2));
num = 11;
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testModelGetById.m 0000644 0000000 0000000 00000010546 11703262262 026145 0 ustar root root function [fail, num, message] = testModelGetById()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing ModelGetById');
m = TranslateSBML('../../Test/test-data/l2v3-all.xml');
fail = fail + ~areIdentical(Model_getFunctionDefinition(m, 1), ...
Model_getFunctionDefinitionById(m, 'fd'));
fail = fail + ~areIdentical(Model_getUnitDefinition(m, 1), ...
Model_getUnitDefinitionById(m, 'ud1'));
fail = fail + ~areIdentical(Model_getCompartmentType(m, 1), ...
Model_getCompartmentTypeById(m, 'hh'));
fail = fail + ~areIdentical(Model_getSpeciesType(m, 1), ...
Model_getSpeciesTypeById(m, 'gg'));
fail = fail + ~areIdentical(Model_getParameter(m, 1), ...
Model_getParameterById(m, 'p'));
fail = fail + ~areIdentical(Model_getParameter(m, 2), ...
Model_getParameterById(m, 'p1'));
fail = fail + ~areIdentical(Model_getParameter(m, 3), ...
Model_getParameterById(m, 'p2'));
fail = fail + ~areIdentical(Model_getParameter(m, 4), ...
Model_getParameterById(m, 'p3'));
fail = fail + ~areIdentical(Model_getParameter(m, 5), ...
Model_getParameterById(m, 'x'));
fail = fail + ~areIdentical(Model_getInitialAssignment(m, 1), ...
Model_getInitialAssignmentBySymbol(m, 'p1'));
fail = fail + ~areIdentical(Model_getCompartment(m, 1), ...
Model_getCompartmentById(m, 'a'));
fail = fail + ~areIdentical(Model_getSpecies(m, 1), ...
Model_getSpeciesById(m, 's'));
fail = fail + ~areIdentical(Model_getRule(m, 2), ...
Model_getAssignmentRuleByVariable(m, 'p2'));
fail = fail + ~areIdentical(Model_getRule(m, 3), ...
Model_getRateRuleByVariable(m, 'p3'));
fail = fail + ~areIdentical(Model_getReaction(m, 1), ...
Model_getReactionById(m, 'r'));
fail = fail + ~areIdentical(Model_getEvent(m, 1), ...
Model_getEventById(m, 'w'));
fail = fail + ~areIdentical(Model_getConstraint(m, 1), ...
Model_getConstraint(m, 1));
fail = fail + ~isempty(Model_getFunctionDefinitionById(m, 'xxx'));
fail = fail + ~isempty(Model_getUnitDefinitionById(m, 'xxx'));
fail = fail + ~isempty(Model_getCompartmentById(m, 'xxx'));
fail = fail + ~isempty(Model_getSpeciesById(m, 'xxx'));
fail = fail + ~isempty(Model_getCompartmentTypeById(m, 'xxx'));
fail = fail + ~isempty(Model_getSpeciesTypeById(m, 'xxx'));
fail = fail + ~isempty(Model_getParameterById(m, 'xxx'));
fail = fail + ~isempty(Model_getInitialAssignmentBySymbol(m, 'xxx'));
fail = fail + ~isempty(Model_getReactionById(m, 'xxx'));
fail = fail + ~isempty(Model_getEventById(m, 'xxx'));
fail = fail + ~isempty(Model_getAssignmentRuleByVariable(m, 'xxx'));
fail = fail + ~isempty(Model_getRateRuleByVariable(m, 'xxx'));
num = 29;
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testModel.m 0000644 0000000 0000000 00000014401 11703262262 024727 0 ustar root root function [fail, num, message] = testModel()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Model');
disp('Testing L1V1');
obj = Model_create(1, 1);
attributes = {...
{'SBML_level', 10}...
{'SBML_version', 10}...
{'Name', 1}...
{'UnitDefinition', 9}...
{'Compartment', 9}...
{'Species', 9}...
{'Parameter', 9}...
{'Rule', 9}...
{'Reaction', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Model', fail, num, message);
disp('Testing L1V2');
obj = Model_create(1, 2);
attributes = {...
{'SBML_level', 10}...
{'SBML_version', 10}...
{'Name', 1}...
{'UnitDefinition', 9}...
{'Compartment', 9}...
{'Species', 9}...
{'Parameter', 9}...
{'Rule', 9}...
{'Reaction', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Model', fail, num, message);
disp('Testing L2V1');
obj = Model_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'SBML_level', 10}...
{'SBML_version', 10}...
{'Name', 1}...
{'Id', 1}...
{'FunctionDefinition', 9}...
{'UnitDefinition', 9}...
{'Compartment', 9}...
{'Species', 9}...
{'Parameter', 9}...
{'Rule', 9}...
{'Reaction', 9}...
{'Event', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Model', fail, num, message);
disp('Testing L2V2');
obj = Model_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'SBML_level', 10}...
{'SBML_version', 10}...
{'Name', 1}...
{'Id', 1}...
{'SBOTerm', 2}...
{'FunctionDefinition', 9}...
{'UnitDefinition', 9}...
{'CompartmentType', 9}...
{'SpeciesType', 9}...
{'Compartment', 9}...
{'Species', 9}...
{'Parameter', 9}...
{'InitialAssignment', 9}...
{'Rule', 9}...
{'Constraint', 9}...
{'Reaction', 9}...
{'Event', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Model', fail, num, message);
disp('Testing L2V3');
obj = Model_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBML_level', 10}...
{'SBML_version', 10}...
{'Name', 1}...
{'Id', 1}...
{'SBOTerm', 2}...
{'FunctionDefinition', 9}...
{'UnitDefinition', 9}...
{'CompartmentType', 9}...
{'SpeciesType', 9}...
{'Compartment', 9}...
{'Species', 9}...
{'Parameter', 9}...
{'InitialAssignment', 9}...
{'Rule', 9}...
{'Constraint', 9}...
{'Reaction', 9}...
{'Event', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Model', fail, num, message);
disp('Testing L2V4');
obj = Model_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBML_level', 10}...
{'SBML_version', 10}...
{'Name', 1}...
{'Id', 1}...
{'SBOTerm', 2}...
{'FunctionDefinition', 9}...
{'UnitDefinition', 9}...
{'CompartmentType', 9}...
{'SpeciesType', 9}...
{'Compartment', 9}...
{'Species', 9}...
{'Parameter', 9}...
{'InitialAssignment', 9}...
{'Rule', 9}...
{'Constraint', 9}...
{'Reaction', 9}...
{'Event', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Model', fail, num, message);
disp('Testing L3V1');
obj = Model_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBML_level', 10}...
{'SBML_version', 10}...
{'Name', 1}...
{'Id', 1}...
{'SBOTerm', 2}...
{'FunctionDefinition', 9}...
{'UnitDefinition', 9}...
{'Compartment', 9}...
{'Species', 9}...
{'Parameter', 9}...
{'InitialAssignment', 9}...
{'Rule', 9}...
{'Constraint', 9}...
{'Reaction', 9}...
{'Event', 9}...
{'SubstanceUnits', 1}...
{'TimeUnits', 1}...
{'LengthUnits', 1}...
{'AreaUnits', 1}...
{'VolumeUnits', 1}...
{'ExtentUnits', 1}...
{'ConversionFactor', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Model', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testLocalParameter.m 0000644 0000000 0000000 00000005531 11703262262 026566 0 ustar root root function [fail, num, message] = testLocalParameter()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing LocalParameter');
disp('Testing L1V1');
obj = LocalParameter_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'LocalParameter', fail, num, message);
disp('Testing L1V2');
obj = LocalParameter_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'LocalParameter', fail, num, message);
disp('Testing L2V1');
obj = LocalParameter_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'LocalParameter', fail, num, message);
disp('Testing L2V2');
obj = LocalParameter_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'LocalParameter', fail, num, message);
disp('Testing L2V3');
obj = LocalParameter_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'LocalParameter', fail, num, message);
disp('Testing L2V4');
obj = LocalParameter_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'LocalParameter', fail, num, message);
disp('Testing L3V1');
obj = LocalParameter_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Value', 3}...
{'Units', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'LocalParameter', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testKineticLaw.m 0000644 0000000 0000000 00000007406 11703262262 025730 0 ustar root root function [fail, num, message] = testKineticLaw()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing KineticLaw');
disp('Testing L1V1');
obj = KineticLaw_create(1, 1);
attributes = {...
{'Formula', 1}...
{'Parameter', 9}...
{'TimeUnits', 1}...
{'SubstanceUnits', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'KineticLaw', fail, num, message);
disp('Testing L1V2');
obj = KineticLaw_create(1, 2);
attributes = {...
{'Formula', 1}...
{'Parameter', 9}...
{'TimeUnits', 1}...
{'SubstanceUnits', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'KineticLaw', fail, num, message);
disp('Testing L2V1');
obj = KineticLaw_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Formula', 1}...
{'Math', 1}...
{'Parameter', 9}...
{'TimeUnits', 1}...
{'SubstanceUnits', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'KineticLaw', fail, num, message);
disp('Testing L2V2');
obj = KineticLaw_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Formula', 1}...
{'Math', 1}...
{'Parameter', 9}...
{'SBOTerm', 2}...
};
[fail, num, message] = testObject(obj, attributes, 'KineticLaw', fail, num, message);
disp('Testing L2V3');
obj = KineticLaw_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Math', 1}...
{'Parameter', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'KineticLaw', fail, num, message);
disp('Testing L2V4');
obj = KineticLaw_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Math', 1}...
{'Parameter', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'KineticLaw', fail, num, message);
disp('Testing L3V1');
obj = KineticLaw_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
{'LocalParameter', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'KineticLaw', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testIsInRules.m 0000644 0000000 0000000 00000011244 11703262262 025546 0 ustar root root function fail = testIsInRules()
%
fail = 0;
numTests = 36;
m = TranslateSBML('../../Test/test-data/testIsInRules.xml');
rules = m.rule;
s1 = m.species(1);
s2 = m.species(2);
s3 = m.species(3);
c1 = m.compartment(1);
c2 = m.compartment(2);
c3 = m.compartment(3);
p1 = m.parameter(1);
p2 = m.parameter(2);
p3 = m.parameter(3);
sr1 = m.reaction(1).product(1);
sr2 = m.reaction(1).product(2);
sr3 = m.reaction(1).product(3);
fail = fail + TestFunction('Compartment_isInAlgebraicRule', 2, 1, c1, rules, 1);
fail = fail + TestFunction('Compartment_isInAlgebraicRule', 2, 1, c2, rules, 0);
fail = fail + TestFunction('Compartment_isInAlgebraicRule', 2, 1, c3, rules, 0);
fail = fail + TestFunction('Species_isInAlgebraicRule', 2, 1, s1, rules, 0);
fail = fail + TestFunction('Species_isInAlgebraicRule', 2, 1, s2, rules, 1);
fail = fail + TestFunction('Species_isInAlgebraicRule', 2, 1, s3, rules, 0);
fail = fail + TestFunction('Parameter_isInAlgebraicRule', 2, 1, p1, rules, 0);
fail = fail + TestFunction('Parameter_isInAlgebraicRule', 2, 1, p2, rules, 0);
fail = fail + TestFunction('Parameter_isInAlgebraicRule', 2, 1, p3, rules, 1);
fail = fail + TestFunction('SpeciesReference_isInAlgebraicRule', 2, 1, sr1, rules, 1);
fail = fail + TestFunction('SpeciesReference_isInAlgebraicRule', 2, 1, sr2, rules, 0);
fail = fail + TestFunction('SpeciesReference_isInAlgebraicRule', 2, 1, sr3, rules, 0);
fail = fail + TestFunction('Compartment_isAssignedByRule', 2, 1, c1, rules, 0);
fail = fail + TestFunction('Compartment_isAssignedByRule', 2, 1, c2, rules, 3);
fail = fail + TestFunction('Compartment_isAssignedByRule', 2, 1, c3, rules, 0);
fail = fail + TestFunction('Species_isAssignedByRule', 2, 1, s1, rules, 4);
fail = fail + TestFunction('Species_isAssignedByRule', 2, 1, s2, rules, 0);
fail = fail + TestFunction('Species_isAssignedByRule', 2, 1, s3, rules, 0);
fail = fail + TestFunction('Parameter_isAssignedByRule', 2, 1, p1, rules, 2);
fail = fail + TestFunction('Parameter_isAssignedByRule', 2, 1, p2, rules, 0);
fail = fail + TestFunction('Parameter_isAssignedByRule', 2, 1, p3, rules, 0);
fail = fail + TestFunction('SpeciesReference_isAssignedByRule', 2, 1, sr1, rules, 0);
fail = fail + TestFunction('SpeciesReference_isAssignedByRule', 2, 1, sr2, rules, 5);
fail = fail + TestFunction('SpeciesReference_isAssignedByRule', 2, 1, sr3, rules, 0);
fail = fail + TestFunction('Compartment_isAssignedByRateRule', 2, 1, c1, rules, 0);
fail = fail + TestFunction('Compartment_isAssignedByRateRule', 2, 1, c2, rules, 0);
fail = fail + TestFunction('Compartment_isAssignedByRateRule', 2, 1, c3, rules, 8);
fail = fail + TestFunction('Species_isAssignedByRateRule', 2, 1, s1, rules, 0);
fail = fail + TestFunction('Species_isAssignedByRateRule', 2, 1, s2, rules, 0);
fail = fail + TestFunction('Species_isAssignedByRateRule', 2, 1, s3, rules, 9);
fail = fail + TestFunction('Parameter_isAssignedByRateRule', 2, 1, p1, rules, 0);
fail = fail + TestFunction('Parameter_isAssignedByRateRule', 2, 1, p2, rules, 7);
fail = fail + TestFunction('Parameter_isAssignedByRateRule', 2, 1, p3, rules, 0);
fail = fail + TestFunction('SpeciesReference_isAssignedByRateRule', 2, 1, sr1, rules, 0);
fail = fail + TestFunction('SpeciesReference_isAssignedByRateRule', 2, 1, sr2, rules, 0);
fail = fail + TestFunction('SpeciesReference_isAssignedByRateRule', 2, 1, sr3, rules, 6);
disp(sprintf('Number tests: %d', numTests));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((numTests-fail)/numTests)*100));
y = fail;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testInitialAssignment.m 0000644 0000000 0000000 00000006365 11703262262 027323 0 ustar root root function [fail, num, message] = testInitialAssignment()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing InitialAssignment');
disp('Testing L1V1');
obj = InitialAssignment_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'InitialAssignment', fail, num, message);
disp('Testing L1V2');
obj = InitialAssignment_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'InitialAssignment', fail, num, message);
disp('Testing L2V1');
obj = InitialAssignment_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'InitialAssignment', fail, num, message);
disp('Testing L2V2');
obj = InitialAssignment_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Symbol', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'InitialAssignment', fail, num, message);
disp('Testing L2V3');
obj = InitialAssignment_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Symbol', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'InitialAssignment', fail, num, message);
disp('Testing L2V4');
obj = InitialAssignment_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Symbol', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'InitialAssignment', fail, num, message);
disp('Testing L3V1');
obj = InitialAssignment_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Symbol', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'InitialAssignment', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testFunctionDefinition.m 0000644 0000000 0000000 00000006756 11703262262 027503 0 ustar root root function [fail, num, message] = testFunctionDefinition()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing FunctionDefinition');
disp('Testing L1V1');
obj = FunctionDefinition_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FunctionDefinition', fail, num, message);
disp('Testing L1V2');
obj = FunctionDefinition_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FunctionDefinition', fail, num, message);
disp('Testing L2V1');
obj = FunctionDefinition_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'FunctionDefinition', fail, num, message);
disp('Testing L2V2');
obj = FunctionDefinition_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'FunctionDefinition', fail, num, message);
disp('Testing L2V3');
obj = FunctionDefinition_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'FunctionDefinition', fail, num, message);
disp('Testing L2V4');
obj = FunctionDefinition_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'FunctionDefinition', fail, num, message);
disp('Testing L3V1');
obj = FunctionDefinition_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'FunctionDefinition', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testEventAssignment.m 0000644 0000000 0000000 00000006513 11703262262 027006 0 ustar root root function [fail, num, message] = testEventAssignment()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing EventAssignment');
disp('Testing L1V1');
obj = EventAssignment_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'EventAssignment', fail, num, message);
disp('Testing L1V2');
obj = EventAssignment_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'EventAssignment', fail, num, message);
disp('Testing L2V1');
obj = EventAssignment_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Variable', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'EventAssignment', fail, num, message);
disp('Testing L2V2');
obj = EventAssignment_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Variable', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'EventAssignment', fail, num, message);
disp('Testing L2V3');
obj = EventAssignment_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Variable', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'EventAssignment', fail, num, message);
disp('Testing L2V4');
obj = EventAssignment_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Variable', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'EventAssignment', fail, num, message);
disp('Testing L3V1');
obj = EventAssignment_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Variable', 1}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'EventAssignment', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testEvent.m 0000644 0000000 0000000 00000007522 11703262262 024756 0 ustar root root function [fail, num, message] = testEvent()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Event');
disp('Testing L1V1');
obj = Event_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Event', fail, num, message);
disp('Testing L1V2');
obj = Event_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Event', fail, num, message);
disp('Testing L2V1');
obj = Event_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Trigger', 1}...
{'Delay', 1}...
{'TimeUnits', 1}...
{'EventAssignment', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Event', fail, num, message);
disp('Testing L2V2');
obj = Event_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'Trigger', 1}...
{'Delay', 1}...
{'TimeUnits', 1}...
{'SBOTerm', 2}...
{'EventAssignment', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Event', fail, num, message);
disp('Testing L2V3');
obj = Event_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'Trigger', 9}...
{'Delay', 9}...
{'EventAssignment', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Event', fail, num, message);
disp('Testing L2V4');
obj = Event_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'UseValuesFromTriggerTime', 7}...
{'Trigger', 9}...
{'Delay', 9}...
{'EventAssignment', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Event', fail, num, message);
disp('Testing L3V1');
obj = Event_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'UseValuesFromTriggerTime', 7}...
{'Trigger', 9}...
{'Delay', 9}...
{'Priority', 9}...
{'EventAssignment', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Event', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testDelay.m 0000644 0000000 0000000 00000005514 11703262262 024732 0 ustar root root function [fail, num, message] = testDelay()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Delay');
disp('Testing L1V1');
obj = Delay_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Delay', fail, num, message);
disp('Testing L1V2');
obj = Delay_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Delay', fail, num, message);
disp('Testing L2V1');
obj = Delay_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Delay', fail, num, message);
disp('Testing L2V2');
obj = Delay_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Delay', fail, num, message);
disp('Testing L2V3');
obj = Delay_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Delay', fail, num, message);
disp('Testing L2V4');
obj = Delay_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Delay', fail, num, message);
disp('Testing L3V1');
obj = Delay_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Delay', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/TestCreate.m 0000644 0000000 0000000 00000005403 11703262262 025034 0 ustar root root function y = TestCreate()
%
fail = 0;
numTests = 0;
warning('off', 'Warn:InvalidLV');
if exist('OCTAVE_VERSION')
warning('off', 'Octave:divide-by-zero');
end;
disp('Testing create functions');
typecodes = {'SBML_ALGEBRAIC_RULE', 'SBML_ASSIGNMENT_RULE', ...
'SBML_COMPARTMENT', 'SBML_COMPARTMENT_TYPE', 'SBML_COMPARTMENT_VOLUME_RULE', ...
'SBML_CONSTRAINT', 'SBML_DELAY', 'SBML_EVENT', 'SBML_EVENT_ASSIGNMENT', ...
'SBML_FUNCTION_DEFINITION', 'SBML_INITIAL_ASSIGNMENT', 'SBML_KINETIC_LAW', ...
'SBML_LOCAL_PARAMETER', 'SBML_MODEL', 'SBML_MODIFIER_SPECIES_REFERENCE', ...
'SBML_PARAMETER', 'SBML_PARAMETER_RULE', 'SBML_PRIORITY', 'SBML_RATE_RULE', ...
'SBML_REACTION', 'SBML_SPECIES', 'SBML_SPECIES_CONCENTRATION_RULE', ...
'SBML_SPECIES_REFERENCE', 'SBML_SPECIES_TYPE', 'SBML_STOICHIOMETRY_MATH', ...
'SBML_TRIGGER', 'SBML_UNIT', 'SBML_UNIT_DEFINITION'};
warning('off', 'Warn:InvalidLV');
for i = 1:length(typecodes)
for level = 1:3
switch (level)
case 1
lastver = 2;
case 2
lastver = 4;
case 3
lastver = 1;
otherwise
lastver = 1;
end;
for version = 1:lastver
warning('off', 'Warn:InvalidLV');
obj = Object_create(typecodes{i} ,level, version);
numTests = numTests+1;
if (~isempty(obj) && ~isValid(obj, level, version))
fail = fail + 1;
end;
end;
end;
end;
warning('on', 'Warn:InvalidLV');
disp(sprintf('Number tests: %d', numTests));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((numTests-fail)/numTests)*100));
y = fail;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testConstraint.m 0000644 0000000 0000000 00000006211 11703262262 026013 0 ustar root root function [fail, num, message] = testConstraint()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Constraint');
disp('Testing L1V1');
obj = Constraint_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Constraint', fail, num, message);
disp('Testing L1V2');
obj = Constraint_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Constraint', fail, num, message);
disp('Testing L2V1');
obj = Constraint_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Constraint', fail, num, message);
disp('Testing L2V2');
obj = Constraint_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
{'Message', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Constraint', fail, num, message);
disp('Testing L2V3');
obj = Constraint_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
{'Message', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Constraint', fail, num, message);
disp('Testing L2V4');
obj = Constraint_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
{'Message', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Constraint', fail, num, message);
disp('Testing L3V1');
obj = Constraint_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Math', 1}...
{'Message', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Constraint', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testComponents.m 0000644 0000000 0000000 00000006151 11703262262 026017 0 ustar root root function [fail] = testComponents()
%
fail = 0;
num = 0;
message = {};
[f, n, m] = testAlgebraicRule;
fail = fail + f;
num = num + n;
[f, n, m] = testAssignmentRule;
fail = fail + f;
num = num + n;
[f, n, m] = testCompartment;
fail = fail + f;
num = num + n;
[f, n, m] = testCompartmentType;
fail = fail + f;
num = num + n;
[f, n, m] = testCompartmentVolumeRule;
fail = fail + f;
num = num + n;
[f, n, m] = testConstraint;
fail = fail + f;
num = num + n;
[f, n, m] = testDelay;
fail = fail + f;
num = num + n;
[f, n, m] = testEvent;
fail = fail + f;
num = num + n;
[f, n, m] = testEventAssignment;
fail = fail + f;
num = num + n;
[f, n, m] = testFunctionDefinition;
fail = fail + f;
num = num + n;
[f, n, m] = testInitialAssignment;
fail = fail + f;
num = num + n;
[f, n, m] = testKineticLaw;
fail = fail + f;
num = num + n;
[f, n, m] = testLocalParameter;
fail = fail + f;
num = num + n;
[f, n, m] = testModel;
fail = fail + f;
num = num + n;
[f, n, m] = testModifierSpeciesReference;
fail = fail + f;
num = num + n;
[f, n, m] = testParameter;
fail = fail + f;
num = num + n;
[f, n, m] = testParameterRule;
fail = fail + f;
num = num + n;
[f, n, m] = testPriority;
fail = fail + f;
num = num + n;
[f, n, m] = testRateRule;
fail = fail + f;
num = num + n;
[f, n, m] = testReaction;
fail = fail + f;
num = num + n;
[f, n, m] = testSpecies;
fail = fail + f;
num = num + n;
[f, n, m] = testSpeciesConcentrationRule;
fail = fail + f;
num = num + n;
[f, n, m] = testSpeciesReference;
fail = fail + f;
num = num + n;
[f, n, m] = testSpeciesType;
fail = fail + f;
num = num + n;
[f, n, m] = testStoichiometryMath;
fail = fail + f;
num = num + n;
[f, n, m] = testTrigger;
fail = fail + f;
num = num + n;
[f, n, m] = testUnit;
fail = fail + f;
num = num + n;
[f, n, m] = testUnitDefinition;
fail = fail + f;
num = num + n;
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testCompartmentVolumeRule.m 0000644 0000000 0000000 00000005751 11703262262 030210 0 ustar root root function [fail, num, message] = testCompartmentVolumeRule()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing CompartmentVolumeRule');
disp('Testing L1V1');
obj = CompartmentVolumeRule_create(1, 1);
attributes = {...
{'Type', 8}...
{'Formula', 1}...
{'Compartment', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'CompartmentVolumeRule', fail, num, message);
disp('Testing L1V2');
obj = CompartmentVolumeRule_create(1, 2);
attributes = {...
{'Type', 8}...
{'Formula', 1}...
{'Compartment', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'CompartmentVolumeRule', fail, num, message);
disp('Testing L2V1');
obj = CompartmentVolumeRule_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentVolumeRule', fail, num, message);
disp('Testing L2V2');
obj = CompartmentVolumeRule_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentVolumeRule', fail, num, message);
disp('Testing L2V3');
obj = CompartmentVolumeRule_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentVolumeRule', fail, num, message);
disp('Testing L2V4');
obj = CompartmentVolumeRule_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentVolumeRule', fail, num, message);
disp('Testing L3V1');
obj = CompartmentVolumeRule_create(3, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentVolumeRule', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testCompartmentType.m 0000644 0000000 0000000 00000006035 11703262262 027026 0 ustar root root function [fail, num, message] = testCompartmentType()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing CompartmentType');
disp('Testing L1V1');
obj = CompartmentType_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentType', fail, num, message);
disp('Testing L1V2');
obj = CompartmentType_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentType', fail, num, message);
disp('Testing L2V1');
obj = CompartmentType_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentType', fail, num, message);
disp('Testing L2V2');
obj = CompartmentType_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'CompartmentType', fail, num, message);
disp('Testing L2V3');
obj = CompartmentType_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'CompartmentType', fail, num, message);
disp('Testing L2V4');
obj = CompartmentType_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'CompartmentType', fail, num, message);
disp('Testing L3V1');
obj = CompartmentType_create(3, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'CompartmentType', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testCompartment.m 0000644 0000000 0000000 00000010571 11703262262 026164 0 ustar root root function [fail, num, message] = testCompartment()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Compartment');
disp('Testing L1V1');
obj = Compartment_create(1, 1);
attributes = {...
{'Name', 1}...
{'Volume', 3}...
{'Units', 1}...
{'Outside', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Compartment', fail, num, message);
disp('Testing L1V2');
obj = Compartment_create(1, 2);
attributes = {...
{'Name', 1}...
{'Volume', 3}...
{'Units', 1}...
{'Outside', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'Compartment', fail, num, message);
disp('Testing L2V1');
obj = Compartment_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'SpatialDimensions', 6}...
{'Size', 3}...
{'Units', 1}...
{'Outside', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Compartment', fail, num, message);
disp('Testing L2V2');
obj = Compartment_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'Name', 1}...
{'Id', 1}...
{'CompartmentType', 1}...
{'SpatialDimensions', 6}...
{'Size', 3}...
{'Units', 1}...
{'Outside', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Compartment', fail, num, message);
disp('Testing L2V3');
obj = Compartment_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'CompartmentType', 1}...
{'SpatialDimensions', 6}...
{'Size', 3}...
{'Units', 1}...
{'Outside', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Compartment', fail, num, message);
disp('Testing L2V4');
obj = Compartment_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'CompartmentType', 1}...
{'SpatialDimensions', 6}...
{'Size', 3}...
{'Units', 1}...
{'Outside', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Compartment', fail, num, message);
disp('Testing L3V1');
obj = Compartment_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Name', 1}...
{'Id', 1}...
{'SpatialDimensions', 3}...
{'Size', 3}...
{'Units', 1}...
{'Constant', 7}...
};
[fail, num, message] = testObject(obj, attributes, 'Compartment', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testAssignmentRule.m 0000644 0000000 0000000 00000006512 11703262262 026633 0 ustar root root function [fail, num, message] = testAssignmentRule()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing AssignmentRule');
disp('Testing L1V1');
obj = AssignmentRule_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'AssignmentRule', fail, num, message);
disp('Testing L1V2');
obj = AssignmentRule_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'AssignmentRule', fail, num, message);
disp('Testing L2V1');
obj = AssignmentRule_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AssignmentRule', fail, num, message);
disp('Testing L2V2');
obj = AssignmentRule_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AssignmentRule', fail, num, message);
disp('Testing L2V3');
obj = AssignmentRule_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AssignmentRule', fail, num, message);
disp('Testing L2V4');
obj = AssignmentRule_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AssignmentRule', fail, num, message);
disp('Testing L3V1');
obj = AssignmentRule_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
{'Variable', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AssignmentRule', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Test/testAlgebraicRule.m 0000644 0000000 0000000 00000006367 11703262262 026404 0 ustar root root function [fail, num, message] = testAlgebraicRule()
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing AlgebraicRule');
disp('Testing L1V1');
obj = AlgebraicRule_create(1, 1);
attributes = {...
{'Formula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AlgebraicRule', fail, num, message);
disp('Testing L1V2');
obj = AlgebraicRule_create(1, 2);
attributes = {...
{'Formula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AlgebraicRule', fail, num, message);
disp('Testing L2V1');
obj = AlgebraicRule_create(2, 1);
attributes = {...
{'Metaid', 1}...
{'Formula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AlgebraicRule', fail, num, message);
disp('Testing L2V2');
obj = AlgebraicRule_create(2, 2);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AlgebraicRule', fail, num, message);
disp('Testing L2V3');
obj = AlgebraicRule_create(2, 3);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AlgebraicRule', fail, num, message);
disp('Testing L2V4');
obj = AlgebraicRule_create(2, 4);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AlgebraicRule', fail, num, message);
disp('Testing L3V1');
obj = AlgebraicRule_create(3, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Formula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'AlgebraicRule', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/ 0000755 0000000 0000000 00000000000 11704572246 025215 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/temp.m 0000644 0000000 0000000 00000000000 11626402770 026323 0 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/propagateLevelVersion.m 0000644 0000000 0000000 00000005251 11703262304 031704 0 ustar root root function model = propagateLevelVersion(SBMLModel)
% SBMLModel = propagateLevelVersion(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with level and version fields added to all
% sub structures
%
% *NOTE:* This function facilitates keeping track of the level and version
% of sub objects within a model
%
%get level and version and check the input arguments are appropriate
if ~isValidSBML_Model(SBMLModel)
error('first argument must be an SBMLModel structure');
end;
level = SBMLModel.SBML_level;
version = SBMLModel.SBML_version;
model = addLV('SBML_MODEL', SBMLModel, level, version);
function model = addLV(typecode, model, level, version)
fields = getFieldnames(typecode, level, version);
for i=1:length(fields)
subcomp = getfield(model, fields{i});
if isstruct(subcomp)
if length(subcomp) > 0
model = setfield(model, fields{i}, addLevelVersion(subcomp, level, version));
end;
end;
end;
function retStr = addLevelVersion(substr, level, version)
if length(substr) == 1
retStr = addLevelVersionStruct(substr, level, version);
retStr = addLV(substr.typecode, retStr, level, version);
else
for i=1:length(substr)
retStr(i) = addLevelVersionStruct(substr(i), level, version);
retStr(i) = addLV(substr(i).typecode, retStr(i), level, version);
end;
end;
function retStr = addLevelVersionStruct(substr, level, version)
retStr = substr;
retStr.level = level;
retStr.version = version;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/isValidLevelVersionCombination.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/isValidLevelVersionCombin0000644 0000000 0000000 00000004414 11703262304 032212 0 ustar root root function valid = isValidLevelVersionCombination(level, version)
% valid = isValidLevelVersionCombination(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. valid = 1 if the level and version combinbation represent a valid
% specification of SBML supported by SBMLToolbox
%
% *NOTE:* This function causes an error if the level/version arguments do
% not represent a valid supported SBML format
%
valid = 1;
if ~isIntegralNumber(level)
error('level must be an integer');
elseif ~isIntegralNumber(version)
error('version must be an integer');
end;
if (level < 1 || level > 3)
error('current SBML levels are 1, 2 or 3');
end;
if (level == 1)
if (version < 1 || version > 2)
error('SBMLToolbox supports versions 1-2 of SBML Level 1');
end;
elseif (level == 2)
if (version < 1 || version > 4)
error('SBMLToolbox supports versions 1-4 of SBML Level 2');
end;
elseif (level == 3)
if (version ~= 1)
error('SBMLToolbox supports only version 1 of SBML Level 3');
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getUnitFieldnames.m 0000644 0000000 0000000 00000007664 11703262304 031005 0 ustar root root function [SBMLfieldnames, nNumberFields] = getUnitFieldnames(level, ...
version)
% [fieldnames, num] = getUnitFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Unit structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'kind', ...
'exponent', ...
'scale', ...
};
nNumberFields = 6;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
'offset', ...
};
nNumberFields = 9;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 9;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 9;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'kind', ...
'exponent', ...
'scale', ...
'multiplier', ...
};
nNumberFields = 9;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getUnitDefinitionFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getUnitDefinitionFieldnam0000644 0000000 0000000 00000007255 11703262304 032227 0 ustar root root function [SBMLfieldnames, nNumberFields] = getUnitDefinitionFieldnames(level, ...
version)
% [fieldnames, num] = getUnitDefinitionFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML UnitDefinition structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'unit', ...
};
nNumberFields = 5;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 7;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'unit', ...
};
nNumberFields = 8;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getUnitDefinitionDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getUnitDefinitionDefaultV0000644 0000000 0000000 00000006760 11703262304 032222 0 ustar root root function [defaultValues] = getUnitDefinitionDefaultValues(level, version)
% [values] = getUnitDefinitionDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML UnitDefinition structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML UnitDefinition structure can be found using
% the function `getUnitDefinitionFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_UNIT_DEFINITION', ...
'', ...
'', ...
'', ...
[], ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_UNIT_DEFINITION', ...
'', ...
'', ...
'', ...
'', ...
'', ...
[], ...
};
elseif (version == 2)
defaultValues = {
'SBML_UNIT_DEFINITION', ...
'', ...
'', ...
'', ...
'', ...
'', ...
[], ...
};
elseif (version == 3)
defaultValues = {
'SBML_UNIT_DEFINITION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
};
elseif (version == 4)
defaultValues = {
'SBML_UNIT_DEFINITION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_UNIT_DEFINITION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getUnitDefaultValues.m 0000644 0000000 0000000 00000007166 11703262304 031477 0 ustar root root function [defaultValues] = getUnitDefaultValues(level, version)
% [values] = getUnitDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Unit structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Unit structure can be found using
% the function `getUnitFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_UNIT', ...
'', ...
'', ...
'', ...
int32(1), ...
int32(0)', ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_UNIT', ...
'', ...
'', ...
'', ...
'', ...
int32(1), ...
int32(0), ...
1.0, ...
0.0, ...
};
elseif (version == 2)
defaultValues = {
'SBML_UNIT', ...
'', ...
'', ...
'', ...
'', ...
int32(1), ...
int32(0), ...
1.0, ...
};
elseif (version == 3)
defaultValues = {
'SBML_UNIT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
int32(1), ...
int32(0), ...
1.0, ...
};
elseif (version == 4)
defaultValues = {
'SBML_UNIT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
int32(1), ...
int32(0), ...
1.0, ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_UNIT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
0/0, ...
0/0, ...
0/0, ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getTriggerFieldnames.m 0000644 0000000 0000000 00000005616 11703262304 031464 0 ustar root root function [SBMLfieldnames, nNumberFields] = getTriggerFieldnames(level, ...
version)
% [fieldnames, num] = getTriggerFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Trigger structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'persistent', ...
'initialValue', ...
'math', ...
};
nNumberFields = 8;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getTriggerDefaultValues.m0000644 0000000 0000000 00000005374 11703262304 032162 0 ustar root root function [defaultValues] = getTriggerDefaultValues(level, version)
% [values] = getTriggerDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Trigger structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Trigger structure can be found using
% the function `getTriggerFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = {
'SBML_TRIGGER', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_TRIGGER', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_TRIGGER', ...
'', ...
'', ...
'', ...
int32(-1), ...
int32(0), ...
int32(0), ...
'', ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getStoichiometryMathFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getStoichiometryMathField0000644 0000000 0000000 00000005221 11703262304 032246 0 ustar root root function [SBMLfieldnames, nNumberFields] = getStoichiometryMathFieldnames(level, ...
version)
% [fieldnames, num] = getStoichiometryMathFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML StoichiometryMath structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getStoichiometryMathDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getStoichiometryMathDefau0000644 0000000 0000000 00000005102 11703262304 032245 0 ustar root root function [defaultValues] = getStoichiometryMathDefaultValues(level, version)
% [values] = getStoichiometryMathDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML StoichiometryMath structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML StoichiometryMath structure can be found using
% the function `getStoichiometryMathFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = {
'SBML_STOICHIOMETRY_MATH', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_STOICHIOMETRY_MATH', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = [];
end;
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesTypeFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesTypeFieldnames.0000644 0000000 0000000 00000005607 11703262304 032141 0 ustar root root function [SBMLfieldnames, nNumberFields] = getSpeciesTypeFieldnames(level, ...
version)
% [fieldnames, num] = getSpeciesTypeFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML SpeciesType structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
};
nNumberFields = 6;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesTypeDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesTypeDefaultValu0000644 0000000 0000000 00000005414 11703262304 032224 0 ustar root root function [defaultValues] = getSpeciesTypeDefaultValues(level, version)
% [values] = getSpeciesTypeDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML SpeciesType structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML SpeciesType structure can be found using
% the function `getSpeciesTypeFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = {
'SBML_SPECIES_TYPE', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_SPECIES_TYPE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_SPECIES_TYPE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = [];
end;
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesReferenceFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesReferenceFieldn0000644 0000000 0000000 00000010346 11703262304 032166 0 ustar root root function [SBMLfieldnames, nNumberFields] = getSpeciesReferenceFieldnames(level, ...
version)
% [fieldnames, num] = getSpeciesReferenceFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML SpeciesReference structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'species', ...
'stoichiometry', ...
'denominator', ...
};
nNumberFields = 6;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
'stoichiometry', ...
'denominator', ...
'stoichiometryMath', ...
};
nNumberFields = 8;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
'id', ...
'name', ...
'sboTerm', ...
'stoichiometry', ...
'stoichiometryMath', ...
};
nNumberFields = 10;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
'stoichiometry', ...
'stoichiometryMath', ...
};
nNumberFields = 10;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
'stoichiometry', ...
'stoichiometryMath', ...
};
nNumberFields = 10;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
'stoichiometry', ...
'constant', ...
'isSetStoichiometry', ...
};
nNumberFields = 11;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000156 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesReferenceDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesReferenceDefaul0000644 0000000 0000000 00000007537 11703262304 032175 0 ustar root root function [defaultValues] = getSpeciesReferenceDefaultValues(level, version)
% [values] = getSpeciesReferenceDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML SpeciesReference structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML SpeciesReference structure can be found using
% the function `getSpeciesReferenceFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
int32(1), ...
int32(1), ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
'', ...
1, ...
int32(1), ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
int32(-1), ...
1, ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
1, ...
[], ...
};
elseif (version == 4)
defaultValues = {
'SBML_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
1, ...
[], ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
0/0, ...
int32(0), ...
int32(0), ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesFieldnames.m 0000644 0000000 0000000 00000014420 11703262304 031445 0 ustar root root function [SBMLfieldnames, nNumberFields] = getSpeciesFieldnames(level, ...
version)
% [fieldnames, num] = getSpeciesFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Species structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'compartment', ...
'initialAmount', ...
'units', ...
'boundaryCondition', ...
'charge', ...
'isSetInitialAmount', ...
'isSetCharge', ...
};
nNumberFields = 11;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'spatialSizeUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 18;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'speciesType', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'spatialSizeUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 19;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'speciesType', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 19;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'speciesType', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'charge', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'isSetCharge', ...
};
nNumberFields = 19;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'compartment', ...
'initialAmount', ...
'initialConcentration', ...
'substanceUnits', ...
'hasOnlySubstanceUnits', ...
'boundaryCondition', ...
'constant', ...
'isSetInitialAmount', ...
'isSetInitialConcentration', ...
'conversionFactor', ...
};
nNumberFields = 17;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesDefaultValues.m0000644 0000000 0000000 00000012165 11703262304 032146 0 ustar root root function [defaultValues] = getSpeciesDefaultValues(level, version)
% [values] = getSpeciesDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Species structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Species structure can be found using
% the function `getSpeciesFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_SPECIES', ...
'', ...
'', ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
0, ...
int32(0), ...
int32(0), ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_SPECIES', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
0/0, ...
0/0, ...
'', ...
'', ...
int32(0), ...
int32(0), ...
0, ...
int32(0), ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 2)
defaultValues = {
'SBML_SPECIES', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
0/0, ...
0/0, ...
'', ...
'', ...
int32(0), ...
int32(0), ...
0, ...
int32(0), ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 3)
defaultValues = {
'SBML_SPECIES', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
0/0, ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
0, ...
int32(0), ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 4)
defaultValues = {
'SBML_SPECIES', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
0/0, ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
0, ...
int32(0), ...
int32(0), ...
int32(0), ...
int32(0), ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_SPECIES', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
0/0, ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
int32(0), ...
int32(0), ...
int32(0), ...
'', ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesConcentrationRuleFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesConcentrationRu0000644 0000000 0000000 00000005130 11703262304 032256 0 ustar root root function [SBMLfieldnames, nNumberFields] = getSpeciesConcentrationRuleFieldnames(level, ...
version)
% [fieldnames, num] = getSpeciesConcentrationRuleFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML SpeciesConcentrationRule structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 4)
SBMLfieldnames = [];
nNumberFields = 0;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesConcentrationRuleDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getSpeciesConcentrationRu0000644 0000000 0000000 00000004774 11703262304 032273 0 ustar root root function [defaultValues] = getSpeciesConcentrationRuleDefaultValues(level, version)
% [values] = getSpeciesConcentrationRuleDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML SpeciesConcentrationRule structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML SpeciesConcentrationRule structure can be found using
% the function `getSpeciesConcentrationRuleFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_SPECIES_CONCENTRATION_RULE', ...
'', ...
'', ...
'scalar', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = [];
elseif (version == 4)
defaultValues = [];
end;
elseif (level == 3)
if (version == 1)
defaultValues = [];
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getRuleFieldnames.m 0000644 0000000 0000000 00000010671 11703262304 030765 0 ustar root root function [SBMLfieldnames, nNumberFields] = getRuleFieldnames(level, ...
version)
% [fieldnames, num] = getRuleFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Rule structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getReactionFieldnames.m 0000644 0000000 0000000 00000011747 11703262304 031627 0 ustar root root function [SBMLfieldnames, nNumberFields] = getReactionFieldnames(level, ...
version)
% [fieldnames, num] = getReactionFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Reaction structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'reactant', ...
'product', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
};
nNumberFields = 9;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
};
nNumberFields = 13;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'sboTerm', ...
'isSetFast', ...
};
nNumberFields = 14;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
};
nNumberFields = 14;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
};
nNumberFields = 14;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'reactant', ...
'product', ...
'modifier', ...
'kineticLaw', ...
'reversible', ...
'fast', ...
'isSetFast', ...
'compartment', ...
};
nNumberFields = 15;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getReactionDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getReactionDefaultValues.0000644 0000000 0000000 00000010671 11703262304 032142 0 ustar root root function [defaultValues] = getReactionDefaultValues(level, version)
% [values] = getReactionDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Reaction structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Reaction structure can be found using
% the function `getReactionFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_REACTION', ...
'', ...
'', ...
'', ...
[], ...
[], ...
[], ...
int32(0), ...
int32(0), ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_REACTION', ...
'', ...
'', ...
'', ...
'', ...
'', ...
[], ...
[], ...
[], ...
[], ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 2)
defaultValues = {
'SBML_REACTION', ...
'', ...
'', ...
'', ...
'', ...
'', ...
[], ...
[], ...
[], ...
[], ...
int32(0), ...
int32(0), ...
int32(-1), ...
int32(0), ...
};
elseif (version == 3)
defaultValues = {
'SBML_REACTION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
[], ...
[], ...
[], ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 4)
defaultValues = {
'SBML_REACTION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
[], ...
[], ...
[], ...
int32(0), ...
int32(0), ...
int32(0), ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_REACTION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
[], ...
[], ...
[], ...
int32(0), ...
int32(0), ...
int32(0), ...
'', ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getRateRuleFieldnames.m 0000644 0000000 0000000 00000010136 11703262304 031575 0 ustar root root function [SBMLfieldnames, nNumberFields] = getRateRuleFieldnames(level, ...
version)
% [fieldnames, num] = getRateRuleFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML RateRule structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getRateRuleDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getRateRuleDefaultValues.0000644 0000000 0000000 00000007270 11703262304 032122 0 ustar root root function [defaultValues] = getRateRuleDefaultValues(level, version)
% [values] = getRateRuleDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML RateRule structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML RateRule structure can be found using
% the function `getRateRuleFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_RATE_RULE', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_RATE_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_RATE_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_RATE_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_RATE_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getPriorityFieldnames.m 0000644 0000000 0000000 00000004265 11703262304 031701 0 ustar root root function [SBMLfieldnames, nNumberFields] = getPriorityFieldnames(level, ...
version)
% [fieldnames, num] = getPriorityFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Priority structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getPriorityDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getPriorityDefaultValues.0000644 0000000 0000000 00000004476 11703262304 032225 0 ustar root root function [defaultValues] = getPriorityDefaultValues(level, version)
% [values] = getPriorityDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Priority structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Priority structure can be found using
% the function `getPriorityFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = [];
elseif (version == 4)
defaultValues = [];
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_PRIORITY', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getParameterRuleFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getParameterRuleFieldname0000644 0000000 0000000 00000005067 11703262304 032213 0 ustar root root function [SBMLfieldnames, nNumberFields] = getParameterRuleFieldnames(level, ...
version)
% [fieldnames, num] = getParameterRuleFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML ParameterRule structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 4)
SBMLfieldnames = [];
nNumberFields = 0;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getParameterRuleDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getParameterRuleDefaultVa0000644 0000000 0000000 00000004671 11703262304 032202 0 ustar root root function [defaultValues] = getParameterRuleDefaultValues(level, version)
% [values] = getParameterRuleDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML ParameterRule structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML ParameterRule structure can be found using
% the function `getParameterRuleFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_PARAMETER_RULE', ...
'', ...
'', ...
'scalar', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = [];
elseif (version == 4)
defaultValues = [];
end;
elseif (level == 3)
if (version == 1)
defaultValues = [];
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getParameterFieldnames.m 0000644 0000000 0000000 00000010467 11703262304 032001 0 ustar root root function [SBMLfieldnames, nNumberFields] = getParameterFieldnames(level, ...
version)
% [fieldnames, num] = getParameterFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Parameter structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'value', ...
'units', ...
'isSetValue', ...
};
nNumberFields = 7;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'sboTerm', ...
'isSetValue', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'constant', ...
'isSetValue', ...
};
nNumberFields = 11;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getParameterDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getParameterDefaultValues0000644 0000000 0000000 00000007724 11703262304 032245 0 ustar root root function [defaultValues] = getParameterDefaultValues(level, version)
% [values] = getParameterDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Parameter structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Parameter structure can be found using
% the function `getParameterFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_PARAMETER', ...
'', ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_PARAMETER', ...
'', ...
'', ...
'', ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
};
elseif (version == 2)
defaultValues = {
'SBML_PARAMETER', ...
'', ...
'', ...
'', ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
int32(-1), ...
int32(0), ...
};
elseif (version == 3)
defaultValues = {
'SBML_PARAMETER', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
};
elseif (version == 4)
defaultValues = {
'SBML_PARAMETER', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_PARAMETER', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getModifierSpeciesReferenceFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getModifierSpeciesReferen0000644 0000000 0000000 00000007027 11703262304 032215 0 ustar root root function [SBMLfieldnames, nNumberFields] = getModifierSpeciesReferenceFieldnames(level, ...
version)
% [fieldnames, num] = getModifierSpeciesReferenceFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML ModifierSpeciesReference structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
};
nNumberFields = 5;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'species', ...
'id', ...
'name', ...
'sboTerm', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'species', ...
'id', ...
'name', ...
};
nNumberFields = 8;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getModifierSpeciesReferenceDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getModifierSpeciesReferen0000644 0000000 0000000 00000006643 11703262304 032220 0 ustar root root function [defaultValues] = getModifierSpeciesReferenceDefaultValues(level, version)
% [values] = getModifierSpeciesReferenceDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML ModifierSpeciesReference structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML ModifierSpeciesReference structure can be found using
% the function `getModifierSpeciesReferenceFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_MODIFIER_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_MODIFIER_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
int32(-1), ...
};
elseif (version == 3)
defaultValues = {
'SBML_MODIFIER_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_MODIFIER_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_MODIFIER_SPECIES_REFERENCE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getModelFieldnames.m 0000644 0000000 0000000 00000015040 11703262304 031111 0 ustar root root function [SBMLfieldnames, nNumberFields] = getModelFieldnames(level, ...
version)
% [fieldnames, num] = getModelFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Model structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'unitDefinition', ...
'compartment', ...
'species', ...
'parameter', ...
'rule', ...
'reaction', ...
};
nNumberFields = 12;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'functionDefinition', ...
'unitDefinition', ...
'compartment', ...
'species', ...
'parameter', ...
'rule', ...
'reaction', ...
'event', ...
};
nNumberFields = 16;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartmentType', ...
'speciesType', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
};
nNumberFields = 21;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartmentType', ...
'speciesType', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
};
nNumberFields = 21;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartmentType', ...
'speciesType', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
};
nNumberFields = 21;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'SBML_level', ...
'SBML_version', ...
'name', ...
'id', ...
'sboTerm', ...
'functionDefinition', ...
'unitDefinition', ...
'compartment', ...
'species', ...
'parameter', ...
'initialAssignment', ...
'rule', ...
'constraint', ...
'reaction', ...
'event', ...
'substanceUnits', ...
'timeUnits', ...
'lengthUnits', ...
'areaUnits', ...
'volumeUnits', ...
'extentUnits', ...
'conversionFactor', ...
};
nNumberFields = 26;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getModelDefaultValues.m 0000644 0000000 0000000 00000012505 11703262304 031611 0 ustar root root function [defaultValues] = getModelDefaultValues(level, version)
% [values] = getModelDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Model structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Model structure can be found using
% the function `getModelFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_MODEL', ...
'', ...
'', ...
level, ...
version, ...
'', ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_MODEL', ...
'', ...
'', ...
'', ...
level, ...
version, ...
'', ...
'', ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
};
elseif (version == 2)
defaultValues = {
'SBML_MODEL', ...
'', ...
'', ...
'', ...
level, ...
version, ...
'', ...
'', ...
int32(-1), ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
};
elseif (version == 3)
defaultValues = {
'SBML_MODEL', ...
'', ...
'', ...
'', ...
level, ...
version, ...
'', ...
'', ...
int32(-1), ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
};
elseif (version == 4)
defaultValues = {
'SBML_MODEL', ...
'', ...
'', ...
'', ...
level, ...
version, ...
'', ...
'', ...
int32(-1), ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_MODEL', ...
'', ...
'', ...
'', ...
level, ...
version, ...
'', ...
'', ...
int32(-1), ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
[], ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getLocalParameterFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getLocalParameterFieldnam0000644 0000000 0000000 00000004530 11703262304 032163 0 ustar root root function [SBMLfieldnames, nNumberFields] = getLocalParameterFieldnames(level, ...
version)
% [fieldnames, num] = getLocalParameterFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML LocalParameter structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'value', ...
'units', ...
'isSetValue', ...
};
nNumberFields = 10;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getLocalParameterDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getLocalParameterDefaultV0000644 0000000 0000000 00000004722 11703262304 032161 0 ustar root root function [defaultValues] = getLocalParameterDefaultValues(level, version)
% [values] = getLocalParameterDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML LocalParameter structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML LocalParameter structure can be found using
% the function `getLocalParameterFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = [];
elseif (version == 4)
defaultValues = [];
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_LOCAL_PARAMETER', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
0/0, ...
'', ...
int32(0), ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getKineticLawFieldnames.m0000644 0000000 0000000 00000007576 11703262304 032122 0 ustar root root function [SBMLfieldnames, nNumberFields] = getKineticLawFieldnames(level, ...
version)
% [fieldnames, num] = getKineticLawFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML KineticLaw structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'formula', ...
'parameter', ...
'timeUnits', ...
'substanceUnits', ...
};
nNumberFields = 7;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'math', ...
'parameter', ...
'timeUnits', ...
'substanceUnits', ...
};
nNumberFields = 9;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'math', ...
'parameter', ...
'sboTerm', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'math', ...
'parameter', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'math', ...
'parameter', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'localParameter', ...
};
nNumberFields = 7;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getKineticLawDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getKineticLawDefaultValue0000644 0000000 0000000 00000007061 11703262304 032166 0 ustar root root function [defaultValues] = getKineticLawDefaultValues(level, version)
% [values] = getKineticLawDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML KineticLaw structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML KineticLaw structure can be found using
% the function `getKineticLawFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_KINETIC_LAW', ...
'', ...
'', ...
'', ...
[], ...
'', ...
'', ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_KINETIC_LAW', ...
'', ...
'', ...
'', ...
'', ...
'', ...
[], ...
'', ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_KINETIC_LAW', ...
'', ...
'', ...
'', ...
'', ...
'', ...
[], ...
int32(-1), ...
};
elseif (version == 3)
defaultValues = {
'SBML_KINETIC_LAW', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
};
elseif (version == 4)
defaultValues = {
'SBML_KINETIC_LAW', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_KINETIC_LAW', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
[], ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getInitialAssignmentFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getInitialAssignmentField0000644 0000000 0000000 00000006307 11703262304 032222 0 ustar root root function [SBMLfieldnames, nNumberFields] = getInitialAssignmentFieldnames(level, ...
version)
% [fieldnames, num] = getInitialAssignmentFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML InitialAssignment structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'symbol', ...
'math', ...
};
nNumberFields = 7;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getInitialAssignmentDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getInitialAssignmentDefau0000644 0000000 0000000 00000006104 11703262304 032216 0 ustar root root function [defaultValues] = getInitialAssignmentDefaultValues(level, version)
% [values] = getInitialAssignmentDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML InitialAssignment structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML InitialAssignment structure can be found using
% the function `getInitialAssignmentFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = {
'SBML_INITIAL_ASSIGNMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_INITIAL_ASSIGNMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_INITIAL_ASSIGNMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_INITIAL_ASSIGNMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getFunctionDefinitionFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getFunctionDefinitionFiel0000644 0000000 0000000 00000007060 11703262304 032227 0 ustar root root function [SBMLfieldnames, nNumberFields] = getFunctionDefinitionFieldnames(level, ...
version)
% [fieldnames, num] = getFunctionDefinitionFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML FunctionDefinition structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'math', ...
};
nNumberFields = 8;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000160 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getFunctionDefinitionDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getFunctionDefinitionDefa0000644 0000000 0000000 00000006626 11703262304 032216 0 ustar root root function [defaultValues] = getFunctionDefinitionDefaultValues(level, version)
% [values] = getFunctionDefinitionDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML FunctionDefinition structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML FunctionDefinition structure can be found using
% the function `getFunctionDefinitionFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_FUNCTION_DEFINITION', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_FUNCTION_DEFINITION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_FUNCTION_DEFINITION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_FUNCTION_DEFINITION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_FUNCTION_DEFINITION', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getFieldnames.m 0000644 0000000 0000000 00000013445 11703262304 030137 0 ustar root root function [SBMLfieldnames, nNumberFields] = getFieldnames(typecode, ...
level, version)
% [fieldnames, num] = getFieldnames(typecode, level, version)
%
% Takes
%
% 1. typecode; a string representing the type of object being queried
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML structure of the given typecode, level and version
% 2. the number of fieldnames
%
%
done = 1;
switch (typecode)
case {'SBML_ALGEBRAIC_RULE', 'AlgebraicRule', 'algebraicRule'}
fhandle = str2func('getAlgebraicRuleFieldnames');
case {'SBML_ASSIGNMENT_RULE', 'AssignmentRule', 'assignmentRule'}
fhandle = str2func('getAssignmentRuleFieldnames');
case {'SBML_COMPARTMENT', 'Compartment', 'compartment'}
fhandle = str2func('getCompartmentFieldnames');
case {'SBML_COMPARTMENT_TYPE', 'CompartmentType', 'compartmentType'}
fhandle = str2func('getCompartmentTypeFieldnames');
case {'SBML_COMPARTMENT_VOLUME_RULE', 'CompartmentVolumeRule', 'compartmentVolumeRule'}
fhandle = str2func('getCompartmentVolumeRuleFieldnames');
case {'SBML_CONSTRAINT', 'Constraint', 'constraint'}
fhandle = str2func('getConstraintFieldnames');
case {'SBML_DELAY', 'Delay', 'delay'}
fhandle = str2func('getDelayFieldnames');
case {'SBML_EVENT', 'Event', 'event'}
fhandle = str2func('getEventFieldnames');
case {'SBML_EVENT_ASSIGNMENT', 'EventAssignment', 'eventAssignment'}
fhandle = str2func('getEventAssignmentFieldnames');
case {'SBML_FUNCTION_DEFINITION', 'FunctionDefinition', 'functionDefinition'}
fhandle = str2func('getFunctionDefinitionFieldnames');
case {'SBML_INITIAL_ASSIGNMENT', 'InitialAssignment', 'initialAssignment'}
fhandle = str2func('getInitialAssignmentFieldnames');
case {'SBML_KINETIC_LAW', 'KineticLaw', 'kineticLaw'}
fhandle = str2func('getKineticLawFieldnames');
case {'SBML_LOCAL_PARAMETER', 'LocalParameter', 'localParameter'}
fhandle = str2func('getLocalParameterFieldnames');
case {'SBML_MODEL', 'Model', 'model'}
fhandle = str2func('getModelFieldnames');
case {'SBML_MODIFIER_SPECIES_REFERENCE', 'ModifierSpeciesReference', 'modifierSpeciesReference'}
fhandle = str2func('getModifierSpeciesReferenceFieldnames');
case {'SBML_PARAMETER', 'Parameter', 'parameter'}
fhandle = str2func('getParameterFieldnames');
case {'SBML_PARAMETER_RULE', 'ParameterRule', 'parameterRule'}
fhandle = str2func('getParameterRuleFieldnames');
case {'SBML_PRIORITY', 'Priority', 'priority'}
fhandle = str2func('getPriorityFieldnames');
case {'SBML_RATE_RULE', 'RateRule', 'ruleRule'}
fhandle = str2func('getRateRuleFieldnames');
case {'SBML_REACTION', 'Reaction', 'reaction'}
fhandle = str2func('getReactionFieldnames');
case {'SBML_SPECIES', 'Species', 'species'}
fhandle = str2func('getSpeciesFieldnames');
case {'SBML_SPECIES_CONCENTRATION_RULE', 'SpeciesConcentrationRule', 'speciesConcentrationRule'}
fhandle = str2func('getSpeciesConcentrationRuleFieldnames');
case {'SBML_SPECIES_REFERENCE', 'SpeciesReference', 'speciesReference'}
fhandle = str2func('getSpeciesReferenceFieldnames');
case {'SBML_SPECIES_TYPE', 'SpeciesType', 'speciesType'}
fhandle = str2func('getSpeciesTypeFieldnames');
case {'SBML_STOICHIOMETRY_MATH', 'StoichiometryMath', 'stoichiometryMath'}
fhandle = str2func('getStoichiometryMathFieldnames');
case {'SBML_TRIGGER', 'Trigger', 'trigger'}
fhandle = str2func('getTriggerFieldnames');
case {'SBML_UNIT', 'Unit', 'unit'}
fhandle = str2func('getUnitFieldnames');
case {'SBML_UNIT_DEFINITION', 'UnitDefinition', 'unitDefinition'}
fhandle = str2func('getUnitDefinitionFieldnames');
otherwise
done = 0;
end;
if done == 1
[SBMLfieldnames, nNumberFields] = feval(fhandle, level, version);
else
switch (typecode)
case {'SBML_FBC_FLUXBOUND', 'FluxBound', 'fluxBound'}
fhandle = str2func('getFluxBoundFieldnames');
case {'SBML_FBC_FLUXOBJECTIVE', 'FluxObjective', 'fluxObjective'}
fhandle = str2func('getFluxObjectiveFieldnames');
case {'SBML_FBC_OBJECTIVE', 'Objective', 'objective'}
fhandle = str2func('getObjectiveFieldnames');
case {'SBML_FBC_MODEL', 'FBCModel'}
fhandle = str2func('getFBCModelFieldnames');
case {'SBML_FBC_SPECIES', 'FBCSpecies'}
fhandle = str2func('getFBCSpeciesFieldnames');
otherwise
error('%s\n%s', ...
'getFieldnames(typecode, level, version', ...
'typecode not recognised');
end;
[SBMLfieldnames, nNumberFields] = feval(fhandle, level, version, 1);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getEventFieldnames.m 0000644 0000000 0000000 00000010161 11703262304 031131 0 ustar root root function [SBMLfieldnames, nNumberFields] = getEventFieldnames(level, ...
version)
% [fieldnames, num] = getEventFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Event structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'trigger', ...
'delay', ...
'timeUnits', ...
'eventAssignment', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'trigger', ...
'delay', ...
'timeUnits', ...
'sboTerm', ...
'eventAssignment', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'trigger', ...
'delay', ...
'eventAssignment', ...
};
nNumberFields = 10;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'useValuesFromTriggerTime', ...
'trigger', ...
'delay', ...
'eventAssignment', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'useValuesFromTriggerTime', ...
'trigger', ...
'delay', ...
'priority', ...
'eventAssignment', ...
};
nNumberFields = 12;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getEventDefaultValues.m 0000644 0000000 0000000 00000007241 11703262304 031633 0 ustar root root function [defaultValues] = getEventDefaultValues(level, version)
% [values] = getEventDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Event structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Event structure can be found using
% the function `getEventFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_EVENT', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
[], ...
};
elseif (version == 2)
defaultValues = {
'SBML_EVENT', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
int32(-1), ...
[], ...
};
elseif (version == 3)
defaultValues = {
'SBML_EVENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
[], ...
[], ...
};
elseif (version == 4)
defaultValues = {
'SBML_EVENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
int32(0), ...
[], ...
[], ...
[], ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_EVENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
int32(0), ...
[], ...
[], ...
[], ...
[], ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getEventAssignmentFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getEventAssignmentFieldna0000644 0000000 0000000 00000006635 11703262304 032235 0 ustar root root function [SBMLfieldnames, nNumberFields] = getEventAssignmentFieldnames(level, ...
version)
% [fieldnames, num] = getEventAssignmentFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML EventAssignment structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'variable', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'variable', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'variable', ...
'math', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'variable', ...
'math', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'variable', ...
'math', ...
};
nNumberFields = 7;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getEventAssignmentDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getEventAssignmentDefault0000644 0000000 0000000 00000006366 11703262304 032260 0 ustar root root function [defaultValues] = getEventAssignmentDefaultValues(level, version)
% [values] = getEventAssignmentDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML EventAssignment structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML EventAssignment structure can be found using
% the function `getEventAssignmentFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_EVENT_ASSIGNMENT', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_EVENT_ASSIGNMENT', ...
'', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_EVENT_ASSIGNMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_EVENT_ASSIGNMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_EVENT_ASSIGNMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getDelayFieldnames.m 0000644 0000000 0000000 00000005466 11703262304 031122 0 ustar root root function [SBMLfieldnames, nNumberFields] = getDelayFieldnames(level, ...
version)
% [fieldnames, num] = getDelayFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Delay structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
};
nNumberFields = 6;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getDelayDefaultValues.m 0000644 0000000 0000000 00000005254 11703262304 031612 0 ustar root root function [defaultValues] = getDelayDefaultValues(level, version)
% [values] = getDelayDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Delay structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Delay structure can be found using
% the function `getDelayFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = {
'SBML_DELAY', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_DELAY', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_DELAY', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getDefaultValues.m 0000644 0000000 0000000 00000013561 11703262304 030633 0 ustar root root function [defaultValues] = getDefaultValues(typecode, level, version)
% [values] = getDefaultValues(typecode, level, version)
%
% Takes
%
% 1. typecode; a string representing the type of object being queried
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML structure of the given typecode, level and version
%
% *NOTE:* The corresponding fields present in an SBML structure can be found using
% the function `getFieldnames`
%
done = 1;
switch (typecode)
case {'SBML_ALGEBRAIC_RULE', 'AlgebraicRule', 'algebraicRule'}
fhandle = str2func('getAlgebraicRuleDefaultValues');
case {'SBML_ASSIGNMENT_RULE', 'AssignmentRule', 'assignmentRule'}
fhandle = str2func('getAssignmentRuleDefaultValues');
case {'SBML_COMPARTMENT', 'Compartment', 'compartment'}
fhandle = str2func('getCompartmentDefaultValues');
case {'SBML_COMPARTMENT_TYPE', 'CompartmentType', 'compartmentType'}
fhandle = str2func('getCompartmentTypeDefaultValues');
case {'SBML_COMPARTMENT_VOLUME_RULE', 'CompartmentVolumeRule', 'compartmentVolumeRule'}
fhandle = str2func('getCompartmentVolumeRuleDefaultValues');
case {'SBML_CONSTRAINT', 'Constraint', 'constraint'}
fhandle = str2func('getConstraintDefaultValues');
case {'SBML_DELAY', 'Delay', 'delay'}
fhandle = str2func('getDelayDefaultValues');
case {'SBML_EVENT', 'Event', 'event'}
fhandle = str2func('getEventDefaultValues');
case {'SBML_EVENT_ASSIGNMENT', 'EventAssignment', 'eventAssignment'}
fhandle = str2func('getEventAssignmentDefaultValues');
case {'SBML_FUNCTION_DEFINITION', 'FunctionDefinition', 'functionDefinition'}
fhandle = str2func('getFunctionDefinitionDefaultValues');
case {'SBML_INITIAL_ASSIGNMENT', 'InitialAssignment', 'initialAssignment'}
fhandle = str2func('getInitialAssignmentDefaultValues');
case {'SBML_KINETIC_LAW', 'KineticLaw', 'kineticLaw'}
fhandle = str2func('getKineticLawDefaultValues');
case {'SBML_LOCAL_PARAMETER', 'LocalParameter', 'localParameter'}
fhandle = str2func('getLocalParameterDefaultValues');
case {'SBML_MODEL', 'Model', 'model'}
fhandle = str2func('getModelDefaultValues');
case {'SBML_MODIFIER_SPECIES_REFERENCE', 'ModifierSpeciesReference', 'modifierSpeciesReference'}
fhandle = str2func('getModifierSpeciesReferenceDefaultValues');
case {'SBML_PARAMETER', 'Parameter', 'parameter'}
fhandle = str2func('getParameterDefaultValues');
case {'SBML_PARAMETER_RULE', 'ParameterRule', 'parameterRule'}
fhandle = str2func('getParameterRuleDefaultValues');
case {'SBML_PRIORITY', 'Priority', 'priority'}
fhandle = str2func('getPriorityDefaultValues');
case {'SBML_RATE_RULE', 'RateRule', 'ruleRule'}
fhandle = str2func('getRateRuleDefaultValues');
case {'SBML_REACTION', 'Reaction', 'reaction'}
fhandle = str2func('getReactionDefaultValues');
case {'SBML_SPECIES', 'Species', 'species'}
fhandle = str2func('getSpeciesDefaultValues');
case {'SBML_SPECIES_CONCENTRATION_RULE', 'SpeciesConcentrationRule', 'speciesConcentrationRule'}
fhandle = str2func('getSpeciesConcentrationRuleDefaultValues');
case {'SBML_SPECIES_REFERENCE', 'SpeciesReference', 'speciesReference'}
fhandle = str2func('getSpeciesReferenceDefaultValues');
case {'SBML_SPECIES_TYPE', 'SpeciesType', 'speciesType'}
fhandle = str2func('getSpeciesTypeDefaultValues');
case {'SBML_STOICHIOMETRY_MATH', 'StoichiometryMath', 'stoichiometryMath'}
fhandle = str2func('getStoichiometryMathDefaultValues');
case {'SBML_TRIGGER', 'Trigger', 'trigger'}
fhandle = str2func('getTriggerDefaultValues');
case {'SBML_UNIT', 'Unit', 'unit'}
fhandle = str2func('getUnitDefaultValues');
case {'SBML_UNIT_DEFINITION', 'UnitDefinition', 'unitDefinition'}
fhandle = str2func('getUnitDefinitionDefaultValues');
otherwise
done = 0;
end;
if done == 1
[defaultValues] = feval(fhandle, level, version);
else
switch (typecode)
case {'SBML_FBC_FLUXBOUND', 'FluxBound', 'fluxBound'}
fhandle = str2func('getFluxBoundDefaultValues');
case {'SBML_FBC_FLUXOBJECTIVE', 'FluxObjective', 'fluxObjective'}
fhandle = str2func('getFluxObjectiveDefaultValues');
case {'SBML_FBC_OBJECTIVE', 'Objective', 'objective'}
fhandle = str2func('getObjectiveDefaultValues');
case {'SBML_FBC_MODEL', 'FBCModel'}
fhandle = str2func('getFBCModelDefaultValues');
case {'SBML_FBC_SPECIES', 'FBCSpecies'}
fhandle = str2func('getFBCSpeciesDefaultValues');
otherwise
error('%s\n%s', ...
'getDefaultValues(typecode, level, version', ...
'typecode not recognised');
end;
[defaultValues] = feval(fhandle, level, version, 1);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getConstraintFieldnames.m0000644 0000000 0000000 00000006257 11703262304 032207 0 ustar root root function [SBMLfieldnames, nNumberFields] = getConstraintFieldnames(level, ...
version)
% [fieldnames, num] = getConstraintFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Constraint structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'math', ...
'message', ...
};
nNumberFields = 7;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getConstraintDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getConstraintDefaultValue0000644 0000000 0000000 00000006001 11703262304 032251 0 ustar root root function [defaultValues] = getConstraintDefaultValues(level, version)
% [values] = getConstraintDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Constraint structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Constraint structure can be found using
% the function `getConstraintFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = {
'SBML_CONSTRAINT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_CONSTRAINT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_CONSTRAINT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_CONSTRAINT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000160 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentVolumeRuleFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentVolumeRuleF0000644 0000000 0000000 00000005117 11703262304 032251 0 ustar root root function [SBMLfieldnames, nNumberFields] = getCompartmentVolumeRuleFieldnames(level, ...
version)
% [fieldnames, num] = getCompartmentVolumeRuleFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML CompartmentVolumeRule structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 3)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 4)
SBMLfieldnames = [];
nNumberFields = 0;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentVolumeRuleDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentVolumeRuleD0000644 0000000 0000000 00000004752 11703262304 032253 0 ustar root root function [defaultValues] = getCompartmentVolumeRuleDefaultValues(level, version)
% [values] = getCompartmentVolumeRuleDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML CompartmentVolumeRule structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML CompartmentVolumeRule structure can be found using
% the function `getCompartmentVolumeRuleFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_COMPARTMENT_VOLUME_RULE', ...
'', ...
'', ...
'scalar', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = [];
elseif (version == 3)
defaultValues = [];
elseif (version == 4)
defaultValues = [];
end;
elseif (level == 3)
if (version == 1)
defaultValues = [];
end;
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentTypeFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentTypeFieldna0000644 0000000 0000000 00000005627 11703262304 032256 0 ustar root root function [SBMLfieldnames, nNumberFields] = getCompartmentTypeFieldnames(level, ...
version)
% [fieldnames, num] = getCompartmentTypeFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML CompartmentType structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
};
nNumberFields = 6;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
};
nNumberFields = 7;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = [];
nNumberFields = 0;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentTypeDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentTypeDefault0000644 0000000 0000000 00000005454 11703262304 032276 0 ustar root root function [defaultValues] = getCompartmentTypeDefaultValues(level, version)
% [values] = getCompartmentTypeDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML CompartmentType structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML CompartmentType structure can be found using
% the function `getCompartmentTypeFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = [];
elseif (version == 2)
defaultValues = {
'SBML_COMPARTMENT_TYPE', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_COMPARTMENT_TYPE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_COMPARTMENT_TYPE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = [];
end;
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentFieldnames.0000644 0000000 0000000 00000012004 11703262304 032162 0 ustar root root function [SBMLfieldnames, nNumberFields] = getCompartmentFieldnames(level, ...
version)
% [fieldnames, num] = getCompartmentFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML Compartment structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'name', ...
'volume', ...
'units', ...
'outside', ...
'isSetVolume', ...
};
nNumberFields = 8;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 13;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'name', ...
'id', ...
'compartmentType', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 14;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'compartmentType', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 15;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'compartmentType', ...
'spatialDimensions', ...
'size', ...
'units', ...
'outside', ...
'constant', ...
'isSetSize', ...
'isSetVolume', ...
};
nNumberFields = 15;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'name', ...
'id', ...
'spatialDimensions', ...
'size', ...
'units', ...
'constant', ...
'isSetSize', ...
'isSetSpatialDimensions', ...
};
nNumberFields = 13;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getCompartmentDefaultValu0000644 0000000 0000000 00000010730 11703262304 032255 0 ustar root root function [defaultValues] = getCompartmentDefaultValues(level, version)
% [values] = getCompartmentDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML Compartment structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Compartment structure can be found using
% the function `getCompartmentFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_COMPARTMENT', ...
'', ...
'', ...
'', ...
1.0, ...
'', ...
'', ...
int32(0), ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_COMPARTMENT', ...
'', ...
'', ...
'', ...
'', ...
'', ...
int32(3), ...
0/0, ...
'', ...
'', ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 2)
defaultValues = {
'SBML_COMPARTMENT', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
int32(3), ...
0/0, ...
'', ...
'', ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 3)
defaultValues = {
'SBML_COMPARTMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
int32(3), ...
0/0, ...
'', ...
'', ...
int32(0), ...
int32(0), ...
int32(0), ...
};
elseif (version == 4)
defaultValues = {
'SBML_COMPARTMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
int32(3), ...
0/0, ...
'', ...
'', ...
int32(0), ...
int32(0), ...
int32(0), ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_COMPARTMENT', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
int32(3), ...
0/0, ...
'', ...
int32(0), ...
int32(0), ...
int32(0), ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAssignmentRuleFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAssignmentRuleFieldnam0000644 0000000 0000000 00000010160 11703262304 032224 0 ustar root root function [SBMLfieldnames, nNumberFields] = getAssignmentRuleFieldnames(level, ...
version)
% [fieldnames, num] = getAssignmentRuleFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML AssignmentRule structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAssignmentRuleDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAssignmentRuleDefaultV0000644 0000000 0000000 00000007364 11703262304 032233 0 ustar root root function [defaultValues] = getAssignmentRuleDefaultValues(level, version)
% [values] = getAssignmentRuleDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML AssignmentRule structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML AssignmentRule structure can be found using
% the function `getAssignmentRuleFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_ASSIGNMENT_RULE', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_ASSIGNMENT_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_ASSIGNMENT_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_ASSIGNMENT_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_ASSIGNMENT_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
end;
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAlgebraicRuleFieldnames.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAlgebraicRuleFieldname0000644 0000000 0000000 00000010723 11703262304 032137 0 ustar root root function [SBMLfieldnames, nNumberFields] = getAlgebraicRuleFieldnames(level, ...
version)
% [fieldnames, num] = getAlgebraicRuleFieldnames(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of fieldnames for an SBML AlgebraicRule structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
if (level == 1)
SBMLfieldnames = { 'typecode', ...
'notes', ...
'annotation', ...
'type', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (level == 2)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 10;
elseif (version == 2)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 3)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
elseif (version == 4)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
elseif (level == 3)
if (version == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'formula', ...
'variable', ...
'species', ...
'compartment', ...
'name', ...
'units', ...
};
nNumberFields = 11;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAlgebraicRuleDefaultValues.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/getAlgebraicRuleDefaultVa0000644 0000000 0000000 00000010017 11703262304 032122 0 ustar root root function [defaultValues] = getAlgebraicRuleDefaultValues(level, version)
% [values] = getAlgebraicRuleDefaultValues(level, version)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
%
% Returns
%
% 1. an array of default values for an SBML AlgebraicRule structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML AlgebraicRule structure can be found using
% the function `getAlgebraicRuleFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = {
'SBML_ALGEBRAIC_RULE', ...
'', ...
'', ...
'scalar', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (level == 2)
if (version == 1)
defaultValues = {
'SBML_ALGEBRAIC_RULE', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 2)
defaultValues = {
'SBML_ALGEBRAIC_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 3)
defaultValues = {
'SBML_ALGEBRAIC_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
elseif (version == 4)
defaultValues = {
'SBML_ALGEBRAIC_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
end;
elseif (level == 3)
if (version == 1)
defaultValues = {
'SBML_ALGEBRAIC_RULE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
'', ...
'', ...
'', ...
};
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/structFieldnames/Contents.m 0000644 0000000 0000000 00000064644 11703262304 027174 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\structFieldnames
%
% These functions return the fieldnames and default values for the
% MATLAB_SBML structures.
%
%==========================================================
% [values] = getAlgebraicRuleDefaultValues(level, version)
%==========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML AlgebraicRule structure of the given level and version
%
%================================================================
% [fieldnames, num] = getAlgebraicRuleFieldnames(level, version)
%================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML AlgebraicRule structure of the given level and version
% 2. the number of fieldnames
%
%===========================================================
% [values] = getAssignmentRuleDefaultValues(level, version)
%===========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML AssignmentRule structure of the given level and version
%
%=================================================================
% [fieldnames, num] = getAssignmentRuleFieldnames(level, version)
%=================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML AssignmentRule structure of the given level and version
% 2. the number of fieldnames
%
%========================================================
% [values] = getCompartmentDefaultValues(level, version)
%========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Compartment structure of the given level and version
%
%==============================================================
% [fieldnames, num] = getCompartmentFieldnames(level, version)
%==============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Compartment structure of the given level and version
% 2. the number of fieldnames
%
%============================================================
% [values] = getCompartmentTypeDefaultValues(level, version)
%============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML CompartmentType structure of the given level and version
%
%==================================================================
% [fieldnames, num] = getCompartmentTypeFieldnames(level, version)
%==================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML CompartmentType structure of the given level and version
% 2. the number of fieldnames
%
%==================================================================
% [values] = getCompartmentVolumeRuleDefaultValues(level, version)
%==================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML CompartmentVolumeRule structure of the given level and version
%
%========================================================================
% [fieldnames, num] = getCompartmentVolumeRuleFieldnames(level, version)
%========================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML CompartmentVolumeRule structure of the given level and version
% 2. the number of fieldnames
%
%=======================================================
% [values] = getConstraintDefaultValues(level, version)
%=======================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Constraint structure of the given level and version
%
%=============================================================
% [fieldnames, num] = getConstraintFieldnames(level, version)
%=============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Constraint structure of the given level and version
% 2. the number of fieldnames
%
%=======================================================
% [values] = getDefaultValues(typecode, level, version)
%=======================================================
% Takes
% 1. typecode; a string representing the type of object being queried
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML structure of the given typecode, level and version
%
%==================================================
% [values] = getDelayDefaultValues(level, version)
%==================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Delay structure of the given level and version
%
%========================================================
% [fieldnames, num] = getDelayFieldnames(level, version)
%========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Delay structure of the given level and version
% 2. the number of fieldnames
%
%============================================================
% [values] = getEventAssignmentDefaultValues(level, version)
%============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML EventAssignment structure of the given level and version
%
%==================================================================
% [fieldnames, num] = getEventAssignmentFieldnames(level, version)
%==================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML EventAssignment structure of the given level and version
% 2. the number of fieldnames
%
%==================================================
% [values] = getEventDefaultValues(level, version)
%==================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Event structure of the given level and version
%
%========================================================
% [fieldnames, num] = getEventFieldnames(level, version)
%========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Event structure of the given level and version
% 2. the number of fieldnames
%
%=============================================================
% [fieldnames, num] = getFieldnames(typecode, level, version)
%=============================================================
% Takes
% 1. typecode; a string representing the type of object being queried
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML structure of the given typecode, level and version
% 2. the number of fieldnames
%
%===============================================================
% [values] = getFunctionDefinitionDefaultValues(level, version)
%===============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML FunctionDefinition structure of the given level and version
%
%=====================================================================
% [fieldnames, num] = getFunctionDefinitionFieldnames(level, version)
%=====================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML FunctionDefinition structure of the given level and version
% 2. the number of fieldnames
%
%==============================================================
% [values] = getInitialAssignmentDefaultValues(level, version)
%==============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML InitialAssignment structure of the given level and version
%
%====================================================================
% [fieldnames, num] = getInitialAssignmentFieldnames(level, version)
%====================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML InitialAssignment structure of the given level and version
% 2. the number of fieldnames
%
%=======================================================
% [values] = getKineticLawDefaultValues(level, version)
%=======================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML KineticLaw structure of the given level and version
%
%=============================================================
% [fieldnames, num] = getKineticLawFieldnames(level, version)
%=============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML KineticLaw structure of the given level and version
% 2. the number of fieldnames
%
%===========================================================
% [values] = getLocalParameterDefaultValues(level, version)
%===========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML LocalParameter structure of the given level and version
%
%=================================================================
% [fieldnames, num] = getLocalParameterFieldnames(level, version)
%=================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML LocalParameter structure of the given level and version
% 2. the number of fieldnames
%
%==================================================
% [values] = getModelDefaultValues(level, version)
%==================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Model structure of the given level and version
%
%========================================================
% [fieldnames, num] = getModelFieldnames(level, version)
%========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Model structure of the given level and version
% 2. the number of fieldnames
%
%=====================================================================
% [values] = getModifierSpeciesReferenceDefaultValues(level, version)
%=====================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML ModifierSpeciesReference structure of the given level and version
%
%===========================================================================
% [fieldnames, num] = getModifierSpeciesReferenceFieldnames(level, version)
%===========================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML ModifierSpeciesReference structure of the given level and version
% 2. the number of fieldnames
%
%======================================================
% [values] = getParameterDefaultValues(level, version)
%======================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Parameter structure of the given level and version
%
%============================================================
% [fieldnames, num] = getParameterFieldnames(level, version)
%============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Parameter structure of the given level and version
% 2. the number of fieldnames
%
%==========================================================
% [values] = getParameterRuleDefaultValues(level, version)
%==========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML ParameterRule structure of the given level and version
%
%================================================================
% [fieldnames, num] = getParameterRuleFieldnames(level, version)
%================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML ParameterRule structure of the given level and version
% 2. the number of fieldnames
%
%=====================================================
% [values] = getPriorityDefaultValues(level, version)
%=====================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Priority structure of the given level and version
%
%===========================================================
% [fieldnames, num] = getPriorityFieldnames(level, version)
%===========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Priority structure of the given level and version
% 2. the number of fieldnames
%
%=====================================================
% [values] = getRateRuleDefaultValues(level, version)
%=====================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML RateRule structure of the given level and version
%
%===========================================================
% [fieldnames, num] = getRateRuleFieldnames(level, version)
%===========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML RateRule structure of the given level and version
% 2. the number of fieldnames
%
%=====================================================
% [values] = getReactionDefaultValues(level, version)
%=====================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Reaction structure of the given level and version
%
%===========================================================
% [fieldnames, num] = getReactionFieldnames(level, version)
%===========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Reaction structure of the given level and version
% 2. the number of fieldnames
%
%=======================================================
% [fieldnames, num] = getRuleFieldnames(level, version)
%=======================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Rule structure of the given level and version
% 2. the number of fieldnames
%
%=====================================================================
% [values] = getSpeciesConcentrationRuleDefaultValues(level, version)
%=====================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML SpeciesConcentrationRule structure of the given level and version
%
%===========================================================================
% [fieldnames, num] = getSpeciesConcentrationRuleFieldnames(level, version)
%===========================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML SpeciesConcentrationRule structure of the given level and version
% 2. the number of fieldnames
%
%====================================================
% [values] = getSpeciesDefaultValues(level, version)
%====================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Species structure of the given level and version
%
%==========================================================
% [fieldnames, num] = getSpeciesFieldnames(level, version)
%==========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Species structure of the given level and version
% 2. the number of fieldnames
%
%=============================================================
% [values] = getSpeciesReferenceDefaultValues(level, version)
%=============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML SpeciesReference structure of the given level and version
%
%===================================================================
% [fieldnames, num] = getSpeciesReferenceFieldnames(level, version)
%===================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML SpeciesReference structure of the given level and version
% 2. the number of fieldnames
%
%========================================================
% [values] = getSpeciesTypeDefaultValues(level, version)
%========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML SpeciesType structure of the given level and version
%
%==============================================================
% [fieldnames, num] = getSpeciesTypeFieldnames(level, version)
%==============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML SpeciesType structure of the given level and version
% 2. the number of fieldnames
%
%==============================================================
% [values] = getStoichiometryMathDefaultValues(level, version)
%==============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML StoichiometryMath structure of the given level and version
%
%====================================================================
% [fieldnames, num] = getStoichiometryMathFieldnames(level, version)
%====================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML StoichiometryMath structure of the given level and version
% 2. the number of fieldnames
%
%====================================================
% [values] = getTriggerDefaultValues(level, version)
%====================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Trigger structure of the given level and version
%
%==========================================================
% [fieldnames, num] = getTriggerFieldnames(level, version)
%==========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Trigger structure of the given level and version
% 2. the number of fieldnames
%
%=================================================
% [values] = getUnitDefaultValues(level, version)
%=================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML Unit structure of the given level and version
%
%===========================================================
% [values] = getUnitDefinitionDefaultValues(level, version)
%===========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of default values for an SBML UnitDefinition structure of the given level and version
%
%=================================================================
% [fieldnames, num] = getUnitDefinitionFieldnames(level, version)
%=================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML UnitDefinition structure of the given level and version
% 2. the number of fieldnames
%
%=======================================================
% [fieldnames, num] = getUnitFieldnames(level, version)
%=======================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. an array of fieldnames for an SBML Unit structure of the given level and version
% 2. the number of fieldnames
%
%========================================================
% valid = isValidLevelVersionCombination(level, version)
%========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% Returns
% 1. valid = 1 if the level and version combinbation represent a valid
% specification of SBML supported by SBMLToolbox
%
%==============================================
% SBMLModel = propagateLevelVersion(SBMLModel)
%==============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with level and version fields added to all
% sub structures
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/ 0000755 0000000 0000000 00000000000 11704572244 025353 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_unsetS0000644 0000000 0000000 00000003515 11703262366 032317 0 ustar root root function SBMLStoichiometryMath = StoichiometryMath_unsetSBOTerm(SBMLStoichiometryMath)
% SBMLStoichiometryMath = StoichiometryMath_unsetSBOTerm(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. the SBML StoichiometryMath structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'sboTerm')
SBMLStoichiometryMath.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_unsetM0000644 0000000 0000000 00000003507 11703262366 032312 0 ustar root root function SBMLStoichiometryMath = StoichiometryMath_unsetMetaid(SBMLStoichiometryMath)
% SBMLStoichiometryMath = StoichiometryMath_unsetMetaid(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. the SBML StoichiometryMath structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'metaid')
SBMLStoichiometryMath.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_unsetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_unsetM0000644 0000000 0000000 00000003473 11703262366 032314 0 ustar root root function SBMLStoichiometryMath = StoichiometryMath_unsetMath(SBMLStoichiometryMath)
% SBMLStoichiometryMath = StoichiometryMath_unsetMath(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. the SBML StoichiometryMath structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'math')
SBMLStoichiometryMath.math = '';
else
error('math not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_setSBO0000644 0000000 0000000 00000003774 11703262366 032204 0 ustar root root function SBMLStoichiometryMath = StoichiometryMath_setSBOTerm(SBMLStoichiometryMath, sboTerm)
% SBMLStoichiometryMath = StoichiometryMath_setSBOTerm(SBMLStoichiometryMath, sboTerm)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML StoichiometryMath structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLStoichiometryMath.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_setMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_setMet0000644 0000000 0000000 00000003750 11703262366 032300 0 ustar root root function SBMLStoichiometryMath = StoichiometryMath_setMetaid(SBMLStoichiometryMath, metaid)
% SBMLStoichiometryMath = StoichiometryMath_setMetaid(SBMLStoichiometryMath, metaid)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML StoichiometryMath structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLStoichiometryMath.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_setMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_setMat0000644 0000000 0000000 00000003734 11703262366 032276 0 ustar root root function SBMLStoichiometryMath = StoichiometryMath_setMath(SBMLStoichiometryMath, math)
% SBMLStoichiometryMath = StoichiometryMath_setMath(SBMLStoichiometryMath, math)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML StoichiometryMath structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLStoichiometryMath.math = math;
end;
else
error('math not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_isSetS0000644 0000000 0000000 00000003460 11703262366 032247 0 ustar root root function value = StoichiometryMath_isSetSBOTerm(SBMLStoichiometryMath)
% value = StoichiometryMath_isSetSBOTerm(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'sboTerm')
value = (SBMLStoichiometryMath.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_isSetM0000644 0000000 0000000 00000003457 11703262366 032247 0 ustar root root function value = StoichiometryMath_isSetMetaid(SBMLStoichiometryMath)
% value = StoichiometryMath_isSetMetaid(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'metaid')
value = ~isempty(SBMLStoichiometryMath.metaid);
else
error('metaid not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_isSetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_isSetM0000644 0000000 0000000 00000003443 11703262366 032242 0 ustar root root function value = StoichiometryMath_isSetMath(SBMLStoichiometryMath)
% value = StoichiometryMath_isSetMath(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'math')
value = ~isempty(SBMLStoichiometryMath.math);
else
error('math not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_getSBO0000644 0000000 0000000 00000003417 11703262366 032162 0 ustar root root function sboTerm = StoichiometryMath_getSBOTerm(SBMLStoichiometryMath)
% sboTerm = StoichiometryMath_getSBOTerm(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'sboTerm')
sboTerm = SBMLStoichiometryMath.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_getMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_getMet0000644 0000000 0000000 00000003406 11703262366 032262 0 ustar root root function metaid = StoichiometryMath_getMetaid(SBMLStoichiometryMath)
% metaid = StoichiometryMath_getMetaid(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'metaid')
metaid = SBMLStoichiometryMath.metaid;
else
error('metaid not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_getMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_getMat0000644 0000000 0000000 00000003364 11703262366 032261 0 ustar root root function math = StoichiometryMath_getMath(SBMLStoichiometryMath)
% math = StoichiometryMath_getMath(SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLStoichiometryMath);
if isfield(SBMLStoichiometryMath, 'math')
math = SBMLStoichiometryMath.math;
else
error('math not an attribute on SBML L%dV%d StoichiometryMath', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_create.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/StoichiometryMath_create0000644 0000000 0000000 00000005562 11703262366 032305 0 ustar root root function StoichiometryMath = StoichiometryMath_create(varargin)
% StoichiometryMath = StoichiometryMath_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML StoichiometryMath structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getStoichiometryMathFieldnames(level, version);
if (num > 0)
values = getStoichiometryMathDefaultValues(level, version);
StoichiometryMath = cell2struct(values, fieldnames, 2);
%add level and version
StoichiometryMath.level = level;
StoichiometryMath.version = version;
%check correct structure
if ~isSBML_StoichiometryMath(StoichiometryMath, level, version)
StoichiometryMath = struct();
warning('Warn:BadStruct', 'Failed to create StoichiometryMath');
end;
else
StoichiometryMath = [];
warning('Warn:InvalidLV', 'StoichiometryMath not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/StoichiometryMath/Contents.m 0000644 0000000 0000000 00000014475 11703262366 027341 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\StoichiometryMath
%
% The functions allow users to create and work with the SBML StoichiometryMath structure.
%
%===================================================================================
% StoichiometryMath = StoichiometryMath_create(level(optional), version(optional) )
%===================================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML StoichiometryMath structure of the appropriate level and version
%
%=========================================================
% math = StoichiometryMath_getMath(SBMLStoichiometryMath)
%=========================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. the value of the math attribute
%
%=============================================================
% metaid = StoichiometryMath_getMetaid(SBMLStoichiometryMath)
%=============================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. the value of the metaid attribute
%
%===============================================================
% sboTerm = StoichiometryMath_getSBOTerm(SBMLStoichiometryMath)
%===============================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. the value of the sboTerm attribute
%
%============================================================
% value = StoichiometryMath_isSetMath(SBMLStoichiometryMath)
%============================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%==============================================================
% value = StoichiometryMath_isSetMetaid(SBMLStoichiometryMath)
%==============================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%===============================================================
% value = StoichiometryMath_isSetSBOTerm(SBMLStoichiometryMath)
%===============================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%================================================================================
% SBMLStoichiometryMath = StoichiometryMath_setMath(SBMLStoichiometryMath, math)
%================================================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML StoichiometryMath structure with the new value for the math attribute
%
%====================================================================================
% SBMLStoichiometryMath = StoichiometryMath_setMetaid(SBMLStoichiometryMath, metaid)
%====================================================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML StoichiometryMath structure with the new value for the metaid attribute
%
%======================================================================================
% SBMLStoichiometryMath = StoichiometryMath_setSBOTerm(SBMLStoichiometryMath, sboTerm)
%======================================================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML StoichiometryMath structure with the new value for the sboTerm attribute
%
%============================================================================
% SBMLStoichiometryMath = StoichiometryMath_unsetMath(SBMLStoichiometryMath)
%============================================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. the SBML StoichiometryMath structure with the math attribute unset
%
%==============================================================================
% SBMLStoichiometryMath = StoichiometryMath_unsetMetaid(SBMLStoichiometryMath)
%==============================================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. the SBML StoichiometryMath structure with the metaid attribute unset
%
%===============================================================================
% SBMLStoichiometryMath = StoichiometryMath_unsetSBOTerm(SBMLStoichiometryMath)
%===============================================================================
% Takes
% 1. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. the SBML StoichiometryMath structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/ 0000755 0000000 0000000 00000000000 11704572242 024132 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_unsetSBOTerm.m 0000644 0000000 0000000 00000003377 11703262356 031172 0 ustar root root function SBMLSpeciesType = SpeciesType_unsetSBOTerm(SBMLSpeciesType)
% SBMLSpeciesType = SpeciesType_unsetSBOTerm(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the SBML SpeciesType structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'sboTerm')
SBMLSpeciesType.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_unsetName.m 0000644 0000000 0000000 00000003355 11703262356 030573 0 ustar root root function SBMLSpeciesType = SpeciesType_unsetName(SBMLSpeciesType)
% SBMLSpeciesType = SpeciesType_unsetName(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the SBML SpeciesType structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'name')
SBMLSpeciesType.name = '';
else
error('name not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_unsetMetaid.m 0000644 0000000 0000000 00000003371 11703262356 031114 0 ustar root root function SBMLSpeciesType = SpeciesType_unsetMetaid(SBMLSpeciesType)
% SBMLSpeciesType = SpeciesType_unsetMetaid(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the SBML SpeciesType structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'metaid')
SBMLSpeciesType.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_unsetId.m 0000644 0000000 0000000 00000003341 11703262356 030242 0 ustar root root function SBMLSpeciesType = SpeciesType_unsetId(SBMLSpeciesType)
% SBMLSpeciesType = SpeciesType_unsetId(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the SBML SpeciesType structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'id')
SBMLSpeciesType.id = '';
else
error('id not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_setSBOTerm.m 0000644 0000000 0000000 00000003656 11703262356 030627 0 ustar root root function SBMLSpeciesType = SpeciesType_setSBOTerm(SBMLSpeciesType, sboTerm)
% SBMLSpeciesType = SpeciesType_setSBOTerm(SBMLSpeciesType, sboTerm)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML SpeciesType structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLSpeciesType.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_setName.m 0000644 0000000 0000000 00000003600 11703262356 030221 0 ustar root root function SBMLSpeciesType = SpeciesType_setName(SBMLSpeciesType, name)
% SBMLSpeciesType = SpeciesType_setName(SBMLSpeciesType, name)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML SpeciesType structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLSpeciesType.name = name;
end;
else
error('name not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_setMetaid.m 0000644 0000000 0000000 00000003632 11703262356 030551 0 ustar root root function SBMLSpeciesType = SpeciesType_setMetaid(SBMLSpeciesType, metaid)
% SBMLSpeciesType = SpeciesType_setMetaid(SBMLSpeciesType, metaid)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML SpeciesType structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLSpeciesType.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_setId.m 0000644 0000000 0000000 00000003546 11703262356 027706 0 ustar root root function SBMLSpeciesType = SpeciesType_setId(SBMLSpeciesType, id)
% SBMLSpeciesType = SpeciesType_setId(SBMLSpeciesType, id)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML SpeciesType structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLSpeciesType.id = id;
end;
else
error('id not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_isSetSBOTerm.m 0000644 0000000 0000000 00000003364 11703262356 031117 0 ustar root root function value = SpeciesType_isSetSBOTerm(SBMLSpeciesType)
% value = SpeciesType_isSetSBOTerm(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'sboTerm')
value = (SBMLSpeciesType.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_isSetName.m 0000644 0000000 0000000 00000003347 11703262356 030525 0 ustar root root function value = SpeciesType_isSetName(SBMLSpeciesType)
% value = SpeciesType_isSetName(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'name')
value = ~isempty(SBMLSpeciesType.name);
else
error('name not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_isSetMetaid.m 0000644 0000000 0000000 00000003363 11703262356 031046 0 ustar root root function value = SpeciesType_isSetMetaid(SBMLSpeciesType)
% value = SpeciesType_isSetMetaid(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'metaid')
value = ~isempty(SBMLSpeciesType.metaid);
else
error('metaid not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_isSetId.m 0000644 0000000 0000000 00000003333 11703262356 030174 0 ustar root root function value = SpeciesType_isSetId(SBMLSpeciesType)
% value = SpeciesType_isSetId(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'id')
value = ~isempty(SBMLSpeciesType.id);
else
error('id not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_getSBOTerm.m 0000644 0000000 0000000 00000003323 11703262356 030602 0 ustar root root function sboTerm = SpeciesType_getSBOTerm(SBMLSpeciesType)
% sboTerm = SpeciesType_getSBOTerm(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'sboTerm')
sboTerm = SBMLSpeciesType.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_getName.m 0000644 0000000 0000000 00000003270 11703262356 030210 0 ustar root root function name = SpeciesType_getName(SBMLSpeciesType)
% name = SpeciesType_getName(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'name')
name = SBMLSpeciesType.name;
else
error('name not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_getMetaid.m 0000644 0000000 0000000 00000003312 11703262356 030530 0 ustar root root function metaid = SpeciesType_getMetaid(SBMLSpeciesType)
% metaid = SpeciesType_getMetaid(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'metaid')
metaid = SBMLSpeciesType.metaid;
else
error('metaid not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_getId.m 0000644 0000000 0000000 00000003246 11703262356 027667 0 ustar root root function id = SpeciesType_getId(SBMLSpeciesType)
% id = SpeciesType_getId(SBMLSpeciesType)
%
% Takes
%
% 1. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesType);
if isfield(SBMLSpeciesType, 'id')
id = SBMLSpeciesType.id;
else
error('id not an attribute on SBML L%dV%d SpeciesType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/SpeciesType_create.m 0000644 0000000 0000000 00000005422 11703262356 030074 0 ustar root root function SpeciesType = SpeciesType_create(varargin)
% SpeciesType = SpeciesType_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML SpeciesType structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getSpeciesTypeFieldnames(level, version);
if (num > 0)
values = getSpeciesTypeDefaultValues(level, version);
SpeciesType = cell2struct(values, fieldnames, 2);
%add level and version
SpeciesType.level = level;
SpeciesType.version = version;
%check correct structure
if ~isSBML_SpeciesType(SpeciesType, level, version)
SpeciesType = struct();
warning('Warn:BadStruct', 'Failed to create SpeciesType');
end;
else
SpeciesType = [];
warning('Warn:InvalidLV', 'SpeciesType not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesType/Contents.m 0000644 0000000 0000000 00000015330 11703262356 026110 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\SpeciesType
%
% The functions allow users to create and work with the SBML SpeciesType structure.
%
%=======================================================================
% SpeciesType = SpeciesType_create(level(optional), version(optional) )
%=======================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML SpeciesType structure of the appropriate level and version
%
%=========================================
% id = SpeciesType_getId(SBMLSpeciesType)
%=========================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the value of the id attribute
%
%=================================================
% metaid = SpeciesType_getMetaid(SBMLSpeciesType)
%=================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the value of the metaid attribute
%
%=============================================
% name = SpeciesType_getName(SBMLSpeciesType)
%=============================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the value of the name attribute
%
%===================================================
% sboTerm = SpeciesType_getSBOTerm(SBMLSpeciesType)
%===================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the value of the sboTerm attribute
%
%==============================================
% value = SpeciesType_isSetId(SBMLSpeciesType)
%==============================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%==================================================
% value = SpeciesType_isSetMetaid(SBMLSpeciesType)
%==================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%================================================
% value = SpeciesType_isSetName(SBMLSpeciesType)
%================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%===================================================
% value = SpeciesType_isSetSBOTerm(SBMLSpeciesType)
%===================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==========================================================
% SBMLSpeciesType = SpeciesType_setId(SBMLSpeciesType, id)
%==========================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML SpeciesType structure with the new value for the id attribute
%
%==================================================================
% SBMLSpeciesType = SpeciesType_setMetaid(SBMLSpeciesType, metaid)
%==================================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML SpeciesType structure with the new value for the metaid attribute
%
%==============================================================
% SBMLSpeciesType = SpeciesType_setName(SBMLSpeciesType, name)
%==============================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML SpeciesType structure with the new value for the name attribute
%
%====================================================================
% SBMLSpeciesType = SpeciesType_setSBOTerm(SBMLSpeciesType, sboTerm)
%====================================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML SpeciesType structure with the new value for the sboTerm attribute
%
%========================================================
% SBMLSpeciesType = SpeciesType_unsetId(SBMLSpeciesType)
%========================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the SBML SpeciesType structure with the id attribute unset
%
%============================================================
% SBMLSpeciesType = SpeciesType_unsetMetaid(SBMLSpeciesType)
%============================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the SBML SpeciesType structure with the metaid attribute unset
%
%==========================================================
% SBMLSpeciesType = SpeciesType_unsetName(SBMLSpeciesType)
%==========================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the SBML SpeciesType structure with the name attribute unset
%
%=============================================================
% SBMLSpeciesType = SpeciesType_unsetSBOTerm(SBMLSpeciesType)
%=============================================================
% Takes
% 1. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the SBML SpeciesType structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/ 0000755 0000000 0000000 00000000000 11704572242 025107 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000165 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetStoichiometryMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetSto0000644 0000000 0000000 00000003741 11703262342 032151 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetStoichiometryMath(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetStoichiometryMath(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the stoichiometryMath field unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometryMath')
if (level == 2 && version < 3)
SBMLSpeciesReference.stoichiometryMath = '';
else
SBMLSpeciesReference.stoichiometryMath = [];
end;
else
error('stoichiometryMath not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000161 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetStoichiometry.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetSto0000644 0000000 0000000 00000003746 11703262344 032160 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetStoichiometry(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetStoichiometry(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the stoichiometry attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometry')
if (level > 2)
SBMLSpeciesReference.stoichiometry = NaN;
SBMLSpeciesReference.isSetStoichiometry = 0;
else
SBMLSpeciesReference.stoichiometry = 1;
end;
else
error('stoichiometry not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetSpe0000644 0000000 0000000 00000003502 11703262344 032130 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetSpecies(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetSpecies(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the species attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'species')
SBMLSpeciesReference.species = '';
else
error('species not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetSBO0000644 0000000 0000000 00000003502 11703262342 032022 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetSBOTerm(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetSBOTerm(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'sboTerm')
SBMLSpeciesReference.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetNam0000644 0000000 0000000 00000003460 11703262342 032115 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetName(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetName(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'name')
SBMLSpeciesReference.name = '';
else
error('name not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetMet0000644 0000000 0000000 00000003474 11703262342 032134 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetMetaid(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetMetaid(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'metaid')
SBMLSpeciesReference.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetId.0000644 0000000 0000000 00000003444 11703262342 032016 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetId(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetId(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'id')
SBMLSpeciesReference.id = '';
else
error('id not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetDenominator.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_unsetDen0000644 0000000 0000000 00000003533 11703262342 032111 0 ustar root root function SBMLSpeciesReference = SpeciesReference_unsetDenominator(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_unsetDenominator(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the denominator attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'denominator')
SBMLSpeciesReference.denominator = NaN;
else
error('denominator not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setStoichiometryMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setStoic0000644 0000000 0000000 00000005035 11703262342 032120 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setStoichiometryMath(SBMLSpeciesReference, stoichiometryMath)
% SBMLSpeciesReference = SpeciesReference_setStoichiometryMath(SBMLSpeciesReference, SBMLStoichiometryMath)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLStoichiometryMath, an SBML StoichiometryMath structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the stoichiometryMath field
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isstruct(stoichiometryMath)
[sm_level, sm_version] = GetLevelVersion(stoichiometryMath);
if level ~= sm_level
error('mismatch in levels');
elseif version ~= sm_version
error('mismatch in versions');
end;
end;
if isfield(SBMLSpeciesReference, 'stoichiometryMath')
if (level == 2 && version < 3) && ~ischar(stoichiometryMath)
error('stoichiometryMath must be character array') ;
elseif (((level == 2 && version > 2) || level > 2) ...
&& ~isValid(stoichiometryMath, level, version))
error('stoichiometryMath must be an SBML StoichiometryMath structure');
else
SBMLSpeciesReference.stoichiometryMath = stoichiometryMath;
end;
else
error('stoichiometryMath not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setStoichiometry.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setStoic0000644 0000000 0000000 00000004211 11703262344 032115 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setStoichiometry(SBMLSpeciesReference, stoichiometry)
% SBMLSpeciesReference = SpeciesReference_setStoichiometry(SBMLSpeciesReference, stoichiometry)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. stoichiometry; number representing the value of stoichiometry to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the stoichiometry attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometry')
if ~isnumeric(stoichiometry)
error('stoichiometry must be numeric') ;
else
SBMLSpeciesReference.stoichiometry = stoichiometry;
if (level > 2)
SBMLSpeciesReference.isSetStoichiometry = 1;
end;
end;
else
error('stoichiometry not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setSpeci0000644 0000000 0000000 00000003752 11703262342 032106 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setSpecies(SBMLSpeciesReference, species)
% SBMLSpeciesReference = SpeciesReference_setSpecies(SBMLSpeciesReference, species)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. species; a string representing the species to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the species attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'species')
if ~ischar(species)
error('species must be character array') ;
else
SBMLSpeciesReference.species = species;
end;
else
error('species not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setSBOTe0000644 0000000 0000000 00000003761 11703262342 031757 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setSBOTerm(SBMLSpeciesReference, sboTerm)
% SBMLSpeciesReference = SpeciesReference_setSBOTerm(SBMLSpeciesReference, sboTerm)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLSpeciesReference.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setName.0000644 0000000 0000000 00000003703 11703262342 031775 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setName(SBMLSpeciesReference, name)
% SBMLSpeciesReference = SpeciesReference_setName(SBMLSpeciesReference, name)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLSpeciesReference.name = name;
end;
else
error('name not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setMetai0000644 0000000 0000000 00000003735 11703262344 032105 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setMetaid(SBMLSpeciesReference, metaid)
% SBMLSpeciesReference = SpeciesReference_setMetaid(SBMLSpeciesReference, metaid)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLSpeciesReference.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setId.m 0000644 0000000 0000000 00000003651 11703262342 031630 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setId(SBMLSpeciesReference, id)
% SBMLSpeciesReference = SpeciesReference_setId(SBMLSpeciesReference, id)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLSpeciesReference.id = id;
end;
else
error('id not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setDenominator.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setDenom0000644 0000000 0000000 00000004033 11703262342 032076 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setDenominator(SBMLSpeciesReference, denominator)
% SBMLSpeciesReference = SpeciesReference_setDenominator(SBMLSpeciesReference, denominator)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. denominator, an integer representing the denominator to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the denominator attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'denominator')
if ~isnumeric(denominator)
error('denominator must be numeric') ;
else
SBMLSpeciesReference.denominator = denominator;
end;
else
error('denominator not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setConstant.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_setConst0000644 0000000 0000000 00000004074 11703262342 032127 0 ustar root root function SBMLSpeciesReference = SpeciesReference_setConstant(SBMLSpeciesReference, constant)
% SBMLSpeciesReference = SpeciesReference_setConstant(SBMLSpeciesReference, constant)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. constant, an integer (0/1) representing the value of constant to be set
%
% Returns
%
% 1. the SBML SpeciesReference structure with the new value for the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'constant')
if (~isIntegralNumber(constant) || constant < 0 || constant > 1)
error('constant must be an integer of value 0/1') ;
else
SBMLSpeciesReference.constant = constant;
end;
else
error('constant not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000165 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetStoichiometryMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetSto0000644 0000000 0000000 00000003551 11703262344 032103 0 ustar root root function value = SpeciesReference_isSetStoichiometryMath(SBMLSpeciesReference)
% value = SpeciesReference_isSetStoichiometryMath(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the stoichiometryMath structure is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometryMath')
value = ~isempty(SBMLSpeciesReference.stoichiometryMath);
else
error('stoichiometryMath not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000161 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetStoichiometry.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetSto0000644 0000000 0000000 00000003602 11703262342 032076 0 ustar root root function value = SpeciesReference_isSetStoichiometry(SBMLSpeciesReference)
% value = SpeciesReference_isSetStoichiometry(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the stoichiometry attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometry')
if (level > 2)
value = SBMLSpeciesReference.isSetStoichiometry;
else
value = 1;
end;
else
error('isSetStoichiometry not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetSpe0000644 0000000 0000000 00000003455 11703262342 032066 0 ustar root root function value = SpeciesReference_isSetSpecies(SBMLSpeciesReference)
% value = SpeciesReference_isSetSpecies(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the species attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'species')
value = ~isempty(SBMLSpeciesReference.species);
else
error('species not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetSBO0000644 0000000 0000000 00000003450 11703262344 031757 0 ustar root root function value = SpeciesReference_isSetSBOTerm(SBMLSpeciesReference)
% value = SpeciesReference_isSetSBOTerm(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'sboTerm')
value = (SBMLSpeciesReference.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetNam0000644 0000000 0000000 00000003433 11703262342 032046 0 ustar root root function value = SpeciesReference_isSetName(SBMLSpeciesReference)
% value = SpeciesReference_isSetName(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'name')
value = ~isempty(SBMLSpeciesReference.name);
else
error('name not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetMet0000644 0000000 0000000 00000003447 11703262342 032065 0 ustar root root function value = SpeciesReference_isSetMetaid(SBMLSpeciesReference)
% value = SpeciesReference_isSetMetaid(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'metaid')
value = ~isempty(SBMLSpeciesReference.metaid);
else
error('metaid not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetId.0000644 0000000 0000000 00000003417 11703262342 031747 0 ustar root root function value = SpeciesReference_isSetId(SBMLSpeciesReference)
% value = SpeciesReference_isSetId(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'id')
value = ~isempty(SBMLSpeciesReference.id);
else
error('id not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetDenominator.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isSetDen0000644 0000000 0000000 00000003441 11703262342 032040 0 ustar root root function value = SpeciesReference_isSetDenominator(SBMLSpeciesReference)
% value = SpeciesReference_isSetDenominator(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the denominator attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'denominator')
value = 1;
else
error('isSetDenominator not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000160 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isInAlgebraicRule.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isInAlge0000644 0000000 0000000 00000006367 11703262344 032031 0 ustar root root function y = SpeciesReference_isInAlgebraicRule(SBMLSpeciesReference, SBMLRules)
% y = SpeciesReference_isInAlgebraicRule(SBMLSpeciesReference, SBMLRules)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - an array of the indices of any algebraicRules the id of the SpeciesReference appears in
% - 0 if the SpeciesReference appears in no algebraicRules
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLSpeciesReference))
error(sprintf('%s', ...
'argument must be an SBML SpeciesReference structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLSpeciesReference);
if (~isSBML_SpeciesReference(SBMLSpeciesReference, sbmlLevel, sbmlVersion))
error('SpeciesReference_isInAlgebraicRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'first argument must be an SBMLSpeciesReference structure');
elseif (~isfield(SBMLSpeciesReference, 'id'))
error('SpeciesReference cannot be used by rules in SBML level %u version %u', ...
sbmlLevel, sbmlVersion);
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('SpeciesReference_isInAlgebraicRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('SpeciesReference_isInAlgebraicRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the species occurs
%determine the name or id of the species
name = SBMLSpeciesReference.id;
y = [];
for i = 1:NumRules
index = matchName(SBMLRules(i).formula, name);
if (~isempty(index) && strcmp(SBMLRules(i).typecode, 'SBML_ALGEBRAIC_RULE'))
y = [y;i];
end;
end;
if isempty(y)
y = 0;
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isAssignedByRule.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isAssign0000644 0000000 0000000 00000006410 11703262344 032103 0 ustar root root function y = SpeciesReference_isAssignedByRule(SBMLSpeciesReference, SBMLRules)
% y = SpeciesReference_isAssignedByRule(SBMLSpeciesReference, SBMLRules)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the assignmentRule used to assigned value to the SpeciesReference
% - 0 if the SpeciesReference is not assigned by assignmentRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLSpeciesReference))
error(sprintf('%s', ...
'argument must be an SBML SpeciesReference structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLSpeciesReference);
if (~isSBML_SpeciesReference(SBMLSpeciesReference, sbmlLevel, sbmlVersion))
error('SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'first argument must be an SBMLSpeciesReference structure');
elseif (sbmlLevel < 3)
error('SpeciesReference cannot be assigned by rules in SBML level %u', sbmlLevel);
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the SpeciesReference is assigned by it
%determine the name or id of the SpeciesReference
name = SBMLSpeciesReference.id;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_ASSIGNMENT_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isAssignedByRateRule.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_isAssign0000644 0000000 0000000 00000006376 11703262344 032116 0 ustar root root function y = SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)
% y = SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the rateRule used to assigned value to the SpeciesReference
% - 0 if the SpeciesReference is not assigned by rateRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLSpeciesReference))
error(sprintf('%s', ...
'argument must be an SBML SpeciesReference structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLSpeciesReference);
if (~isSBML_SpeciesReference(SBMLSpeciesReference, sbmlLevel, sbmlVersion))
error('SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'first argument must be an SBMLSpeciesReference structure');
elseif (sbmlLevel < 3)
error('SpeciesReference cannot be assigned by rules in SBML level %u', sbmlLevel);
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the SpeciesReference is assigned by it
%determine the name or id of the SpeciesReference
name = SBMLSpeciesReference.id;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_RATE_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getStoichiometryMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getStoic0000644 0000000 0000000 00000003531 11703262342 032103 0 ustar root root function stoichiometryMath = SpeciesReference_getStoichiometryMath(SBMLSpeciesReference)
% stoichiometryMath = SpeciesReference_getStoichiometryMath(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML StoichiometryMath structure
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometryMath')
stoichiometryMath = SBMLSpeciesReference.stoichiometryMath;
else
error('stoichiometryMath not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getStoichiometry.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getStoic0000644 0000000 0000000 00000003475 11703262342 032112 0 ustar root root function stoichiometry = SpeciesReference_getStoichiometry(SBMLSpeciesReference)
% stoichiometry = SpeciesReference_getStoichiometry(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the stoichiometry attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometry')
stoichiometry = SBMLSpeciesReference.stoichiometry;
else
error('stoichiometry not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getSpeci0000644 0000000 0000000 00000003407 11703262342 032067 0 ustar root root function species = SpeciesReference_getSpecies(SBMLSpeciesReference)
% species = SpeciesReference_getSpecies(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the species attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'species')
species = SBMLSpeciesReference.species;
else
error('species not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getSBOTe0000644 0000000 0000000 00000003407 11703262342 031740 0 ustar root root function sboTerm = SpeciesReference_getSBOTerm(SBMLSpeciesReference)
% sboTerm = SpeciesReference_getSBOTerm(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'sboTerm')
sboTerm = SBMLSpeciesReference.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getName.0000644 0000000 0000000 00000003354 11703262344 031765 0 ustar root root function name = SpeciesReference_getName(SBMLSpeciesReference)
% name = SpeciesReference_getName(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'name')
name = SBMLSpeciesReference.name;
else
error('name not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getMetai0000644 0000000 0000000 00000003376 11703262342 032070 0 ustar root root function metaid = SpeciesReference_getMetaid(SBMLSpeciesReference)
% metaid = SpeciesReference_getMetaid(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'metaid')
metaid = SBMLSpeciesReference.metaid;
else
error('metaid not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getId.m 0000644 0000000 0000000 00000003332 11703262342 031610 0 ustar root root function id = SpeciesReference_getId(SBMLSpeciesReference)
% id = SpeciesReference_getId(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'id')
id = SBMLSpeciesReference.id;
else
error('id not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getDenominator.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getDenom0000644 0000000 0000000 00000003453 11703262344 032071 0 ustar root root function denominator = SpeciesReference_getDenominator(SBMLSpeciesReference)
% denominator = SpeciesReference_getDenominator(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the denominator attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'denominator')
denominator = SBMLSpeciesReference.denominator;
else
error('denominator not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getConstant.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_getConst0000644 0000000 0000000 00000003420 11703262344 032107 0 ustar root root function constant = SpeciesReference_getConstant(SBMLSpeciesReference)
% constant = SpeciesReference_getConstant(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the value of the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'constant')
constant = SBMLSpeciesReference.constant;
else
error('constant not an attribute on SBML L%dV%d SpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_createStoichiometryMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_createSt0000644 0000000 0000000 00000004007 11703262342 032073 0 ustar root root function SBMLSpeciesReference = SpeciesReference_createStoichiometryMath(SBMLSpeciesReference)
% SBMLSpeciesReference = SpeciesReference_createStoichiometryMath(SBMLSpeciesReference)
%
% Takes
%
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
%
% Returns
%
% 1. the SBML SpeciesReference structure with a new SBML StoichiometryMath structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesReference);
if isfield(SBMLSpeciesReference, 'stoichiometryMath')
SBMLStoichiometryMath = StoichiometryMath_create(level, version);
if ~isempty(SBMLStoichiometryMath)
SBMLSpeciesReference.stoichiometryMath = SBMLStoichiometryMath;
end;
else
error('stoichiometryMath not an element on SBML L%dV%d SpeciesReference', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/SpeciesReference_create.m0000644 0000000 0000000 00000006125 11703262342 032022 0 ustar root root function SpeciesReference = SpeciesReference_create(varargin)
% SpeciesReference = SpeciesReference_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML SpeciesReference structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getSpeciesReferenceFieldnames(level, version);
if (num > 0)
values = getSpeciesReferenceDefaultValues(level, version);
SpeciesReference = cell2struct(values, fieldnames, 2);
warning('off', 'Warn:InvalidLV');
t = StoichiometryMath_create(level, version);
if ~isempty(t)
SpeciesReference.stoichiometryMath = t;
SpeciesReference.stoichiometryMath(1:end) = [];
end;
warning('on', 'Warn:InvalidLV');
%add level and version
SpeciesReference.level = level;
SpeciesReference.version = version;
%check correct structure
if ~isSBML_SpeciesReference(SpeciesReference, level, version)
SpeciesReference = struct();
warning('Warn:BadStruct', 'Failed to create SpeciesReference');
end;
else
SpeciesReference = [];
warning('Warn:InvalidLV', 'SpeciesReference not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesReference/Contents.m 0000644 0000000 0000000 00000050422 11703262342 027061 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\SpeciesReference
%
% The functions allow users to create and work with the SBML SpeciesReference structure.
%
%=================================================================================
% SpeciesReference = SpeciesReference_create(level(optional), version(optional) )
%=================================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML SpeciesReference structure of the appropriate level and version
%
%=======================================================================================
% SBMLSpeciesReference = SpeciesReference_createStoichiometryMath(SBMLSpeciesReference)
%=======================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with a new SBML StoichiometryMath structure added
%
%===============================================================
% constant = SpeciesReference_getConstant(SBMLSpeciesReference)
%===============================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the constant attribute
%
%=====================================================================
% denominator = SpeciesReference_getDenominator(SBMLSpeciesReference)
%=====================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the denominator attribute
%
%===================================================
% id = SpeciesReference_getId(SBMLSpeciesReference)
%===================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the id attribute
%
%===========================================================
% metaid = SpeciesReference_getMetaid(SBMLSpeciesReference)
%===========================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the metaid attribute
%
%=======================================================
% name = SpeciesReference_getName(SBMLSpeciesReference)
%=======================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the name attribute
%
%=============================================================
% sboTerm = SpeciesReference_getSBOTerm(SBMLSpeciesReference)
%=============================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the sboTerm attribute
%
%=============================================================
% species = SpeciesReference_getSpecies(SBMLSpeciesReference)
%=============================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the species attribute
%
%=========================================================================
% stoichiometry = SpeciesReference_getStoichiometry(SBMLSpeciesReference)
%=========================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the value of the stoichiometry attribute
%
%=================================================================================
% stoichiometryMath = SpeciesReference_getStoichiometryMath(SBMLSpeciesReference)
%=================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML StoichiometryMath structure
%
%============================================================================
% y = SpeciesReference_isAssignedByRateRule(SBMLSpeciesReference, SBMLRules)
%============================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the rateRule used to assigned value to the SpeciesReference
% - 0 if the SpeciesReference is not assigned by rateRule
%
%
%========================================================================
% y = SpeciesReference_isAssignedByRule(SBMLSpeciesReference, SBMLRules)
%========================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the assignmentRule used to assigned value to the SpeciesReference
% - 0 if the SpeciesReference is not assigned by assignmentRule
%
%
%=========================================================================
% y = SpeciesReference_isInAlgebraicRule(SBMLSpeciesReference, SBMLRules)
%=========================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - an array of the indices of any algebraicRules the id of the SpeciesReference appears in
% - 0 if the SpeciesReference appears in no algebraicRules
%
%
%=================================================================
% value = SpeciesReference_isSetDenominator(SBMLSpeciesReference)
%=================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the denominator attribute is set
% - 0 otherwise
%
%========================================================
% value = SpeciesReference_isSetId(SBMLSpeciesReference)
%========================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%============================================================
% value = SpeciesReference_isSetMetaid(SBMLSpeciesReference)
%============================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%==========================================================
% value = SpeciesReference_isSetName(SBMLSpeciesReference)
%==========================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%=============================================================
% value = SpeciesReference_isSetSBOTerm(SBMLSpeciesReference)
%=============================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%=============================================================
% value = SpeciesReference_isSetSpecies(SBMLSpeciesReference)
%=============================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the species attribute is set
% - 0 otherwise
%
%===================================================================
% value = SpeciesReference_isSetStoichiometry(SBMLSpeciesReference)
%===================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the stoichiometry attribute is set
% - 0 otherwise
%
%=======================================================================
% value = SpeciesReference_isSetStoichiometryMath(SBMLSpeciesReference)
%=======================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. value =
% - 1 if the stoichiometryMath structure is set
% - 0 otherwise
%
%=====================================================================================
% SBMLSpeciesReference = SpeciesReference_setConstant(SBMLSpeciesReference, constant)
%=====================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. constant, an integer (0/1) representing the value of constant to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the constant attribute
%
%===========================================================================================
% SBMLSpeciesReference = SpeciesReference_setDenominator(SBMLSpeciesReference, denominator)
%===========================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. denominator, an integer representing the denominator to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the denominator attribute
%
%=========================================================================
% SBMLSpeciesReference = SpeciesReference_setId(SBMLSpeciesReference, id)
%=========================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the id attribute
%
%=================================================================================
% SBMLSpeciesReference = SpeciesReference_setMetaid(SBMLSpeciesReference, metaid)
%=================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the metaid attribute
%
%=============================================================================
% SBMLSpeciesReference = SpeciesReference_setName(SBMLSpeciesReference, name)
%=============================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the name attribute
%
%===================================================================================
% SBMLSpeciesReference = SpeciesReference_setSBOTerm(SBMLSpeciesReference, sboTerm)
%===================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the sboTerm attribute
%
%===================================================================================
% SBMLSpeciesReference = SpeciesReference_setSpecies(SBMLSpeciesReference, species)
%===================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. species; a string representing the species to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the species attribute
%
%===============================================================================================
% SBMLSpeciesReference = SpeciesReference_setStoichiometry(SBMLSpeciesReference, stoichiometry)
%===============================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. stoichiometry; number representing the value of stoichiometry to be set
% Returns
% 1. the SBML SpeciesReference structure with the new value for the stoichiometry attribute
%
%===========================================================================================================
% SBMLSpeciesReference = SpeciesReference_setStoichiometryMath(SBMLSpeciesReference, SBMLStoichiometryMath)
%===========================================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% 2. SBMLStoichiometryMath, an SBML StoichiometryMath structure
% Returns
% 1. the SBML SpeciesReference structure with the new value for the stoichiometryMath field
%
%================================================================================
% SBMLSpeciesReference = SpeciesReference_unsetDenominator(SBMLSpeciesReference)
%================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the denominator attribute unset
%
%=======================================================================
% SBMLSpeciesReference = SpeciesReference_unsetId(SBMLSpeciesReference)
%=======================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the id attribute unset
%
%===========================================================================
% SBMLSpeciesReference = SpeciesReference_unsetMetaid(SBMLSpeciesReference)
%===========================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the metaid attribute unset
%
%=========================================================================
% SBMLSpeciesReference = SpeciesReference_unsetName(SBMLSpeciesReference)
%=========================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the name attribute unset
%
%============================================================================
% SBMLSpeciesReference = SpeciesReference_unsetSBOTerm(SBMLSpeciesReference)
%============================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the sboTerm attribute unset
%
%============================================================================
% SBMLSpeciesReference = SpeciesReference_unsetSpecies(SBMLSpeciesReference)
%============================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the species attribute unset
%
%==================================================================================
% SBMLSpeciesReference = SpeciesReference_unsetStoichiometry(SBMLSpeciesReference)
%==================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the stoichiometry attribute unset
%
%======================================================================================
% SBMLSpeciesReference = SpeciesReference_unsetStoichiometryMath(SBMLSpeciesReference)
%======================================================================================
% Takes
% 1. SBMLSpeciesReference, an SBML SpeciesReference structure
% Returns
% 1. the SBML SpeciesReference structure with the stoichiometryMath field unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/ 0000755 0000000 0000000 00000000000 11704572240 026645 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000174 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_unsetVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003656 11703262342 032214 0 ustar root root function SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetVariable(SBMLSpeciesConcentrationRule)
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetVariable(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. the SBML SpeciesConcentrationRule structure with the variable attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'variable')
SBMLSpeciesConcentrationRule.variable = '';
else
error('variable not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000170 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_unsetType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003634 11703262342 032210 0 ustar root root function SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetType(SBMLSpeciesConcentrationRule)
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetType(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. the SBML SpeciesConcentrationRule structure with the type attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'type')
SBMLSpeciesConcentrationRule.type = 'scalar';
else
error('type not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_unsetSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003650 11703262342 032206 0 ustar root root function SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetSpecies(SBMLSpeciesConcentrationRule)
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetSpecies(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. the SBML SpeciesConcentrationRule structure with the species attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'species')
SBMLSpeciesConcentrationRule.species = '';
else
error('species not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_unsetFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003650 11703262342 032206 0 ustar root root function SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetFormula(SBMLSpeciesConcentrationRule)
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetFormula(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. the SBML SpeciesConcentrationRule structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'formula')
SBMLSpeciesConcentrationRule.formula = '';
else
error('formula not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_setType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000004051 11703262342 032202 0 ustar root root function SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setType(SBMLSpeciesConcentrationRule, type)
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setType(SBMLSpeciesConcentrationRule, type)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. type; a string representing the type to be set
%
% Returns
%
% 1. the SBML SpeciesConcentrationRule structure with the new value for the type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'type')
if ~ischar(type)
error('type must be character array') ;
else
SBMLSpeciesConcentrationRule.type = type;
end;
else
error('type not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_setSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000004120 11703262342 032177 0 ustar root root function SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setSpecies(SBMLSpeciesConcentrationRule, species)
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setSpecies(SBMLSpeciesConcentrationRule, species)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. species; a string representing the species to be set
%
% Returns
%
% 1. the SBML SpeciesConcentrationRule structure with the new value for the species attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'species')
if ~ischar(species)
error('species must be character array') ;
else
SBMLSpeciesConcentrationRule.species = species;
end;
else
error('species not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_setFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000004120 11703262342 032177 0 ustar root root function SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setFormula(SBMLSpeciesConcentrationRule, formula)
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setFormula(SBMLSpeciesConcentrationRule, formula)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML SpeciesConcentrationRule structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLSpeciesConcentrationRule.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000170 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_isSetType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003551 11703262342 032206 0 ustar root root function value = SpeciesConcentrationRule_isSetType(SBMLSpeciesConcentrationRule)
% value = SpeciesConcentrationRule_isSetType(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. value =
% - 1 if the type attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'type')
value = ~isempty(SBMLSpeciesConcentrationRule.type);
else
error('type not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_isSetSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003573 11703262342 032212 0 ustar root root function value = SpeciesConcentrationRule_isSetSpecies(SBMLSpeciesConcentrationRule)
% value = SpeciesConcentrationRule_isSetSpecies(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. value =
% - 1 if the species attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'species')
value = ~isempty(SBMLSpeciesConcentrationRule.species);
else
error('species not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_isSetFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003573 11703262342 032212 0 ustar root root function value = SpeciesConcentrationRule_isSetFormula(SBMLSpeciesConcentrationRule)
% value = SpeciesConcentrationRule_isSetFormula(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'formula')
value = ~isempty(SBMLSpeciesConcentrationRule.formula);
else
error('formula not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_getType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003472 11703262342 032210 0 ustar root root function type = SpeciesConcentrationRule_getType(SBMLSpeciesConcentrationRule)
% type = SpeciesConcentrationRule_getType(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. the value of the type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'type')
type = SBMLSpeciesConcentrationRule.type;
else
error('type not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_getSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003525 11703262342 032207 0 ustar root root function species = SpeciesConcentrationRule_getSpecies(SBMLSpeciesConcentrationRule)
% species = SpeciesConcentrationRule_getSpecies(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. the value of the species attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'species')
species = SBMLSpeciesConcentrationRule.species;
else
error('species not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_getFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000003525 11703262342 032207 0 ustar root root function formula = SpeciesConcentrationRule_getFormula(SBMLSpeciesConcentrationRule)
% formula = SpeciesConcentrationRule_getFormula(SBMLSpeciesConcentrationRule)
%
% Takes
%
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpeciesConcentrationRule);
if isfield(SBMLSpeciesConcentrationRule, 'formula')
formula = SBMLSpeciesConcentrationRule.formula;
else
error('formula not an attribute on SBML L%dV%d SpeciesConcentrationRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000165 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrationRule_create.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/SpeciesConcentrat0000644 0000000 0000000 00000005742 11703262342 032212 0 ustar root root function SpeciesConcentrationRule = SpeciesConcentrationRule_create(varargin)
% SpeciesConcentrationRule = SpeciesConcentrationRule_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML SpeciesConcentrationRule structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getSpeciesConcentrationRuleFieldnames(level, version);
if (num > 0)
values = getSpeciesConcentrationRuleDefaultValues(level, version);
SpeciesConcentrationRule = cell2struct(values, fieldnames, 2);
%add level and version
SpeciesConcentrationRule.level = level;
SpeciesConcentrationRule.version = version;
%check correct structure
if ~isSBML_SpeciesConcentrationRule(SpeciesConcentrationRule, level, version)
SpeciesConcentrationRule = struct();
warning('Warn:BadStruct', 'Failed to create SpeciesConcentrationRule');
end;
else
SpeciesConcentrationRule = [];
warning('Warn:InvalidLV', 'SpeciesConcentrationRule not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/SpeciesConcentrationRule/Contents.m 0000644 0000000 0000000 00000017265 11703262342 030631 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\SpeciesConcentrationRule
%
% The functions allow users to create and work with the SBML SpeciesConcentrationRule structure.
%
%=================================================================================================
% SpeciesConcentrationRule = SpeciesConcentrationRule_create(level(optional), version(optional) )
%=================================================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML SpeciesConcentrationRule structure of the appropriate level and version
%
%=============================================================================
% formula = SpeciesConcentrationRule_getFormula(SBMLSpeciesConcentrationRule)
%=============================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. the value of the formula attribute
%
%=============================================================================
% species = SpeciesConcentrationRule_getSpecies(SBMLSpeciesConcentrationRule)
%=============================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. the value of the species attribute
%
%=======================================================================
% type = SpeciesConcentrationRule_getType(SBMLSpeciesConcentrationRule)
%=======================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. the value of the type attribute
%
%=============================================================================
% value = SpeciesConcentrationRule_isSetFormula(SBMLSpeciesConcentrationRule)
%=============================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%=============================================================================
% value = SpeciesConcentrationRule_isSetSpecies(SBMLSpeciesConcentrationRule)
%=============================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. value =
% - 1 if the species attribute is set
% - 0 otherwise
%
%==========================================================================
% value = SpeciesConcentrationRule_isSetType(SBMLSpeciesConcentrationRule)
%==========================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. value =
% - 1 if the type attribute is set
% - 0 otherwise
%
%===========================================================================================================
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setFormula(SBMLSpeciesConcentrationRule, formula)
%===========================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML SpeciesConcentrationRule structure with the new value for the formula attribute
%
%===========================================================================================================
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setSpecies(SBMLSpeciesConcentrationRule, species)
%===========================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. species; a string representing the species to be set
% Returns
% 1. the SBML SpeciesConcentrationRule structure with the new value for the species attribute
%
%=====================================================================================================
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_setType(SBMLSpeciesConcentrationRule, type)
%=====================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% 2. type; a string representing the type to be set
% Returns
% 1. the SBML SpeciesConcentrationRule structure with the new value for the type attribute
%
%====================================================================================================
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetFormula(SBMLSpeciesConcentrationRule)
%====================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. the SBML SpeciesConcentrationRule structure with the formula attribute unset
%
%====================================================================================================
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetSpecies(SBMLSpeciesConcentrationRule)
%====================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. the SBML SpeciesConcentrationRule structure with the species attribute unset
%
%=================================================================================================
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetType(SBMLSpeciesConcentrationRule)
%=================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. the SBML SpeciesConcentrationRule structure with the type attribute unset
%
%=====================================================================================================
% SBMLSpeciesConcentrationRule = SpeciesConcentrationRule_unsetVariable(SBMLSpeciesConcentrationRule)
%=====================================================================================================
% Takes
% 1. SBMLSpeciesConcentrationRule, an SBML SpeciesConcentrationRule structure
% Returns
% 1. the SBML SpeciesConcentrationRule structure with the variable attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/ 0000755 0000000 0000000 00000000000 11704572240 023266 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetUnits.m 0000644 0000000 0000000 00000003301 11703262332 027272 0 ustar root root function SBMLSpecies = Species_unsetUnits(SBMLSpecies)
% SBMLSpecies = Species_unsetUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the units attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'units')
SBMLSpecies.units = '';
else
error('units not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetSubstanceUnits.m 0000644 0000000 0000000 00000003367 11703262332 031156 0 ustar root root function SBMLSpecies = Species_unsetSubstanceUnits(SBMLSpecies)
% SBMLSpecies = Species_unsetSubstanceUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the substanceUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'substanceUnits')
SBMLSpecies.substanceUnits = '';
else
error('substanceUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetSpeciesType.m 0000644 0000000 0000000 00000003345 11703262332 030435 0 ustar root root function SBMLSpecies = Species_unsetSpeciesType(SBMLSpecies)
% SBMLSpecies = Species_unsetSpeciesType(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the speciesType attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'speciesType')
SBMLSpecies.speciesType = '';
else
error('speciesType not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetSpatialSizeUnits.m 0000644 0000000 0000000 00000003403 11703262332 031446 0 ustar root root function SBMLSpecies = Species_unsetSpatialSizeUnits(SBMLSpecies)
% SBMLSpecies = Species_unsetSpatialSizeUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the spatialSizeUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'spatialSizeUnits')
SBMLSpecies.spatialSizeUnits = '';
else
error('spatialSizeUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetSBOTerm.m 0000644 0000000 0000000 00000003315 11703262332 027450 0 ustar root root function SBMLSpecies = Species_unsetSBOTerm(SBMLSpecies)
% SBMLSpecies = Species_unsetSBOTerm(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'sboTerm')
SBMLSpecies.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetName.m 0000644 0000000 0000000 00000003273 11703262332 027060 0 ustar root root function SBMLSpecies = Species_unsetName(SBMLSpecies)
% SBMLSpecies = Species_unsetName(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'name')
SBMLSpecies.name = '';
else
error('name not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetMetaid.m 0000644 0000000 0000000 00000003307 11703262332 027401 0 ustar root root function SBMLSpecies = Species_unsetMetaid(SBMLSpecies)
% SBMLSpecies = Species_unsetMetaid(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'metaid')
SBMLSpecies.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Species', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetInitialConcentration.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetInitialConcentration.0000644 0000000 0000000 00000003511 11703262332 032136 0 ustar root root function SBMLSpecies = Species_unsetInitialConcentration(SBMLSpecies)
% SBMLSpecies = Species_unsetInitialConcentration(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the initialConcentration attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialConcentration')
SBMLSpecies.initialConcentration = NaN;
SBMLSpecies.isSetInitialConcentration = 0;
else
error('initialConcentration not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetInitialAmount.m 0000644 0000000 0000000 00000003430 11703262332 030750 0 ustar root root function SBMLSpecies = Species_unsetInitialAmount(SBMLSpecies)
% SBMLSpecies = Species_unsetInitialAmount(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the initialAmount attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialAmount')
SBMLSpecies.initialAmount = NaN;
SBMLSpecies.isSetInitialAmount = 0;
else
error('initialAmount not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetId.m 0000644 0000000 0000000 00000003257 11703262332 026536 0 ustar root root function SBMLSpecies = Species_unsetId(SBMLSpecies)
% SBMLSpecies = Species_unsetId(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'id')
SBMLSpecies.id = '';
else
error('id not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetConversionFactor.m 0000644 0000000 0000000 00000003403 11703262332 031457 0 ustar root root function SBMLSpecies = Species_unsetConversionFactor(SBMLSpecies)
% SBMLSpecies = Species_unsetConversionFactor(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the conversionFactor attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'conversionFactor')
SBMLSpecies.conversionFactor = '';
else
error('conversionFactor not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetCompartment.m 0000644 0000000 0000000 00000003345 11703262332 030471 0 ustar root root function SBMLSpecies = Species_unsetCompartment(SBMLSpecies)
% SBMLSpecies = Species_unsetCompartment(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the compartment attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'compartment')
SBMLSpecies.compartment = '';
else
error('compartment not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_unsetCharge.m 0000644 0000000 0000000 00000003347 11703262332 027373 0 ustar root root function SBMLSpecies = Species_unsetCharge(SBMLSpecies)
% SBMLSpecies = Species_unsetCharge(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Species structure with the charge attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'charge')
SBMLSpecies.charge = NaN;
SBMLSpecies.isSetCharge = 0;
else
error('charge not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setUnits.m 0000644 0000000 0000000 00000003533 11703262332 026736 0 ustar root root function SBMLSpecies = Species_setUnits(SBMLSpecies, units)
% SBMLSpecies = Species_setUnits(SBMLSpecies, units)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. units; a string representing the units to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'units')
if ~ischar(units)
error('units must be character array') ;
else
SBMLSpecies.units = units;
end;
else
error('units not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setSubstanceUnits.m 0000644 0000000 0000000 00000003720 11703262332 030604 0 ustar root root function SBMLSpecies = Species_setSubstanceUnits(SBMLSpecies, substanceUnits)
% SBMLSpecies = Species_setSubstanceUnits(SBMLSpecies, substanceUnits)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. substanceUnits; a string representing the substanceUnits to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the substanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'substanceUnits')
if ~ischar(substanceUnits)
error('substanceUnits must be character array') ;
else
SBMLSpecies.substanceUnits = substanceUnits;
end;
else
error('substanceUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setSpeciesType.m 0000644 0000000 0000000 00000003651 11703262332 030072 0 ustar root root function SBMLSpecies = Species_setSpeciesType(SBMLSpecies, speciesType)
% SBMLSpecies = Species_setSpeciesType(SBMLSpecies, speciesType)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. speciesType; a string representing the speciesType to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the speciesType attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'speciesType')
if ~ischar(speciesType)
error('speciesType must be character array') ;
else
SBMLSpecies.speciesType = speciesType;
end;
else
error('speciesType not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setSpatialSizeUnits.m 0000644 0000000 0000000 00000003752 11703262332 031112 0 ustar root root function SBMLSpecies = Species_setSpatialSizeUnits(SBMLSpecies, spatialSizeUnits)
% SBMLSpecies = Species_setSpatialSizeUnits(SBMLSpecies, spatialSizeUnits)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. spatialSizeUnits; a string representing the spatialSizeUnits to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the spatialSizeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'spatialSizeUnits')
if ~ischar(spatialSizeUnits)
error('spatialSizeUnits must be character array') ;
else
SBMLSpecies.spatialSizeUnits = spatialSizeUnits;
end;
else
error('spatialSizeUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setSBOTerm.m 0000644 0000000 0000000 00000003574 11703262332 027114 0 ustar root root function SBMLSpecies = Species_setSBOTerm(SBMLSpecies, sboTerm)
% SBMLSpecies = Species_setSBOTerm(SBMLSpecies, sboTerm)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLSpecies.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setName.m 0000644 0000000 0000000 00000003516 11703262332 026515 0 ustar root root function SBMLSpecies = Species_setName(SBMLSpecies, name)
% SBMLSpecies = Species_setName(SBMLSpecies, name)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLSpecies.name = name;
end;
else
error('name not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setMetaid.m 0000644 0000000 0000000 00000003550 11703262332 027036 0 ustar root root function SBMLSpecies = Species_setMetaid(SBMLSpecies, metaid)
% SBMLSpecies = Species_setMetaid(SBMLSpecies, metaid)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLSpecies.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setInitialConcentration.m 0000644 0000000 0000000 00000004117 11703262332 031753 0 ustar root root function SBMLSpecies = Species_setInitialConcentration(SBMLSpecies, initialConcentration)
% SBMLSpecies = Species_setInitialConcentration(SBMLSpecies, initialConcentration)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. initialConcentration; number representing the value of initialConcentration to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the initialConcentration attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialConcentration')
if ~isnumeric(initialConcentration)
error('initialConcentration must be numeric') ;
else
SBMLSpecies.initialConcentration = initialConcentration;
SBMLSpecies.isSetInitialConcentration = 1;
end;
else
error('initialConcentration not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setInitialAmount.m 0000644 0000000 0000000 00000003755 11703262332 030417 0 ustar root root function SBMLSpecies = Species_setInitialAmount(SBMLSpecies, initialAmount)
% SBMLSpecies = Species_setInitialAmount(SBMLSpecies, initialAmount)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. initialAmount; number representing the value of initialAmount to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the initialAmount attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialAmount')
if ~isnumeric(initialAmount)
error('initialAmount must be numeric') ;
else
SBMLSpecies.initialAmount = initialAmount;
SBMLSpecies.isSetInitialAmount = 1;
end;
else
error('initialAmount not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setId.m 0000644 0000000 0000000 00000003464 11703262332 026173 0 ustar root root function SBMLSpecies = Species_setId(SBMLSpecies, id)
% SBMLSpecies = Species_setId(SBMLSpecies, id)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLSpecies.id = id;
end;
else
error('id not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setHasOnlySubstanceUnits.m0000644 0000000 0000000 00000004212 11703262332 032077 0 ustar root root function SBMLSpecies = Species_setHasOnlySubstanceUnits(SBMLSpecies, hasOnlySubstanceUnits)
% SBMLSpecies = Species_setHasOnlySubstanceUnits(SBMLSpecies, hasOnlySubstanceUnits)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. hasOnlySubstanceUnits, an integer (0/1) representing the value of hasOnlySubstanceUnits to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the hasOnlySubstanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'hasOnlySubstanceUnits')
if (~isIntegralNumber(hasOnlySubstanceUnits) || hasOnlySubstanceUnits < 0 || hasOnlySubstanceUnits > 1)
error('hasOnlySubstanceUnits must be an integer of value 0/1') ;
else
SBMLSpecies.hasOnlySubstanceUnits = hasOnlySubstanceUnits;
end;
else
error('hasOnlySubstanceUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setConversionFactor.m 0000644 0000000 0000000 00000003752 11703262332 031123 0 ustar root root function SBMLSpecies = Species_setConversionFactor(SBMLSpecies, conversionFactor)
% SBMLSpecies = Species_setConversionFactor(SBMLSpecies, conversionFactor)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. conversionFactor; a string representing the conversionFactor to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the conversionFactor attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'conversionFactor')
if ~ischar(conversionFactor)
error('conversionFactor must be character array') ;
else
SBMLSpecies.conversionFactor = conversionFactor;
end;
else
error('conversionFactor not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setConstant.m 0000644 0000000 0000000 00000003707 11703262332 027430 0 ustar root root function SBMLSpecies = Species_setConstant(SBMLSpecies, constant)
% SBMLSpecies = Species_setConstant(SBMLSpecies, constant)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. constant, an integer (0/1) representing the value of constant to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'constant')
if (~isIntegralNumber(constant) || constant < 0 || constant > 1)
error('constant must be an integer of value 0/1') ;
else
SBMLSpecies.constant = constant;
end;
else
error('constant not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setCompartment.m 0000644 0000000 0000000 00000003651 11703262332 030126 0 ustar root root function SBMLSpecies = Species_setCompartment(SBMLSpecies, compartment)
% SBMLSpecies = Species_setCompartment(SBMLSpecies, compartment)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. compartment; a string representing the compartment to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the compartment attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'compartment')
if ~ischar(compartment)
error('compartment must be character array') ;
else
SBMLSpecies.compartment = compartment;
end;
else
error('compartment not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setCharge.m 0000644 0000000 0000000 00000003606 11703262332 027026 0 ustar root root function SBMLSpecies = Species_setCharge(SBMLSpecies, charge)
% SBMLSpecies = Species_setCharge(SBMLSpecies, charge)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. charge, an integer representing the charge to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the charge attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'charge')
if ~isnumeric(charge)
error('charge must be numeric') ;
else
SBMLSpecies.charge = charge;
SBMLSpecies.isSetCharge = 1;
end;
else
error('charge not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_setBoundaryCondition.m 0000644 0000000 0000000 00000004116 11703262332 031264 0 ustar root root function SBMLSpecies = Species_setBoundaryCondition(SBMLSpecies, boundaryCondition)
% SBMLSpecies = Species_setBoundaryCondition(SBMLSpecies, boundaryCondition)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. boundaryCondition, an integer (0/1) representing the value of boundaryCondition to be set
%
% Returns
%
% 1. the SBML Species structure with the new value for the boundaryCondition attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'boundaryCondition')
if (~isIntegralNumber(boundaryCondition) || boundaryCondition < 0 || boundaryCondition > 1)
error('boundaryCondition must be an integer of value 0/1') ;
else
SBMLSpecies.boundaryCondition = boundaryCondition;
end;
else
error('boundaryCondition not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetUnits.m 0000644 0000000 0000000 00000003307 11703262332 027231 0 ustar root root function value = Species_isSetUnits(SBMLSpecies)
% value = Species_isSetUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'units')
value = ~isempty(SBMLSpecies.units);
else
error('units not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetSubstanceUnits.m 0000644 0000000 0000000 00000003375 11703262332 031106 0 ustar root root function value = Species_isSetSubstanceUnits(SBMLSpecies)
% value = Species_isSetSubstanceUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the substanceUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'substanceUnits')
value = ~isempty(SBMLSpecies.substanceUnits);
else
error('substanceUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetSpeciesType.m 0000644 0000000 0000000 00000003353 11703262332 030365 0 ustar root root function value = Species_isSetSpeciesType(SBMLSpecies)
% value = Species_isSetSpeciesType(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the speciesType attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'speciesType')
value = ~isempty(SBMLSpecies.speciesType);
else
error('speciesType not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetSpatialSizeUnits.m 0000644 0000000 0000000 00000003411 11703262332 031376 0 ustar root root function value = Species_isSetSpatialSizeUnits(SBMLSpecies)
% value = Species_isSetSpatialSizeUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the spatialSizeUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'spatialSizeUnits')
value = ~isempty(SBMLSpecies.spatialSizeUnits);
else
error('spatialSizeUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetSBOTerm.m 0000644 0000000 0000000 00000003316 11703262332 027402 0 ustar root root function value = Species_isSetSBOTerm(SBMLSpecies)
% value = Species_isSetSBOTerm(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'sboTerm')
value = (SBMLSpecies.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetName.m 0000644 0000000 0000000 00000003301 11703262332 027001 0 ustar root root function value = Species_isSetName(SBMLSpecies)
% value = Species_isSetName(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'name')
value = ~isempty(SBMLSpecies.name);
else
error('name not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetMetaid.m 0000644 0000000 0000000 00000003315 11703262332 027331 0 ustar root root function value = Species_isSetMetaid(SBMLSpecies)
% value = Species_isSetMetaid(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'metaid')
value = ~isempty(SBMLSpecies.metaid);
else
error('metaid not an attribute on SBML L%dV%d Species', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetInitialConcentration.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetInitialConcentration.0000644 0000000 0000000 00000003441 11703262332 032071 0 ustar root root function value = Species_isSetInitialConcentration(SBMLSpecies)
% value = Species_isSetInitialConcentration(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the initialConcentration attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialConcentration')
value = SBMLSpecies.isSetInitialConcentration;
else
error('isSetInitialConcentration not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetInitialAmount.m 0000644 0000000 0000000 00000003367 11703262332 030712 0 ustar root root function value = Species_isSetInitialAmount(SBMLSpecies)
% value = Species_isSetInitialAmount(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the initialAmount attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialAmount')
value = SBMLSpecies.isSetInitialAmount;
else
error('isSetInitialAmount not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetId.m 0000644 0000000 0000000 00000003265 11703262332 026466 0 ustar root root function value = Species_isSetId(SBMLSpecies)
% value = Species_isSetId(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'id')
value = ~isempty(SBMLSpecies.id);
else
error('id not an attribute on SBML L%dV%d Species', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetHasOnlySubstanceUnits.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetHasOnlySubstanceUnits0000644 0000000 0000000 00000003447 11703262332 032151 0 ustar root root function value = Species_isSetHasOnlySubstanceUnits(SBMLSpecies)
% value = Species_isSetHasOnlySubstanceUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the hasOnlySubstanceUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'hasOnlySubstanceUnits')
value = SBMLSpecies.isSetHasOnlySubstanceUnits;
else
error('isSetHasOnlySubstanceUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetConversionFactor.m 0000644 0000000 0000000 00000003411 11703262332 031407 0 ustar root root function value = Species_isSetConversionFactor(SBMLSpecies)
% value = Species_isSetConversionFactor(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the conversionFactor attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'conversionFactor')
value = ~isempty(SBMLSpecies.conversionFactor);
else
error('conversionFactor not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetCompartment.m 0000644 0000000 0000000 00000003353 11703262332 030421 0 ustar root root function value = Species_isSetCompartment(SBMLSpecies)
% value = Species_isSetCompartment(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the compartment attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'compartment')
value = ~isempty(SBMLSpecies.compartment);
else
error('compartment not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isSetCharge.m 0000644 0000000 0000000 00000003315 11703262332 027317 0 ustar root root function value = Species_isSetCharge(SBMLSpecies)
% value = Species_isSetCharge(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. value =
% - 1 if the charge attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'charge')
value = SBMLSpecies.isSetCharge;
else
error('isSetCharge not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isInAlgebraicRule.m 0000644 0000000 0000000 00000006061 11703262332 030443 0 ustar root root function y = Species_isInAlgebraicRule(SBMLSpecies, SBMLRules)
% y = Species_isInAlgebraicRule(SBMLSpecies, SBMLRules)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - an array of the indices of any algebraicRules the id of the Species appears in
% - 0 if the Species appears in no algebraicRules
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLSpecies))
error(sprintf('%s', ...
'argument must be an SBML Species structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLSpecies);
if (~isSBML_Species(SBMLSpecies, sbmlLevel, sbmlVersion))
error('Species_isInAlgebraicRule(SBMLSpecies, SBMLRules)\n%s', ...
'first argument must be an SBMLSpecies structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Species_isInAlgebraicRule(SBMLSpecies, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Species_isInAlgebraicRule(SBMLSpecies, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the species occurs
%determine the name or id of the species
if (sbmlLevel == 1)
name = SBMLSpecies.name;
else
if (isempty(SBMLSpecies.id))
name = SBMLSpecies.name;
else
name = SBMLSpecies.id;
end;
end;
y = [];
for i = 1:NumRules
index = matchName(SBMLRules(i).formula, name);
if (~isempty(index) && strcmp(SBMLRules(i).typecode, 'SBML_ALGEBRAIC_RULE'))
y = [y;i];
end;
end;
if isempty(y)
y = 0;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isAssignedByRule.m 0000644 0000000 0000000 00000006501 11703262332 030332 0 ustar root root function y = Species_isAssignedByRule(SBMLSpecies, SBMLRules)
% y = Species_isAssignedByRule(SBMLSpecies, SBMLRules)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the assignmentRule used to assigned value to the Species
% - 0 if the Species is not assigned by assignmentRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLSpecies))
error(sprintf('%s', ...
'argument must be an SBML Species structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLSpecies);
if (~isSBML_Species(SBMLSpecies, sbmlLevel, sbmlVersion))
error('Species_isAssignedByRule(SBMLSpecies, SBMLRules)\n%s', ...
'first argument must be an SBMLSpecies structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Species_isAssignedByRule(SBMLSpecies, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Species_isAssignedByRule(SBMLSpecies, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the species is assigned by it
%determine the name or id of the species
if (sbmlLevel == 1)
name = SBMLSpecies.name;
else
if (isempty(SBMLSpecies.id))
name = SBMLSpecies.name;
else
name = SBMLSpecies.id;
end;
end;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_ASSIGNMENT_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
elseif ((strcmp(SBMLRules(i).typecode, 'SBML_SPECIES_CONCENTRATION_RULE')) ...
&& (strcmp(SBMLRules(i).type, 'scalar')))
if (strcmp(SBMLRules(i).species, name))
y = i;
return;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_isAssignedByRateRule.m 0000644 0000000 0000000 00000006501 11703262332 031146 0 ustar root root function y = Species_isAssignedByRateRule(SBMLSpecies, SBMLRules)
% y = Species_isAssignedByRateRule(SBMLSpecies, SBMLRules)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the rateRule used to assigned value to the Species
% - 0 if the Species is not assigned by rateRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLSpecies))
error(sprintf('%s', ...
'argument must be an SBML Species structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLSpecies);
if (~isSBML_Species(SBMLSpecies, sbmlLevel, sbmlVersion))
error('Species_isAssignedByRateRule(SBMLSpecies, SBMLRules)\n%s', ...
'first argument must be an SBMLSpecies structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Species_isAssignedByRateRule(SBMLSpecies, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Species_isAssignedByRateRule(SBMLSpecies, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the Species is assigned by it
%determine the name or id of the Species
if (sbmlLevel == 1)
name = SBMLSpecies.name;
else
if (isempty(SBMLSpecies.id))
name = SBMLSpecies.name;
else
name = SBMLSpecies.id;
end;
end;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_RATE_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
elseif ((strcmp(SBMLRules(i).typecode, 'SBML_SPECIES_CONCENTRATION_RULE')) ...
&& (strcmp(SBMLRules(i).type, 'rate')))
if (strcmp(SBMLRules(i).species, name))
y = i;
return;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getUnits.m 0000644 0000000 0000000 00000003233 11703262332 026717 0 ustar root root function units = Species_getUnits(SBMLSpecies)
% units = Species_getUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'units')
units = SBMLSpecies.units;
else
error('units not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getSubstanceUnits.m 0000644 0000000 0000000 00000003354 11703262332 030573 0 ustar root root function substanceUnits = Species_getSubstanceUnits(SBMLSpecies)
% substanceUnits = Species_getSubstanceUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the substanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'substanceUnits')
substanceUnits = SBMLSpecies.substanceUnits;
else
error('substanceUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getSpeciesType.m 0000644 0000000 0000000 00000003321 11703262332 030050 0 ustar root root function speciesType = Species_getSpeciesType(SBMLSpecies)
% speciesType = Species_getSpeciesType(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the speciesType attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'speciesType')
speciesType = SBMLSpecies.speciesType;
else
error('speciesType not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getSpatialSizeUnits.m 0000644 0000000 0000000 00000003376 11703262332 031100 0 ustar root root function spatialSizeUnits = Species_getSpatialSizeUnits(SBMLSpecies)
% spatialSizeUnits = Species_getSpatialSizeUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the spatialSizeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'spatialSizeUnits')
spatialSizeUnits = SBMLSpecies.spatialSizeUnits;
else
error('spatialSizeUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getSBOTerm.m 0000644 0000000 0000000 00000003255 11703262332 027074 0 ustar root root function sboTerm = Species_getSBOTerm(SBMLSpecies)
% sboTerm = Species_getSBOTerm(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'sboTerm')
sboTerm = SBMLSpecies.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getName.m 0000644 0000000 0000000 00000003222 11703262332 026473 0 ustar root root function name = Species_getName(SBMLSpecies)
% name = Species_getName(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'name')
name = SBMLSpecies.name;
else
error('name not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getMetaid.m 0000644 0000000 0000000 00000003244 11703262332 027022 0 ustar root root function metaid = Species_getMetaid(SBMLSpecies)
% metaid = Species_getMetaid(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'metaid')
metaid = SBMLSpecies.metaid;
else
error('metaid not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getInitialConcentration.m 0000644 0000000 0000000 00000003442 11703262332 031737 0 ustar root root function initialConcentration = Species_getInitialConcentration(SBMLSpecies)
% initialConcentration = Species_getInitialConcentration(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the initialConcentration attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialConcentration')
initialConcentration = SBMLSpecies.initialConcentration;
else
error('initialConcentration not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getInitialAmount.m 0000644 0000000 0000000 00000003343 11703262332 030374 0 ustar root root function initialAmount = Species_getInitialAmount(SBMLSpecies)
% initialAmount = Species_getInitialAmount(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the initialAmount attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'initialAmount')
initialAmount = SBMLSpecies.initialAmount;
else
error('initialAmount not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getId.m 0000644 0000000 0000000 00000003200 11703262332 026143 0 ustar root root function id = Species_getId(SBMLSpecies)
% id = Species_getId(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'id')
id = SBMLSpecies.id;
else
error('id not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getHasOnlySubstanceUnits.m0000644 0000000 0000000 00000003453 11703262332 032071 0 ustar root root function hasOnlySubstanceUnits = Species_getHasOnlySubstanceUnits(SBMLSpecies)
% hasOnlySubstanceUnits = Species_getHasOnlySubstanceUnits(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the hasOnlySubstanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'hasOnlySubstanceUnits')
hasOnlySubstanceUnits = SBMLSpecies.hasOnlySubstanceUnits;
else
error('hasOnlySubstanceUnits not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getConversionFactor.m 0000644 0000000 0000000 00000003376 11703262332 031111 0 ustar root root function conversionFactor = Species_getConversionFactor(SBMLSpecies)
% conversionFactor = Species_getConversionFactor(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the conversionFactor attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'conversionFactor')
conversionFactor = SBMLSpecies.conversionFactor;
else
error('conversionFactor not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getConstant.m 0000644 0000000 0000000 00000003266 11703262332 027414 0 ustar root root function constant = Species_getConstant(SBMLSpecies)
% constant = Species_getConstant(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'constant')
constant = SBMLSpecies.constant;
else
error('constant not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getCompartment.m 0000644 0000000 0000000 00000003321 11703262332 030104 0 ustar root root function compartment = Species_getCompartment(SBMLSpecies)
% compartment = Species_getCompartment(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the compartment attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'compartment')
compartment = SBMLSpecies.compartment;
else
error('compartment not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getCharge.m 0000644 0000000 0000000 00000003244 11703262332 027010 0 ustar root root function charge = Species_getCharge(SBMLSpecies)
% charge = Species_getCharge(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the charge attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'charge')
charge = SBMLSpecies.charge;
else
error('charge not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_getBoundaryCondition.m 0000644 0000000 0000000 00000003407 11703262332 031252 0 ustar root root function boundaryCondition = Species_getBoundaryCondition(SBMLSpecies)
% boundaryCondition = Species_getBoundaryCondition(SBMLSpecies)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the value of the boundaryCondition attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLSpecies);
if isfield(SBMLSpecies, 'boundaryCondition')
boundaryCondition = SBMLSpecies.boundaryCondition;
else
error('boundaryCondition not an attribute on SBML L%dV%d Species', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Species_create.m 0000644 0000000 0000000 00000005324 11703262332 026363 0 ustar root root function Species = Species_create(varargin)
% Species = Species_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Species structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getSpeciesFieldnames(level, version);
if (num > 0)
values = getSpeciesDefaultValues(level, version);
Species = cell2struct(values, fieldnames, 2);
%add level and version
Species.level = level;
Species.version = version;
%check correct structure
if ~isSBML_Species(Species, level, version)
Species = struct();
warning('Warn:BadStruct', 'Failed to create Species');
end;
else
Species = [];
warning('Warn:InvalidLV', 'Species not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Species/Contents.m 0000644 0000000 0000000 00000061446 11703262332 025251 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Species
%
% The functions allow users to create and work with the SBML Species structure.
%
%===============================================================
% Species = Species_create(level(optional), version(optional) )
%===============================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Species structure of the appropriate level and version
%
%===============================================================
% boundaryCondition = Species_getBoundaryCondition(SBMLSpecies)
%===============================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the boundaryCondition attribute
%
%=========================================
% charge = Species_getCharge(SBMLSpecies)
%=========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the charge attribute
%
%===================================================
% compartment = Species_getCompartment(SBMLSpecies)
%===================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the compartment attribute
%
%=============================================
% constant = Species_getConstant(SBMLSpecies)
%=============================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the constant attribute
%
%=============================================================
% conversionFactor = Species_getConversionFactor(SBMLSpecies)
%=============================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the conversionFactor attribute
%
%=======================================================================
% hasOnlySubstanceUnits = Species_getHasOnlySubstanceUnits(SBMLSpecies)
%=======================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the hasOnlySubstanceUnits attribute
%
%=================================
% id = Species_getId(SBMLSpecies)
%=================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the id attribute
%
%=======================================================
% initialAmount = Species_getInitialAmount(SBMLSpecies)
%=======================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the initialAmount attribute
%
%=====================================================================
% initialConcentration = Species_getInitialConcentration(SBMLSpecies)
%=====================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the initialConcentration attribute
%
%=========================================
% metaid = Species_getMetaid(SBMLSpecies)
%=========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the metaid attribute
%
%=====================================
% name = Species_getName(SBMLSpecies)
%=====================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the name attribute
%
%===========================================
% sboTerm = Species_getSBOTerm(SBMLSpecies)
%===========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the sboTerm attribute
%
%=============================================================
% spatialSizeUnits = Species_getSpatialSizeUnits(SBMLSpecies)
%=============================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the spatialSizeUnits attribute
%
%===================================================
% speciesType = Species_getSpeciesType(SBMLSpecies)
%===================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the speciesType attribute
%
%=========================================================
% substanceUnits = Species_getSubstanceUnits(SBMLSpecies)
%=========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the substanceUnits attribute
%
%=======================================
% units = Species_getUnits(SBMLSpecies)
%=======================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the value of the units attribute
%
%==========================================================
% y = Species_isAssignedByRateRule(SBMLSpecies, SBMLRules)
%==========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the rateRule used to assigned value to the Species
% - 0 if the Species is not assigned by rateRule
%
%
%======================================================
% y = Species_isAssignedByRule(SBMLSpecies, SBMLRules)
%======================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the assignmentRule used to assigned value to the Species
% - 0 if the Species is not assigned by assignmentRule
%
%
%=======================================================
% y = Species_isInAlgebraicRule(SBMLSpecies, SBMLRules)
%=======================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - an array of the indices of any algebraicRules the id of the Species appears in
% - 0 if the Species appears in no algebraicRules
%
%
%==========================================
% value = Species_isSetCharge(SBMLSpecies)
%==========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the charge attribute is set
% - 0 otherwise
%
%===============================================
% value = Species_isSetCompartment(SBMLSpecies)
%===============================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the compartment attribute is set
% - 0 otherwise
%
%====================================================
% value = Species_isSetConversionFactor(SBMLSpecies)
%====================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the conversionFactor attribute is set
% - 0 otherwise
%
%=========================================================
% value = Species_isSetHasOnlySubstanceUnits(SBMLSpecies)
%=========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the hasOnlySubstanceUnits attribute is set
% - 0 otherwise
%
%======================================
% value = Species_isSetId(SBMLSpecies)
%======================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%=================================================
% value = Species_isSetInitialAmount(SBMLSpecies)
%=================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the initialAmount attribute is set
% - 0 otherwise
%
%========================================================
% value = Species_isSetInitialConcentration(SBMLSpecies)
%========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the initialConcentration attribute is set
% - 0 otherwise
%
%==========================================
% value = Species_isSetMetaid(SBMLSpecies)
%==========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%========================================
% value = Species_isSetName(SBMLSpecies)
%========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%===========================================
% value = Species_isSetSBOTerm(SBMLSpecies)
%===========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%====================================================
% value = Species_isSetSpatialSizeUnits(SBMLSpecies)
%====================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the spatialSizeUnits attribute is set
% - 0 otherwise
%
%===============================================
% value = Species_isSetSpeciesType(SBMLSpecies)
%===============================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the speciesType attribute is set
% - 0 otherwise
%
%==================================================
% value = Species_isSetSubstanceUnits(SBMLSpecies)
%==================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the substanceUnits attribute is set
% - 0 otherwise
%
%=========================================
% value = Species_isSetUnits(SBMLSpecies)
%=========================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%============================================================================
% SBMLSpecies = Species_setBoundaryCondition(SBMLSpecies, boundaryCondition)
%============================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. boundaryCondition, an integer (0/1) representing the value of boundaryCondition to be set
% Returns
% 1. the SBML Species structure with the new value for the boundaryCondition attribute
%
%======================================================
% SBMLSpecies = Species_setCharge(SBMLSpecies, charge)
%======================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. charge, an integer representing the charge to be set
% Returns
% 1. the SBML Species structure with the new value for the charge attribute
%
%================================================================
% SBMLSpecies = Species_setCompartment(SBMLSpecies, compartment)
%================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. compartment; a string representing the compartment to be set
% Returns
% 1. the SBML Species structure with the new value for the compartment attribute
%
%==========================================================
% SBMLSpecies = Species_setConstant(SBMLSpecies, constant)
%==========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. constant, an integer (0/1) representing the value of constant to be set
% Returns
% 1. the SBML Species structure with the new value for the constant attribute
%
%==========================================================================
% SBMLSpecies = Species_setConversionFactor(SBMLSpecies, conversionFactor)
%==========================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. conversionFactor; a string representing the conversionFactor to be set
% Returns
% 1. the SBML Species structure with the new value for the conversionFactor attribute
%
%====================================================================================
% SBMLSpecies = Species_setHasOnlySubstanceUnits(SBMLSpecies, hasOnlySubstanceUnits)
%====================================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. hasOnlySubstanceUnits, an integer (0/1) representing the value of hasOnlySubstanceUnits to be set
% Returns
% 1. the SBML Species structure with the new value for the hasOnlySubstanceUnits attribute
%
%==============================================
% SBMLSpecies = Species_setId(SBMLSpecies, id)
%==============================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML Species structure with the new value for the id attribute
%
%====================================================================
% SBMLSpecies = Species_setInitialAmount(SBMLSpecies, initialAmount)
%====================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. initialAmount; number representing the value of initialAmount to be set
% Returns
% 1. the SBML Species structure with the new value for the initialAmount attribute
%
%==================================================================================
% SBMLSpecies = Species_setInitialConcentration(SBMLSpecies, initialConcentration)
%==================================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. initialConcentration; number representing the value of initialConcentration to be set
% Returns
% 1. the SBML Species structure with the new value for the initialConcentration attribute
%
%======================================================
% SBMLSpecies = Species_setMetaid(SBMLSpecies, metaid)
%======================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Species structure with the new value for the metaid attribute
%
%==================================================
% SBMLSpecies = Species_setName(SBMLSpecies, name)
%==================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML Species structure with the new value for the name attribute
%
%========================================================
% SBMLSpecies = Species_setSBOTerm(SBMLSpecies, sboTerm)
%========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Species structure with the new value for the sboTerm attribute
%
%==========================================================================
% SBMLSpecies = Species_setSpatialSizeUnits(SBMLSpecies, spatialSizeUnits)
%==========================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. spatialSizeUnits; a string representing the spatialSizeUnits to be set
% Returns
% 1. the SBML Species structure with the new value for the spatialSizeUnits attribute
%
%================================================================
% SBMLSpecies = Species_setSpeciesType(SBMLSpecies, speciesType)
%================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. speciesType; a string representing the speciesType to be set
% Returns
% 1. the SBML Species structure with the new value for the speciesType attribute
%
%======================================================================
% SBMLSpecies = Species_setSubstanceUnits(SBMLSpecies, substanceUnits)
%======================================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. substanceUnits; a string representing the substanceUnits to be set
% Returns
% 1. the SBML Species structure with the new value for the substanceUnits attribute
%
%====================================================
% SBMLSpecies = Species_setUnits(SBMLSpecies, units)
%====================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% 2. units; a string representing the units to be set
% Returns
% 1. the SBML Species structure with the new value for the units attribute
%
%================================================
% SBMLSpecies = Species_unsetCharge(SBMLSpecies)
%================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the charge attribute unset
%
%=====================================================
% SBMLSpecies = Species_unsetCompartment(SBMLSpecies)
%=====================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the compartment attribute unset
%
%==========================================================
% SBMLSpecies = Species_unsetConversionFactor(SBMLSpecies)
%==========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the conversionFactor attribute unset
%
%============================================
% SBMLSpecies = Species_unsetId(SBMLSpecies)
%============================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the id attribute unset
%
%=======================================================
% SBMLSpecies = Species_unsetInitialAmount(SBMLSpecies)
%=======================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the initialAmount attribute unset
%
%==============================================================
% SBMLSpecies = Species_unsetInitialConcentration(SBMLSpecies)
%==============================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the initialConcentration attribute unset
%
%================================================
% SBMLSpecies = Species_unsetMetaid(SBMLSpecies)
%================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the metaid attribute unset
%
%==============================================
% SBMLSpecies = Species_unsetName(SBMLSpecies)
%==============================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the name attribute unset
%
%=================================================
% SBMLSpecies = Species_unsetSBOTerm(SBMLSpecies)
%=================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the sboTerm attribute unset
%
%==========================================================
% SBMLSpecies = Species_unsetSpatialSizeUnits(SBMLSpecies)
%==========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the spatialSizeUnits attribute unset
%
%=====================================================
% SBMLSpecies = Species_unsetSpeciesType(SBMLSpecies)
%=====================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the speciesType attribute unset
%
%========================================================
% SBMLSpecies = Species_unsetSubstanceUnits(SBMLSpecies)
%========================================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the substanceUnits attribute unset
%
%===============================================
% SBMLSpecies = Species_unsetUnits(SBMLSpecies)
%===============================================
% Takes
% 1. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Species structure with the units attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/ 0000755 0000000 0000000 00000000000 11704572240 022602 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_unsetSBOTerm.m 0000644 0000000 0000000 00000003244 11703262340 026300 0 ustar root root function SBMLRule = Rule_unsetSBOTerm(SBMLRule)
% SBMLRule = Rule_unsetSBOTerm(SBMLRule)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
%
% Returns
%
% 1. the SBML Rule structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'sboTerm')
SBMLRule.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_unsetFormula.m 0000644 0000000 0000000 00000003244 11703262340 026432 0 ustar root root function SBMLRule = Rule_unsetFormula(SBMLRule)
% SBMLRule = Rule_unsetFormula(SBMLRule)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
%
% Returns
%
% 1. the SBML Rule structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'formula')
SBMLRule.formula = '';
else
error('formula not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_setSBOTerm.m 0000644 0000000 0000000 00000003523 11703262340 025735 0 ustar root root function SBMLRule = Rule_setSBOTerm(SBMLRule, sboTerm)
% SBMLRule = Rule_setSBOTerm(SBMLRule, sboTerm)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Rule structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLRule.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_setFormula.m 0000644 0000000 0000000 00000003514 11703262340 026067 0 ustar root root function SBMLRule = Rule_setFormula(SBMLRule, formula)
% SBMLRule = Rule_setFormula(SBMLRule, formula)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML Rule structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLRule.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_isSetSBOTerm.m 0000644 0000000 0000000 00000003257 11703262340 026235 0 ustar root root function value = Rule_isSetSBOTerm(SBMLRule)
% value = Rule_isSetSBOTerm(SBMLRule)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'sboTerm')
value = (SBMLRule.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_isSetFormula.m 0000644 0000000 0000000 00000003263 11703262340 026364 0 ustar root root function value = Rule_isSetFormula(SBMLRule)
% value = Rule_isSetFormula(SBMLRule)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'formula')
value = ~isempty(SBMLRule.formula);
else
error('formula not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_getSBOTerm.m 0000644 0000000 0000000 00000003215 11703262340 025717 0 ustar root root function sboTerm = Rule_getSBOTerm(SBMLRule)
% sboTerm = Rule_getSBOTerm(SBMLRule)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'sboTerm')
sboTerm = SBMLRule.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_getFormula.m 0000644 0000000 0000000 00000003215 11703262340 026051 0 ustar root root function formula = Rule_getFormula(SBMLRule)
% formula = Rule_getFormula(SBMLRule)
%
% Takes
%
% 1. SBMLRule, an SBML Rule structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRule);
if isfield(SBMLRule, 'formula')
formula = SBMLRule.formula;
else
error('formula not an attribute on SBML L%dV%d Rule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Rule_create.m 0000644 0000000 0000000 00000005323 11703262340 025211 0 ustar root root function Rule = Rule_create(varargin)
% Rule = Rule_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Rule structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getAlgebraicRuleFieldnames(level, version);
if (num > 0)
values = getAlgebraicRuleDefaultValues(level, version);
Rule = cell2struct(values, fieldnames, 2);
Rule.typecode = 'SBML_RULE';
%add level and version
Rule.level = level;
Rule.version = version;
%check correct structure
if ~isSBML_Rule(Rule, level, version)
Rule = struct();
warning('Warn:BadStruct', 'Failed to create Rule');
end;
else
Rule = [];
warning('Warn:InvalidLV', 'Rule not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Rule/Contents.m 0000644 0000000 0000000 00000007363 11703262340 024562 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Rule
%
% The functions allow users to create and work with the SBML Rule structure.
%
%=========================================================
% Rule = Rule_create(level(optional), version(optional) )
%=========================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Rule structure of the appropriate level and version
%
%=====================================
% formula = Rule_getFormula(SBMLRule)
%=====================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% Returns
% 1. the value of the formula attribute
%
%=====================================
% sboTerm = Rule_getSBOTerm(SBMLRule)
%=====================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% Returns
% 1. the value of the sboTerm attribute
%
%=====================================
% value = Rule_isSetFormula(SBMLRule)
%=====================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%=====================================
% value = Rule_isSetSBOTerm(SBMLRule)
%=====================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%===============================================
% SBMLRule = Rule_setFormula(SBMLRule, formula)
%===============================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML Rule structure with the new value for the formula attribute
%
%===============================================
% SBMLRule = Rule_setSBOTerm(SBMLRule, sboTerm)
%===============================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Rule structure with the new value for the sboTerm attribute
%
%========================================
% SBMLRule = Rule_unsetFormula(SBMLRule)
%========================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% Returns
% 1. the SBML Rule structure with the formula attribute unset
%
%========================================
% SBMLRule = Rule_unsetSBOTerm(SBMLRule)
%========================================
% Takes
% 1. SBMLRule, an SBML Rule structure
% Returns
% 1. the SBML Rule structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/ 0000755 0000000 0000000 00000000000 11704572240 023437 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetSBOTerm.m 0000644 0000000 0000000 00000003332 11703262362 027774 0 ustar root root function SBMLReaction = Reaction_unsetSBOTerm(SBMLReaction)
% SBMLReaction = Reaction_unsetSBOTerm(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'sboTerm')
SBMLReaction.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetReversible.m 0000644 0000000 0000000 00000003354 11703262362 030627 0 ustar root root function SBMLReaction = Reaction_unsetReversible(SBMLReaction)
% SBMLReaction = Reaction_unsetReversible(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the reversible attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reversible')
SBMLReaction.reversible = '';
else
error('reversible not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetName.m 0000644 0000000 0000000 00000003310 11703262362 027375 0 ustar root root function SBMLReaction = Reaction_unsetName(SBMLReaction)
% SBMLReaction = Reaction_unsetName(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'name')
SBMLReaction.name = '';
else
error('name not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetMetaid.m 0000644 0000000 0000000 00000003324 11703262362 027725 0 ustar root root function SBMLReaction = Reaction_unsetMetaid(SBMLReaction)
% SBMLReaction = Reaction_unsetMetaid(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'metaid')
SBMLReaction.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetKineticLaw.m 0000644 0000000 0000000 00000003350 11703262362 030553 0 ustar root root function SBMLReaction = Reaction_unsetKineticLaw(SBMLReaction)
% SBMLReaction = Reaction_unsetKineticLaw(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the kineticLaw field unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'kineticLaw')
SBMLReaction.kineticLaw = [];
else
error('kineticLaw not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetId.m 0000644 0000000 0000000 00000003274 11703262362 027062 0 ustar root root function SBMLReaction = Reaction_unsetId(SBMLReaction)
% SBMLReaction = Reaction_unsetId(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'id')
SBMLReaction.id = '';
else
error('id not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetFast.m 0000644 0000000 0000000 00000003402 11703262362 027414 0 ustar root root function SBMLReaction = Reaction_unsetFast(SBMLReaction)
% SBMLReaction = Reaction_unsetFast(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the fast attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'fast')
SBMLReaction.fast = 0;
if (level > 1)
SBMLReaction.isSetFast = 0;
end;
else
error('fast not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_unsetCompartment.m 0000644 0000000 0000000 00000003362 11703262362 031015 0 ustar root root function SBMLReaction = Reaction_unsetCompartment(SBMLReaction)
% SBMLReaction = Reaction_unsetCompartment(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with the compartment attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'compartment')
SBMLReaction.compartment = '';
else
error('compartment not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setSBOTerm.m 0000644 0000000 0000000 00000003611 11703262362 027431 0 ustar root root function SBMLReaction = Reaction_setSBOTerm(SBMLReaction, sboTerm)
% SBMLReaction = Reaction_setSBOTerm(SBMLReaction, sboTerm)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLReaction.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setReversible.m 0000644 0000000 0000000 00000003762 11703262362 030267 0 ustar root root function SBMLReaction = Reaction_setReversible(SBMLReaction, reversible)
% SBMLReaction = Reaction_setReversible(SBMLReaction, reversible)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. reversible, an integer (0/1) representing the value of reversible to be set
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the reversible attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reversible')
if (~isIntegralNumber(reversible) || reversible < 0 || reversible > 1)
error('reversible must be an integer of value 0/1') ;
else
SBMLReaction.reversible = reversible;
end;
else
error('reversible not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setName.m 0000644 0000000 0000000 00000003533 11703262362 027041 0 ustar root root function SBMLReaction = Reaction_setName(SBMLReaction, name)
% SBMLReaction = Reaction_setName(SBMLReaction, name)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLReaction.name = name;
end;
else
error('name not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setMetaid.m 0000644 0000000 0000000 00000003565 11703262362 027371 0 ustar root root function SBMLReaction = Reaction_setMetaid(SBMLReaction, metaid)
% SBMLReaction = Reaction_setMetaid(SBMLReaction, metaid)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLReaction.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setKineticLaw.m 0000644 0000000 0000000 00000004214 11703262362 030210 0 ustar root root function SBMLReaction = Reaction_setKineticLaw(SBMLReaction, kineticLaw)
% SBMLReaction = Reaction_setKineticLaw(SBMLReaction, SBMLKineticLaw)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the kineticLaw field
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isstruct(kineticLaw)
[kl_level, kl_version] = GetLevelVersion(kineticLaw);
if level ~= kl_level
error('mismatch in levels');
elseif version ~= kl_version
error('mismatch in versions');
end;
end;
if isfield(SBMLReaction, 'kineticLaw')
if ~isValid(kineticLaw, level, version)
error('KineticLaw must ba an SBML KineticLaw');
else
SBMLReaction.kineticLaw = kineticLaw;
end;
else
error('kineticLaw not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setId.m 0000644 0000000 0000000 00000003501 11703262362 026510 0 ustar root root function SBMLReaction = Reaction_setId(SBMLReaction, id)
% SBMLReaction = Reaction_setId(SBMLReaction, id)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLReaction.id = id;
end;
else
error('id not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setFast.m 0000644 0000000 0000000 00000003726 11703262362 027062 0 ustar root root function SBMLReaction = Reaction_setFast(SBMLReaction, fast)
% SBMLReaction = Reaction_setFast(SBMLReaction, fast)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. fast, an integer (0/1) representing the value of fast to be set
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the fast attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'fast')
if (~isIntegralNumber(fast) || fast < 0 || fast > 1)
error('fast must be an integer of value 0/1') ;
else
SBMLReaction.fast = fast;
if (level > 1)
SBMLReaction.isSetFast = 1;
end;
end;
else
error('fast not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_setCompartment.m 0000644 0000000 0000000 00000003666 11703262362 030461 0 ustar root root function SBMLReaction = Reaction_setCompartment(SBMLReaction, compartment)
% SBMLReaction = Reaction_setCompartment(SBMLReaction, compartment)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. compartment; a string representing the compartment to be set
%
% Returns
%
% 1. the SBML Reaction structure with the new value for the compartment attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'compartment')
if ~ischar(compartment)
error('compartment must be character array') ;
else
SBMLReaction.compartment = compartment;
end;
else
error('compartment not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetSBOTerm.m 0000644 0000000 0000000 00000003335 11703262362 027730 0 ustar root root function value = Reaction_isSetSBOTerm(SBMLReaction)
% value = Reaction_isSetSBOTerm(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'sboTerm')
value = (SBMLReaction.sboTerm >0);
else
error('isSetSboTerm not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetReversible.m 0000644 0000000 0000000 00000003357 11703262362 030563 0 ustar root root function value = Reaction_isSetReversible(SBMLReaction)
% value = Reaction_isSetReversible(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the reversible attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reversible')
value = SBMLReaction.isSetReversible;
else
error('isSetReversible not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetName.m 0000644 0000000 0000000 00000003313 11703262362 027331 0 ustar root root function value = Reaction_isSetName(SBMLReaction)
% value = Reaction_isSetName(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'name')
value = ~isempty(SBMLReaction.name);
else
error('name not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetMetaid.m 0000644 0000000 0000000 00000003327 11703262362 027661 0 ustar root root function value = Reaction_isSetMetaid(SBMLReaction)
% value = Reaction_isSetMetaid(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'metaid')
value = ~isempty(SBMLReaction.metaid);
else
error('metaid not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetKineticLaw.m 0000644 0000000 0000000 00000003364 11703262362 030511 0 ustar root root function value = Reaction_isSetKineticLaw(SBMLReaction)
% value = Reaction_isSetKineticLaw(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the kineticLaw structure is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'kineticLaw')
value = ~isempty(SBMLReaction.kineticLaw);
else
error('isSetKineticLaw not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetId.m 0000644 0000000 0000000 00000003277 11703262362 027016 0 ustar root root function value = Reaction_isSetId(SBMLReaction)
% value = Reaction_isSetId(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'id')
value = ~isempty(SBMLReaction.id);
else
error('id not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetFast.m 0000644 0000000 0000000 00000003375 11703262362 027356 0 ustar root root function value = Reaction_isSetFast(SBMLReaction)
% value = Reaction_isSetFast(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the fast attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'fast')
if (level == 1)
value = 1;
else
value = SBMLReaction.isSetFast;
end;
else
error('isSetFast not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_isSetCompartment.m 0000644 0000000 0000000 00000003365 11703262362 030751 0 ustar root root function value = Reaction_isSetCompartment(SBMLReaction)
% value = Reaction_isSetCompartment(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. value =
% - 1 if the compartment attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'compartment')
value = ~isempty(SBMLReaction.compartment);
else
error('compartment not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getSBOTerm.m 0000644 0000000 0000000 00000003267 11703262362 027424 0 ustar root root function sboTerm = Reaction_getSBOTerm(SBMLReaction)
% sboTerm = Reaction_getSBOTerm(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'sboTerm')
sboTerm = SBMLReaction.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getReversible.m 0000644 0000000 0000000 00000003322 11703262362 030243 0 ustar root root function reversible = Reaction_getReversible(SBMLReaction)
% reversible = Reaction_getReversible(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the value of the reversible attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reversible')
reversible = SBMLReaction.reversible;
else
error('reversible not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getReactantById.m 0000644 0000000 0000000 00000004533 11703262362 030457 0 ustar root root function reactant = Reaction_getReactantById(SBMLReaction, id)
% reactant = Reaction_getReactantById(SBMLReaction, id)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id of SBML Reactant structure
%
% Returns
%
% 1. the SBML Reactant structure that has this id
%
%
% check that input is correct
if (~isstruct(SBMLReaction))
error(sprintf('%s', ...
'first argument must be an SBML Reaction structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLReaction);
if (~isSBML_Reaction(SBMLReaction, sbmlLevel, sbmlVersion))
error(sprintf('%s\n%s', 'Reaction_getReactantById(SBMLReaction, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Reaction_getReactantById(SBMLReaction, id)', 'second argument must be a string'));
elseif (sbmlLevel ~= 2)
error(sprintf('%s\n%s', 'Reaction_getReactantById(SBMLReaction, id)', 'no id field in a level 1 model'));
end;
reactant = [];
for i = 1:length(SBMLReaction.reactant)
if (strcmp(id, SBMLReaction.reactant(i).species))
reactant = SBMLReaction.reactant(i);
return;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getReactant.m 0000644 0000000 0000000 00000003744 11703262362 027712 0 ustar root root function reactant = Reaction_getReactant(SBMLReaction, index)
% reactant = Reaction_getReactant(SBMLReaction, index)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. index, an integer representing the index of SBML Reactant structure
%
% Returns
%
% 1. the SBML Reactant structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reactant')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLReaction.reactant)
reactant = SBMLReaction.reactant(index);
else
error('index is out of range');
end;
else
error('reactant not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getProductById.m 0000644 0000000 0000000 00000004515 11703262362 030336 0 ustar root root function product = Reaction_getProductById(SBMLReaction, id)
% product = Reaction_getProductById(SBMLReaction, id)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id of SBML Product structure
%
% Returns
%
% 1. the SBML Product structure that has this id
%
%
% check that input is correct
if (~isstruct(SBMLReaction))
error(sprintf('%s', ...
'first argument must be an SBML Reaction structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLReaction);
if (~isSBML_Reaction(SBMLReaction, sbmlLevel, sbmlVersion))
error(sprintf('%s\n%s', 'Reaction_getProductById(SBMLReaction, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Reaction_getProductById(SBMLReaction, id)', 'second argument must be a string'));
elseif (sbmlLevel ~= 2)
error(sprintf('%s\n%s', 'Reaction_getProductById(SBMLReaction, id)', 'no id field in a level 1 model'));
end;
product = [];
for i = 1:length(SBMLReaction.product)
if (strcmp(id, SBMLReaction.product(i).species))
product = SBMLReaction.product(i);
return;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getProduct.m 0000644 0000000 0000000 00000003731 11703262362 027565 0 ustar root root function product = Reaction_getProduct(SBMLReaction, index)
% product = Reaction_getProduct(SBMLReaction, index)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. index, an integer representing the index of SBML Product structure
%
% Returns
%
% 1. the SBML Product structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'product')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLReaction.product)
product = SBMLReaction.product(index);
else
error('index is out of range');
end;
else
error('product not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getNumReactants.m 0000644 0000000 0000000 00000003332 11703262362 030546 0 ustar root root function num = Reaction_getNumReactants(SBMLReaction)
% num = Reaction_getNumReactants(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the number of SBML Reactant structures present in the Reaction
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reactant')
num = length(SBMLReaction.reactant);
else
error('reactant not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getNumProducts.m 0000644 0000000 0000000 00000003324 11703262362 030426 0 ustar root root function num = Reaction_getNumProducts(SBMLReaction)
% num = Reaction_getNumProducts(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the number of SBML Product structures present in the Reaction
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'product')
num = length(SBMLReaction.product);
else
error('product not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getNumModifiers.m 0000644 0000000 0000000 00000003332 11703262362 030543 0 ustar root root function num = Reaction_getNumModifiers(SBMLReaction)
% num = Reaction_getNumModifiers(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the number of SBML Modifier structures present in the Reaction
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'modifier')
num = length(SBMLReaction.modifier);
else
error('modifier not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getName.m 0000644 0000000 0000000 00000003234 11703262362 027023 0 ustar root root function name = Reaction_getName(SBMLReaction)
% name = Reaction_getName(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'name')
name = SBMLReaction.name;
else
error('name not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getModifierById.m 0000644 0000000 0000000 00000004547 11703262362 030461 0 ustar root root function modifier = Reaction_getModifierById(SBMLReaction, id)
% modifier = Reaction_getModifierById(SBMLReaction, id)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id of SBML Modifier structure
%
% Returns
%
% 1. the SBML Modifier structure that has this id
%
%
% check that input is correct
if (~isstruct(SBMLReaction))
error(sprintf('%s', ...
'first argument must be an SBML Reaction structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLReaction);
if (~isSBML_Reaction(SBMLReaction, sbmlLevel, sbmlVersion))
error(sprintf('%s\n%s', 'Reaction_getModifierById(SBMLReaction, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Reaction_getModifierById(SBMLReaction, id)', 'second argument must be a string'));
elseif (sbmlLevel ~= 2)
error(sprintf('%s\n%s', 'Reaction_getModifierById(SBMLReaction, id)', 'no id or modifier field in a level 1 model'));
end;
modifier = [];
for i = 1:length(SBMLReaction.modifier)
if (strcmp(id, SBMLReaction.modifier(i).species))
modifier = SBMLReaction.modifier(i);
return;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getModifier.m 0000644 0000000 0000000 00000003744 11703262362 027707 0 ustar root root function modifier = Reaction_getModifier(SBMLReaction, index)
% modifier = Reaction_getModifier(SBMLReaction, index)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. index, an integer representing the index of SBML Modifier structure
%
% Returns
%
% 1. the SBML Modifier structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'modifier')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLReaction.modifier)
modifier = SBMLReaction.modifier(index);
else
error('index is out of range');
end;
else
error('modifier not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getMetaid.m 0000644 0000000 0000000 00000003256 11703262362 027352 0 ustar root root function metaid = Reaction_getMetaid(SBMLReaction)
% metaid = Reaction_getMetaid(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'metaid')
metaid = SBMLReaction.metaid;
else
error('metaid not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getListOfReactants.m 0000644 0000000 0000000 00000003314 11703262362 031207 0 ustar root root function reactant = Reaction_getListOfReactants(SBMLReaction)
% reactant = Reaction_getListOfReactants(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. an array of the reactant structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reactant')
reactant = SBMLReaction.reactant;
else
error('reactant not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getListOfProducts.m 0000644 0000000 0000000 00000003303 11703262362 031064 0 ustar root root function product = Reaction_getListOfProducts(SBMLReaction)
% product = Reaction_getListOfProducts(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. an array of the product structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'product')
product = SBMLReaction.product;
else
error('product not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getListOfModifiers.m 0000644 0000000 0000000 00000003314 11703262362 031204 0 ustar root root function modifier = Reaction_getListOfModifiers(SBMLReaction)
% modifier = Reaction_getListOfModifiers(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. an array of the modifier structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'modifier')
modifier = SBMLReaction.modifier;
else
error('modifier not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getKineticLaw.m 0000644 0000000 0000000 00000003312 11703262362 030172 0 ustar root root function kineticLaw = Reaction_getKineticLaw(SBMLReaction)
% kineticLaw = Reaction_getKineticLaw(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML KineticLaw structure
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'kineticLaw')
kineticLaw = SBMLReaction.kineticLaw;
else
error('kineticLaw not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getId.m 0000644 0000000 0000000 00000003212 11703262362 026473 0 ustar root root function id = Reaction_getId(SBMLReaction)
% id = Reaction_getId(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'id')
id = SBMLReaction.id;
else
error('id not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getFast.m 0000644 0000000 0000000 00000003234 11703262362 027040 0 ustar root root function fast = Reaction_getFast(SBMLReaction)
% fast = Reaction_getFast(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the value of the fast attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'fast')
fast = SBMLReaction.fast;
else
error('fast not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_getCompartment.m 0000644 0000000 0000000 00000003333 11703262362 030434 0 ustar root root function compartment = Reaction_getCompartment(SBMLReaction)
% compartment = Reaction_getCompartment(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the value of the compartment attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'compartment')
compartment = SBMLReaction.compartment;
else
error('compartment not an attribute on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_createReactant.m 0000644 0000000 0000000 00000003650 11703262362 030372 0 ustar root root function SBMLReaction = Reaction_createReactant(SBMLReaction)
% SBMLReaction = Reaction_createReactant(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with a new SBML SpeciesReference structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'reactant')
index = length(SBMLReaction.reactant);
SBMLReactant = SpeciesReference_create(level, version);
if index == 0
SBMLReaction.reactant = SBMLReactant;
else
SBMLReaction.reactant(index+1) = SBMLReactant;
end;
else
error('reactant not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_createProduct.m 0000644 0000000 0000000 00000003636 11703262362 030255 0 ustar root root function SBMLReaction = Reaction_createProduct(SBMLReaction)
% SBMLReaction = Reaction_createProduct(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with a new SBML SpeciesReference structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'product')
index = length(SBMLReaction.product);
SBMLProduct = SpeciesReference_create(level, version);
if index == 0
SBMLReaction.product = SBMLProduct;
else
SBMLReaction.product(index+1) = SBMLProduct;
end;
else
error('product not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_createModifier.m 0000644 0000000 0000000 00000003670 11703262362 030371 0 ustar root root function SBMLReaction = Reaction_createModifier(SBMLReaction)
% SBMLReaction = Reaction_createModifier(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with a new SBML ModifierSpeciesReference structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'modifier')
index = length(SBMLReaction.modifier);
SBMLModifier = ModifierSpeciesReference_create(level, version);
if index == 0
SBMLReaction.modifier = SBMLModifier;
else
SBMLReaction.modifier(index+1) = SBMLModifier;
end;
else
error('modifier not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_createKineticLaw.m 0000644 0000000 0000000 00000003462 11703262362 030664 0 ustar root root function SBMLReaction = Reaction_createKineticLaw(SBMLReaction)
% SBMLReaction = Reaction_createKineticLaw(SBMLReaction)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure with a new SBML KineticLaw structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
if isfield(SBMLReaction, 'kineticLaw')
SBMLKineticLaw = KineticLaw_create(level, version);
SBMLReaction.kineticLaw = SBMLKineticLaw;
else
error('kineticLaw not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_create.m 0000644 0000000 0000000 00000006364 11703262362 026715 0 ustar root root function Reaction = Reaction_create(varargin)
% Reaction = Reaction_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Reaction structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getReactionFieldnames(level, version);
if (num > 0)
values = getReactionDefaultValues(level, version);
Reaction = cell2struct(values, fieldnames, 2);
%add empty substructures
Reaction.reactant = SpeciesReference_create(level, version);
Reaction.reactant(1:end) = [];
Reaction.product = SpeciesReference_create(level, version);
Reaction.product(1:end) = [];
Reaction.kineticLaw = KineticLaw_create(level, version);
Reaction.kineticLaw(1:end) = [];
warning('off', 'Warn:InvalidLV');
t = ModifierSpeciesReference_create(level, version);
if ~isempty(t)
Reaction.modifier = t;
Reaction.modifier(1:end) = [];
end;
warning('on', 'Warn:InvalidLV');
%add level and version
Reaction.level = level;
Reaction.version = version;
%check correct structure
if ~isSBML_Reaction(Reaction, level, version)
Reaction = struct();
warning('Warn:BadStruct', 'Failed to create Reaction');
end;
else
Reaction = [];
warning('Warn:InvalidLV', 'Reaction not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_addReactant.m 0000644 0000000 0000000 00000004156 11703262362 027661 0 ustar root root function SBMLReaction = Reaction_addReactant(SBMLReaction, SBMLReactant)
% SBMLReaction = Reaction_addReactant(SBMLReaction, SBMLReactant)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLReactant, an SBML Reactant structure
%
% Returns
%
% 1. the SBML Reaction structure with the SBML Reactant structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
[reactant_level, reactant_version] = GetLevelVersion(SBMLReactant);
if level ~= reactant_level
error('mismatch in levels');
elseif version ~= reactant_version
error('mismatch in versions');
end;
if isfield(SBMLReaction, 'reactant')
index = length(SBMLReaction.reactant);
if index == 0
SBMLReaction.reactant = SBMLReactant;
else
SBMLReaction.reactant(index+1) = SBMLReactant;
end;
else
error('reactant not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_addProduct.m 0000644 0000000 0000000 00000004133 11703262362 027533 0 ustar root root function SBMLReaction = Reaction_addProduct(SBMLReaction, SBMLProduct)
% SBMLReaction = Reaction_addProduct(SBMLReaction, SBMLProduct)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLProduct, an SBML Product structure
%
% Returns
%
% 1. the SBML Reaction structure with the SBML Product structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
[product_level, product_version] = GetLevelVersion(SBMLProduct);
if level ~= product_level
error('mismatch in levels');
elseif version ~= product_version
error('mismatch in versions');
end;
if isfield(SBMLReaction, 'product')
index = length(SBMLReaction.product);
if index == 0
SBMLReaction.product = SBMLProduct;
else
SBMLReaction.product(index+1) = SBMLProduct;
end;
else
error('product not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Reaction_addModifier.m 0000644 0000000 0000000 00000004156 11703262362 027656 0 ustar root root function SBMLReaction = Reaction_addModifier(SBMLReaction, SBMLModifier)
% SBMLReaction = Reaction_addModifier(SBMLReaction, SBMLModifier)
%
% Takes
%
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLModifier, an SBML Modifier structure
%
% Returns
%
% 1. the SBML Reaction structure with the SBML Modifier structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLReaction);
[modifier_level, modifier_version] = GetLevelVersion(SBMLModifier);
if level ~= modifier_level
error('mismatch in levels');
elseif version ~= modifier_version
error('mismatch in versions');
end;
if isfield(SBMLReaction, 'modifier')
index = length(SBMLReaction.modifier);
if index == 0
SBMLReaction.modifier = SBMLModifier;
else
SBMLReaction.modifier(index+1) = SBMLModifier;
end;
else
error('modifier not an element on SBML L%dV%d Reaction', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Reaction/Contents.m 0000644 0000000 0000000 00000042161 11703262362 025416 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Reaction
%
% The functions allow users to create and work with the SBML Reaction structure.
%
%=================================================================
% SBMLReaction = Reaction_addModifier(SBMLReaction, SBMLModifier)
%=================================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLModifier, an SBML Modifier structure
% Returns
% 1. the SBML Reaction structure with the SBML Modifier structure added
%
%===============================================================
% SBMLReaction = Reaction_addProduct(SBMLReaction, SBMLProduct)
%===============================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLProduct, an SBML Product structure
% Returns
% 1. the SBML Reaction structure with the SBML Product structure added
%
%=================================================================
% SBMLReaction = Reaction_addReactant(SBMLReaction, SBMLReactant)
%=================================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLReactant, an SBML Reactant structure
% Returns
% 1. the SBML Reaction structure with the SBML Reactant structure added
%
%=================================================================
% Reaction = Reaction_create(level(optional), version(optional) )
%=================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Reaction structure of the appropriate level and version
%
%========================================================
% SBMLReaction = Reaction_createKineticLaw(SBMLReaction)
%========================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with a new SBML KineticLaw structure added
%
%======================================================
% SBMLReaction = Reaction_createModifier(SBMLReaction)
%======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with a new SBML ModifierSpeciesReference structure added
%
%=====================================================
% SBMLReaction = Reaction_createProduct(SBMLReaction)
%=====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with a new SBML SpeciesReference structure added
%
%======================================================
% SBMLReaction = Reaction_createReactant(SBMLReaction)
%======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with a new SBML SpeciesReference structure added
%
%=====================================================
% compartment = Reaction_getCompartment(SBMLReaction)
%=====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the value of the compartment attribute
%
%=======================================
% fast = Reaction_getFast(SBMLReaction)
%=======================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the value of the fast attribute
%
%===================================
% id = Reaction_getId(SBMLReaction)
%===================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the value of the id attribute
%
%===================================================
% kineticLaw = Reaction_getKineticLaw(SBMLReaction)
%===================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML KineticLaw structure
%
%======================================================
% modifier = Reaction_getListOfModifiers(SBMLReaction)
%======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. an array of the modifier structures
%
%====================================================
% product = Reaction_getListOfProducts(SBMLReaction)
%====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. an array of the product structures
%
%======================================================
% reactant = Reaction_getListOfReactants(SBMLReaction)
%======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. an array of the reactant structures
%
%===========================================
% metaid = Reaction_getMetaid(SBMLReaction)
%===========================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the value of the metaid attribute
%
%======================================================
% modifier = Reaction_getModifier(SBMLReaction, index)
%======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. index, an integer representing the index of SBML Modifier structure
% Returns
% 1. the SBML Modifier structure at the indexed position
%
%=======================================================
% modifier = Reaction_getModifierById(SBMLReaction, id)
%=======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id of SBML Modifier structure
% Returns
% 1. the SBML Modifier structure that has this id
%
%=======================================
% name = Reaction_getName(SBMLReaction)
%=======================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the value of the name attribute
%
%==============================================
% num = Reaction_getNumModifiers(SBMLReaction)
%==============================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the number of SBML Modifier structures present in the Reaction
%
%=============================================
% num = Reaction_getNumProducts(SBMLReaction)
%=============================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the number of SBML Product structures present in the Reaction
%
%==============================================
% num = Reaction_getNumReactants(SBMLReaction)
%==============================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the number of SBML Reactant structures present in the Reaction
%
%====================================================
% product = Reaction_getProduct(SBMLReaction, index)
%====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. index, an integer representing the index of SBML Product structure
% Returns
% 1. the SBML Product structure at the indexed position
%
%=====================================================
% product = Reaction_getProductById(SBMLReaction, id)
%=====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id of SBML Product structure
% Returns
% 1. the SBML Product structure that has this id
%
%======================================================
% reactant = Reaction_getReactant(SBMLReaction, index)
%======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. index, an integer representing the index of SBML Reactant structure
% Returns
% 1. the SBML Reactant structure at the indexed position
%
%=======================================================
% reactant = Reaction_getReactantById(SBMLReaction, id)
%=======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id of SBML Reactant structure
% Returns
% 1. the SBML Reactant structure that has this id
%
%===================================================
% reversible = Reaction_getReversible(SBMLReaction)
%===================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the value of the reversible attribute
%
%=============================================
% sboTerm = Reaction_getSBOTerm(SBMLReaction)
%=============================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the value of the sboTerm attribute
%
%=================================================
% value = Reaction_isSetCompartment(SBMLReaction)
%=================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the compartment attribute is set
% - 0 otherwise
%
%==========================================
% value = Reaction_isSetFast(SBMLReaction)
%==========================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the fast attribute is set
% - 0 otherwise
%
%========================================
% value = Reaction_isSetId(SBMLReaction)
%========================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%================================================
% value = Reaction_isSetKineticLaw(SBMLReaction)
%================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the kineticLaw structure is set
% - 0 otherwise
%
%============================================
% value = Reaction_isSetMetaid(SBMLReaction)
%============================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%==========================================
% value = Reaction_isSetName(SBMLReaction)
%==========================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%================================================
% value = Reaction_isSetReversible(SBMLReaction)
%================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the reversible attribute is set
% - 0 otherwise
%
%=============================================
% value = Reaction_isSetSBOTerm(SBMLReaction)
%=============================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%===================================================================
% SBMLReaction = Reaction_setCompartment(SBMLReaction, compartment)
%===================================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. compartment; a string representing the compartment to be set
% Returns
% 1. the SBML Reaction structure with the new value for the compartment attribute
%
%=====================================================
% SBMLReaction = Reaction_setFast(SBMLReaction, fast)
%=====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. fast, an integer (0/1) representing the value of fast to be set
% Returns
% 1. the SBML Reaction structure with the new value for the fast attribute
%
%=================================================
% SBMLReaction = Reaction_setId(SBMLReaction, id)
%=================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML Reaction structure with the new value for the id attribute
%
%=====================================================================
% SBMLReaction = Reaction_setKineticLaw(SBMLReaction, SBMLKineticLaw)
%=====================================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML Reaction structure with the new value for the kineticLaw field
%
%=========================================================
% SBMLReaction = Reaction_setMetaid(SBMLReaction, metaid)
%=========================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Reaction structure with the new value for the metaid attribute
%
%=====================================================
% SBMLReaction = Reaction_setName(SBMLReaction, name)
%=====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML Reaction structure with the new value for the name attribute
%
%=================================================================
% SBMLReaction = Reaction_setReversible(SBMLReaction, reversible)
%=================================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. reversible, an integer (0/1) representing the value of reversible to be set
% Returns
% 1. the SBML Reaction structure with the new value for the reversible attribute
%
%===========================================================
% SBMLReaction = Reaction_setSBOTerm(SBMLReaction, sboTerm)
%===========================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Reaction structure with the new value for the sboTerm attribute
%
%========================================================
% SBMLReaction = Reaction_unsetCompartment(SBMLReaction)
%========================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the compartment attribute unset
%
%=================================================
% SBMLReaction = Reaction_unsetFast(SBMLReaction)
%=================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the fast attribute unset
%
%===============================================
% SBMLReaction = Reaction_unsetId(SBMLReaction)
%===============================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the id attribute unset
%
%=======================================================
% SBMLReaction = Reaction_unsetKineticLaw(SBMLReaction)
%=======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the kineticLaw field unset
%
%===================================================
% SBMLReaction = Reaction_unsetMetaid(SBMLReaction)
%===================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the metaid attribute unset
%
%=================================================
% SBMLReaction = Reaction_unsetName(SBMLReaction)
%=================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the name attribute unset
%
%=======================================================
% SBMLReaction = Reaction_unsetReversible(SBMLReaction)
%=======================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the reversible attribute unset
%
%====================================================
% SBMLReaction = Reaction_unsetSBOTerm(SBMLReaction)
%====================================================
% Takes
% 1. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Reaction structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/ 0000755 0000000 0000000 00000000000 11704572236 023423 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_unsetVariable.m 0000644 0000000 0000000 00000003336 11703262350 030205 0 ustar root root function SBMLRateRule = RateRule_unsetVariable(SBMLRateRule)
% SBMLRateRule = RateRule_unsetVariable(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the SBML RateRule structure with the variable attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'variable')
SBMLRateRule.variable = '';
else
error('variable not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_unsetSBOTerm.m 0000644 0000000 0000000 00000003330 11703262350 027725 0 ustar root root function SBMLRateRule = RateRule_unsetSBOTerm(SBMLRateRule)
% SBMLRateRule = RateRule_unsetSBOTerm(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the SBML RateRule structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'sboTerm')
SBMLRateRule.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_unsetMetaid.m 0000644 0000000 0000000 00000003322 11703262350 027656 0 ustar root root function SBMLRateRule = RateRule_unsetMetaid(SBMLRateRule)
% SBMLRateRule = RateRule_unsetMetaid(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the SBML RateRule structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'metaid')
SBMLRateRule.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_unsetFormula.m 0000644 0000000 0000000 00000003330 11703262350 030057 0 ustar root root function SBMLRateRule = RateRule_unsetFormula(SBMLRateRule)
% SBMLRateRule = RateRule_unsetFormula(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the SBML RateRule structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'formula')
SBMLRateRule.formula = '';
else
error('formula not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_setVariable.m 0000644 0000000 0000000 00000003615 11703262350 027642 0 ustar root root function SBMLRateRule = RateRule_setVariable(SBMLRateRule, variable)
% SBMLRateRule = RateRule_setVariable(SBMLRateRule, variable)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
% 2. variable; a string representing the variable to be set
%
% Returns
%
% 1. the SBML RateRule structure with the new value for the variable attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'variable')
if ~ischar(variable)
error('variable must be character array') ;
else
SBMLRateRule.variable = variable;
end;
else
error('variable not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_setSBOTerm.m 0000644 0000000 0000000 00000003607 11703262350 027371 0 ustar root root function SBMLRateRule = RateRule_setSBOTerm(SBMLRateRule, sboTerm)
% SBMLRateRule = RateRule_setSBOTerm(SBMLRateRule, sboTerm)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML RateRule structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLRateRule.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_setMetaid.m 0000644 0000000 0000000 00000003563 11703262350 027322 0 ustar root root function SBMLRateRule = RateRule_setMetaid(SBMLRateRule, metaid)
% SBMLRateRule = RateRule_setMetaid(SBMLRateRule, metaid)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML RateRule structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLRateRule.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_setFormula.m 0000644 0000000 0000000 00000003600 11703262350 027514 0 ustar root root function SBMLRateRule = RateRule_setFormula(SBMLRateRule, formula)
% SBMLRateRule = RateRule_setFormula(SBMLRateRule, formula)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML RateRule structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLRateRule.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_isSetVariable.m 0000644 0000000 0000000 00000003341 11703262350 030132 0 ustar root root function value = RateRule_isSetVariable(SBMLRateRule)
% value = RateRule_isSetVariable(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. value =
% - 1 if the variable attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'variable')
value = ~isempty(SBMLRateRule.variable);
else
error('variable not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_isSetSBOTerm.m 0000644 0000000 0000000 00000003326 11703262350 027663 0 ustar root root function value = RateRule_isSetSBOTerm(SBMLRateRule)
% value = RateRule_isSetSBOTerm(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'sboTerm')
value = (SBMLRateRule.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_isSetMetaid.m 0000644 0000000 0000000 00000003325 11703262350 027612 0 ustar root root function value = RateRule_isSetMetaid(SBMLRateRule)
% value = RateRule_isSetMetaid(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'metaid')
value = ~isempty(SBMLRateRule.metaid);
else
error('metaid not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_isSetFormula.m 0000644 0000000 0000000 00000003333 11703262350 030013 0 ustar root root function value = RateRule_isSetFormula(SBMLRateRule)
% value = RateRule_isSetFormula(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'formula')
value = ~isempty(SBMLRateRule.formula);
else
error('formula not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_getVariable.m 0000644 0000000 0000000 00000003276 11703262350 027631 0 ustar root root function variable = RateRule_getVariable(SBMLRateRule)
% variable = RateRule_getVariable(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the value of the variable attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'variable')
variable = SBMLRateRule.variable;
else
error('variable not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_getSBOTerm.m 0000644 0000000 0000000 00000003265 11703262350 027355 0 ustar root root function sboTerm = RateRule_getSBOTerm(SBMLRateRule)
% sboTerm = RateRule_getSBOTerm(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'sboTerm')
sboTerm = SBMLRateRule.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_getMetaid.m 0000644 0000000 0000000 00000003254 11703262350 027303 0 ustar root root function metaid = RateRule_getMetaid(SBMLRateRule)
% metaid = RateRule_getMetaid(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'metaid')
metaid = SBMLRateRule.metaid;
else
error('metaid not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_getFormula.m 0000644 0000000 0000000 00000003265 11703262350 027507 0 ustar root root function formula = RateRule_getFormula(SBMLRateRule)
% formula = RateRule_getFormula(SBMLRateRule)
%
% Takes
%
% 1. SBMLRateRule, an SBML RateRule structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLRateRule);
if isfield(SBMLRateRule, 'formula')
formula = SBMLRateRule.formula;
else
error('formula not an attribute on SBML L%dV%d RateRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/RateRule_create.m 0000644 0000000 0000000 00000005342 11703262350 026643 0 ustar root root function RateRule = RateRule_create(varargin)
% RateRule = RateRule_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML RateRule structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getRateRuleFieldnames(level, version);
if (num > 0)
values = getRateRuleDefaultValues(level, version);
RateRule = cell2struct(values, fieldnames, 2);
%add level and version
RateRule.level = level;
RateRule.version = version;
%check correct structure
if ~isSBML_RateRule(RateRule, level, version)
RateRule = struct();
warning('Warn:BadStruct', 'Failed to create RateRule');
end;
else
RateRule = [];
warning('Warn:InvalidLV', 'RateRule not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/RateRule/Contents.m 0000644 0000000 0000000 00000014665 11703262350 025402 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\RateRule
%
% The functions allow users to create and work with the SBML RateRule structure.
%
%=================================================================
% RateRule = RateRule_create(level(optional), version(optional) )
%=================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML RateRule structure of the appropriate level and version
%
%=============================================
% formula = RateRule_getFormula(SBMLRateRule)
%=============================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the value of the formula attribute
%
%===========================================
% metaid = RateRule_getMetaid(SBMLRateRule)
%===========================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the value of the metaid attribute
%
%=============================================
% sboTerm = RateRule_getSBOTerm(SBMLRateRule)
%=============================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the value of the sboTerm attribute
%
%===============================================
% variable = RateRule_getVariable(SBMLRateRule)
%===============================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the value of the variable attribute
%
%=============================================
% value = RateRule_isSetFormula(SBMLRateRule)
%=============================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%============================================
% value = RateRule_isSetMetaid(SBMLRateRule)
%============================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=============================================
% value = RateRule_isSetSBOTerm(SBMLRateRule)
%=============================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==============================================
% value = RateRule_isSetVariable(SBMLRateRule)
%==============================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. value =
% - 1 if the variable attribute is set
% - 0 otherwise
%
%===========================================================
% SBMLRateRule = RateRule_setFormula(SBMLRateRule, formula)
%===========================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML RateRule structure with the new value for the formula attribute
%
%=========================================================
% SBMLRateRule = RateRule_setMetaid(SBMLRateRule, metaid)
%=========================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML RateRule structure with the new value for the metaid attribute
%
%===========================================================
% SBMLRateRule = RateRule_setSBOTerm(SBMLRateRule, sboTerm)
%===========================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML RateRule structure with the new value for the sboTerm attribute
%
%=============================================================
% SBMLRateRule = RateRule_setVariable(SBMLRateRule, variable)
%=============================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% 2. variable; a string representing the variable to be set
% Returns
% 1. the SBML RateRule structure with the new value for the variable attribute
%
%====================================================
% SBMLRateRule = RateRule_unsetFormula(SBMLRateRule)
%====================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the SBML RateRule structure with the formula attribute unset
%
%===================================================
% SBMLRateRule = RateRule_unsetMetaid(SBMLRateRule)
%===================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the SBML RateRule structure with the metaid attribute unset
%
%====================================================
% SBMLRateRule = RateRule_unsetSBOTerm(SBMLRateRule)
%====================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the SBML RateRule structure with the sboTerm attribute unset
%
%=====================================================
% SBMLRateRule = RateRule_unsetVariable(SBMLRateRule)
%=====================================================
% Takes
% 1. SBMLRateRule, an SBML RateRule structure
% Returns
% 1. the SBML RateRule structure with the variable attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/ 0000755 0000000 0000000 00000000000 11704572246 023522 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_unsetSBOTerm.m 0000644 0000000 0000000 00000003330 11703262304 030120 0 ustar root root function SBMLPriority = Priority_unsetSBOTerm(SBMLPriority)
% SBMLPriority = Priority_unsetSBOTerm(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. the SBML Priority structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'sboTerm')
SBMLPriority.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_unsetMetaid.m 0000644 0000000 0000000 00000003322 11703262304 030051 0 ustar root root function SBMLPriority = Priority_unsetMetaid(SBMLPriority)
% SBMLPriority = Priority_unsetMetaid(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. the SBML Priority structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'metaid')
SBMLPriority.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_unsetMath.m 0000644 0000000 0000000 00000003306 11703262304 027541 0 ustar root root function SBMLPriority = Priority_unsetMath(SBMLPriority)
% SBMLPriority = Priority_unsetMath(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. the SBML Priority structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'math')
SBMLPriority.math = '';
else
error('math not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_setSBOTerm.m 0000644 0000000 0000000 00000003607 11703262304 027564 0 ustar root root function SBMLPriority = Priority_setSBOTerm(SBMLPriority, sboTerm)
% SBMLPriority = Priority_setSBOTerm(SBMLPriority, sboTerm)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Priority structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLPriority.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_setMetaid.m 0000644 0000000 0000000 00000003563 11703262304 027515 0 ustar root root function SBMLPriority = Priority_setMetaid(SBMLPriority, metaid)
% SBMLPriority = Priority_setMetaid(SBMLPriority, metaid)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Priority structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLPriority.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_setMath.m 0000644 0000000 0000000 00000003547 11703262304 027205 0 ustar root root function SBMLPriority = Priority_setMath(SBMLPriority, math)
% SBMLPriority = Priority_setMath(SBMLPriority, math)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML Priority structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLPriority.math = math;
end;
else
error('math not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_isSetSBOTerm.m 0000644 0000000 0000000 00000003326 11703262304 030056 0 ustar root root function value = Priority_isSetSBOTerm(SBMLPriority)
% value = Priority_isSetSBOTerm(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'sboTerm')
value = (SBMLPriority.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_isSetMetaid.m 0000644 0000000 0000000 00000003325 11703262304 030005 0 ustar root root function value = Priority_isSetMetaid(SBMLPriority)
% value = Priority_isSetMetaid(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'metaid')
value = ~isempty(SBMLPriority.metaid);
else
error('metaid not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_isSetMath.m 0000644 0000000 0000000 00000003311 11703262304 027466 0 ustar root root function value = Priority_isSetMath(SBMLPriority)
% value = Priority_isSetMath(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'math')
value = ~isempty(SBMLPriority.math);
else
error('math not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_getSBOTerm.m 0000644 0000000 0000000 00000003265 11703262304 027550 0 ustar root root function sboTerm = Priority_getSBOTerm(SBMLPriority)
% sboTerm = Priority_getSBOTerm(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'sboTerm')
sboTerm = SBMLPriority.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_getMetaid.m 0000644 0000000 0000000 00000003254 11703262304 027476 0 ustar root root function metaid = Priority_getMetaid(SBMLPriority)
% metaid = Priority_getMetaid(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'metaid')
metaid = SBMLPriority.metaid;
else
error('metaid not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_getMath.m 0000644 0000000 0000000 00000003232 11703262304 027160 0 ustar root root function math = Priority_getMath(SBMLPriority)
% math = Priority_getMath(SBMLPriority)
%
% Takes
%
% 1. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLPriority);
if isfield(SBMLPriority, 'math')
math = SBMLPriority.math;
else
error('math not an attribute on SBML L%dV%d Priority', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Priority_create.m 0000644 0000000 0000000 00000005342 11703262304 027036 0 ustar root root function Priority = Priority_create(varargin)
% Priority = Priority_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Priority structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getPriorityFieldnames(level, version);
if (num > 0)
values = getPriorityDefaultValues(level, version);
Priority = cell2struct(values, fieldnames, 2);
%add level and version
Priority.level = level;
Priority.version = version;
%check correct structure
if ~isSBML_Priority(Priority, level, version)
Priority = struct();
warning('Warn:BadStruct', 'Failed to create Priority');
end;
else
Priority = [];
warning('Warn:InvalidLV', 'Priority not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Priority/Contents.m 0000644 0000000 0000000 00000012264 11703262304 025470 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Priority
%
% The functions allow users to create and work with the SBML Priority structure.
%
%=================================================================
% Priority = Priority_create(level(optional), version(optional) )
%=================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Priority structure of the appropriate level and version
%
%=======================================
% math = Priority_getMath(SBMLPriority)
%=======================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. the value of the math attribute
%
%===========================================
% metaid = Priority_getMetaid(SBMLPriority)
%===========================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. the value of the metaid attribute
%
%=============================================
% sboTerm = Priority_getSBOTerm(SBMLPriority)
%=============================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. the value of the sboTerm attribute
%
%==========================================
% value = Priority_isSetMath(SBMLPriority)
%==========================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%============================================
% value = Priority_isSetMetaid(SBMLPriority)
%============================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=============================================
% value = Priority_isSetSBOTerm(SBMLPriority)
%=============================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%=====================================================
% SBMLPriority = Priority_setMath(SBMLPriority, math)
%=====================================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML Priority structure with the new value for the math attribute
%
%=========================================================
% SBMLPriority = Priority_setMetaid(SBMLPriority, metaid)
%=========================================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Priority structure with the new value for the metaid attribute
%
%===========================================================
% SBMLPriority = Priority_setSBOTerm(SBMLPriority, sboTerm)
%===========================================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Priority structure with the new value for the sboTerm attribute
%
%=================================================
% SBMLPriority = Priority_unsetMath(SBMLPriority)
%=================================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. the SBML Priority structure with the math attribute unset
%
%===================================================
% SBMLPriority = Priority_unsetMetaid(SBMLPriority)
%===================================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. the SBML Priority structure with the metaid attribute unset
%
%====================================================
% SBMLPriority = Priority_unsetSBOTerm(SBMLPriority)
%====================================================
% Takes
% 1. SBMLPriority, an SBML Priority structure
% Returns
% 1. the SBML Priority structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ 0000755 0000000 0000000 00000000000 11704572236 024450 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_unsetUnits.m 0000644 0000000 0000000 00000003415 11703262364 031637 0 ustar root root function SBMLParameterRule = ParameterRule_unsetUnits(SBMLParameterRule)
% SBMLParameterRule = ParameterRule_unsetUnits(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the SBML ParameterRule structure with the units attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'units')
SBMLParameterRule.units = '';
else
error('units not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_unsetType.m 0000644 0000000 0000000 00000003415 11703262364 031456 0 ustar root root function SBMLParameterRule = ParameterRule_unsetType(SBMLParameterRule)
% SBMLParameterRule = ParameterRule_unsetType(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the SBML ParameterRule structure with the type attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'type')
SBMLParameterRule.type = 'scalar';
else
error('type not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_unsetName.m 0000644 0000000 0000000 00000003407 11703262364 031416 0 ustar root root function SBMLParameterRule = ParameterRule_unsetName(SBMLParameterRule)
% SBMLParameterRule = ParameterRule_unsetName(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the SBML ParameterRule structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'name')
SBMLParameterRule.name = '';
else
error('name not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_unsetFormula.m0000644 0000000 0000000 00000003431 11703262364 032140 0 ustar root root function SBMLParameterRule = ParameterRule_unsetFormula(SBMLParameterRule)
% SBMLParameterRule = ParameterRule_unsetFormula(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the SBML ParameterRule structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'formula')
SBMLParameterRule.formula = '';
else
error('formula not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_setUnits.m 0000644 0000000 0000000 00000003647 11703262364 031303 0 ustar root root function SBMLParameterRule = ParameterRule_setUnits(SBMLParameterRule, units)
% SBMLParameterRule = ParameterRule_setUnits(SBMLParameterRule, units)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. units; a string representing the units to be set
%
% Returns
%
% 1. the SBML ParameterRule structure with the new value for the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'units')
if ~ischar(units)
error('units must be character array') ;
else
SBMLParameterRule.units = units;
end;
else
error('units not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_setType.m 0000644 0000000 0000000 00000003632 11703262364 031114 0 ustar root root function SBMLParameterRule = ParameterRule_setType(SBMLParameterRule, type)
% SBMLParameterRule = ParameterRule_setType(SBMLParameterRule, type)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. type; a string representing the type to be set
%
% Returns
%
% 1. the SBML ParameterRule structure with the new value for the type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'type')
if ~ischar(type)
error('type must be character array') ;
else
SBMLParameterRule.type = type;
end;
else
error('type not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_setName.m 0000644 0000000 0000000 00000003632 11703262364 031053 0 ustar root root function SBMLParameterRule = ParameterRule_setName(SBMLParameterRule, name)
% SBMLParameterRule = ParameterRule_setName(SBMLParameterRule, name)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML ParameterRule structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLParameterRule.name = name;
end;
else
error('name not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_setFormula.m 0000644 0000000 0000000 00000003701 11703262364 031575 0 ustar root root function SBMLParameterRule = ParameterRule_setFormula(SBMLParameterRule, formula)
% SBMLParameterRule = ParameterRule_setFormula(SBMLParameterRule, formula)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML ParameterRule structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLParameterRule.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_isSetUnits.m 0000644 0000000 0000000 00000003401 11703262364 031563 0 ustar root root function value = ParameterRule_isSetUnits(SBMLParameterRule)
% value = ParameterRule_isSetUnits(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'units')
value = ~isempty(SBMLParameterRule.units);
else
error('units not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_isSetType.m 0000644 0000000 0000000 00000003373 11703262364 031412 0 ustar root root function value = ParameterRule_isSetType(SBMLParameterRule)
% value = ParameterRule_isSetType(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. value =
% - 1 if the type attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'type')
value = ~isempty(SBMLParameterRule.type);
else
error('type not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_isSetName.m 0000644 0000000 0000000 00000003373 11703262364 031351 0 ustar root root function value = ParameterRule_isSetName(SBMLParameterRule)
% value = ParameterRule_isSetName(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'name')
value = ~isempty(SBMLParameterRule.name);
else
error('name not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_isSetFormula.m0000644 0000000 0000000 00000003415 11703262364 032073 0 ustar root root function value = ParameterRule_isSetFormula(SBMLParameterRule)
% value = ParameterRule_isSetFormula(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'formula')
value = ~isempty(SBMLParameterRule.formula);
else
error('formula not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_getUnits.m 0000644 0000000 0000000 00000003325 11703262364 031260 0 ustar root root function units = ParameterRule_getUnits(SBMLParameterRule)
% units = ParameterRule_getUnits(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the value of the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'units')
units = SBMLParameterRule.units;
else
error('units not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_getType.m 0000644 0000000 0000000 00000003314 11703262364 031075 0 ustar root root function type = ParameterRule_getType(SBMLParameterRule)
% type = ParameterRule_getType(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the value of the type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'type')
type = SBMLParameterRule.type;
else
error('type not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_getName.m 0000644 0000000 0000000 00000003314 11703262364 031034 0 ustar root root function name = ParameterRule_getName(SBMLParameterRule)
% name = ParameterRule_getName(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'name')
name = SBMLParameterRule.name;
else
error('name not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_getFormula.m 0000644 0000000 0000000 00000003347 11703262364 031567 0 ustar root root function formula = ParameterRule_getFormula(SBMLParameterRule)
% formula = ParameterRule_getFormula(SBMLParameterRule)
%
% Takes
%
% 1. SBMLParameterRule, an SBML ParameterRule structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameterRule);
if isfield(SBMLParameterRule, 'formula')
formula = SBMLParameterRule.formula;
else
error('formula not an attribute on SBML L%dV%d ParameterRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/ParameterRule_create.m 0000644 0000000 0000000 00000005462 11703262364 030725 0 ustar root root function ParameterRule = ParameterRule_create(varargin)
% ParameterRule = ParameterRule_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML ParameterRule structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getParameterRuleFieldnames(level, version);
if (num > 0)
values = getParameterRuleDefaultValues(level, version);
ParameterRule = cell2struct(values, fieldnames, 2);
%add level and version
ParameterRule.level = level;
ParameterRule.version = version;
%check correct structure
if ~isSBML_ParameterRule(ParameterRule, level, version)
ParameterRule = struct();
warning('Warn:BadStruct', 'Failed to create ParameterRule');
end;
else
ParameterRule = [];
warning('Warn:InvalidLV', 'ParameterRule not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ParameterRule/Contents.m 0000644 0000000 0000000 00000016100 11703262364 026416 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\ParameterRule
%
% The functions allow users to create and work with the SBML ParameterRule structure.
%
%===========================================================================
% ParameterRule = ParameterRule_create(level(optional), version(optional) )
%===========================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML ParameterRule structure of the appropriate level and version
%
%=======================================================
% formula = ParameterRule_getFormula(SBMLParameterRule)
%=======================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the value of the formula attribute
%
%=================================================
% name = ParameterRule_getName(SBMLParameterRule)
%=================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the value of the name attribute
%
%=================================================
% type = ParameterRule_getType(SBMLParameterRule)
%=================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the value of the type attribute
%
%===================================================
% units = ParameterRule_getUnits(SBMLParameterRule)
%===================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the value of the units attribute
%
%=======================================================
% value = ParameterRule_isSetFormula(SBMLParameterRule)
%=======================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%====================================================
% value = ParameterRule_isSetName(SBMLParameterRule)
%====================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%====================================================
% value = ParameterRule_isSetType(SBMLParameterRule)
%====================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. value =
% - 1 if the type attribute is set
% - 0 otherwise
%
%=====================================================
% value = ParameterRule_isSetUnits(SBMLParameterRule)
%=====================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%==========================================================================
% SBMLParameterRule = ParameterRule_setFormula(SBMLParameterRule, formula)
%==========================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML ParameterRule structure with the new value for the formula attribute
%
%====================================================================
% SBMLParameterRule = ParameterRule_setName(SBMLParameterRule, name)
%====================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML ParameterRule structure with the new value for the name attribute
%
%====================================================================
% SBMLParameterRule = ParameterRule_setType(SBMLParameterRule, type)
%====================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. type; a string representing the type to be set
% Returns
% 1. the SBML ParameterRule structure with the new value for the type attribute
%
%======================================================================
% SBMLParameterRule = ParameterRule_setUnits(SBMLParameterRule, units)
%======================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% 2. units; a string representing the units to be set
% Returns
% 1. the SBML ParameterRule structure with the new value for the units attribute
%
%===================================================================
% SBMLParameterRule = ParameterRule_unsetFormula(SBMLParameterRule)
%===================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the SBML ParameterRule structure with the formula attribute unset
%
%================================================================
% SBMLParameterRule = ParameterRule_unsetName(SBMLParameterRule)
%================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the SBML ParameterRule structure with the name attribute unset
%
%================================================================
% SBMLParameterRule = ParameterRule_unsetType(SBMLParameterRule)
%================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the SBML ParameterRule structure with the type attribute unset
%
%=================================================================
% SBMLParameterRule = ParameterRule_unsetUnits(SBMLParameterRule)
%=================================================================
% Takes
% 1. SBMLParameterRule, an SBML ParameterRule structure
% Returns
% 1. the SBML ParameterRule structure with the units attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/ 0000755 0000000 0000000 00000000000 11704572236 023620 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_unsetValue.m 0000644 0000000 0000000 00000003374 11703262350 030130 0 ustar root root function SBMLParameter = Parameter_unsetValue(SBMLParameter)
% SBMLParameter = Parameter_unsetValue(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure with the value attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'value')
SBMLParameter.value = NaN;
SBMLParameter.isSetValue = 0;
else
error('value not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_unsetUnits.m 0000644 0000000 0000000 00000003333 11703262350 030151 0 ustar root root function SBMLParameter = Parameter_unsetUnits(SBMLParameter)
% SBMLParameter = Parameter_unsetUnits(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure with the units attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'units')
SBMLParameter.units = '';
else
error('units not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_unsetSBOTerm.m 0000644 0000000 0000000 00000003347 11703262350 030327 0 ustar root root function SBMLParameter = Parameter_unsetSBOTerm(SBMLParameter)
% SBMLParameter = Parameter_unsetSBOTerm(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'sboTerm')
SBMLParameter.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_unsetName.m 0000644 0000000 0000000 00000003325 11703262350 027730 0 ustar root root function SBMLParameter = Parameter_unsetName(SBMLParameter)
% SBMLParameter = Parameter_unsetName(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'name')
SBMLParameter.name = '';
else
error('name not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_unsetMetaid.m 0000644 0000000 0000000 00000003341 11703262350 030251 0 ustar root root function SBMLParameter = Parameter_unsetMetaid(SBMLParameter)
% SBMLParameter = Parameter_unsetMetaid(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'metaid')
SBMLParameter.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_unsetId.m 0000644 0000000 0000000 00000003311 11703262350 027377 0 ustar root root function SBMLParameter = Parameter_unsetId(SBMLParameter)
% SBMLParameter = Parameter_unsetId(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'id')
SBMLParameter.id = '';
else
error('id not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_setValue.m 0000644 0000000 0000000 00000003631 11703262350 027561 0 ustar root root function SBMLParameter = Parameter_setValue(SBMLParameter, value)
% SBMLParameter = Parameter_setValue(SBMLParameter, value)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. value; number representing the value of value to be set
%
% Returns
%
% 1. the SBML Parameter structure with the new value for the value attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'value')
if ~isnumeric(value)
error('value must be numeric') ;
else
SBMLParameter.value = value;
SBMLParameter.isSetValue = 1;
end;
else
error('value not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_setUnits.m 0000644 0000000 0000000 00000003565 11703262350 027615 0 ustar root root function SBMLParameter = Parameter_setUnits(SBMLParameter, units)
% SBMLParameter = Parameter_setUnits(SBMLParameter, units)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. units; a string representing the units to be set
%
% Returns
%
% 1. the SBML Parameter structure with the new value for the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'units')
if ~ischar(units)
error('units must be character array') ;
else
SBMLParameter.units = units;
end;
else
error('units not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_setSBOTerm.m 0000644 0000000 0000000 00000003626 11703262350 027764 0 ustar root root function SBMLParameter = Parameter_setSBOTerm(SBMLParameter, sboTerm)
% SBMLParameter = Parameter_setSBOTerm(SBMLParameter, sboTerm)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Parameter structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLParameter.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_setName.m 0000644 0000000 0000000 00000003550 11703262350 027365 0 ustar root root function SBMLParameter = Parameter_setName(SBMLParameter, name)
% SBMLParameter = Parameter_setName(SBMLParameter, name)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML Parameter structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLParameter.name = name;
end;
else
error('name not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_setMetaid.m 0000644 0000000 0000000 00000003602 11703262350 027706 0 ustar root root function SBMLParameter = Parameter_setMetaid(SBMLParameter, metaid)
% SBMLParameter = Parameter_setMetaid(SBMLParameter, metaid)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Parameter structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLParameter.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_setId.m 0000644 0000000 0000000 00000003516 11703262350 027043 0 ustar root root function SBMLParameter = Parameter_setId(SBMLParameter, id)
% SBMLParameter = Parameter_setId(SBMLParameter, id)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML Parameter structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLParameter.id = id;
end;
else
error('id not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_setConstant.m 0000644 0000000 0000000 00000003741 11703262350 030300 0 ustar root root function SBMLParameter = Parameter_setConstant(SBMLParameter, constant)
% SBMLParameter = Parameter_setConstant(SBMLParameter, constant)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. constant, an integer (0/1) representing the value of constant to be set
%
% Returns
%
% 1. the SBML Parameter structure with the new value for the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'constant')
if (~isIntegralNumber(constant) || constant < 0 || constant > 1)
error('constant must be an integer of value 0/1') ;
else
SBMLParameter.constant = constant;
end;
else
error('constant not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isSetValue.m 0000644 0000000 0000000 00000003333 11703262350 030054 0 ustar root root function value = Parameter_isSetValue(SBMLParameter)
% value = Parameter_isSetValue(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. value =
% - 1 if the value attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'value')
value = SBMLParameter.isSetValue;
else
error('isSetValue not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isSetUnits.m 0000644 0000000 0000000 00000003333 11703262350 030102 0 ustar root root function value = Parameter_isSetUnits(SBMLParameter)
% value = Parameter_isSetUnits(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'units')
value = ~isempty(SBMLParameter.units);
else
error('units not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isSetSBOTerm.m 0000644 0000000 0000000 00000003342 11703262350 030253 0 ustar root root function value = Parameter_isSetSBOTerm(SBMLParameter)
% value = Parameter_isSetSBOTerm(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'sboTerm')
value = (SBMLParameter.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isSetName.m 0000644 0000000 0000000 00000003325 11703262350 027661 0 ustar root root function value = Parameter_isSetName(SBMLParameter)
% value = Parameter_isSetName(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'name')
value = ~isempty(SBMLParameter.name);
else
error('name not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isSetMetaid.m 0000644 0000000 0000000 00000003341 11703262350 030202 0 ustar root root function value = Parameter_isSetMetaid(SBMLParameter)
% value = Parameter_isSetMetaid(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'metaid')
value = ~isempty(SBMLParameter.metaid);
else
error('metaid not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isSetId.m 0000644 0000000 0000000 00000003311 11703262350 027330 0 ustar root root function value = Parameter_isSetId(SBMLParameter)
% value = Parameter_isSetId(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'id')
value = ~isempty(SBMLParameter.id);
else
error('id not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isInAlgebraicRule.m 0000644 0000000 0000000 00000006145 11703262350 031320 0 ustar root root function y = Parameter_isInAlgebraicRule(SBMLParameter, SBMLRules)
% y = Parameter_isInAlgebraicRule(SBMLParameter, SBMLRules)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - an array of the indices of any algebraicRules the id of the Parameter appears in
% - 0 if the Parameter appears in no algebraicRules
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLParameter))
error(sprintf('%s', ...
'argument must be an SBML Parameter structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLParameter);
if (~isSBML_Parameter(SBMLParameter, sbmlLevel, sbmlVersion))
error('Parameter_isInAlgebraicRule(SBMLParameter, SBMLRules)\n%s', ...
'first argument must be an SBMLParameter structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Parameter_isInAlgebraicRule(SBMLParameter, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Parameter_isInAlgebraicRule(SBMLParameter, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the Parameter occurs
%determine the name or id of the Parameter
if (sbmlLevel == 1)
name = SBMLParameter.name;
else
if (isempty(SBMLParameter.id))
name = SBMLParameter.name;
else
name = SBMLParameter.id;
end;
end;
y = [];
for i = 1:NumRules
index = matchName(SBMLRules(i).formula, name);
if (~isempty(index) && strcmp(SBMLRules(i).typecode, 'SBML_ALGEBRAIC_RULE'))
y = [y;i];
end;
end;
if isempty(y)
y = 0;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isAssignedByRule.m 0000644 0000000 0000000 00000006553 11703262350 031213 0 ustar root root function y = Parameter_isAssignedByRule(SBMLParameter, SBMLRules)
% y = Parameter_isAssignedByRule(SBMLParameter, SBMLRules)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the assignmentRule used to assigned value to the Parameter
% - 0 if the Parameter is not assigned by assignmentRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLParameter))
error(sprintf('%s', ...
'argument must be an SBML Parameter structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLParameter);
if (~isSBML_Parameter(SBMLParameter, sbmlLevel, sbmlVersion))
error('Parameter_isAssignedByRule(SBMLParameter, SBMLRules)\n%s', ...
'first argument must be an SBMLParameter structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Parameter_isAssignedByRule(SBMLParameter, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Parameter_isAssignedByRule(SBMLParameter, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the Parameter is assigned by it
%determine the name or id of the Parameter
if (sbmlLevel == 1)
name = SBMLParameter.name;
else
if (isempty(SBMLParameter.id))
name = SBMLParameter.name;
else
name = SBMLParameter.id;
end;
end;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_ASSIGNMENT_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
elseif ((strcmp(SBMLRules(i).typecode, 'SBML_PARAMETER_RULE')) ...
&& (strcmp(SBMLRules(i).type, 'scalar')))
if (strcmp(SBMLRules(i).parameter, name))
y = i;
return;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_isAssignedByRateRule.m0000644 0000000 0000000 00000006553 11703262350 032027 0 ustar root root function y = Parameter_isAssignedByRateRule(SBMLParameter, SBMLRules)
% y = Parameter_isAssignedByRateRule(SBMLParameter, SBMLRules)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the rateRule used to assigned value to the Parameter
% - 0 if the Parameter is not assigned by rateRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLParameter))
error(sprintf('%s', ...
'argument must be an SBML Parameter structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLParameter);
if (~isSBML_Parameter(SBMLParameter, sbmlLevel, sbmlVersion))
error('Parameter_isAssignedByRateRule(SBMLParameter, SBMLRules)\n%s', ...
'first argument must be an SBMLParameter structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Parameter_isAssignedByRateRule(SBMLParameter, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Parameter_isAssignedByRateRule(SBMLParameter, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the Parameter is assigned by it
%determine the name or id of the Parameter
if (sbmlLevel == 1)
name = SBMLParameter.name;
else
if (isempty(SBMLParameter.id))
name = SBMLParameter.name;
else
name = SBMLParameter.id;
end;
end;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_RATE_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
elseif ((strcmp(SBMLRules(i).typecode, 'SBML_PARAMETER_RULE')) ...
&& (strcmp(SBMLRules(i).type, 'rate')))
if (strcmp(SBMLRules(i).parameter, name))
y = i;
return;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_getValue.m 0000644 0000000 0000000 00000003257 11703262350 027551 0 ustar root root function value = Parameter_getValue(SBMLParameter)
% value = Parameter_getValue(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the value of the value attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'value')
value = SBMLParameter.value;
else
error('value not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_getUnits.m 0000644 0000000 0000000 00000003257 11703262350 027577 0 ustar root root function units = Parameter_getUnits(SBMLParameter)
% units = Parameter_getUnits(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the value of the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'units')
units = SBMLParameter.units;
else
error('units not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_getSBOTerm.m 0000644 0000000 0000000 00000003301 11703262350 027736 0 ustar root root function sboTerm = Parameter_getSBOTerm(SBMLParameter)
% sboTerm = Parameter_getSBOTerm(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'sboTerm')
sboTerm = SBMLParameter.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_getName.m 0000644 0000000 0000000 00000003246 11703262350 027353 0 ustar root root function name = Parameter_getName(SBMLParameter)
% name = Parameter_getName(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'name')
name = SBMLParameter.name;
else
error('name not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_getMetaid.m 0000644 0000000 0000000 00000003270 11703262350 027673 0 ustar root root function metaid = Parameter_getMetaid(SBMLParameter)
% metaid = Parameter_getMetaid(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'metaid')
metaid = SBMLParameter.metaid;
else
error('metaid not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_getId.m 0000644 0000000 0000000 00000003224 11703262350 027023 0 ustar root root function id = Parameter_getId(SBMLParameter)
% id = Parameter_getId(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'id')
id = SBMLParameter.id;
else
error('id not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_getConstant.m 0000644 0000000 0000000 00000003312 11703262350 030256 0 ustar root root function constant = Parameter_getConstant(SBMLParameter)
% constant = Parameter_getConstant(SBMLParameter)
%
% Takes
%
% 1. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the value of the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLParameter);
if isfield(SBMLParameter, 'constant')
constant = SBMLParameter.constant;
else
error('constant not an attribute on SBML L%dV%d Parameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Parameter_create.m 0000644 0000000 0000000 00000005364 11703262350 027241 0 ustar root root function Parameter = Parameter_create(varargin)
% Parameter = Parameter_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Parameter structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getParameterFieldnames(level, version);
if (num > 0)
values = getParameterDefaultValues(level, version);
Parameter = cell2struct(values, fieldnames, 2);
%add level and version
Parameter.level = level;
Parameter.version = version;
%check correct structure
if ~isSBML_Parameter(Parameter, level, version)
Parameter = struct();
warning('Warn:BadStruct', 'Failed to create Parameter');
end;
else
Parameter = [];
warning('Warn:InvalidLV', 'Parameter not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Parameter/Contents.m 0000644 0000000 0000000 00000034440 11703262350 025570 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Parameter
%
% The functions allow users to create and work with the SBML Parameter structure.
%
%===================================================================
% Parameter = Parameter_create(level(optional), version(optional) )
%===================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Parameter structure of the appropriate level and version
%
%=================================================
% constant = Parameter_getConstant(SBMLParameter)
%=================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the value of the constant attribute
%
%=====================================
% id = Parameter_getId(SBMLParameter)
%=====================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the value of the id attribute
%
%=============================================
% metaid = Parameter_getMetaid(SBMLParameter)
%=============================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the value of the metaid attribute
%
%=========================================
% name = Parameter_getName(SBMLParameter)
%=========================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the value of the name attribute
%
%===============================================
% sboTerm = Parameter_getSBOTerm(SBMLParameter)
%===============================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the value of the sboTerm attribute
%
%===========================================
% units = Parameter_getUnits(SBMLParameter)
%===========================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the value of the units attribute
%
%===========================================
% value = Parameter_getValue(SBMLParameter)
%===========================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the value of the value attribute
%
%==============================================================
% y = Parameter_isAssignedByRateRule(SBMLParameter, SBMLRules)
%==============================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the rateRule used to assigned value to the Parameter
% - 0 if the Parameter is not assigned by rateRule
%
%
%==========================================================
% y = Parameter_isAssignedByRule(SBMLParameter, SBMLRules)
%==========================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the assignmentRule used to assigned value to the Parameter
% - 0 if the Parameter is not assigned by assignmentRule
%
%
%===========================================================
% y = Parameter_isInAlgebraicRule(SBMLParameter, SBMLRules)
%===========================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - an array of the indices of any algebraicRules the id of the Parameter appears in
% - 0 if the Parameter appears in no algebraicRules
%
%
%==========================================
% value = Parameter_isSetId(SBMLParameter)
%==========================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%==============================================
% value = Parameter_isSetMetaid(SBMLParameter)
%==============================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%============================================
% value = Parameter_isSetName(SBMLParameter)
%============================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%===============================================
% value = Parameter_isSetSBOTerm(SBMLParameter)
%===============================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%=============================================
% value = Parameter_isSetUnits(SBMLParameter)
%=============================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%=============================================
% value = Parameter_isSetValue(SBMLParameter)
%=============================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. value =
% - 1 if the value attribute is set
% - 0 otherwise
%
%================================================================
% SBMLParameter = Parameter_setConstant(SBMLParameter, constant)
%================================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. constant, an integer (0/1) representing the value of constant to be set
% Returns
% 1. the SBML Parameter structure with the new value for the constant attribute
%
%====================================================
% SBMLParameter = Parameter_setId(SBMLParameter, id)
%====================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML Parameter structure with the new value for the id attribute
%
%============================================================
% SBMLParameter = Parameter_setMetaid(SBMLParameter, metaid)
%============================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Parameter structure with the new value for the metaid attribute
%
%========================================================
% SBMLParameter = Parameter_setName(SBMLParameter, name)
%========================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML Parameter structure with the new value for the name attribute
%
%==============================================================
% SBMLParameter = Parameter_setSBOTerm(SBMLParameter, sboTerm)
%==============================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Parameter structure with the new value for the sboTerm attribute
%
%==========================================================
% SBMLParameter = Parameter_setUnits(SBMLParameter, units)
%==========================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. units; a string representing the units to be set
% Returns
% 1. the SBML Parameter structure with the new value for the units attribute
%
%==========================================================
% SBMLParameter = Parameter_setValue(SBMLParameter, value)
%==========================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% 2. value; number representing the value of value to be set
% Returns
% 1. the SBML Parameter structure with the new value for the value attribute
%
%==================================================
% SBMLParameter = Parameter_unsetId(SBMLParameter)
%==================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML Parameter structure with the id attribute unset
%
%======================================================
% SBMLParameter = Parameter_unsetMetaid(SBMLParameter)
%======================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML Parameter structure with the metaid attribute unset
%
%====================================================
% SBMLParameter = Parameter_unsetName(SBMLParameter)
%====================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML Parameter structure with the name attribute unset
%
%=======================================================
% SBMLParameter = Parameter_unsetSBOTerm(SBMLParameter)
%=======================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML Parameter structure with the sboTerm attribute unset
%
%=====================================================
% SBMLParameter = Parameter_unsetUnits(SBMLParameter)
%=====================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML Parameter structure with the units attribute unset
%
%=====================================================
% SBMLParameter = Parameter_unsetValue(SBMLParameter)
%=====================================================
% Takes
% 1. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML Parameter structure with the value attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Object_create.m 0000644 0000000 0000000 00000011432 11703262354 024604 0 ustar root root function SBMLObject = Object_create(typecode, level, version)
% SBMLStructure = Object_create(typecode, level, version)
%
% Takes
%
% 1. typecode; a string representing the type of object being queried
% 2. level; an integer representing an SBML level
% 3. version; an integer representing an SBML version
%
% Returns
%
% 1. an SBML structure representing the given typecode, level and version
%
%
switch (typecode)
case {'SBML_ALGEBRAIC_RULE', 'AlgebraicRule', 'algebraicRule'}
fhandle = str2func('AlgebraicRule_create');
case {'SBML_ASSIGNMENT_RULE', 'AssignmentRule', 'assignmentRule'}
fhandle = str2func('AssignmentRule_create');
case {'SBML_COMPARTMENT', 'Compartment', 'compartment'}
fhandle = str2func('Compartment_create');
case {'SBML_COMPARTMENT_TYPE', 'CompartmentType', 'compartmentType'}
fhandle = str2func('CompartmentType_create');
case {'SBML_COMPARTMENT_VOLUME_RULE', 'CompartmentVolumeRule', 'compartmentVolumeRule'}
fhandle = str2func('CompartmentVolumeRule_create');
case {'SBML_CONSTRAINT', 'Constraint', 'constraint'}
fhandle = str2func('Constraint_create');
case {'SBML_DELAY', 'Delay', 'delay'}
fhandle = str2func('Delay_create');
case {'SBML_EVENT', 'Event', 'event'}
fhandle = str2func('Event_create');
case {'SBML_EVENT_ASSIGNMENT', 'EventAssignment', 'eventAssignment'}
fhandle = str2func('EventAssignment_create');
case {'SBML_FUNCTION_DEFINITION', 'FunctionDefinition', 'functionDefinition'}
fhandle = str2func('FunctionDefinition_create');
case {'SBML_INITIAL_ASSIGNMENT', 'InitialAssignment', 'initialAssignment'}
fhandle = str2func('InitialAssignment_create');
case {'SBML_KINETIC_LAW', 'KineticLaw', 'kineticLaw'}
fhandle = str2func('KineticLaw_create');
case {'SBML_LOCAL_PARAMETER', 'LocalParameter', 'localParameter'}
fhandle = str2func('LocalParameter_create');
case {'SBML_MODEL', 'Model', 'model'}
fhandle = str2func('Model_create');
case {'SBML_MODIFIER_SPECIES_REFERENCE', 'ModifierSpeciesReference', 'modifierSpeciesReference'}
fhandle = str2func('ModifierSpeciesReference_create');
case {'SBML_PARAMETER', 'Parameter', 'parameter'}
fhandle = str2func('Parameter_create');
case {'SBML_PARAMETER_RULE', 'ParameterRule', 'parameterRule'}
fhandle = str2func('ParameterRule_create');
case {'SBML_PRIORITY', 'Priority', 'priority'}
fhandle = str2func('Priority_create');
case {'SBML_RATE_RULE', 'RateRule', 'ruleRule'}
fhandle = str2func('RateRule_create');
case {'SBML_REACTION', 'Reaction', 'reaction'}
fhandle = str2func('Reaction_create');
case {'SBML_SPECIES', 'Species', 'species'}
fhandle = str2func('Species_create');
case {'SBML_SPECIES_CONCENTRATION_RULE', 'SpeciesConcentrationRule', 'speciesConcentrationRule'}
fhandle = str2func('SpeciesConcentrationRule_create');
case {'SBML_SPECIES_REFERENCE', 'SpeciesReference', 'speciesReference'}
fhandle = str2func('SpeciesReference_create');
case {'SBML_SPECIES_TYPE', 'SpeciesType', 'speciesType'}
fhandle = str2func('SpeciesType_create');
case {'SBML_STOICHIOMETRY_MATH', 'StoichiometryMath', 'stoichiometryMath'}
fhandle = str2func('StoichiometryMath_create');
case {'SBML_TRIGGER', 'Trigger', 'trigger'}
fhandle = str2func('Trigger_create');
case {'SBML_UNIT', 'Unit', 'unit'}
fhandle = str2func('Unit_create');
case {'SBML_UNIT_DEFINITION', 'UnitDefinition', 'unitDefinition'}
fhandle = str2func('UnitDefinition_create');
otherwise
error('%s\n%s', ...
'Object_create(typecode, level, version)', ...
'typecode not recognised');
end;
SBMLObject = feval(fhandle, level, version);
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ 0000755 0000000 0000000 00000000000 11704572236 026571 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_unsetSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003650 11703262316 032053 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetSpecies(SBMLModifierSpeciesReference)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetSpecies(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the species attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'species')
SBMLModifierSpeciesReference.species = '';
else
error('species not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003650 11703262316 032053 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetSBOTerm(SBMLModifierSpeciesReference)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetSBOTerm(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'sboTerm')
SBMLModifierSpeciesReference.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000170 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_unsetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003626 11703262316 032056 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetName(SBMLModifierSpeciesReference)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetName(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'name')
SBMLModifierSpeciesReference.name = '';
else
error('name not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000172 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003642 11703262316 032054 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetMetaid(SBMLModifierSpeciesReference)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetMetaid(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'metaid')
SBMLModifierSpeciesReference.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_unsetId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003612 11703262316 032051 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetId(SBMLModifierSpeciesReference)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetId(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'id')
SBMLModifierSpeciesReference.id = '';
else
error('id not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_setSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000004120 11703262316 032044 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_setSpecies(SBMLModifierSpeciesReference, species)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setSpecies(SBMLModifierSpeciesReference, species)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. species; a string representing the species to be set
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the new value for the species attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'species')
if ~ischar(species)
error('species must be character array') ;
else
SBMLModifierSpeciesReference.species = species;
end;
else
error('species not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000004127 11703262316 032053 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_setSBOTerm(SBMLModifierSpeciesReference, sboTerm)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setSBOTerm(SBMLModifierSpeciesReference, sboTerm)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLModifierSpeciesReference.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_setName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000004051 11703262316 032047 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_setName(SBMLModifierSpeciesReference, name)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setName(SBMLModifierSpeciesReference, name)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLModifierSpeciesReference.name = name;
end;
else
error('name not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000170 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_setMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000004103 11703262316 032045 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_setMetaid(SBMLModifierSpeciesReference, metaid)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setMetaid(SBMLModifierSpeciesReference, metaid)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLModifierSpeciesReference.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000164 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_setId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000004017 11703262316 032051 0 ustar root root function SBMLModifierSpeciesReference = ModifierSpeciesReference_setId(SBMLModifierSpeciesReference, id)
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setId(SBMLModifierSpeciesReference, id)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML ModifierSpeciesReference structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLModifierSpeciesReference.id = id;
end;
else
error('id not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_isSetSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003573 11703262316 032057 0 ustar root root function value = ModifierSpeciesReference_isSetSpecies(SBMLModifierSpeciesReference)
% value = ModifierSpeciesReference_isSetSpecies(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the species attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'species')
value = ~isempty(SBMLModifierSpeciesReference.species);
else
error('species not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000173 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003566 11703262316 032061 0 ustar root root function value = ModifierSpeciesReference_isSetSBOTerm(SBMLModifierSpeciesReference)
% value = ModifierSpeciesReference_isSetSBOTerm(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'sboTerm')
value = (SBMLModifierSpeciesReference.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000170 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_isSetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003551 11703262316 032053 0 ustar root root function value = ModifierSpeciesReference_isSetName(SBMLModifierSpeciesReference)
% value = ModifierSpeciesReference_isSetName(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'name')
value = ~isempty(SBMLModifierSpeciesReference.name);
else
error('name not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000172 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003565 11703262316 032060 0 ustar root root function value = ModifierSpeciesReference_isSetMetaid(SBMLModifierSpeciesReference)
% value = ModifierSpeciesReference_isSetMetaid(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'metaid')
value = ~isempty(SBMLModifierSpeciesReference.metaid);
else
error('metaid not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_isSetId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003535 11703262316 032055 0 ustar root root function value = ModifierSpeciesReference_isSetId(SBMLModifierSpeciesReference)
% value = ModifierSpeciesReference_isSetId(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'id')
value = ~isempty(SBMLModifierSpeciesReference.id);
else
error('id not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_getSpecies.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003525 11703262316 032054 0 ustar root root function species = ModifierSpeciesReference_getSpecies(SBMLModifierSpeciesReference)
% species = ModifierSpeciesReference_getSpecies(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the value of the species attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'species')
species = SBMLModifierSpeciesReference.species;
else
error('species not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003525 11703262316 032054 0 ustar root root function sboTerm = ModifierSpeciesReference_getSBOTerm(SBMLModifierSpeciesReference)
% sboTerm = ModifierSpeciesReference_getSBOTerm(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'sboTerm')
sboTerm = SBMLModifierSpeciesReference.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_getName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003472 11703262316 032055 0 ustar root root function name = ModifierSpeciesReference_getName(SBMLModifierSpeciesReference)
% name = ModifierSpeciesReference_getName(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'name')
name = SBMLModifierSpeciesReference.name;
else
error('name not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000170 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_getMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003514 11703262316 032052 0 ustar root root function metaid = ModifierSpeciesReference_getMetaid(SBMLModifierSpeciesReference)
% metaid = ModifierSpeciesReference_getMetaid(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'metaid')
metaid = SBMLModifierSpeciesReference.metaid;
else
error('metaid not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000164 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_getId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000003450 11703262316 032051 0 ustar root root function id = ModifierSpeciesReference_getId(SBMLModifierSpeciesReference)
% id = ModifierSpeciesReference_getId(SBMLModifierSpeciesReference)
%
% Takes
%
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModifierSpeciesReference);
if isfield(SBMLModifierSpeciesReference, 'id')
id = SBMLModifierSpeciesReference.id;
else
error('id not an attribute on SBML L%dV%d ModifierSpeciesReference', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000165 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesReference_create.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/ModifierSpeciesRe0000644 0000000 0000000 00000005742 11703262316 032057 0 ustar root root function ModifierSpeciesReference = ModifierSpeciesReference_create(varargin)
% ModifierSpeciesReference = ModifierSpeciesReference_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML ModifierSpeciesReference structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getModifierSpeciesReferenceFieldnames(level, version);
if (num > 0)
values = getModifierSpeciesReferenceDefaultValues(level, version);
ModifierSpeciesReference = cell2struct(values, fieldnames, 2);
%add level and version
ModifierSpeciesReference.level = level;
ModifierSpeciesReference.version = version;
%check correct structure
if ~isSBML_ModifierSpeciesReference(ModifierSpeciesReference, level, version)
ModifierSpeciesReference = struct();
warning('Warn:BadStruct', 'Failed to create ModifierSpeciesReference');
end;
else
ModifierSpeciesReference = [];
warning('Warn:InvalidLV', 'ModifierSpeciesReference not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/ModifierSpeciesReference/Contents.m 0000644 0000000 0000000 00000025234 11703262316 030544 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\ModifierSpeciesReference
%
% The functions allow users to create and work with the SBML ModifierSpeciesReference structure.
%
%=================================================================================================
% ModifierSpeciesReference = ModifierSpeciesReference_create(level(optional), version(optional) )
%=================================================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML ModifierSpeciesReference structure of the appropriate level and version
%
%===================================================================
% id = ModifierSpeciesReference_getId(SBMLModifierSpeciesReference)
%===================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the value of the id attribute
%
%===========================================================================
% metaid = ModifierSpeciesReference_getMetaid(SBMLModifierSpeciesReference)
%===========================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the value of the metaid attribute
%
%=======================================================================
% name = ModifierSpeciesReference_getName(SBMLModifierSpeciesReference)
%=======================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the value of the name attribute
%
%=============================================================================
% sboTerm = ModifierSpeciesReference_getSBOTerm(SBMLModifierSpeciesReference)
%=============================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the value of the sboTerm attribute
%
%=============================================================================
% species = ModifierSpeciesReference_getSpecies(SBMLModifierSpeciesReference)
%=============================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the value of the species attribute
%
%========================================================================
% value = ModifierSpeciesReference_isSetId(SBMLModifierSpeciesReference)
%========================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%============================================================================
% value = ModifierSpeciesReference_isSetMetaid(SBMLModifierSpeciesReference)
%============================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%==========================================================================
% value = ModifierSpeciesReference_isSetName(SBMLModifierSpeciesReference)
%==========================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%=============================================================================
% value = ModifierSpeciesReference_isSetSBOTerm(SBMLModifierSpeciesReference)
%=============================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%=============================================================================
% value = ModifierSpeciesReference_isSetSpecies(SBMLModifierSpeciesReference)
%=============================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. value =
% - 1 if the species attribute is set
% - 0 otherwise
%
%=================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setId(SBMLModifierSpeciesReference, id)
%=================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML ModifierSpeciesReference structure with the new value for the id attribute
%
%=========================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setMetaid(SBMLModifierSpeciesReference, metaid)
%=========================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML ModifierSpeciesReference structure with the new value for the metaid attribute
%
%=====================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setName(SBMLModifierSpeciesReference, name)
%=====================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML ModifierSpeciesReference structure with the new value for the name attribute
%
%===========================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setSBOTerm(SBMLModifierSpeciesReference, sboTerm)
%===========================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML ModifierSpeciesReference structure with the new value for the sboTerm attribute
%
%===========================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_setSpecies(SBMLModifierSpeciesReference, species)
%===========================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% 2. species; a string representing the species to be set
% Returns
% 1. the SBML ModifierSpeciesReference structure with the new value for the species attribute
%
%===============================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetId(SBMLModifierSpeciesReference)
%===============================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the SBML ModifierSpeciesReference structure with the id attribute unset
%
%===================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetMetaid(SBMLModifierSpeciesReference)
%===================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the SBML ModifierSpeciesReference structure with the metaid attribute unset
%
%=================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetName(SBMLModifierSpeciesReference)
%=================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the SBML ModifierSpeciesReference structure with the name attribute unset
%
%====================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetSBOTerm(SBMLModifierSpeciesReference)
%====================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the SBML ModifierSpeciesReference structure with the sboTerm attribute unset
%
%====================================================================================================
% SBMLModifierSpeciesReference = ModifierSpeciesReference_unsetSpecies(SBMLModifierSpeciesReference)
%====================================================================================================
% Takes
% 1. SBMLModifierSpeciesReference, an SBML ModifierSpeciesReference structure
% Returns
% 1. the SBML ModifierSpeciesReference structure with the species attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/ 0000755 0000000 0000000 00000000000 11704572234 022736 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetVolumeUnits.m 0000644 0000000 0000000 00000003337 11703262276 027614 0 ustar root root function SBMLModel = Model_unsetVolumeUnits(SBMLModel)
% SBMLModel = Model_unsetVolumeUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the volumeUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'volumeUnits')
SBMLModel.volumeUnits = '';
else
error('volumeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetTimeUnits.m 0000644 0000000 0000000 00000003323 11703262300 027222 0 ustar root root function SBMLModel = Model_unsetTimeUnits(SBMLModel)
% SBMLModel = Model_unsetTimeUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the timeUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'timeUnits')
SBMLModel.timeUnits = '';
else
error('timeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetSubstanceUnits.m 0000644 0000000 0000000 00000003361 11703262300 030255 0 ustar root root function SBMLModel = Model_unsetSubstanceUnits(SBMLModel)
% SBMLModel = Model_unsetSubstanceUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the substanceUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'substanceUnits')
SBMLModel.substanceUnits = '';
else
error('substanceUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetSBOTerm.m 0000644 0000000 0000000 00000003307 11703262276 026572 0 ustar root root function SBMLModel = Model_unsetSBOTerm(SBMLModel)
% SBMLModel = Model_unsetSBOTerm(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'sboTerm')
SBMLModel.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetName.m 0000644 0000000 0000000 00000003265 11703262300 026166 0 ustar root root function SBMLModel = Model_unsetName(SBMLModel)
% SBMLModel = Model_unsetName(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'name')
SBMLModel.name = '';
else
error('name not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetMetaid.m 0000644 0000000 0000000 00000003301 11703262276 026514 0 ustar root root function SBMLModel = Model_unsetMetaid(SBMLModel)
% SBMLModel = Model_unsetMetaid(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'metaid')
SBMLModel.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetLengthUnits.m 0000644 0000000 0000000 00000003337 11703262276 027566 0 ustar root root function SBMLModel = Model_unsetLengthUnits(SBMLModel)
% SBMLModel = Model_unsetLengthUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the lengthUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'lengthUnits')
SBMLModel.lengthUnits = '';
else
error('lengthUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetId.m 0000644 0000000 0000000 00000003251 11703262276 025651 0 ustar root root function SBMLModel = Model_unsetId(SBMLModel)
% SBMLModel = Model_unsetId(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'id')
SBMLModel.id = '';
else
error('id not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetExtentUnits.m 0000644 0000000 0000000 00000003337 11703262276 027614 0 ustar root root function SBMLModel = Model_unsetExtentUnits(SBMLModel)
% SBMLModel = Model_unsetExtentUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the extentUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'extentUnits')
SBMLModel.extentUnits = '';
else
error('extentUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetConversionFactor.m 0000644 0000000 0000000 00000003375 11703262276 030610 0 ustar root root function SBMLModel = Model_unsetConversionFactor(SBMLModel)
% SBMLModel = Model_unsetConversionFactor(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the conversionFactor attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'conversionFactor')
SBMLModel.conversionFactor = '';
else
error('conversionFactor not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_unsetAreaUnits.m 0000644 0000000 0000000 00000003323 11703262276 027210 0 ustar root root function SBMLModel = Model_unsetAreaUnits(SBMLModel)
% SBMLModel = Model_unsetAreaUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the areaUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'areaUnits')
SBMLModel.areaUnits = '';
else
error('areaUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setVolumeUnits.m 0000644 0000000 0000000 00000003643 11703262276 027251 0 ustar root root function SBMLModel = Model_setVolumeUnits(SBMLModel, volumeUnits)
% SBMLModel = Model_setVolumeUnits(SBMLModel, volumeUnits)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. volumeUnits; a string representing the volumeUnits to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the volumeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'volumeUnits')
if ~ischar(volumeUnits)
error('volumeUnits must be character array') ;
else
SBMLModel.volumeUnits = volumeUnits;
end;
else
error('volumeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setTimeUnits.m 0000644 0000000 0000000 00000003611 11703262276 026673 0 ustar root root function SBMLModel = Model_setTimeUnits(SBMLModel, timeUnits)
% SBMLModel = Model_setTimeUnits(SBMLModel, timeUnits)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. timeUnits; a string representing the timeUnits to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the timeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'timeUnits')
if ~ischar(timeUnits)
error('timeUnits must be character array') ;
else
SBMLModel.timeUnits = timeUnits;
end;
else
error('timeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setSubstanceUnits.m 0000644 0000000 0000000 00000003712 11703262276 027726 0 ustar root root function SBMLModel = Model_setSubstanceUnits(SBMLModel, substanceUnits)
% SBMLModel = Model_setSubstanceUnits(SBMLModel, substanceUnits)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. substanceUnits; a string representing the substanceUnits to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the substanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'substanceUnits')
if ~ischar(substanceUnits)
error('substanceUnits must be character array') ;
else
SBMLModel.substanceUnits = substanceUnits;
end;
else
error('substanceUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setSBOTerm.m 0000644 0000000 0000000 00000003566 11703262276 026236 0 ustar root root function SBMLModel = Model_setSBOTerm(SBMLModel, sboTerm)
% SBMLModel = Model_setSBOTerm(SBMLModel, sboTerm)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLModel.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setName.m 0000644 0000000 0000000 00000003510 11703262276 025630 0 ustar root root function SBMLModel = Model_setName(SBMLModel, name)
% SBMLModel = Model_setName(SBMLModel, name)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLModel.name = name;
end;
else
error('name not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setMetaid.m 0000644 0000000 0000000 00000003542 11703262276 026160 0 ustar root root function SBMLModel = Model_setMetaid(SBMLModel, metaid)
% SBMLModel = Model_setMetaid(SBMLModel, metaid)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLModel.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setLengthUnits.m 0000644 0000000 0000000 00000003643 11703262276 027223 0 ustar root root function SBMLModel = Model_setLengthUnits(SBMLModel, lengthUnits)
% SBMLModel = Model_setLengthUnits(SBMLModel, lengthUnits)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. lengthUnits; a string representing the lengthUnits to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the lengthUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'lengthUnits')
if ~ischar(lengthUnits)
error('lengthUnits must be character array') ;
else
SBMLModel.lengthUnits = lengthUnits;
end;
else
error('lengthUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setId.m 0000644 0000000 0000000 00000003456 11703262276 025315 0 ustar root root function SBMLModel = Model_setId(SBMLModel, id)
% SBMLModel = Model_setId(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLModel.id = id;
end;
else
error('id not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setExtentUnits.m 0000644 0000000 0000000 00000003643 11703262276 027251 0 ustar root root function SBMLModel = Model_setExtentUnits(SBMLModel, extentUnits)
% SBMLModel = Model_setExtentUnits(SBMLModel, extentUnits)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. extentUnits; a string representing the extentUnits to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the extentUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'extentUnits')
if ~ischar(extentUnits)
error('extentUnits must be character array') ;
else
SBMLModel.extentUnits = extentUnits;
end;
else
error('extentUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setConversionFactor.m 0000644 0000000 0000000 00000003744 11703262276 030245 0 ustar root root function SBMLModel = Model_setConversionFactor(SBMLModel, conversionFactor)
% SBMLModel = Model_setConversionFactor(SBMLModel, conversionFactor)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. conversionFactor; a string representing the conversionFactor to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the conversionFactor attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'conversionFactor')
if ~ischar(conversionFactor)
error('conversionFactor must be character array') ;
else
SBMLModel.conversionFactor = conversionFactor;
end;
else
error('conversionFactor not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_setAreaUnits.m 0000644 0000000 0000000 00000003611 11703262300 026631 0 ustar root root function SBMLModel = Model_setAreaUnits(SBMLModel, areaUnits)
% SBMLModel = Model_setAreaUnits(SBMLModel, areaUnits)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. areaUnits; a string representing the areaUnits to be set
%
% Returns
%
% 1. the SBML Model structure with the new value for the areaUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'areaUnits')
if ~ischar(areaUnits)
error('areaUnits must be character array') ;
else
SBMLModel.areaUnits = areaUnits;
end;
else
error('areaUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetVolumeUnits.m 0000644 0000000 0000000 00000003353 11703262300 027527 0 ustar root root function value = Model_isSetVolumeUnits(SBMLModel)
% value = Model_isSetVolumeUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the volumeUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'volumeUnits')
value = ~isempty(SBMLModel.volumeUnits);
else
error('volumeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetTimeUnits.m 0000644 0000000 0000000 00000003337 11703262300 027160 0 ustar root root function value = Model_isSetTimeUnits(SBMLModel)
% value = Model_isSetTimeUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the timeUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'timeUnits')
value = ~isempty(SBMLModel.timeUnits);
else
error('timeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetSubstanceUnits.m 0000644 0000000 0000000 00000003375 11703262276 030227 0 ustar root root function value = Model_isSetSubstanceUnits(SBMLModel)
% value = Model_isSetSubstanceUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the substanceUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'substanceUnits')
value = ~isempty(SBMLModel.substanceUnits);
else
error('substanceUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetSBOTerm.m 0000644 0000000 0000000 00000003316 11703262276 026523 0 ustar root root function value = Model_isSetSBOTerm(SBMLModel)
% value = Model_isSetSBOTerm(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'sboTerm')
value = (SBMLModel.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetSBML_version.m 0000644 0000000 0000000 00000003366 11703262276 027557 0 ustar root root function value = Model_isSetSBML_version(SBMLModel)
% value = Model_isSetSBML_version(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the sBML_version attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'SBML_version')
value = ~isempty(SBMLModel.SBML_version);
else
error('isSetSBML_version not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetSBML_level.m 0000644 0000000 0000000 00000003352 11703262276 027174 0 ustar root root function value = Model_isSetSBML_level(SBMLModel)
% value = Model_isSetSBML_level(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the sBML_level attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'SBML_level')
value = ~isempty(SBMLModel.SBML_level);
else
error('isSetSBML_level not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetName.m 0000644 0000000 0000000 00000003301 11703262276 026122 0 ustar root root function value = Model_isSetName(SBMLModel)
% value = Model_isSetName(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'name')
value = ~isempty(SBMLModel.name);
else
error('name not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetMetaid.m 0000644 0000000 0000000 00000003315 11703262276 026452 0 ustar root root function value = Model_isSetMetaid(SBMLModel)
% value = Model_isSetMetaid(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'metaid')
value = ~isempty(SBMLModel.metaid);
else
error('metaid not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetLengthUnits.m 0000644 0000000 0000000 00000003353 11703262276 027515 0 ustar root root function value = Model_isSetLengthUnits(SBMLModel)
% value = Model_isSetLengthUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the lengthUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'lengthUnits')
value = ~isempty(SBMLModel.lengthUnits);
else
error('lengthUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetId.m 0000644 0000000 0000000 00000003265 11703262276 025607 0 ustar root root function value = Model_isSetId(SBMLModel)
% value = Model_isSetId(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'id')
value = ~isempty(SBMLModel.id);
else
error('id not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetExtentUnits.m 0000644 0000000 0000000 00000003353 11703262300 027527 0 ustar root root function value = Model_isSetExtentUnits(SBMLModel)
% value = Model_isSetExtentUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the extentUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'extentUnits')
value = ~isempty(SBMLModel.extentUnits);
else
error('extentUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetConversionFactor.m 0000644 0000000 0000000 00000003411 11703262276 030530 0 ustar root root function value = Model_isSetConversionFactor(SBMLModel)
% value = Model_isSetConversionFactor(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the conversionFactor attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'conversionFactor')
value = ~isempty(SBMLModel.conversionFactor);
else
error('conversionFactor not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_isSetAreaUnits.m 0000644 0000000 0000000 00000003337 11703262300 027132 0 ustar root root function value = Model_isSetAreaUnits(SBMLModel)
% value = Model_isSetAreaUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. value =
% - 1 if the areaUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'areaUnits')
value = ~isempty(SBMLModel.areaUnits);
else
error('areaUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getVolumeUnits.m 0000644 0000000 0000000 00000003321 11703262276 027226 0 ustar root root function volumeUnits = Model_getVolumeUnits(SBMLModel)
% volumeUnits = Model_getVolumeUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the volumeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'volumeUnits')
volumeUnits = SBMLModel.volumeUnits;
else
error('volumeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getUnitDefinitionById.m 0000644 0000000 0000000 00000004670 11703262300 030430 0 ustar root root function unitDefinition = Model_getUnitDefinitionById(SBMLModel, id)
% unitDefinition = Model_getUnitDefinitionById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML UnitDefinition structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getUnitDefinitionById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getUnitDefinitionById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getUnitDefinitionById(SBMLModel, id)', 'no id field in a level 1 model'));
end;
unitDefinition = [];
for i = 1:length(SBMLModel.unitDefinition)
if (strcmp(id, SBMLModel.unitDefinition(i).id))
unitDefinition = SBMLModel.unitDefinition(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(unitDefinition) && ~isfield(unitDefinition, 'level')
unitDefinition.level = SBMLModel.SBML_level;
unitDefinition.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getUnitDefinition.m 0000644 0000000 0000000 00000004312 11703262300 027651 0 ustar root root function unitDefinition = Model_getUnitDefinition(SBMLModel, index)
% unitDefinition = Model_getUnitDefinition(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML UnitDefinition structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'unitDefinition')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.unitDefinition)
unitDefinition = SBMLModel.unitDefinition(index);
else
error('index is out of range');
end;
else
error('unitDefinition not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(unitDefinition, 'level')
unitDefinition.level = level;
unitDefinition.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getTimeUnits.m 0000644 0000000 0000000 00000003277 11703262276 026667 0 ustar root root function timeUnits = Model_getTimeUnits(SBMLModel)
% timeUnits = Model_getTimeUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the timeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'timeUnits')
timeUnits = SBMLModel.timeUnits;
else
error('timeUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSubstanceUnits.m 0000644 0000000 0000000 00000003354 11703262276 027714 0 ustar root root function substanceUnits = Model_getSubstanceUnits(SBMLModel)
% substanceUnits = Model_getSubstanceUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the substanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'substanceUnits')
substanceUnits = SBMLModel.substanceUnits;
else
error('substanceUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSpeciesTypeById.m 0000644 0000000 0000000 00000004602 11703262276 027744 0 ustar root root function speciesType = Model_getSpeciesTypeById(SBMLModel, id)
% speciesType = Model_getSpeciesTypeById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML SpeciesType structure
%
% Returns
%
% 1. the SBML SpeciesType structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getSpeciesTypeById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getSpeciesTypeById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level ~= 2)
error(sprintf('%s\n%s', 'Model_getSpeciesTypeById(SBMLModel, id)', 'no id field in a level 1 model'));
end;
speciesType = [];
for i = 1:length(SBMLModel.speciesType)
if (strcmp(id, SBMLModel.speciesType(i).id))
speciesType = SBMLModel.speciesType(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(speciesType) && ~isfield(speciesType, 'level')
speciesType.level = SBMLModel.SBML_level;
speciesType.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSpeciesType.m 0000644 0000000 0000000 00000004240 11703262276 027172 0 ustar root root function speciesType = Model_getSpeciesType(SBMLModel, index)
% speciesType = Model_getSpeciesType(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML SpeciesType structure
%
% Returns
%
% 1. the SBML SpeciesType structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'speciesType')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.speciesType)
speciesType = SBMLModel.speciesType(index);
else
error('index is out of range');
end;
else
error('speciesType not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(speciesType, 'level')
speciesType.level = level;
speciesType.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSpeciesById.m 0000644 0000000 0000000 00000004472 11703262276 027107 0 ustar root root function species = Model_getSpeciesById(SBMLModel, id)
% species = Model_getSpeciesById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Species structure
%
% Returns
%
% 1. the SBML Species structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getSpeciesById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getSpeciesById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getSpeciesById(SBMLModel, id)', 'no id field in a level 1 model'));
end;
species = [];
for i = 1:length(SBMLModel.species)
if (strcmp(id, SBMLModel.species(i).id))
species = SBMLModel.species(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(species) && ~isfield(species, 'level')
species.level = SBMLModel.SBML_level;
species.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSpecies.m 0000644 0000000 0000000 00000004150 11703262300 026314 0 ustar root root function species = Model_getSpecies(SBMLModel, index)
% species = Model_getSpecies(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Species structure
%
% Returns
%
% 1. the SBML Species structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'species')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.species)
species = SBMLModel.species(index);
else
error('index is out of range');
end;
else
error('species not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(species, 'level')
species.level = level;
species.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSBOTerm.m 0000644 0000000 0000000 00000003255 11703262276 026215 0 ustar root root function sboTerm = Model_getSBOTerm(SBMLModel)
% sboTerm = Model_getSBOTerm(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'sboTerm')
sboTerm = SBMLModel.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSBML_version.m 0000644 0000000 0000000 00000003332 11703262300 027224 0 ustar root root function SBML_version = Model_getSBML_version(SBMLModel)
% sBML_version = Model_getSBML_version(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the sBML_version attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'SBML_version')
SBML_version = SBMLModel.SBML_version;
else
error('SBML_version not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getSBML_level.m 0000644 0000000 0000000 00000003310 11703262276 026656 0 ustar root root function SBML_level = Model_getSBML_level(SBMLModel)
% sBML_level = Model_getSBML_level(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the sBML_level attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'SBML_level')
SBML_level = SBMLModel.SBML_level;
else
error('SBML_level not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getRule.m 0000644 0000000 0000000 00000004076 11703262276 025653 0 ustar root root function rule = Model_getRule(SBMLModel, index)
% rule = Model_getRule(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Rule structure
%
% Returns
%
% 1. the SBML Rule structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'rule')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.rule)
rule = SBMLModel.rule(index);
else
error('index is out of range');
end;
else
error('rule not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(rule, 'level')
rule.level = level;
rule.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getReactionById.m 0000644 0000000 0000000 00000004514 11703262300 027241 0 ustar root root function reaction = Model_getReactionById(SBMLModel, id)
% reaction = Model_getReactionById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getReactionById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getReactionById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getReactionById(SBMLModel, id)', 'no id field in a level 1 model'));
end;
reaction = [];
for i = 1:length(SBMLModel.reaction)
if (strcmp(id, SBMLModel.reaction(i).id))
reaction = SBMLModel.reaction(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(reaction) && ~isfield(reaction, 'level')
reaction.level = SBMLModel.SBML_level;
reaction.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getReaction.m 0000644 0000000 0000000 00000004166 11703262300 026474 0 ustar root root function reaction = Model_getReaction(SBMLModel, index)
% reaction = Model_getReaction(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Reaction structure
%
% Returns
%
% 1. the SBML Reaction structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'reaction')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.reaction)
reaction = SBMLModel.reaction(index);
else
error('index is out of range');
end;
else
error('reaction not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(reaction, 'level')
reaction.level = level;
reaction.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getRateRuleByVariable.m 0000644 0000000 0000000 00000004637 11703262300 030417 0 ustar root root function rule = Model_getRateRuleByVariable(SBMLModel, variable)
% rateRule = Model_getRateRuleByVariable(SBMLModel, variable)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. variable; a string representing the variable of SBML RateRule structure
%
% Returns
%
% 1. the SBML RateRule structure that has this variable
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getRateRuleByVariable(SBMLModel, variable)', 'first argument must be an SBML model structure'));
elseif (~ischar(variable))
error(sprintf('%s\n%s', 'Model_getRateRuleByVariable(SBMLModel, variable)', 'second argument must be a string'));
end;
rule = [];
% get level and version
sbmlLevel = SBMLModel.SBML_level;
sbmlVersion = SBMLModel.SBML_version;
for i = 1:length(SBMLModel.rule)
if (isSBML_RateRule(SBMLModel.rule(i), sbmlLevel, sbmlVersion))
if (strcmp(variable, RateRule_getVariable(SBMLModel.rule(i))))
rule = SBMLModel.rule(i);
break;
end;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(rule) && ~isfield(rule, 'level')
rule.level = SBMLModel.SBML_level;
rule.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getParameterById.m 0000644 0000000 0000000 00000004536 11703262276 027435 0 ustar root root function parameter = Model_getParameterById(SBMLModel, id)
% parameter = Model_getParameterById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getParameterById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getParameterById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getParameterById(SBMLModel, id)', 'no id field in a level 1 model'));
end;
parameter = [];
for i = 1:length(SBMLModel.parameter)
if (strcmp(id, SBMLModel.parameter(i).id))
parameter = SBMLModel.parameter(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(parameter) && ~isfield(parameter, 'level')
parameter.level = SBMLModel.SBML_level;
parameter.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getParameter.m 0000644 0000000 0000000 00000004204 11703262276 026655 0 ustar root root function parameter = Model_getParameter(SBMLModel, index)
% parameter = Model_getParameter(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'parameter')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.parameter)
parameter = SBMLModel.parameter(index);
else
error('index is out of range');
end;
else
error('parameter not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(parameter, 'level')
parameter.level = level;
parameter.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumUnitDefinitions.m 0000644 0000000 0000000 00000003361 11703262276 030533 0 ustar root root function num = Model_getNumUnitDefinitions(SBMLModel)
% num = Model_getNumUnitDefinitions(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML UnitDefinition structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'unitDefinition')
num = length(SBMLModel.unitDefinition);
else
error('unitDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumSpeciesTypes.m 0000644 0000000 0000000 00000003337 11703262300 030027 0 ustar root root function num = Model_getNumSpeciesTypes(SBMLModel)
% num = Model_getNumSpeciesTypes(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML SpeciesType structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'speciesType')
num = length(SBMLModel.speciesType);
else
error('speciesType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumSpeciess.m 0000644 0000000 0000000 00000003307 11703262300 027162 0 ustar root root function num = Model_getNumSpeciess(SBMLModel)
% num = Model_getNumSpeciess(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Species structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'species')
num = length(SBMLModel.species);
else
error('species not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumSpecies.m 0000644 0000000 0000000 00000003314 11703262276 027011 0 ustar root root function number = Model_getNumSpecies(SBMLModel)
% num = Model_getNumSpecies(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Species structures present in the Model
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getNumSpecies(SBMLModel)', 'argument must be an SBML model structure'));
end;
number = 0;
if (~isempty(SBMLModel.species))
number = length(SBMLModel.species);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumRules.m 0000644 0000000 0000000 00000003265 11703262300 026501 0 ustar root root function num = Model_getNumRules(SBMLModel)
% num = Model_getNumRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Rule structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'rule')
num = length(SBMLModel.rule);
else
error('rule not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumReactions.m 0000644 0000000 0000000 00000003315 11703262276 027346 0 ustar root root function num = Model_getNumReactions(SBMLModel)
% num = Model_getNumReactions(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Reaction structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'reaction')
num = length(SBMLModel.reaction);
else
error('reaction not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumRateRules.m 0000644 0000000 0000000 00000004453 11703262276 027331 0 ustar root root function y = Model_getNumRateRules(SBMLModel)
% num = Model_getNumRateRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML RateRule structures present in the Model
%
%
y = 0;
%------------------------------------------------------------
% get level
SBMLLevel = SBMLModel.SBML_level;
for i = 1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_RATE_RULE'))
y = y + 1;
elseif(SBMLLevel == 1)
if ((strcmp(SBMLModel.rule(i).typecode, 'SBML_ASSIGNMENT_RULE')) & (strcmp(SBMLModel.rule(i).type, 'rate')))
y = y + 1;
elseif ((strcmp(SBMLModel.rule(i).typecode, 'SBML_SPECIES_CONCENTRATION_RULE')) & (strcmp(SBMLModel.rule(i).type, 'rate')))
y = y + 1;
elseif ((strcmp(SBMLModel.rule(i).typecode, 'SBML_COMPARTMENT_VOLUME_RULE')) & (strcmp(SBMLModel.rule(i).type, 'rate')))
y = y + 1;
elseif ((strcmp(SBMLModel.rule(i).typecode, 'SBML_PARAMETER_RULE')) & (strcmp(SBMLModel.rule(i).type, 'rate')))
y = y + 1;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumParameters.m 0000644 0000000 0000000 00000003323 11703262276 027521 0 ustar root root function num = Model_getNumParameters(SBMLModel)
% num = Model_getNumParameters(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Parameter structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'parameter')
num = length(SBMLModel.parameter);
else
error('parameter not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumInitialAssignments.m 0000644 0000000 0000000 00000003403 11703262300 031206 0 ustar root root function num = Model_getNumInitialAssignments(SBMLModel)
% num = Model_getNumInitialAssignments(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML InitialAssignment structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'initialAssignment')
num = length(SBMLModel.initialAssignment);
else
error('initialAssignment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumFunctionDefinitions.m 0000644 0000000 0000000 00000003411 11703262276 031375 0 ustar root root function num = Model_getNumFunctionDefinitions(SBMLModel)
% num = Model_getNumFunctionDefinitions(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML FunctionDefinition structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'functionDefinition')
num = length(SBMLModel.functionDefinition);
else
error('functionDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumEvents.m 0000644 0000000 0000000 00000003273 11703262276 026666 0 ustar root root function num = Model_getNumEvents(SBMLModel)
% num = Model_getNumEvents(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Event structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'event')
num = length(SBMLModel.event);
else
error('event not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumConstraints.m 0000644 0000000 0000000 00000003331 11703262276 027724 0 ustar root root function num = Model_getNumConstraints(SBMLModel)
% num = Model_getNumConstraints(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Constraint structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'constraint')
num = length(SBMLModel.constraint);
else
error('constraint not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumCompartmentTypes.m 0000644 0000000 0000000 00000003367 11703262276 030744 0 ustar root root function num = Model_getNumCompartmentTypes(SBMLModel)
% num = Model_getNumCompartmentTypes(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML CompartmentType structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartmentType')
num = length(SBMLModel.compartmentType);
else
error('compartmentType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumCompartments.m 0000644 0000000 0000000 00000003337 11703262276 030077 0 ustar root root function num = Model_getNumCompartments(SBMLModel)
% num = Model_getNumCompartments(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML Compartment structures present in the Model
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartment')
num = length(SBMLModel.compartment);
else
error('compartment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumAssignmentRules.m 0000644 0000000 0000000 00000004267 11703262276 030551 0 ustar root root function y = Model_getNumAssignmentRules(SBMLModel)
% num = Model_getNumAssignmentRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML AssignmentRule structures present in the Model
%
%
y = 0;
%------------------------------------------------------------
% get level
SBMLLevel = SBMLModel.SBML_level;
for i = 1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_ASSIGNMENT_RULE'))
y = y + 1;
elseif(SBMLLevel == 1)
if ((strcmp(SBMLModel.rule(i).typecode, 'SBML_SPECIES_CONCENTRATION_RULE')) & (strcmp(SBMLModel.rule(i).type, 'scalar')))
y = y + 1;
elseif ((strcmp(SBMLModel.rule(i).typecode, 'SBML_COMPARTMENT_VOLUME_RULE')) & (strcmp(SBMLModel.rule(i).type, 'scalar')))
y = y + 1;
elseif ((strcmp(SBMLModel.rule(i).typecode, 'SBML_PARAMETER_RULE')) & (strcmp(SBMLModel.rule(i).type, 'scalar')))
y = y + 1;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getNumAlgebraicRules.m 0000644 0000000 0000000 00000003230 11703262276 030277 0 ustar root root function y = Model_getNumAlgebraicRules(SBMLModel)
% num = Model_getNumAlgebraicRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the number of SBML AlgebraicRule structures present in the Model
%
%
y = 0;
%------------------------------------------------------------
for i = 1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_ALGEBRAIC_RULE'))
y = y + 1;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getName.m 0000644 0000000 0000000 00000003222 11703262276 025614 0 ustar root root function name = Model_getName(SBMLModel)
% name = Model_getName(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'name')
name = SBMLModel.name;
else
error('name not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getMetaid.m 0000644 0000000 0000000 00000003244 11703262300 026127 0 ustar root root function metaid = Model_getMetaid(SBMLModel)
% metaid = Model_getMetaid(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'metaid')
metaid = SBMLModel.metaid;
else
error('metaid not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfUnitDefinitions.m 0000644 0000000 0000000 00000003370 11703262300 031160 0 ustar root root function unitDefinition = Model_getListOfUnitDefinitions(SBMLModel)
% unitDefinition = Model_getListOfUnitDefinitions(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the unitDefinition structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'unitDefinition')
unitDefinition = SBMLModel.unitDefinition;
else
error('unitDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfSpeciesTypes.m 0000644 0000000 0000000 00000003335 11703262276 030502 0 ustar root root function speciesType = Model_getListOfSpeciesTypes(SBMLModel)
% speciesType = Model_getListOfSpeciesTypes(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the speciesType structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'speciesType')
speciesType = SBMLModel.speciesType;
else
error('speciesType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfSpeciess.m 0000644 0000000 0000000 00000003271 11703262300 027623 0 ustar root root function species = Model_getListOfSpeciess(SBMLModel)
% species = Model_getListOfSpeciess(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the species structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'species')
species = SBMLModel.species;
else
error('species not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfSpecies.m 0000644 0000000 0000000 00000003204 11703262276 027450 0 ustar root root function species = Model_getListOfSpecies(SBMLModel)
% species = Model_getListOfSpecies(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the species structures
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getListOfSpecies(SBMLModel)', 'argument must be an SBML model structure'));
end;
species = SBMLModel.species;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfRules.m 0000644 0000000 0000000 00000003236 11703262276 027154 0 ustar root root function rule = Model_getListOfRules(SBMLModel)
% rule = Model_getListOfRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the rule structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'rule')
rule = SBMLModel.rule;
else
error('rule not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfReactions.m 0000644 0000000 0000000 00000003302 11703262276 030003 0 ustar root root function reaction = Model_getListOfReactions(SBMLModel)
% reaction = Model_getListOfReactions(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the reaction structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'reaction')
reaction = SBMLModel.reaction;
else
error('reaction not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfRateRules.m 0000644 0000000 0000000 00000003516 11703262300 027755 0 ustar root root function RateRules = Model_getListOfRateRules(SBMLModel)
% rateRule = Model_getListOfRateRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the rateRule structures
%
%
j = 1;
for i = 1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_RATE_RULE'))
RateRules(j) = SBMLModel.rule(i);
j = j + 1;
elseif (SBMLModel.SBML_level == 1)
if (strcmp(SBMLModel.rule(i).type, 'rate'))
RateRules(j) = SBMLModel.rule(i);
j = j + 1;
end;
end;
end;
if (j == 1)
RateRules = '';
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfParameters.m 0000644 0000000 0000000 00000003313 11703262276 030161 0 ustar root root function parameter = Model_getListOfParameters(SBMLModel)
% parameter = Model_getListOfParameters(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the parameter structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'parameter')
parameter = SBMLModel.parameter;
else
error('parameter not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfInitialAssignments.m 0000644 0000000 0000000 00000003423 11703262276 031665 0 ustar root root function initialAssignment = Model_getListOfInitialAssignments(SBMLModel)
% initialAssignment = Model_getListOfInitialAssignments(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the initialAssignment structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'initialAssignment')
initialAssignment = SBMLModel.initialAssignment;
else
error('initialAssignment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfFunctionDefinitions.m0000644 0000000 0000000 00000003434 11703262300 032027 0 ustar root root function functionDefinition = Model_getListOfFunctionDefinitions(SBMLModel)
% functionDefinition = Model_getListOfFunctionDefinitions(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the functionDefinition structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'functionDefinition')
functionDefinition = SBMLModel.functionDefinition;
else
error('functionDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfEvents.m 0000644 0000000 0000000 00000003247 11703262276 027330 0 ustar root root function event = Model_getListOfEvents(SBMLModel)
% event = Model_getListOfEvents(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the event structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'event')
event = SBMLModel.event;
else
error('event not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfConstraints.m 0000644 0000000 0000000 00000003324 11703262276 030367 0 ustar root root function constraint = Model_getListOfConstraints(SBMLModel)
% constraint = Model_getListOfConstraints(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the constraint structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'constraint')
constraint = SBMLModel.constraint;
else
error('constraint not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfCompartmentTypes.m 0000644 0000000 0000000 00000003401 11703262300 031356 0 ustar root root function compartmentType = Model_getListOfCompartmentTypes(SBMLModel)
% compartmentType = Model_getListOfCompartmentTypes(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the compartmentType structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartmentType')
compartmentType = SBMLModel.compartmentType;
else
error('compartmentType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfCompartments.m 0000644 0000000 0000000 00000003335 11703262276 030536 0 ustar root root function compartment = Model_getListOfCompartments(SBMLModel)
% compartment = Model_getListOfCompartments(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the compartment structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartment')
compartment = SBMLModel.compartment;
else
error('compartment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfByTypecode.m 0000644 0000000 0000000 00000006616 11703262276 030136 0 ustar root root function array = Model_getListOfByTypecode(SBMLModel, SBMLTypecode)
% listOf = Model_getListOfByTypecode(SBMLModel, typecode)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. typecode; a string representing the typecode of SBML ListOf structure
%
% Returns
%
% 1. the SBML ListOf structure that has this typecode
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getListOfByTypecode(SBMLModel, SBMLTypecode)', 'first argument must be an SBML model structure'));
elseif (~CheckTypecode(SBMLTypecode))
error(sprintf('%s\n%s', 'Model_getListOfByTypecode(SBMLModel, SBMLTypecode)', 'second argument must be a string representing an SBML typecode'));
end;
switch (SBMLTypecode)
case 'SBML_FUNCTION_DEFINITION'
array = SBMLModel.functionDefinition;
case 'SBML_UNIT_DEFINITION'
array = SBMLModel.unitDefinition;
case 'SBML_COMPARTMENT'
array = SBMLModel.compartment;
case 'SBML_SPECIES'
array = SBMLModel.species;
case 'SBML_PARAMETER'
array = SBMLModel.parameter;
case {'SBML_ASSIGNMENT_RULE', 'SBML_ALGEBRAIC_RULE', 'SBML_RATE_RULE', 'SBML_SPECIES_CONCENTRATION_RULE', 'SBML_COMPARTMENT_VOLUME_RULE', 'SBML_PARAMETER_RULE'}
array = SBMLModel.rule;
case 'SBML_REACTION'
array = SBMLModel.reaction;
case 'SBML_EVENT'
array = SBMLModel.event;
otherwise
array = [];
end;
%------------------------------------------------------------------------------------
function value = CheckTypecode(SBMLTypecode)
%
% CheckTypecode
% takes a string representing an SBMLTypecode
% and returns 1 if it is a valid typecode and 0 otherwise
%
% value = CheckTypecode('SBMLTypecode')
ValidTypecodes = {'SBML_COMPARTMENT', 'SBML_EVENT', 'SBML_FUNCTION_DEFINITION', 'SBML_PARAMETER', 'SBML_REACTION', 'SBML_SPECIES', ...
'SBML_UNIT_DEFINITION', 'SBML_ASSIGNMENT_RULE', 'SBML_ALGEBRAIC_RULE', 'SBML_RATE_RULE', 'SBML_SPECIES_CONCENTRATION_RULE', ...
'SBML_COMPARTMENT_VOLUME_RULE', 'SBML_PARAMETER_RULE'};
value = 1;
if (~ischar(SBMLTypecode))
value = 0;
elseif (~ismember(SBMLTypecode, ValidTypecodes))
value = 0;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfAssignmentRules.m 0000644 0000000 0000000 00000004510 11703262276 031201 0 ustar root root function AssignRules = Model_getListOfAssignmentRules(SBMLModel)
% assignmentRule = Model_getListOfAssignmentRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the assignmentRule structures
%
%
j = 1;
for i = 1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_ASSIGNMENT_RULE'))
AssignRules(j) = SBMLModel.rule(i);
j = j + 1;
elseif (SBMLModel.SBML_level == 1)
if ((strcmp(SBMLModel.rule(i).typecode, 'SBML_SPECIES_CONCENTRATION_RULE')) & (strcmp(SBMLModel.rule(i).type, 'scalar')))
AssignRules(j) = SBMLModel.rule(i);
j = j + 1;
elseif ((strcmp(SBMLModel.rule(i).typecode, 'SBML_COMPARTMENT_VOLUME_RULE')) & (strcmp(SBMLModel.rule(i).type, 'scalar')))
AssignRules(j) = SBMLModel.rule(i);
j = j + 1;
elseif ((strcmp(SBMLModel.rule(i).typecode, 'SBML_PARAMETER_RULE')) & (strcmp(SBMLModel.rule(i).type, 'scalar')))
AssignRules(j) = SBMLModel.rule(i);
j = j + 1;
end;
end;
end;
if (j == 1)
AssignRules = '';
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getListOfAlgebraicRules.m 0000644 0000000 0000000 00000003266 11703262276 030751 0 ustar root root function AlgebraicRules = Model_getListOfAlgebraicRules(SBMLModel)
% algebraicRule = Model_getListOfAlgebraicRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of the algebraicRule structures
%
%
j = 1;
for i = 1:length(SBMLModel.rule)
if (strcmp(SBMLModel.rule(i).typecode, 'SBML_ALGEBRAIC_RULE'))
AlgebraicRules(j) = SBMLModel.rule(i);
j = j + 1;
end;
end;
if (j == 1)
AlgebraicRules = '';
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getLengthUnits.m 0000644 0000000 0000000 00000003321 11703262276 027200 0 ustar root root function lengthUnits = Model_getLengthUnits(SBMLModel)
% lengthUnits = Model_getLengthUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the lengthUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'lengthUnits')
lengthUnits = SBMLModel.lengthUnits;
else
error('lengthUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getInitialAssignmentBySymbol.m0000644 0000000 0000000 00000005212 11703262276 032040 0 ustar root root function initialAssignment = Model_getInitialAssignmentBySymbol(SBMLModel, symbol)
% initialAssignment = Model_getInitialAssignmentBySymbol(SBMLModel, symbol)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. symbol; a string representing the symbol of SBML InitialAssignment structure
%
% Returns
%
% 1. the SBML InitialAssignment structure that has this symbol
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getInitialAssignmentBySymbol(SBMLModel, symbol)', 'first argument must be an SBML model structure'));
elseif (~ischar(symbol))
error(sprintf('%s\n%s', 'Model_getInitialAssignmentBySymbol(SBMLModel, symbol)', 'second argument must be a string'));
elseif ((SBMLModel.SBML_level == 2 && SBMLModel.SBML_version == 1) ...
|| SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getInitialAssignmentBySymbol(SBMLModel, symbol)', ...
'no symbol field in a level 1 or l2v1 model'));
end;
initialAssignment = [];
for i = 1:length(SBMLModel.initialAssignment)
if (strcmp(symbol, SBMLModel.initialAssignment(i).symbol))
initialAssignment = SBMLModel.initialAssignment(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(initialAssignment) && ~isfield(initialAssignment, 'level')
initialAssignment.level = SBMLModel.SBML_level;
initialAssignment.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getInitialAssignment.m 0000644 0000000 0000000 00000004364 11703262300 030352 0 ustar root root function initialAssignment = Model_getInitialAssignment(SBMLModel, index)
% initialAssignment = Model_getInitialAssignment(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML InitialAssignment structure
%
% Returns
%
% 1. the SBML InitialAssignment structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'initialAssignment')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.initialAssignment)
initialAssignment = SBMLModel.initialAssignment(index);
else
error('index is out of range');
end;
else
error('initialAssignment not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(initialAssignment, 'level')
initialAssignment.level = level;
initialAssignment.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getId.m 0000644 0000000 0000000 00000003200 11703262276 025264 0 ustar root root function id = Model_getId(SBMLModel)
% id = Model_getId(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'id')
id = SBMLModel.id;
else
error('id not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getFunctionIds.m 0000644 0000000 0000000 00000003523 11703262300 027151 0 ustar root root function FunctionIds = Model_getFunctionIds(SBMLModel)
% functionIds = Model_getFunctionIds(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the functionIds attribute
%
%
%-------------------------------------------------------------------
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('Model_getFunctionIds(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
FunctionIds = {};
if (SBMLModel.SBML_level == 2)
for i = 1:length(SBMLModel.functionDefinition)
FunctionIds{i} = SBMLModel.functionDefinition(i).id;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getFunctionDefinitionById.m 0000644 0000000 0000000 00000005014 11703262276 031303 0 ustar root root function functionDefinition = Model_getFunctionDefinitionById(SBMLModel, id)
% functionDefinition = Model_getFunctionDefinitionById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML FunctionDefinition structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getFunctionDefinitionById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getFunctionDefinitionById(SBMLModel, id)', 'no function definitions in a level 1 model'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getFunctionDefinitionById(SBMLModel, id)', 'second argument must be a string'));
end;
functionDefinition = [];
for i = 1:length(SBMLModel.functionDefinition)
if (strcmp(id, SBMLModel.functionDefinition(i).id))
functionDefinition = SBMLModel.functionDefinition(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(functionDefinition) && ~isfield(functionDefinition, 'level')
functionDefinition.level = SBMLModel.SBML_level;
functionDefinition.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getFunctionDefinition.m 0000644 0000000 0000000 00000004402 11703262300 030517 0 ustar root root function functionDefinition = Model_getFunctionDefinition(SBMLModel, index)
% functionDefinition = Model_getFunctionDefinition(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML FunctionDefinition structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'functionDefinition')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.functionDefinition)
functionDefinition = SBMLModel.functionDefinition(index);
else
error('index is out of range');
end;
else
error('functionDefinition not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(functionDefinition, 'level')
functionDefinition.level = level;
functionDefinition.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getExtentUnits.m 0000644 0000000 0000000 00000003321 11703262276 027226 0 ustar root root function extentUnits = Model_getExtentUnits(SBMLModel)
% extentUnits = Model_getExtentUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the extentUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'extentUnits')
extentUnits = SBMLModel.extentUnits;
else
error('extentUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getEventById.m 0000644 0000000 0000000 00000004424 11703262300 026556 0 ustar root root function event = Model_getEventById(SBMLModel, id)
% event = Model_getEventById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Event structure
%
% Returns
%
% 1. the SBML Event structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getEventById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getEventById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getEventById(SBMLModel, id)', 'no events in a level 1 model'));
end;
event = [];
for i = 1:length(SBMLModel.event)
if (strcmp(id, SBMLModel.event(i).id))
event = SBMLModel.event(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(event) && ~isfield(event, 'level')
event.level = SBMLModel.SBML_level;
event.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getEvent.m 0000644 0000000 0000000 00000004114 11703262276 026016 0 ustar root root function event = Model_getEvent(SBMLModel, index)
% event = Model_getEvent(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Event structure
%
% Returns
%
% 1. the SBML Event structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'event')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.event)
event = SBMLModel.event(index);
else
error('index is out of range');
end;
else
error('event not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(event, 'level')
event.level = level;
event.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getConversionFactor.m 0000644 0000000 0000000 00000003376 11703262276 030232 0 ustar root root function conversionFactor = Model_getConversionFactor(SBMLModel)
% conversionFactor = Model_getConversionFactor(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the conversionFactor attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'conversionFactor')
conversionFactor = SBMLModel.conversionFactor;
else
error('conversionFactor not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getConstraint.m 0000644 0000000 0000000 00000004222 11703262276 027061 0 ustar root root function constraint = Model_getConstraint(SBMLModel, index)
% constraint = Model_getConstraint(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Constraint structure
%
% Returns
%
% 1. the SBML Constraint structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'constraint')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.constraint)
constraint = SBMLModel.constraint(index);
else
error('index is out of range');
end;
else
error('constraint not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(constraint, 'level')
constraint.level = level;
constraint.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getCompartmentTypeById.m 0000644 0000000 0000000 00000004712 11703262276 030644 0 ustar root root function compartmentType = Model_getCompartmentTypeById(SBMLModel, id)
% compartmentType = Model_getCompartmentTypeById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML CompartmentType structure
%
% Returns
%
% 1. the SBML CompartmentType structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getCompartmentTypeById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getCompartmentTypeById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level ~= 2)
error(sprintf('%s\n%s', 'Model_getCompartmentTypeById(SBMLModel, id)', 'no id field in a level 1 model'));
end;
compartmentType = [];
for i = 1:length(SBMLModel.compartmentType)
if (strcmp(id, SBMLModel.compartmentType(i).id))
compartmentType = SBMLModel.compartmentType(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(compartmentType) && ~isfield(compartmentType, 'level')
compartmentType.level = SBMLModel.SBML_level;
compartmentType.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getCompartmentType.m 0000644 0000000 0000000 00000004330 11703262276 030070 0 ustar root root function compartmentType = Model_getCompartmentType(SBMLModel, index)
% compartmentType = Model_getCompartmentType(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML CompartmentType structure
%
% Returns
%
% 1. the SBML CompartmentType structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartmentType')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.compartmentType)
compartmentType = SBMLModel.compartmentType(index);
else
error('index is out of range');
end;
else
error('compartmentType not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(compartmentType, 'level')
compartmentType.level = level;
compartmentType.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getCompartmentById.m 0000644 0000000 0000000 00000004602 11703262276 030000 0 ustar root root function compartment = Model_getCompartmentById(SBMLModel, id)
% compartment = Model_getCompartmentById(SBMLModel, id)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure that has this id
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getCompartmentById(SBMLModel, id)', 'first argument must be an SBML model structure'));
elseif (~ischar(id))
error(sprintf('%s\n%s', 'Model_getCompartmentById(SBMLModel, id)', 'second argument must be a string'));
elseif (SBMLModel.SBML_level == 1)
error(sprintf('%s\n%s', 'Model_getCompartmentById(SBMLModel, id)', 'no id field in a level 1 model'));
end;
compartment = [];
for i = 1:length(SBMLModel.compartment)
if (strcmp(id, SBMLModel.compartment(i).id))
compartment = SBMLModel.compartment(i);
break;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(compartment) && ~isfield(compartment, 'level')
compartment.level = SBMLModel.SBML_level;
compartment.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getCompartment.m 0000644 0000000 0000000 00000004240 11703262300 027212 0 ustar root root function compartment = Model_getCompartment(SBMLModel, index)
% compartment = Model_getCompartment(SBMLModel, index)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartment')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLModel.compartment)
compartment = SBMLModel.compartment(index);
else
error('index is out of range');
end;
else
error('compartment not an element on SBML L%dV%d Model', level, version);
end;
%if level and version fields are not on returned object add them
if ~isfield(compartment, 'level')
compartment.level = level;
compartment.version = version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getAssignmentRuleByVariable.m 0000644 0000000 0000000 00000004725 11703262276 031646 0 ustar root root function rule = Model_getAssignmentRuleByVariable(SBMLModel, variable)
% assignmentRule = Model_getAssignmentRuleByVariable(SBMLModel, variable)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. variable; a string representing the variable of SBML AssignmentRule structure
%
% Returns
%
% 1. the SBML AssignmentRule structure that has this variable
%
%
% check that input is correct
if (~isValidSBML_Model(SBMLModel))
error(sprintf('%s\n%s', 'Model_getAssignmentRuleByVariable(SBMLModel, variable)', 'first argument must be an SBML model structure'));
elseif (~ischar(variable))
error(sprintf('%s\n%s', 'Model_getAssignmentRuleByVariable(SBMLModel, variable)', 'second argument must be a string'));
end;
rule = [];
% get level and version
sbmlLevel = SBMLModel.SBML_level;
sbmlVersion = SBMLModel.SBML_version;
for i = 1:length(SBMLModel.rule)
if (isSBML_AssignmentRule(SBMLModel.rule(i), sbmlLevel, sbmlVersion))
if (strcmp(variable, AssignmentRule_getVariable(SBMLModel.rule(i))))
rule = SBMLModel.rule(i);
break;
end;
end;
end;
%if level and version fields are not on returned object add them
if ~isempty(rule) && ~isfield(rule, 'level')
rule.level = SBMLModel.SBML_level;
rule.version = SBMLModel.SBML_version;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_getAreaUnits.m 0000644 0000000 0000000 00000003301 11703262276 026625 0 ustar root root function areaUnits = Model_getAreaUnits(SBMLModel)
% areaUnits = Model_getAreaUnits(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the areaUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'areaUnits')
areaUnits = SBMLModel.areaUnits;
else
error('areaUnits not an attribute on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createUnitDefinition.m 0000644 0000000 0000000 00000004040 11703262276 030347 0 ustar root root function SBMLModel = Model_createUnitDefinition(SBMLModel)
% SBMLModel = Model_createUnitDefinition(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML UnitDefinition structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'unitDefinition')
index = length(SBMLModel.unitDefinition);
SBMLUnitDefinition = UnitDefinition_create(level, version);
if index == 0
SBMLModel.unitDefinition = SBMLUnitDefinition;
else
if ~isfield(SBMLModel.unitDefinition(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.unitDefinition(index+1) = SBMLUnitDefinition;
end;
else
error('unitDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createSpeciesType.m 0000644 0000000 0000000 00000003771 11703262276 027666 0 ustar root root function SBMLModel = Model_createSpeciesType(SBMLModel)
% SBMLModel = Model_createSpeciesType(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML SpeciesType structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'speciesType')
index = length(SBMLModel.speciesType);
SBMLSpeciesType = SpeciesType_create(level, version);
if index == 0
SBMLModel.speciesType = SBMLSpeciesType;
else
if ~isfield(SBMLModel.speciesType(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.speciesType(index+1) = SBMLSpeciesType;
end;
else
error('speciesType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createSpecies.m 0000644 0000000 0000000 00000003705 11703262276 027021 0 ustar root root function SBMLModel = Model_createSpecies(SBMLModel)
% SBMLModel = Model_createSpecies(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Species structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'species')
index = length(SBMLModel.species);
SBMLSpecies = Species_create(level, version);
if index == 0
SBMLModel.species = SBMLSpecies;
else
if ~isfield(SBMLModel.species(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.species(index+1) = SBMLSpecies;
end;
else
error('species not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createRule.m 0000644 0000000 0000000 00000003636 11703262276 026340 0 ustar root root function SBMLModel = Model_createRule(SBMLModel)
% SBMLModel = Model_createRule(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Rule structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'rule')
index = length(SBMLModel.rule);
SBMLRule = Rule_create(level, version);
if index == 0
SBMLModel.rule = SBMLRule;
else
if ~isfield(SBMLModel.rule(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.rule(index+1) = SBMLRule;
end;
else
error('rule not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createReaction.m 0000644 0000000 0000000 00000003722 11703262276 027171 0 ustar root root function SBMLModel = Model_createReaction(SBMLModel)
% SBMLModel = Model_createReaction(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Reaction structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'reaction')
index = length(SBMLModel.reaction);
SBMLReaction = Reaction_create(level, version);
if index == 0
SBMLModel.reaction = SBMLReaction;
else
if ~isfield(SBMLModel.reaction(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.reaction(index+1) = SBMLReaction;
end;
else
error('reaction not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createParameter.m 0000644 0000000 0000000 00000003737 11703262300 027337 0 ustar root root function SBMLModel = Model_createParameter(SBMLModel)
% SBMLModel = Model_createParameter(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Parameter structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'parameter')
index = length(SBMLModel.parameter);
SBMLParameter = Parameter_create(level, version);
if index == 0
SBMLModel.parameter = SBMLParameter;
else
if ~isfield(SBMLModel.parameter(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.parameter(index+1) = SBMLParameter;
end;
else
error('parameter not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createInitialAssignment.m 0000644 0000000 0000000 00000004107 11703262300 031031 0 ustar root root function SBMLModel = Model_createInitialAssignment(SBMLModel)
% SBMLModel = Model_createInitialAssignment(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML InitialAssignment structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'initialAssignment')
index = length(SBMLModel.initialAssignment);
SBMLInitialAssignment = InitialAssignment_create(level, version);
if index == 0
SBMLModel.initialAssignment = SBMLInitialAssignment;
else
if ~isfield(SBMLModel.initialAssignment(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.initialAssignment(index+1) = SBMLInitialAssignment;
end;
else
error('initialAssignment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createFunctionDefinition.m 0000644 0000000 0000000 00000004124 11703262276 031220 0 ustar root root function SBMLModel = Model_createFunctionDefinition(SBMLModel)
% SBMLModel = Model_createFunctionDefinition(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML FunctionDefinition structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'functionDefinition')
index = length(SBMLModel.functionDefinition);
SBMLFunctionDefinition = FunctionDefinition_create(level, version);
if index == 0
SBMLModel.functionDefinition = SBMLFunctionDefinition;
else
if ~isfield(SBMLModel.functionDefinition(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.functionDefinition(index+1) = SBMLFunctionDefinition;
end;
else
error('functionDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createEvent.m 0000644 0000000 0000000 00000003653 11703262276 026511 0 ustar root root function SBMLModel = Model_createEvent(SBMLModel)
% SBMLModel = Model_createEvent(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Event structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'event')
index = length(SBMLModel.event);
SBMLEvent = Event_create(level, version);
if index == 0
SBMLModel.event = SBMLEvent;
else
if ~isfield(SBMLModel.event(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.event(index+1) = SBMLEvent;
end;
else
error('event not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createConstraint.m 0000644 0000000 0000000 00000003754 11703262276 027556 0 ustar root root function SBMLModel = Model_createConstraint(SBMLModel)
% SBMLModel = Model_createConstraint(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Constraint structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'constraint')
index = length(SBMLModel.constraint);
SBMLConstraint = Constraint_create(level, version);
if index == 0
SBMLModel.constraint = SBMLConstraint;
else
if ~isfield(SBMLModel.constraint(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.constraint(index+1) = SBMLConstraint;
end;
else
error('constraint not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createCompartmentType.m 0000644 0000000 0000000 00000004055 11703262276 030560 0 ustar root root function SBMLModel = Model_createCompartmentType(SBMLModel)
% SBMLModel = Model_createCompartmentType(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML CompartmentType structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartmentType')
index = length(SBMLModel.compartmentType);
SBMLCompartmentType = CompartmentType_create(level, version);
if index == 0
SBMLModel.compartmentType = SBMLCompartmentType;
else
if ~isfield(SBMLModel.compartmentType(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.compartmentType(index+1) = SBMLCompartmentType;
end;
else
error('compartmentType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_createCompartment.m 0000644 0000000 0000000 00000003771 11703262276 027722 0 ustar root root function SBMLModel = Model_createCompartment(SBMLModel)
% SBMLModel = Model_createCompartment(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Compartment structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
if isfield(SBMLModel, 'compartment')
index = length(SBMLModel.compartment);
SBMLCompartment = Compartment_create(level, version);
if index == 0
SBMLModel.compartment = SBMLCompartment;
else
if ~isfield(SBMLModel.compartment(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.compartment(index+1) = SBMLCompartment;
end;
else
error('compartment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_create.m 0000644 0000000 0000000 00000010651 11703262276 025503 0 ustar root root function Model = Model_create(varargin)
% Model = Model_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Model structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
% note state of the Level version warning
ss = warning('query', 'Warn:InvalidLV');
warnLV = strcmp(ss.state, 'off');
%get fields and values and create the structure
[fieldnames, num] = getModelFieldnames(level, version);
if (num > 0)
values = getModelDefaultValues(level, version);
Model = cell2struct(values, fieldnames, 2);
%add empty substructures
Model.unitDefinition = UnitDefinition_create(level, version);
Model.unitDefinition(1:end) = [];
Model.compartment = Compartment_create(level, version);
Model.compartment(1:end) = [];
Model.species = Species_create(level, version);
Model.species(1:end) = [];
Model.parameter = Parameter_create(level, version);
Model.parameter(1:end) = [];
Model.rule = Rule_create(level, version);
Model.rule(1:end) = [];
Model.reaction = Reaction_create(level, version);
Model.reaction(1:end) = [];
warning('off', 'Warn:InvalidLV');
t = FunctionDefinition_create(level, version);
if ~isempty(t)
Model.functionDefinition = t;
Model.functionDefinition(1:end) = [];
end;
t = Event_create(level, version);
if ~isempty(t)
Model.event = t;
Model.event(1:end) = [];
end;
warning('off', 'Warn:InvalidLV');
t = CompartmentType_create(level, version);
if ~isempty(t)
Model.compartmentType = t;
Model.compartmentType(1:end) = [];
end;
t = SpeciesType_create(level, version);
if ~isempty(t)
Model.speciesType = t;
Model.speciesType(1:end) = [];
end;
t = InitialAssignment_create(level, version);
if ~isempty(t)
Model.initialAssignment = t;
Model.initialAssignment(1:end) = [];
end;
t = Constraint_create(level, version);
if ~isempty(t)
Model.constraint = t;
Model.constraint(1:end) = [];
end;
if warnLV == 0
warning('on', 'Warn:InvalidLV');
else
warning('off', 'Warn:InvalidLV');
end;
if level > 1
Model.time_symbol = '';
Model.delay_symbol = '';
end;
if level > 2
Model.avogadro_symbol = '';
end;
ns = struct('prefix', [], 'uri', []);
Model.namespaces = ns;
Model.namespaces(1:end) = [];
%check correct structure
if ~isValidSBML_Model(Model)
Model = struct();
warning('Warn:BadStruct', 'Failed to create Model');
end;
else
Model = [];
warning('Warn:InvalidLV', 'Model not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addUnitDefinition.m 0000644 0000000 0000000 00000004474 11703262276 027647 0 ustar root root function SBMLModel = Model_addUnitDefinition(SBMLModel, SBMLUnitDefinition)
% SBMLModel = Model_addUnitDefinition(SBMLModel, SBMLUnitDefinition)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLUnitDefinition, an SBML UnitDefinition structure
%
% Returns
%
% 1. the SBML Model structure with the SBML UnitDefinition structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[unitDefinition_level, unitDefinition_version] = GetLevelVersion(SBMLUnitDefinition);
if level ~= unitDefinition_level
error('mismatch in levels');
elseif version ~= unitDefinition_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'unitDefinition')
index = length(SBMLModel.unitDefinition);
if index == 0
SBMLModel.unitDefinition = SBMLUnitDefinition;
else
if ~isfield(SBMLModel.unitDefinition(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.unitDefinition(index+1) = SBMLUnitDefinition;
end;
else
error('unitDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addSpeciesType.m 0000644 0000000 0000000 00000004400 11703262276 027141 0 ustar root root function SBMLModel = Model_addSpeciesType(SBMLModel, SBMLSpeciesType)
% SBMLModel = Model_addSpeciesType(SBMLModel, SBMLSpeciesType)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLSpeciesType, an SBML SpeciesType structure
%
% Returns
%
% 1. the SBML Model structure with the SBML SpeciesType structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[speciesType_level, speciesType_version] = GetLevelVersion(SBMLSpeciesType);
if level ~= speciesType_level
error('mismatch in levels');
elseif version ~= speciesType_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'speciesType')
index = length(SBMLModel.speciesType);
if index == 0
SBMLModel.speciesType = SBMLSpeciesType;
else
if ~isfield(SBMLModel.speciesType(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.speciesType(index+1) = SBMLSpeciesType;
end;
else
error('speciesType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addSpecies.m 0000644 0000000 0000000 00000004260 11703262276 026303 0 ustar root root function SBMLModel = Model_addSpecies(SBMLModel, SBMLSpecies)
% SBMLModel = Model_addSpecies(SBMLModel, SBMLSpecies)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLSpecies, an SBML Species structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Species structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[species_level, species_version] = GetLevelVersion(SBMLSpecies);
if level ~= species_level
error('mismatch in levels');
elseif version ~= species_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'species')
index = length(SBMLModel.species);
if index == 0
SBMLModel.species = SBMLSpecies;
else
if ~isfield(SBMLModel.species(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.species(index+1) = SBMLSpecies;
end;
else
error('species not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addRule.m 0000644 0000000 0000000 00000004164 11703262276 025622 0 ustar root root function SBMLModel = Model_addRule(SBMLModel, SBMLRule)
% SBMLModel = Model_addRule(SBMLModel, SBMLRule)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLRule, an SBML Rule structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Rule structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[rule_level, rule_version] = GetLevelVersion(SBMLRule);
if level ~= rule_level
error('mismatch in levels');
elseif version ~= rule_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'rule')
index = length(SBMLModel.rule);
if index == 0
SBMLModel.rule = SBMLRule;
else
if ~isfield(SBMLModel.rule(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.rule(index+1) = SBMLRule;
end;
else
error('rule not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addReaction.m 0000644 0000000 0000000 00000004304 11703262276 026453 0 ustar root root function SBMLModel = Model_addReaction(SBMLModel, SBMLReaction)
% SBMLModel = Model_addReaction(SBMLModel, SBMLReaction)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Reaction structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[reaction_level, reaction_version] = GetLevelVersion(SBMLReaction);
if level ~= reaction_level
error('mismatch in levels');
elseif version ~= reaction_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'reaction')
index = length(SBMLModel.reaction);
if index == 0
SBMLModel.reaction = SBMLReaction;
else
if ~isfield(SBMLModel.reaction(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.reaction(index+1) = SBMLReaction;
end;
else
error('reaction not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addParameter.m 0000644 0000000 0000000 00000004330 11703262300 026612 0 ustar root root function SBMLModel = Model_addParameter(SBMLModel, SBMLParameter)
% SBMLModel = Model_addParameter(SBMLModel, SBMLParameter)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Parameter structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[parameter_level, parameter_version] = GetLevelVersion(SBMLParameter);
if level ~= parameter_level
error('mismatch in levels');
elseif version ~= parameter_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'parameter')
index = length(SBMLModel.parameter);
if index == 0
SBMLModel.parameter = SBMLParameter;
else
if ~isfield(SBMLModel.parameter(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.parameter(index+1) = SBMLParameter;
end;
else
error('parameter not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addInitialAssignment.m 0000644 0000000 0000000 00000004570 11703262276 030336 0 ustar root root function SBMLModel = Model_addInitialAssignment(SBMLModel, SBMLInitialAssignment)
% SBMLModel = Model_addInitialAssignment(SBMLModel, SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the SBML Model structure with the SBML InitialAssignment structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[initialAssignment_level, initialAssignment_version] = GetLevelVersion(SBMLInitialAssignment);
if level ~= initialAssignment_level
error('mismatch in levels');
elseif version ~= initialAssignment_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'initialAssignment')
index = length(SBMLModel.initialAssignment);
if index == 0
SBMLModel.initialAssignment = SBMLInitialAssignment;
else
if ~isfield(SBMLModel.initialAssignment(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.initialAssignment(index+1) = SBMLInitialAssignment;
end;
else
error('initialAssignment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addFunctionDefinition.m 0000644 0000000 0000000 00000004617 11703262300 030500 0 ustar root root function SBMLModel = Model_addFunctionDefinition(SBMLModel, SBMLFunctionDefinition)
% SBMLModel = Model_addFunctionDefinition(SBMLModel, SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML Model structure with the SBML FunctionDefinition structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[functionDefinition_level, functionDefinition_version] = GetLevelVersion(SBMLFunctionDefinition);
if level ~= functionDefinition_level
error('mismatch in levels');
elseif version ~= functionDefinition_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'functionDefinition')
index = length(SBMLModel.functionDefinition);
if index == 0
SBMLModel.functionDefinition = SBMLFunctionDefinition;
else
if ~isfield(SBMLModel.functionDefinition(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.functionDefinition(index+1) = SBMLFunctionDefinition;
end;
else
error('functionDefinition not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addEvent.m 0000644 0000000 0000000 00000004210 11703262276 025764 0 ustar root root function SBMLModel = Model_addEvent(SBMLModel, SBMLEvent)
% SBMLModel = Model_addEvent(SBMLModel, SBMLEvent)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Event structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[event_level, event_version] = GetLevelVersion(SBMLEvent);
if level ~= event_level
error('mismatch in levels');
elseif version ~= event_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'event')
index = length(SBMLModel.event);
if index == 0
SBMLModel.event = SBMLEvent;
else
if ~isfield(SBMLModel.event(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.event(index+1) = SBMLEvent;
end;
else
error('event not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addConstraint.m 0000644 0000000 0000000 00000004354 11703262276 027040 0 ustar root root function SBMLModel = Model_addConstraint(SBMLModel, SBMLConstraint)
% SBMLModel = Model_addConstraint(SBMLModel, SBMLConstraint)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Constraint structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[constraint_level, constraint_version] = GetLevelVersion(SBMLConstraint);
if level ~= constraint_level
error('mismatch in levels');
elseif version ~= constraint_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'constraint')
index = length(SBMLModel.constraint);
if index == 0
SBMLModel.constraint = SBMLConstraint;
else
if ~isfield(SBMLModel.constraint(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.constraint(index+1) = SBMLConstraint;
end;
else
error('constraint not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addCompartmentType.m 0000644 0000000 0000000 00000004520 11703262276 030042 0 ustar root root function SBMLModel = Model_addCompartmentType(SBMLModel, SBMLCompartmentType)
% SBMLModel = Model_addCompartmentType(SBMLModel, SBMLCompartmentType)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the SBML Model structure with the SBML CompartmentType structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[compartmentType_level, compartmentType_version] = GetLevelVersion(SBMLCompartmentType);
if level ~= compartmentType_level
error('mismatch in levels');
elseif version ~= compartmentType_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'compartmentType')
index = length(SBMLModel.compartmentType);
if index == 0
SBMLModel.compartmentType = SBMLCompartmentType;
else
if ~isfield(SBMLModel.compartmentType(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.compartmentType(index+1) = SBMLCompartmentType;
end;
else
error('compartmentType not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Model_addCompartment.m 0000644 0000000 0000000 00000004400 11703262276 027175 0 ustar root root function SBMLModel = Model_addCompartment(SBMLModel, SBMLCompartment)
% SBMLModel = Model_addCompartment(SBMLModel, SBMLCompartment)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
% 2. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Model structure with the SBML Compartment structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLModel);
[compartment_level, compartment_version] = GetLevelVersion(SBMLCompartment);
if level ~= compartment_level
error('mismatch in levels');
elseif version ~= compartment_version
error('mismatch in versions');
end;
if isfield(SBMLModel, 'compartment')
index = length(SBMLModel.compartment);
if index == 0
SBMLModel.compartment = SBMLCompartment;
else
if ~isfield(SBMLModel.compartment(1), 'level')
SBMLModel = propagateLevelVersion(SBMLModel);
end;
SBMLModel.compartment(index+1) = SBMLCompartment;
end;
else
error('compartment not an element on SBML L%dV%d Model', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Model/Contents.m 0000644 0000000 0000000 00000117632 11703262276 024724 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Model
%
% The functions allow users to create and work with the SBML Model structure.
%
%==============================================================
% SBMLModel = Model_addCompartment(SBMLModel, SBMLCompartment)
%==============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Model structure with the SBML Compartment structure added
%
%======================================================================
% SBMLModel = Model_addCompartmentType(SBMLModel, SBMLCompartmentType)
%======================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the SBML Model structure with the SBML CompartmentType structure added
%
%============================================================
% SBMLModel = Model_addConstraint(SBMLModel, SBMLConstraint)
%============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the SBML Model structure with the SBML Constraint structure added
%
%==================================================
% SBMLModel = Model_addEvent(SBMLModel, SBMLEvent)
%==================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Model structure with the SBML Event structure added
%
%============================================================================
% SBMLModel = Model_addFunctionDefinition(SBMLModel, SBMLFunctionDefinition)
%============================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the SBML Model structure with the SBML FunctionDefinition structure added
%
%==========================================================================
% SBMLModel = Model_addInitialAssignment(SBMLModel, SBMLInitialAssignment)
%==========================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the SBML Model structure with the SBML InitialAssignment structure added
%
%==========================================================
% SBMLModel = Model_addParameter(SBMLModel, SBMLParameter)
%==========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML Model structure with the SBML Parameter structure added
%
%========================================================
% SBMLModel = Model_addReaction(SBMLModel, SBMLReaction)
%========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLReaction, an SBML Reaction structure
% Returns
% 1. the SBML Model structure with the SBML Reaction structure added
%
%================================================
% SBMLModel = Model_addRule(SBMLModel, SBMLRule)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLRule, an SBML Rule structure
% Returns
% 1. the SBML Model structure with the SBML Rule structure added
%
%======================================================
% SBMLModel = Model_addSpecies(SBMLModel, SBMLSpecies)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLSpecies, an SBML Species structure
% Returns
% 1. the SBML Model structure with the SBML Species structure added
%
%==============================================================
% SBMLModel = Model_addSpeciesType(SBMLModel, SBMLSpeciesType)
%==============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLSpeciesType, an SBML SpeciesType structure
% Returns
% 1. the SBML Model structure with the SBML SpeciesType structure added
%
%====================================================================
% SBMLModel = Model_addUnitDefinition(SBMLModel, SBMLUnitDefinition)
%====================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. SBMLUnitDefinition, an SBML UnitDefinition structure
% Returns
% 1. the SBML Model structure with the SBML UnitDefinition structure added
%
%===========================================================
% Model = Model_create(level(optional), version(optional) )
%===========================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Model structure of the appropriate level and version
%
%================================================
% SBMLModel = Model_createCompartment(SBMLModel)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML Compartment structure added
%
%====================================================
% SBMLModel = Model_createCompartmentType(SBMLModel)
%====================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML CompartmentType structure added
%
%===============================================
% SBMLModel = Model_createConstraint(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML Constraint structure added
%
%==========================================
% SBMLModel = Model_createEvent(SBMLModel)
%==========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML Event structure added
%
%=======================================================
% SBMLModel = Model_createFunctionDefinition(SBMLModel)
%=======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML FunctionDefinition structure added
%
%======================================================
% SBMLModel = Model_createInitialAssignment(SBMLModel)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML InitialAssignment structure added
%
%==============================================
% SBMLModel = Model_createParameter(SBMLModel)
%==============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML Parameter structure added
%
%=============================================
% SBMLModel = Model_createReaction(SBMLModel)
%=============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML Reaction structure added
%
%=========================================
% SBMLModel = Model_createRule(SBMLModel)
%=========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML Rule structure added
%
%============================================
% SBMLModel = Model_createSpecies(SBMLModel)
%============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML Species structure added
%
%================================================
% SBMLModel = Model_createSpeciesType(SBMLModel)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML SpeciesType structure added
%
%===================================================
% SBMLModel = Model_createUnitDefinition(SBMLModel)
%===================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the SBML UnitDefinition structure added
%
%===========================================
% areaUnits = Model_getAreaUnits(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the areaUnits attribute
%
%=========================================================================
% assignmentRule = Model_getAssignmentRuleByVariable(SBMLModel, variable)
%=========================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. variable; a string representing the variable of SBML AssignmentRule structure
% Returns
% 1. the SBML AssignmentRule structure that has this variable
%
%======================================================
% compartment = Model_getCompartment(SBMLModel, index)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Compartment structure
% Returns
% 1. the SBML Compartment structure at the indexed position
%
%=======================================================
% compartment = Model_getCompartmentById(SBMLModel, id)
%=======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Compartment structure
% Returns
% 1. the SBML Compartment structure that has this id
%
%==============================================================
% compartmentType = Model_getCompartmentType(SBMLModel, index)
%==============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML CompartmentType structure
% Returns
% 1. the SBML CompartmentType structure at the indexed position
%
%===============================================================
% compartmentType = Model_getCompartmentTypeById(SBMLModel, id)
%===============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML CompartmentType structure
% Returns
% 1. the SBML CompartmentType structure that has this id
%
%====================================================
% constraint = Model_getConstraint(SBMLModel, index)
%====================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Constraint structure
% Returns
% 1. the SBML Constraint structure at the indexed position
%
%=========================================================
% conversionFactor = Model_getConversionFactor(SBMLModel)
%=========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the conversionFactor attribute
%
%==========================================
% event = Model_getEvent(SBMLModel, index)
%==========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Event structure
% Returns
% 1. the SBML Event structure at the indexed position
%
%===========================================
% event = Model_getEventById(SBMLModel, id)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Event structure
% Returns
% 1. the SBML Event structure that has this id
%
%===============================================
% extentUnits = Model_getExtentUnits(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the extentUnits attribute
%
%====================================================================
% functionDefinition = Model_getFunctionDefinition(SBMLModel, index)
%====================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML FunctionDefinition structure
% Returns
% 1. the SBML FunctionDefinition structure at the indexed position
%
%=====================================================================
% functionDefinition = Model_getFunctionDefinitionById(SBMLModel, id)
%=====================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML FunctionDefinition structure
% Returns
% 1. the SBML FunctionDefinition structure that has this id
%
%===============================================
% functionIds = Model_getFunctionIds(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the functionIds attribute
%
%=============================
% id = Model_getId(SBMLModel)
%=============================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the id attribute
%
%==================================================================
% initialAssignment = Model_getInitialAssignment(SBMLModel, index)
%==================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML InitialAssignment structure
% Returns
% 1. the SBML InitialAssignment structure at the indexed position
%
%===========================================================================
% initialAssignment = Model_getInitialAssignmentBySymbol(SBMLModel, symbol)
%===========================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. symbol; a string representing the symbol of SBML InitialAssignment structure
% Returns
% 1. the SBML InitialAssignment structure that has this symbol
%
%===============================================
% lengthUnits = Model_getLengthUnits(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the lengthUnits attribute
%
%==========================================================
% algebraicRule = Model_getListOfAlgebraicRules(SBMLModel)
%==========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the algebraicRule structures
%
%============================================================
% assignmentRule = Model_getListOfAssignmentRules(SBMLModel)
%============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the assignmentRule structures
%
%=========================================================
% listOf = Model_getListOfByTypecode(SBMLModel, typecode)
%=========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. typecode; a string representing the typecode of SBML ListOf structure
% Returns
% 1. the SBML ListOf structure that has this typecode
%
%==============================================================
% compartmentType = Model_getListOfCompartmentTypes(SBMLModel)
%==============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the compartmentType structures
%
%======================================================
% compartment = Model_getListOfCompartments(SBMLModel)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the compartment structures
%
%====================================================
% constraint = Model_getListOfConstraints(SBMLModel)
%====================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the constraint structures
%
%==========================================
% event = Model_getListOfEvents(SBMLModel)
%==========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the event structures
%
%====================================================================
% functionDefinition = Model_getListOfFunctionDefinitions(SBMLModel)
%====================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the functionDefinition structures
%
%==================================================================
% initialAssignment = Model_getListOfInitialAssignments(SBMLModel)
%==================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the initialAssignment structures
%
%==================================================
% parameter = Model_getListOfParameters(SBMLModel)
%==================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the parameter structures
%
%================================================
% rateRule = Model_getListOfRateRules(SBMLModel)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the rateRule structures
%
%================================================
% reaction = Model_getListOfReactions(SBMLModel)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the reaction structures
%
%========================================
% rule = Model_getListOfRules(SBMLModel)
%========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the rule structures
%
%=============================================
% species = Model_getListOfSpecies(SBMLModel)
%=============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the species structures
%
%======================================================
% speciesType = Model_getListOfSpeciesTypes(SBMLModel)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the speciesType structures
%
%==============================================
% species = Model_getListOfSpeciess(SBMLModel)
%==============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the species structures
%
%============================================================
% unitDefinition = Model_getListOfUnitDefinitions(SBMLModel)
%============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. an array of the unitDefinition structures
%
%=====================================
% metaid = Model_getMetaid(SBMLModel)
%=====================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the metaid attribute
%
%=================================
% name = Model_getName(SBMLModel)
%=================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the name attribute
%
%=============================================
% num = Model_getNumAlgebraicRules(SBMLModel)
%=============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML AlgebraicRule structures present in the Model
%
%==============================================
% num = Model_getNumAssignmentRules(SBMLModel)
%==============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML AssignmentRule structures present in the Model
%
%===============================================
% num = Model_getNumCompartmentTypes(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML CompartmentType structures present in the Model
%
%===========================================
% num = Model_getNumCompartments(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Compartment structures present in the Model
%
%==========================================
% num = Model_getNumConstraints(SBMLModel)
%==========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Constraint structures present in the Model
%
%=====================================
% num = Model_getNumEvents(SBMLModel)
%=====================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Event structures present in the Model
%
%==================================================
% num = Model_getNumFunctionDefinitions(SBMLModel)
%==================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML FunctionDefinition structures present in the Model
%
%=================================================
% num = Model_getNumInitialAssignments(SBMLModel)
%=================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML InitialAssignment structures present in the Model
%
%=========================================
% num = Model_getNumParameters(SBMLModel)
%=========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Parameter structures present in the Model
%
%========================================
% num = Model_getNumRateRules(SBMLModel)
%========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML RateRule structures present in the Model
%
%========================================
% num = Model_getNumReactions(SBMLModel)
%========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Reaction structures present in the Model
%
%====================================
% num = Model_getNumRules(SBMLModel)
%====================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Rule structures present in the Model
%
%======================================
% num = Model_getNumSpecies(SBMLModel)
%======================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Species structures present in the Model
%
%===========================================
% num = Model_getNumSpeciesTypes(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML SpeciesType structures present in the Model
%
%=======================================
% num = Model_getNumSpeciess(SBMLModel)
%=======================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML Species structures present in the Model
%
%==============================================
% num = Model_getNumUnitDefinitions(SBMLModel)
%==============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the number of SBML UnitDefinition structures present in the Model
%
%==================================================
% parameter = Model_getParameter(SBMLModel, index)
%==================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Parameter structure
% Returns
% 1. the SBML Parameter structure at the indexed position
%
%===================================================
% parameter = Model_getParameterById(SBMLModel, id)
%===================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Parameter structure
% Returns
% 1. the SBML Parameter structure that has this id
%
%=============================================================
% rateRule = Model_getRateRuleByVariable(SBMLModel, variable)
%=============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. variable; a string representing the variable of SBML RateRule structure
% Returns
% 1. the SBML RateRule structure that has this variable
%
%================================================
% reaction = Model_getReaction(SBMLModel, index)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Reaction structure
% Returns
% 1. the SBML Reaction structure at the indexed position
%
%=================================================
% reaction = Model_getReactionById(SBMLModel, id)
%=================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Reaction structure
% Returns
% 1. the SBML Reaction structure that has this id
%
%========================================
% rule = Model_getRule(SBMLModel, index)
%========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Rule structure
% Returns
% 1. the SBML Rule structure at the indexed position
%
%=============================================
% sBML_level = Model_getSBML_level(SBMLModel)
%=============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the sBML_level attribute
%
%=================================================
% sBML_version = Model_getSBML_version(SBMLModel)
%=================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the sBML_version attribute
%
%=======================================
% sboTerm = Model_getSBOTerm(SBMLModel)
%=======================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the sboTerm attribute
%
%==============================================
% species = Model_getSpecies(SBMLModel, index)
%==============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML Species structure
% Returns
% 1. the SBML Species structure at the indexed position
%
%===============================================
% species = Model_getSpeciesById(SBMLModel, id)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML Species structure
% Returns
% 1. the SBML Species structure that has this id
%
%======================================================
% speciesType = Model_getSpeciesType(SBMLModel, index)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML SpeciesType structure
% Returns
% 1. the SBML SpeciesType structure at the indexed position
%
%=======================================================
% speciesType = Model_getSpeciesTypeById(SBMLModel, id)
%=======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML SpeciesType structure
% Returns
% 1. the SBML SpeciesType structure that has this id
%
%=====================================================
% substanceUnits = Model_getSubstanceUnits(SBMLModel)
%=====================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the substanceUnits attribute
%
%===========================================
% timeUnits = Model_getTimeUnits(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the timeUnits attribute
%
%============================================================
% unitDefinition = Model_getUnitDefinition(SBMLModel, index)
%============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. index, an integer representing the index of SBML UnitDefinition structure
% Returns
% 1. the SBML UnitDefinition structure at the indexed position
%
%=============================================================
% unitDefinition = Model_getUnitDefinitionById(SBMLModel, id)
%=============================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id of SBML UnitDefinition structure
% Returns
% 1. the SBML UnitDefinition structure that has this id
%
%===============================================
% volumeUnits = Model_getVolumeUnits(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the volumeUnits attribute
%
%=========================================
% value = Model_isSetAreaUnits(SBMLModel)
%=========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the areaUnits attribute is set
% - 0 otherwise
%
%================================================
% value = Model_isSetConversionFactor(SBMLModel)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the conversionFactor attribute is set
% - 0 otherwise
%
%===========================================
% value = Model_isSetExtentUnits(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the extentUnits attribute is set
% - 0 otherwise
%
%==================================
% value = Model_isSetId(SBMLModel)
%==================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%===========================================
% value = Model_isSetLengthUnits(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the lengthUnits attribute is set
% - 0 otherwise
%
%======================================
% value = Model_isSetMetaid(SBMLModel)
%======================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%====================================
% value = Model_isSetName(SBMLModel)
%====================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%==========================================
% value = Model_isSetSBML_level(SBMLModel)
%==========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the sBML_level attribute is set
% - 0 otherwise
%
%============================================
% value = Model_isSetSBML_version(SBMLModel)
%============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the sBML_version attribute is set
% - 0 otherwise
%
%=======================================
% value = Model_isSetSBOTerm(SBMLModel)
%=======================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==============================================
% value = Model_isSetSubstanceUnits(SBMLModel)
%==============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the substanceUnits attribute is set
% - 0 otherwise
%
%=========================================
% value = Model_isSetTimeUnits(SBMLModel)
%=========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the timeUnits attribute is set
% - 0 otherwise
%
%===========================================
% value = Model_isSetVolumeUnits(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. value =
% - 1 if the volumeUnits attribute is set
% - 0 otherwise
%
%======================================================
% SBMLModel = Model_setAreaUnits(SBMLModel, areaUnits)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. areaUnits; a string representing the areaUnits to be set
% Returns
% 1. the SBML Model structure with the new value for the areaUnits attribute
%
%====================================================================
% SBMLModel = Model_setConversionFactor(SBMLModel, conversionFactor)
%====================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. conversionFactor; a string representing the conversionFactor to be set
% Returns
% 1. the SBML Model structure with the new value for the conversionFactor attribute
%
%==========================================================
% SBMLModel = Model_setExtentUnits(SBMLModel, extentUnits)
%==========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. extentUnits; a string representing the extentUnits to be set
% Returns
% 1. the SBML Model structure with the new value for the extentUnits attribute
%
%========================================
% SBMLModel = Model_setId(SBMLModel, id)
%========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML Model structure with the new value for the id attribute
%
%==========================================================
% SBMLModel = Model_setLengthUnits(SBMLModel, lengthUnits)
%==========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. lengthUnits; a string representing the lengthUnits to be set
% Returns
% 1. the SBML Model structure with the new value for the lengthUnits attribute
%
%================================================
% SBMLModel = Model_setMetaid(SBMLModel, metaid)
%================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Model structure with the new value for the metaid attribute
%
%============================================
% SBMLModel = Model_setName(SBMLModel, name)
%============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML Model structure with the new value for the name attribute
%
%==================================================
% SBMLModel = Model_setSBOTerm(SBMLModel, sboTerm)
%==================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Model structure with the new value for the sboTerm attribute
%
%================================================================
% SBMLModel = Model_setSubstanceUnits(SBMLModel, substanceUnits)
%================================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. substanceUnits; a string representing the substanceUnits to be set
% Returns
% 1. the SBML Model structure with the new value for the substanceUnits attribute
%
%======================================================
% SBMLModel = Model_setTimeUnits(SBMLModel, timeUnits)
%======================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. timeUnits; a string representing the timeUnits to be set
% Returns
% 1. the SBML Model structure with the new value for the timeUnits attribute
%
%==========================================================
% SBMLModel = Model_setVolumeUnits(SBMLModel, volumeUnits)
%==========================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% 2. volumeUnits; a string representing the volumeUnits to be set
% Returns
% 1. the SBML Model structure with the new value for the volumeUnits attribute
%
%=============================================
% SBMLModel = Model_unsetAreaUnits(SBMLModel)
%=============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the areaUnits attribute unset
%
%====================================================
% SBMLModel = Model_unsetConversionFactor(SBMLModel)
%====================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the conversionFactor attribute unset
%
%===============================================
% SBMLModel = Model_unsetExtentUnits(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the extentUnits attribute unset
%
%======================================
% SBMLModel = Model_unsetId(SBMLModel)
%======================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the id attribute unset
%
%===============================================
% SBMLModel = Model_unsetLengthUnits(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the lengthUnits attribute unset
%
%==========================================
% SBMLModel = Model_unsetMetaid(SBMLModel)
%==========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the metaid attribute unset
%
%========================================
% SBMLModel = Model_unsetName(SBMLModel)
%========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the name attribute unset
%
%===========================================
% SBMLModel = Model_unsetSBOTerm(SBMLModel)
%===========================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the sboTerm attribute unset
%
%==================================================
% SBMLModel = Model_unsetSubstanceUnits(SBMLModel)
%==================================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the substanceUnits attribute unset
%
%=============================================
% SBMLModel = Model_unsetTimeUnits(SBMLModel)
%=============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the timeUnits attribute unset
%
%===============================================
% SBMLModel = Model_unsetVolumeUnits(SBMLModel)
%===============================================
% Takes
% 1. SBMLModel, an SBML Model structure
% Returns
% 1. the SBML Model structure with the volumeUnits attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/ 0000755 0000000 0000000 00000000000 11704572250 024567 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetValue.m0000644 0000000 0000000 00000003500 11703262354 032051 0 ustar root root function SBMLLocalParameter = LocalParameter_unsetValue(SBMLLocalParameter)
% SBMLLocalParameter = LocalParameter_unsetValue(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the SBML LocalParameter structure with the value attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'value')
SBMLLocalParameter.value = NaN;
SBMLLocalParameter.isSetValue = 0;
else
error('value not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetUnits.m0000644 0000000 0000000 00000003432 11703262354 032103 0 ustar root root function SBMLLocalParameter = LocalParameter_unsetUnits(SBMLLocalParameter)
% SBMLLocalParameter = LocalParameter_unsetUnits(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the SBML LocalParameter structure with the units attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'units')
SBMLLocalParameter.units = '';
else
error('units not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetSBOTerm0000644 0000000 0000000 00000003446 11703262354 032026 0 ustar root root function SBMLLocalParameter = LocalParameter_unsetSBOTerm(SBMLLocalParameter)
% SBMLLocalParameter = LocalParameter_unsetSBOTerm(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the SBML LocalParameter structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'sboTerm')
SBMLLocalParameter.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetName.m 0000644 0000000 0000000 00000003424 11703262354 031662 0 ustar root root function SBMLLocalParameter = LocalParameter_unsetName(SBMLLocalParameter)
% SBMLLocalParameter = LocalParameter_unsetName(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the SBML LocalParameter structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'name')
SBMLLocalParameter.name = '';
else
error('name not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetMetaid.0000644 0000000 0000000 00000003440 11703262354 032026 0 ustar root root function SBMLLocalParameter = LocalParameter_unsetMetaid(SBMLLocalParameter)
% SBMLLocalParameter = LocalParameter_unsetMetaid(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the SBML LocalParameter structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'metaid')
SBMLLocalParameter.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_unsetId.m 0000644 0000000 0000000 00000003410 11703262354 031331 0 ustar root root function SBMLLocalParameter = LocalParameter_unsetId(SBMLLocalParameter)
% SBMLLocalParameter = LocalParameter_unsetId(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the SBML LocalParameter structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'id')
SBMLLocalParameter.id = '';
else
error('id not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_setValue.m 0000644 0000000 0000000 00000003735 11703262354 031520 0 ustar root root function SBMLLocalParameter = LocalParameter_setValue(SBMLLocalParameter, value)
% SBMLLocalParameter = LocalParameter_setValue(SBMLLocalParameter, value)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. value; number representing the value of value to be set
%
% Returns
%
% 1. the SBML LocalParameter structure with the new value for the value attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'value')
if ~isnumeric(value)
error('value must be numeric') ;
else
SBMLLocalParameter.value = value;
SBMLLocalParameter.isSetValue = 1;
end;
else
error('value not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_setUnits.m 0000644 0000000 0000000 00000003664 11703262354 031547 0 ustar root root function SBMLLocalParameter = LocalParameter_setUnits(SBMLLocalParameter, units)
% SBMLLocalParameter = LocalParameter_setUnits(SBMLLocalParameter, units)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. units; a string representing the units to be set
%
% Returns
%
% 1. the SBML LocalParameter structure with the new value for the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'units')
if ~ischar(units)
error('units must be character array') ;
else
SBMLLocalParameter.units = units;
end;
else
error('units not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_setSBOTerm.m0000644 0000000 0000000 00000003725 11703262354 031716 0 ustar root root function SBMLLocalParameter = LocalParameter_setSBOTerm(SBMLLocalParameter, sboTerm)
% SBMLLocalParameter = LocalParameter_setSBOTerm(SBMLLocalParameter, sboTerm)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML LocalParameter structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLLocalParameter.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_setName.m 0000644 0000000 0000000 00000003647 11703262354 031326 0 ustar root root function SBMLLocalParameter = LocalParameter_setName(SBMLLocalParameter, name)
% SBMLLocalParameter = LocalParameter_setName(SBMLLocalParameter, name)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML LocalParameter structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLLocalParameter.name = name;
end;
else
error('name not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_setMetaid.m 0000644 0000000 0000000 00000003701 11703262354 031640 0 ustar root root function SBMLLocalParameter = LocalParameter_setMetaid(SBMLLocalParameter, metaid)
% SBMLLocalParameter = LocalParameter_setMetaid(SBMLLocalParameter, metaid)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML LocalParameter structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLLocalParameter.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_setId.m 0000644 0000000 0000000 00000003615 11703262354 030775 0 ustar root root function SBMLLocalParameter = LocalParameter_setId(SBMLLocalParameter, id)
% SBMLLocalParameter = LocalParameter_setId(SBMLLocalParameter, id)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML LocalParameter structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLLocalParameter.id = id;
end;
else
error('id not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetValue.m0000644 0000000 0000000 00000003413 11703262354 032005 0 ustar root root function value = LocalParameter_isSetValue(SBMLLocalParameter)
% value = LocalParameter_isSetValue(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. value =
% - 1 if the value attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'value')
value = SBMLLocalParameter.isSetValue;
else
error('isSetValue not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetUnits.m0000644 0000000 0000000 00000003413 11703262354 032033 0 ustar root root function value = LocalParameter_isSetUnits(SBMLLocalParameter)
% value = LocalParameter_isSetUnits(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'units')
value = ~isempty(SBMLLocalParameter.units);
else
error('units not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetSBOTerm0000644 0000000 0000000 00000003422 11703262354 031751 0 ustar root root function value = LocalParameter_isSetSBOTerm(SBMLLocalParameter)
% value = LocalParameter_isSetSBOTerm(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'sboTerm')
value = (SBMLLocalParameter.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetName.m 0000644 0000000 0000000 00000003405 11703262354 031612 0 ustar root root function value = LocalParameter_isSetName(SBMLLocalParameter)
% value = LocalParameter_isSetName(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'name')
value = ~isempty(SBMLLocalParameter.name);
else
error('name not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetMetaid.0000644 0000000 0000000 00000003421 11703262354 031756 0 ustar root root function value = LocalParameter_isSetMetaid(SBMLLocalParameter)
% value = LocalParameter_isSetMetaid(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'metaid')
value = ~isempty(SBMLLocalParameter.metaid);
else
error('metaid not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_isSetId.m 0000644 0000000 0000000 00000003371 11703262354 031270 0 ustar root root function value = LocalParameter_isSetId(SBMLLocalParameter)
% value = LocalParameter_isSetId(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'id')
value = ~isempty(SBMLLocalParameter.id);
else
error('id not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_getValue.m 0000644 0000000 0000000 00000003337 11703262354 031502 0 ustar root root function value = LocalParameter_getValue(SBMLLocalParameter)
% value = LocalParameter_getValue(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the value of the value attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'value')
value = SBMLLocalParameter.value;
else
error('value not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_getUnits.m 0000644 0000000 0000000 00000003337 11703262354 031530 0 ustar root root function units = LocalParameter_getUnits(SBMLLocalParameter)
% units = LocalParameter_getUnits(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the value of the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'units')
units = SBMLLocalParameter.units;
else
error('units not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_getSBOTerm.m0000644 0000000 0000000 00000003361 11703262354 031676 0 ustar root root function sboTerm = LocalParameter_getSBOTerm(SBMLLocalParameter)
% sboTerm = LocalParameter_getSBOTerm(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'sboTerm')
sboTerm = SBMLLocalParameter.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_getName.m 0000644 0000000 0000000 00000003326 11703262354 031304 0 ustar root root function name = LocalParameter_getName(SBMLLocalParameter)
% name = LocalParameter_getName(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'name')
name = SBMLLocalParameter.name;
else
error('name not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_getMetaid.m 0000644 0000000 0000000 00000003350 11703262354 031624 0 ustar root root function metaid = LocalParameter_getMetaid(SBMLLocalParameter)
% metaid = LocalParameter_getMetaid(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'metaid')
metaid = SBMLLocalParameter.metaid;
else
error('metaid not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_getId.m 0000644 0000000 0000000 00000003304 11703262354 030754 0 ustar root root function id = LocalParameter_getId(SBMLLocalParameter)
% id = LocalParameter_getId(SBMLLocalParameter)
%
% Takes
%
% 1. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLLocalParameter);
if isfield(SBMLLocalParameter, 'id')
id = SBMLLocalParameter.id;
else
error('id not an attribute on SBML L%dV%d LocalParameter', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/LocalParameter_create.m 0000644 0000000 0000000 00000005502 11703262354 031165 0 ustar root root function LocalParameter = LocalParameter_create(varargin)
% LocalParameter = LocalParameter_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML LocalParameter structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getLocalParameterFieldnames(level, version);
if (num > 0)
values = getLocalParameterDefaultValues(level, version);
LocalParameter = cell2struct(values, fieldnames, 2);
%add level and version
LocalParameter.level = level;
LocalParameter.version = version;
%check correct structure
if ~isSBML_LocalParameter(LocalParameter, level, version)
LocalParameter = struct();
warning('Warn:BadStruct', 'Failed to create LocalParameter');
end;
else
LocalParameter = [];
warning('Warn:InvalidLV', 'LocalParameter not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/LocalParameter/Contents.m 0000644 0000000 0000000 00000023670 11703262354 026552 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\LocalParameter
%
% The functions allow users to create and work with the SBML LocalParameter structure.
%
%=============================================================================
% LocalParameter = LocalParameter_create(level(optional), version(optional) )
%=============================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML LocalParameter structure of the appropriate level and version
%
%===============================================
% id = LocalParameter_getId(SBMLLocalParameter)
%===============================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the value of the id attribute
%
%=======================================================
% metaid = LocalParameter_getMetaid(SBMLLocalParameter)
%=======================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the value of the metaid attribute
%
%===================================================
% name = LocalParameter_getName(SBMLLocalParameter)
%===================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the value of the name attribute
%
%=========================================================
% sboTerm = LocalParameter_getSBOTerm(SBMLLocalParameter)
%=========================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the value of the sboTerm attribute
%
%=====================================================
% units = LocalParameter_getUnits(SBMLLocalParameter)
%=====================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the value of the units attribute
%
%=====================================================
% value = LocalParameter_getValue(SBMLLocalParameter)
%=====================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the value of the value attribute
%
%====================================================
% value = LocalParameter_isSetId(SBMLLocalParameter)
%====================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%========================================================
% value = LocalParameter_isSetMetaid(SBMLLocalParameter)
%========================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%======================================================
% value = LocalParameter_isSetName(SBMLLocalParameter)
%======================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%=========================================================
% value = LocalParameter_isSetSBOTerm(SBMLLocalParameter)
%=========================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%=======================================================
% value = LocalParameter_isSetUnits(SBMLLocalParameter)
%=======================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%=======================================================
% value = LocalParameter_isSetValue(SBMLLocalParameter)
%=======================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. value =
% - 1 if the value attribute is set
% - 0 otherwise
%
%===================================================================
% SBMLLocalParameter = LocalParameter_setId(SBMLLocalParameter, id)
%===================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML LocalParameter structure with the new value for the id attribute
%
%===========================================================================
% SBMLLocalParameter = LocalParameter_setMetaid(SBMLLocalParameter, metaid)
%===========================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML LocalParameter structure with the new value for the metaid attribute
%
%=======================================================================
% SBMLLocalParameter = LocalParameter_setName(SBMLLocalParameter, name)
%=======================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML LocalParameter structure with the new value for the name attribute
%
%=============================================================================
% SBMLLocalParameter = LocalParameter_setSBOTerm(SBMLLocalParameter, sboTerm)
%=============================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML LocalParameter structure with the new value for the sboTerm attribute
%
%=========================================================================
% SBMLLocalParameter = LocalParameter_setUnits(SBMLLocalParameter, units)
%=========================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. units; a string representing the units to be set
% Returns
% 1. the SBML LocalParameter structure with the new value for the units attribute
%
%=========================================================================
% SBMLLocalParameter = LocalParameter_setValue(SBMLLocalParameter, value)
%=========================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% 2. value; number representing the value of value to be set
% Returns
% 1. the SBML LocalParameter structure with the new value for the value attribute
%
%=================================================================
% SBMLLocalParameter = LocalParameter_unsetId(SBMLLocalParameter)
%=================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the SBML LocalParameter structure with the id attribute unset
%
%=====================================================================
% SBMLLocalParameter = LocalParameter_unsetMetaid(SBMLLocalParameter)
%=====================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the SBML LocalParameter structure with the metaid attribute unset
%
%===================================================================
% SBMLLocalParameter = LocalParameter_unsetName(SBMLLocalParameter)
%===================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the SBML LocalParameter structure with the name attribute unset
%
%======================================================================
% SBMLLocalParameter = LocalParameter_unsetSBOTerm(SBMLLocalParameter)
%======================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the SBML LocalParameter structure with the sboTerm attribute unset
%
%====================================================================
% SBMLLocalParameter = LocalParameter_unsetUnits(SBMLLocalParameter)
%====================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the SBML LocalParameter structure with the units attribute unset
%
%====================================================================
% SBMLLocalParameter = LocalParameter_unsetValue(SBMLLocalParameter)
%====================================================================
% Takes
% 1. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the SBML LocalParameter structure with the value attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/ 0000755 0000000 0000000 00000000000 11704572232 023726 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_unsetTimeUnits.m 0000644 0000000 0000000 00000003400 11703262326 031212 0 ustar root root function SBMLKineticLaw = KineticLaw_unsetTimeUnits(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_unsetTimeUnits(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the timeUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'timeUnits')
SBMLKineticLaw.timeUnits = '';
else
error('timeUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_unsetSubstanceUnits.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_unsetSubstanceUnits.0000644 0000000 0000000 00000003436 11703262326 032077 0 ustar root root function SBMLKineticLaw = KineticLaw_unsetSubstanceUnits(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_unsetSubstanceUnits(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the substanceUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'substanceUnits')
SBMLKineticLaw.substanceUnits = '';
else
error('substanceUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_unsetSBOTerm.m 0000644 0000000 0000000 00000003364 11703262326 030555 0 ustar root root function SBMLKineticLaw = KineticLaw_unsetSBOTerm(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_unsetSBOTerm(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'sboTerm')
SBMLKineticLaw.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_unsetMetaid.m 0000644 0000000 0000000 00000003356 11703262326 030506 0 ustar root root function SBMLKineticLaw = KineticLaw_unsetMetaid(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_unsetMetaid(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'metaid')
SBMLKineticLaw.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_unsetMath.m 0000644 0000000 0000000 00000003342 11703262326 030167 0 ustar root root function SBMLKineticLaw = KineticLaw_unsetMath(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_unsetMath(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'math')
SBMLKineticLaw.math = '';
else
error('math not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_unsetFormula.m 0000644 0000000 0000000 00000003364 11703262326 030707 0 ustar root root function SBMLKineticLaw = KineticLaw_unsetFormula(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_unsetFormula(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'formula')
SBMLKineticLaw.formula = '';
else
error('formula not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setTimeUnits.m 0000644 0000000 0000000 00000003666 11703262326 030665 0 ustar root root function SBMLKineticLaw = KineticLaw_setTimeUnits(SBMLKineticLaw, timeUnits)
% SBMLKineticLaw = KineticLaw_setTimeUnits(SBMLKineticLaw, timeUnits)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. timeUnits; a string representing the timeUnits to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the timeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'timeUnits')
if ~ischar(timeUnits)
error('timeUnits must be character array') ;
else
SBMLKineticLaw.timeUnits = timeUnits;
end;
else
error('timeUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setSubstanceUnits.m 0000644 0000000 0000000 00000003767 11703262326 031720 0 ustar root root function SBMLKineticLaw = KineticLaw_setSubstanceUnits(SBMLKineticLaw, substanceUnits)
% SBMLKineticLaw = KineticLaw_setSubstanceUnits(SBMLKineticLaw, substanceUnits)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. substanceUnits; a string representing the substanceUnits to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the substanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'substanceUnits')
if ~ischar(substanceUnits)
error('substanceUnits must be character array') ;
else
SBMLKineticLaw.substanceUnits = substanceUnits;
end;
else
error('substanceUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setSBOTerm.m 0000644 0000000 0000000 00000003643 11703262326 030212 0 ustar root root function SBMLKineticLaw = KineticLaw_setSBOTerm(SBMLKineticLaw, sboTerm)
% SBMLKineticLaw = KineticLaw_setSBOTerm(SBMLKineticLaw, sboTerm)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLKineticLaw.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setMetaid.m 0000644 0000000 0000000 00000003617 11703262326 030143 0 ustar root root function SBMLKineticLaw = KineticLaw_setMetaid(SBMLKineticLaw, metaid)
% SBMLKineticLaw = KineticLaw_setMetaid(SBMLKineticLaw, metaid)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLKineticLaw.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setMathFromFormula.m0000644 0000000 0000000 00000004477 11703262326 032010 0 ustar root root function SBMLKineticLaw = KineticLaw_setMathFromFormula(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_setMathFromFormula(SBMLKineticLaw, mathFromFormula)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. mathFromFormula; string representing the math expression mathFromFormula to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the mathFromFormula attribute
%
%
% check that input is correct
if (~isstruct(SBMLKineticLaw))
error(sprintf('%s\n%s', ...
'KineticLaw_setMathFromFormula(SBMLKineticLaw)', ...
'first argument must be an SBML KineticLaw structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLKineticLaw);
if (~isSBML_KineticLaw(SBMLKineticLaw, sbmlLevel, sbmlVersion))
error(sprintf('%s\n%s', 'KineticLaw_setMathFromFormula(SBMLKineticLaw)', 'argument must be an SBML kineticLaw structure'));
elseif (sbmlLevel ~= 2)
error(sprintf('%s\n%s', 'KineticLaw_setMathFromFormula(SBMLKineticLaw)', 'no math field in a level 1 model'));
end;
formula = KineticLaw_getFormula(SBMLKineticLaw);
SBMLKineticLaw = KineticLaw_setMath(SBMLKineticLaw, formula);
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setMath.m 0000644 0000000 0000000 00000003603 11703262326 027624 0 ustar root root function SBMLKineticLaw = KineticLaw_setMath(SBMLKineticLaw, math)
% SBMLKineticLaw = KineticLaw_setMath(SBMLKineticLaw, math)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLKineticLaw.math = math;
end;
else
error('math not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setFormulaFromMath.m0000644 0000000 0000000 00000004453 11703262326 032002 0 ustar root root function SBMLKineticLaw = KineticLaw_setFormulaFromMath(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_setFormulaFromMath(SBMLKineticLaw, formulaFromMath)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. formulaFromMath; a string representing the formulaFromMath to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the formulaFromMath attribute
%
%
% check that input is correct
if (~isstruct(SBMLKineticLaw))
error(sprintf('%s\n%s', ...
'KineticLaw_setFormulaFromMath(SBMLKineticLaw)', ...
'first argument must be an SBML KineticLaw structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLKineticLaw);
if (~isSBML_KineticLaw(SBMLKineticLaw, sbmlLevel, sbmlVersion))
error(sprintf('%s\n%s', 'KineticLaw_setFormulaFromMath(SBMLKineticLaw)', 'argument must be an SBML kineticLaw structure'));
elseif (sbmlLevel ~= 2)
error(sprintf('%s\n%s', 'KineticLaw_setFormulaFromMath(SBMLKineticLaw)', 'no math field in a level 1 model'));
end;
math = KineticLaw_getMath(SBMLKineticLaw);
SBMLKineticLaw = KineticLaw_setFormula(SBMLKineticLaw, math);
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_setFormula.m 0000644 0000000 0000000 00000003634 11703262326 030344 0 ustar root root function SBMLKineticLaw = KineticLaw_setFormula(SBMLKineticLaw, formula)
% SBMLKineticLaw = KineticLaw_setFormula(SBMLKineticLaw, formula)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML KineticLaw structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLKineticLaw.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_isSetTimeUnits.m 0000644 0000000 0000000 00000003375 11703262326 031156 0 ustar root root function value = KineticLaw_isSetTimeUnits(SBMLKineticLaw)
% value = KineticLaw_isSetTimeUnits(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. value =
% - 1 if the timeUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'timeUnits')
value = ~isempty(SBMLKineticLaw.timeUnits);
else
error('timeUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_isSetSubstanceUnits.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_isSetSubstanceUnits.0000644 0000000 0000000 00000003433 11703262326 032025 0 ustar root root function value = KineticLaw_isSetSubstanceUnits(SBMLKineticLaw)
% value = KineticLaw_isSetSubstanceUnits(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. value =
% - 1 if the substanceUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'substanceUnits')
value = ~isempty(SBMLKineticLaw.substanceUnits);
else
error('substanceUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_isSetSBOTerm.m 0000644 0000000 0000000 00000003354 11703262326 030505 0 ustar root root function value = KineticLaw_isSetSBOTerm(SBMLKineticLaw)
% value = KineticLaw_isSetSBOTerm(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'sboTerm')
value = (SBMLKineticLaw.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_isSetMetaid.m 0000644 0000000 0000000 00000003353 11703262326 030434 0 ustar root root function value = KineticLaw_isSetMetaid(SBMLKineticLaw)
% value = KineticLaw_isSetMetaid(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'metaid')
value = ~isempty(SBMLKineticLaw.metaid);
else
error('metaid not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_isSetMath.m 0000644 0000000 0000000 00000003337 11703262326 030124 0 ustar root root function value = KineticLaw_isSetMath(SBMLKineticLaw)
% value = KineticLaw_isSetMath(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'math')
value = ~isempty(SBMLKineticLaw.math);
else
error('math not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_isSetFormula.m 0000644 0000000 0000000 00000003361 11703262326 030635 0 ustar root root function value = KineticLaw_isSetFormula(SBMLKineticLaw)
% value = KineticLaw_isSetFormula(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'formula')
value = ~isempty(SBMLKineticLaw.formula);
else
error('formula not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getTimeUnits.m 0000644 0000000 0000000 00000003335 11703262326 030642 0 ustar root root function timeUnits = KineticLaw_getTimeUnits(SBMLKineticLaw)
% timeUnits = KineticLaw_getTimeUnits(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the value of the timeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'timeUnits')
timeUnits = SBMLKineticLaw.timeUnits;
else
error('timeUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getSubstanceUnits.m 0000644 0000000 0000000 00000003412 11703262326 031667 0 ustar root root function substanceUnits = KineticLaw_getSubstanceUnits(SBMLKineticLaw)
% substanceUnits = KineticLaw_getSubstanceUnits(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the value of the substanceUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'substanceUnits')
substanceUnits = SBMLKineticLaw.substanceUnits;
else
error('substanceUnits not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getSBOTerm.m 0000644 0000000 0000000 00000003313 11703262326 030170 0 ustar root root function sboTerm = KineticLaw_getSBOTerm(SBMLKineticLaw)
% sboTerm = KineticLaw_getSBOTerm(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'sboTerm')
sboTerm = SBMLKineticLaw.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getParameter.m 0000644 0000000 0000000 00000004006 11703262326 030635 0 ustar root root function parameter = KineticLaw_getParameter(SBMLKineticLaw, index)
% parameter = KineticLaw_getParameter(SBMLKineticLaw, index)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. index, an integer representing the index of SBML Parameter structure
%
% Returns
%
% 1. the SBML Parameter structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'parameter')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLKineticLaw.parameter)
parameter = SBMLKineticLaw.parameter(index);
else
error('index is out of range');
end;
else
error('parameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getNumParameters.m 0000644 0000000 0000000 00000003366 11703262326 031510 0 ustar root root function num = KineticLaw_getNumParameters(SBMLKineticLaw)
% num = KineticLaw_getNumParameters(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the number of SBML Parameter structures present in the KineticLaw
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'parameter')
num = length(SBMLKineticLaw.parameter);
else
error('parameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getNumLocalParameters.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getNumLocalParameter0000644 0000000 0000000 00000003424 11703262326 032040 0 ustar root root function num = KineticLaw_getNumLocalParameters(SBMLKineticLaw)
% num = KineticLaw_getNumLocalParameters(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the number of SBML LocalParameter structures present in the KineticLaw
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'localParameter')
num = length(SBMLKineticLaw.localParameter);
else
error('localParameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getMetaid.m 0000644 0000000 0000000 00000003302 11703262326 030116 0 ustar root root function metaid = KineticLaw_getMetaid(SBMLKineticLaw)
% metaid = KineticLaw_getMetaid(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'metaid')
metaid = SBMLKineticLaw.metaid;
else
error('metaid not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getMath.m 0000644 0000000 0000000 00000003260 11703262326 027607 0 ustar root root function math = KineticLaw_getMath(SBMLKineticLaw)
% math = KineticLaw_getMath(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'math')
math = SBMLKineticLaw.math;
else
error('math not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getLocalParameter.m 0000644 0000000 0000000 00000004075 11703262326 031616 0 ustar root root function localParameter = KineticLaw_getLocalParameter(SBMLKineticLaw, index)
% localParameter = KineticLaw_getLocalParameter(SBMLKineticLaw, index)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. index, an integer representing the index of SBML LocalParameter structure
%
% Returns
%
% 1. the SBML LocalParameter structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'localParameter')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLKineticLaw.localParameter)
localParameter = SBMLKineticLaw.localParameter(index);
else
error('index is out of range');
end;
else
error('localParameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getListOfParameters.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getListOfParameters.0000644 0000000 0000000 00000003351 11703262326 031766 0 ustar root root function parameter = KineticLaw_getListOfParameters(SBMLKineticLaw)
% parameter = KineticLaw_getListOfParameters(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. an array of the parameter structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'parameter')
parameter = SBMLKineticLaw.parameter;
else
error('parameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getListOfLocalParameters.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getListOfLocalParame0000644 0000000 0000000 00000003426 11703262326 031770 0 ustar root root function localParameter = KineticLaw_getListOfLocalParameters(SBMLKineticLaw)
% localParameter = KineticLaw_getListOfLocalParameters(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. an array of the localParameter structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'localParameter')
localParameter = SBMLKineticLaw.localParameter;
else
error('localParameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_getFormula.m 0000644 0000000 0000000 00000003313 11703262326 030322 0 ustar root root function formula = KineticLaw_getFormula(SBMLKineticLaw)
% formula = KineticLaw_getFormula(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'formula')
formula = SBMLKineticLaw.formula;
else
error('formula not an attribute on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_createParameter.m 0000644 0000000 0000000 00000003702 11703262326 031323 0 ustar root root function SBMLKineticLaw = KineticLaw_createParameter(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_createParameter(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with a new SBML Parameter structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'parameter')
index = length(SBMLKineticLaw.parameter);
SBMLParameter = Parameter_create(level, version);
if index == 0
SBMLKineticLaw.parameter = SBMLParameter;
else
SBMLKineticLaw.parameter(index+1) = SBMLParameter;
end;
else
error('parameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_createLocalParameter.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_createLocalParameter0000644 0000000 0000000 00000003776 11703262326 032056 0 ustar root root function SBMLKineticLaw = KineticLaw_createLocalParameter(SBMLKineticLaw)
% SBMLKineticLaw = KineticLaw_createLocalParameter(SBMLKineticLaw)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
%
% Returns
%
% 1. the SBML KineticLaw structure with a new SBML LocalParameter structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
if isfield(SBMLKineticLaw, 'localParameter')
index = length(SBMLKineticLaw.localParameter);
SBMLLocalParameter = LocalParameter_create(level, version);
if index == 0
SBMLKineticLaw.localParameter = SBMLLocalParameter;
else
SBMLKineticLaw.localParameter(index+1) = SBMLLocalParameter;
end;
else
error('localParameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_create.m 0000644 0000000 0000000 00000006161 11703262326 027464 0 ustar root root function KineticLaw = KineticLaw_create(varargin)
% KineticLaw = KineticLaw_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML KineticLaw structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getKineticLawFieldnames(level, version);
if (num > 0)
values = getKineticLawDefaultValues(level, version);
KineticLaw = cell2struct(values, fieldnames, 2);
%add empty substructures
warning('off', 'Warn:InvalidLV');
p = LocalParameter_create(level, version);
if ~isempty(p)
KineticLaw.localParameter = p;
KineticLaw.localParameter(1:end) = [];
else
p = Parameter_create(level, version);
KineticLaw.parameter = p;
KineticLaw.parameter(1:end) = [];
end;
warning('on', 'Warn:InvalidLV');
%add level and version
KineticLaw.level = level;
KineticLaw.version = version;
%check correct structure
if ~isSBML_KineticLaw(KineticLaw, level, version)
KineticLaw = struct();
warning('Warn:BadStruct', 'Failed to create KineticLaw');
end;
else
KineticLaw = [];
warning('Warn:InvalidLV', 'KineticLaw not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_addParameter.m 0000644 0000000 0000000 00000004237 11703262326 030614 0 ustar root root function SBMLKineticLaw = KineticLaw_addParameter(SBMLKineticLaw, SBMLParameter)
% SBMLKineticLaw = KineticLaw_addParameter(SBMLKineticLaw, SBMLParameter)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. SBMLParameter, an SBML Parameter structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the SBML Parameter structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
[parameter_level, parameter_version] = GetLevelVersion(SBMLParameter);
if level ~= parameter_level
error('mismatch in levels');
elseif version ~= parameter_version
error('mismatch in versions');
end;
if isfield(SBMLKineticLaw, 'parameter')
index = length(SBMLKineticLaw.parameter);
if index == 0
SBMLKineticLaw.parameter = SBMLParameter;
else
SBMLKineticLaw.parameter(index+1) = SBMLParameter;
end;
else
error('parameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/KineticLaw_addLocalParameter.m 0000644 0000000 0000000 00000004376 11703262326 031573 0 ustar root root function SBMLKineticLaw = KineticLaw_addLocalParameter(SBMLKineticLaw, SBMLLocalParameter)
% SBMLKineticLaw = KineticLaw_addLocalParameter(SBMLKineticLaw, SBMLLocalParameter)
%
% Takes
%
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. SBMLLocalParameter, an SBML LocalParameter structure
%
% Returns
%
% 1. the SBML KineticLaw structure with the SBML LocalParameter structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLKineticLaw);
[localParameter_level, localParameter_version] = GetLevelVersion(SBMLLocalParameter);
if level ~= localParameter_level
error('mismatch in levels');
elseif version ~= localParameter_version
error('mismatch in versions');
end;
if isfield(SBMLKineticLaw, 'localParameter')
index = length(SBMLKineticLaw.localParameter);
if index == 0
SBMLKineticLaw.localParameter = SBMLLocalParameter;
else
SBMLKineticLaw.localParameter(index+1) = SBMLLocalParameter;
end;
else
error('localParameter not an element on SBML L%dV%d KineticLaw', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/KineticLaw/Contents.m 0000644 0000000 0000000 00000033607 11703262326 025711 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\KineticLaw
%
% The functions allow users to create and work with the SBML KineticLaw structure.
%
%===================================================================================
% SBMLKineticLaw = KineticLaw_addLocalParameter(SBMLKineticLaw, SBMLLocalParameter)
%===================================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. SBMLLocalParameter, an SBML LocalParameter structure
% Returns
% 1. the SBML KineticLaw structure with the SBML LocalParameter structure added
%
%=========================================================================
% SBMLKineticLaw = KineticLaw_addParameter(SBMLKineticLaw, SBMLParameter)
%=========================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. SBMLParameter, an SBML Parameter structure
% Returns
% 1. the SBML KineticLaw structure with the SBML Parameter structure added
%
%=====================================================================
% KineticLaw = KineticLaw_create(level(optional), version(optional) )
%=====================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML KineticLaw structure of the appropriate level and version
%
%==================================================================
% SBMLKineticLaw = KineticLaw_createLocalParameter(SBMLKineticLaw)
%==================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with a new SBML LocalParameter structure added
%
%=============================================================
% SBMLKineticLaw = KineticLaw_createParameter(SBMLKineticLaw)
%=============================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with a new SBML Parameter structure added
%
%=================================================
% formula = KineticLaw_getFormula(SBMLKineticLaw)
%=================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the value of the formula attribute
%
%======================================================================
% localParameter = KineticLaw_getListOfLocalParameters(SBMLKineticLaw)
%======================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. an array of the localParameter structures
%
%============================================================
% parameter = KineticLaw_getListOfParameters(SBMLKineticLaw)
%============================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. an array of the parameter structures
%
%======================================================================
% localParameter = KineticLaw_getLocalParameter(SBMLKineticLaw, index)
%======================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. index, an integer representing the index of SBML LocalParameter structure
% Returns
% 1. the SBML LocalParameter structure at the indexed position
%
%===========================================
% math = KineticLaw_getMath(SBMLKineticLaw)
%===========================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the value of the math attribute
%
%===============================================
% metaid = KineticLaw_getMetaid(SBMLKineticLaw)
%===============================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the value of the metaid attribute
%
%========================================================
% num = KineticLaw_getNumLocalParameters(SBMLKineticLaw)
%========================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the number of SBML LocalParameter structures present in the KineticLaw
%
%===================================================
% num = KineticLaw_getNumParameters(SBMLKineticLaw)
%===================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the number of SBML Parameter structures present in the KineticLaw
%
%============================================================
% parameter = KineticLaw_getParameter(SBMLKineticLaw, index)
%============================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. index, an integer representing the index of SBML Parameter structure
% Returns
% 1. the SBML Parameter structure at the indexed position
%
%=================================================
% sboTerm = KineticLaw_getSBOTerm(SBMLKineticLaw)
%=================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the value of the sboTerm attribute
%
%===============================================================
% substanceUnits = KineticLaw_getSubstanceUnits(SBMLKineticLaw)
%===============================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the value of the substanceUnits attribute
%
%=====================================================
% timeUnits = KineticLaw_getTimeUnits(SBMLKineticLaw)
%=====================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the value of the timeUnits attribute
%
%=================================================
% value = KineticLaw_isSetFormula(SBMLKineticLaw)
%=================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%==============================================
% value = KineticLaw_isSetMath(SBMLKineticLaw)
%==============================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%================================================
% value = KineticLaw_isSetMetaid(SBMLKineticLaw)
%================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=================================================
% value = KineticLaw_isSetSBOTerm(SBMLKineticLaw)
%=================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%========================================================
% value = KineticLaw_isSetSubstanceUnits(SBMLKineticLaw)
%========================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. value =
% - 1 if the substanceUnits attribute is set
% - 0 otherwise
%
%===================================================
% value = KineticLaw_isSetTimeUnits(SBMLKineticLaw)
%===================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. value =
% - 1 if the timeUnits attribute is set
% - 0 otherwise
%
%=================================================================
% SBMLKineticLaw = KineticLaw_setFormula(SBMLKineticLaw, formula)
%=================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the formula attribute
%
%=================================================================================
% SBMLKineticLaw = KineticLaw_setFormulaFromMath(SBMLKineticLaw, formulaFromMath)
%=================================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. formulaFromMath; a string representing the formulaFromMath to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the formulaFromMath attribute
%
%===========================================================
% SBMLKineticLaw = KineticLaw_setMath(SBMLKineticLaw, math)
%===========================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the math attribute
%
%=================================================================================
% SBMLKineticLaw = KineticLaw_setMathFromFormula(SBMLKineticLaw, mathFromFormula)
%=================================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. mathFromFormula; string representing the math expression mathFromFormula to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the mathFromFormula attribute
%
%===============================================================
% SBMLKineticLaw = KineticLaw_setMetaid(SBMLKineticLaw, metaid)
%===============================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the metaid attribute
%
%=================================================================
% SBMLKineticLaw = KineticLaw_setSBOTerm(SBMLKineticLaw, sboTerm)
%=================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the sboTerm attribute
%
%===============================================================================
% SBMLKineticLaw = KineticLaw_setSubstanceUnits(SBMLKineticLaw, substanceUnits)
%===============================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. substanceUnits; a string representing the substanceUnits to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the substanceUnits attribute
%
%=====================================================================
% SBMLKineticLaw = KineticLaw_setTimeUnits(SBMLKineticLaw, timeUnits)
%=====================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% 2. timeUnits; a string representing the timeUnits to be set
% Returns
% 1. the SBML KineticLaw structure with the new value for the timeUnits attribute
%
%==========================================================
% SBMLKineticLaw = KineticLaw_unsetFormula(SBMLKineticLaw)
%==========================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with the formula attribute unset
%
%=======================================================
% SBMLKineticLaw = KineticLaw_unsetMath(SBMLKineticLaw)
%=======================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with the math attribute unset
%
%=========================================================
% SBMLKineticLaw = KineticLaw_unsetMetaid(SBMLKineticLaw)
%=========================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with the metaid attribute unset
%
%==========================================================
% SBMLKineticLaw = KineticLaw_unsetSBOTerm(SBMLKineticLaw)
%==========================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with the sboTerm attribute unset
%
%=================================================================
% SBMLKineticLaw = KineticLaw_unsetSubstanceUnits(SBMLKineticLaw)
%=================================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with the substanceUnits attribute unset
%
%============================================================
% SBMLKineticLaw = KineticLaw_unsetTimeUnits(SBMLKineticLaw)
%============================================================
% Takes
% 1. SBMLKineticLaw, an SBML KineticLaw structure
% Returns
% 1. the SBML KineticLaw structure with the timeUnits attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/ 0000755 0000000 0000000 00000000000 11704572230 025314 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetSymbol.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetS0000644 0000000 0000000 00000003507 11703262312 032223 0 ustar root root function SBMLInitialAssignment = InitialAssignment_unsetSymbol(SBMLInitialAssignment)
% SBMLInitialAssignment = InitialAssignment_unsetSymbol(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the SBML InitialAssignment structure with the symbol attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'symbol')
SBMLInitialAssignment.symbol = '';
else
error('symbol not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetS0000644 0000000 0000000 00000003515 11703262312 032222 0 ustar root root function SBMLInitialAssignment = InitialAssignment_unsetSBOTerm(SBMLInitialAssignment)
% SBMLInitialAssignment = InitialAssignment_unsetSBOTerm(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the SBML InitialAssignment structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'sboTerm')
SBMLInitialAssignment.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetM0000644 0000000 0000000 00000003507 11703262312 032215 0 ustar root root function SBMLInitialAssignment = InitialAssignment_unsetMetaid(SBMLInitialAssignment)
% SBMLInitialAssignment = InitialAssignment_unsetMetaid(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the SBML InitialAssignment structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'metaid')
SBMLInitialAssignment.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_unsetM0000644 0000000 0000000 00000003473 11703262312 032217 0 ustar root root function SBMLInitialAssignment = InitialAssignment_unsetMath(SBMLInitialAssignment)
% SBMLInitialAssignment = InitialAssignment_unsetMath(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the SBML InitialAssignment structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'math')
SBMLInitialAssignment.math = '';
else
error('math not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setSymbol.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setSym0000644 0000000 0000000 00000003750 11703262312 032226 0 ustar root root function SBMLInitialAssignment = InitialAssignment_setSymbol(SBMLInitialAssignment, symbol)
% SBMLInitialAssignment = InitialAssignment_setSymbol(SBMLInitialAssignment, symbol)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. symbol; a string representing the symbol to be set
%
% Returns
%
% 1. the SBML InitialAssignment structure with the new value for the symbol attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'symbol')
if ~ischar(symbol)
error('symbol must be character array') ;
else
SBMLInitialAssignment.symbol = symbol;
end;
else
error('symbol not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setSBO0000644 0000000 0000000 00000003774 11703262312 032107 0 ustar root root function SBMLInitialAssignment = InitialAssignment_setSBOTerm(SBMLInitialAssignment, sboTerm)
% SBMLInitialAssignment = InitialAssignment_setSBOTerm(SBMLInitialAssignment, sboTerm)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML InitialAssignment structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLInitialAssignment.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setMet0000644 0000000 0000000 00000003750 11703262312 032203 0 ustar root root function SBMLInitialAssignment = InitialAssignment_setMetaid(SBMLInitialAssignment, metaid)
% SBMLInitialAssignment = InitialAssignment_setMetaid(SBMLInitialAssignment, metaid)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML InitialAssignment structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLInitialAssignment.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_setMat0000644 0000000 0000000 00000003734 11703262312 032201 0 ustar root root function SBMLInitialAssignment = InitialAssignment_setMath(SBMLInitialAssignment, math)
% SBMLInitialAssignment = InitialAssignment_setMath(SBMLInitialAssignment, math)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML InitialAssignment structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLInitialAssignment.math = math;
end;
else
error('math not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetSymbol.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetS0000644 0000000 0000000 00000003457 11703262312 032160 0 ustar root root function value = InitialAssignment_isSetSymbol(SBMLInitialAssignment)
% value = InitialAssignment_isSetSymbol(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the symbol attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'symbol')
value = ~isempty(SBMLInitialAssignment.symbol);
else
error('symbol not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetS0000644 0000000 0000000 00000003460 11703262312 032152 0 ustar root root function value = InitialAssignment_isSetSBOTerm(SBMLInitialAssignment)
% value = InitialAssignment_isSetSBOTerm(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'sboTerm')
value = (SBMLInitialAssignment.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetM0000644 0000000 0000000 00000003457 11703262312 032152 0 ustar root root function value = InitialAssignment_isSetMetaid(SBMLInitialAssignment)
% value = InitialAssignment_isSetMetaid(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'metaid')
value = ~isempty(SBMLInitialAssignment.metaid);
else
error('metaid not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_isSetM0000644 0000000 0000000 00000003443 11703262312 032145 0 ustar root root function value = InitialAssignment_isSetMath(SBMLInitialAssignment)
% value = InitialAssignment_isSetMath(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'math')
value = ~isempty(SBMLInitialAssignment.math);
else
error('math not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getSymbol.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getSym0000644 0000000 0000000 00000003406 11703262312 032210 0 ustar root root function symbol = InitialAssignment_getSymbol(SBMLInitialAssignment)
% symbol = InitialAssignment_getSymbol(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the value of the symbol attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'symbol')
symbol = SBMLInitialAssignment.symbol;
else
error('symbol not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getSBO0000644 0000000 0000000 00000003417 11703262312 032065 0 ustar root root function sboTerm = InitialAssignment_getSBOTerm(SBMLInitialAssignment)
% sboTerm = InitialAssignment_getSBOTerm(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'sboTerm')
sboTerm = SBMLInitialAssignment.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getMet0000644 0000000 0000000 00000003406 11703262312 032165 0 ustar root root function metaid = InitialAssignment_getMetaid(SBMLInitialAssignment)
% metaid = InitialAssignment_getMetaid(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'metaid')
metaid = SBMLInitialAssignment.metaid;
else
error('metaid not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_getMat0000644 0000000 0000000 00000003364 11703262312 032164 0 ustar root root function math = InitialAssignment_getMath(SBMLInitialAssignment)
% math = InitialAssignment_getMath(SBMLInitialAssignment)
%
% Takes
%
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLInitialAssignment);
if isfield(SBMLInitialAssignment, 'math')
math = SBMLInitialAssignment.math;
else
error('math not an attribute on SBML L%dV%d InitialAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_create.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/InitialAssignment_create0000644 0000000 0000000 00000005562 11703262312 032210 0 ustar root root function InitialAssignment = InitialAssignment_create(varargin)
% InitialAssignment = InitialAssignment_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML InitialAssignment structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getInitialAssignmentFieldnames(level, version);
if (num > 0)
values = getInitialAssignmentDefaultValues(level, version);
InitialAssignment = cell2struct(values, fieldnames, 2);
%add level and version
InitialAssignment.level = level;
InitialAssignment.version = version;
%check correct structure
if ~isSBML_InitialAssignment(InitialAssignment, level, version)
InitialAssignment = struct();
warning('Warn:BadStruct', 'Failed to create InitialAssignment');
end;
else
InitialAssignment = [];
warning('Warn:InvalidLV', 'InitialAssignment not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/InitialAssignment/Contents.m 0000644 0000000 0000000 00000017474 11703262312 027300 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\InitialAssignment
%
% The functions allow users to create and work with the SBML InitialAssignment structure.
%
%===================================================================================
% InitialAssignment = InitialAssignment_create(level(optional), version(optional) )
%===================================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML InitialAssignment structure of the appropriate level and version
%
%=========================================================
% math = InitialAssignment_getMath(SBMLInitialAssignment)
%=========================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the value of the math attribute
%
%=============================================================
% metaid = InitialAssignment_getMetaid(SBMLInitialAssignment)
%=============================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the value of the metaid attribute
%
%===============================================================
% sboTerm = InitialAssignment_getSBOTerm(SBMLInitialAssignment)
%===============================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the value of the sboTerm attribute
%
%=============================================================
% symbol = InitialAssignment_getSymbol(SBMLInitialAssignment)
%=============================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the value of the symbol attribute
%
%============================================================
% value = InitialAssignment_isSetMath(SBMLInitialAssignment)
%============================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%==============================================================
% value = InitialAssignment_isSetMetaid(SBMLInitialAssignment)
%==============================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%===============================================================
% value = InitialAssignment_isSetSBOTerm(SBMLInitialAssignment)
%===============================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==============================================================
% value = InitialAssignment_isSetSymbol(SBMLInitialAssignment)
%==============================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. value =
% - 1 if the symbol attribute is set
% - 0 otherwise
%
%================================================================================
% SBMLInitialAssignment = InitialAssignment_setMath(SBMLInitialAssignment, math)
%================================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML InitialAssignment structure with the new value for the math attribute
%
%====================================================================================
% SBMLInitialAssignment = InitialAssignment_setMetaid(SBMLInitialAssignment, metaid)
%====================================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML InitialAssignment structure with the new value for the metaid attribute
%
%======================================================================================
% SBMLInitialAssignment = InitialAssignment_setSBOTerm(SBMLInitialAssignment, sboTerm)
%======================================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML InitialAssignment structure with the new value for the sboTerm attribute
%
%====================================================================================
% SBMLInitialAssignment = InitialAssignment_setSymbol(SBMLInitialAssignment, symbol)
%====================================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% 2. symbol; a string representing the symbol to be set
% Returns
% 1. the SBML InitialAssignment structure with the new value for the symbol attribute
%
%============================================================================
% SBMLInitialAssignment = InitialAssignment_unsetMath(SBMLInitialAssignment)
%============================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the SBML InitialAssignment structure with the math attribute unset
%
%==============================================================================
% SBMLInitialAssignment = InitialAssignment_unsetMetaid(SBMLInitialAssignment)
%==============================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the SBML InitialAssignment structure with the metaid attribute unset
%
%===============================================================================
% SBMLInitialAssignment = InitialAssignment_unsetSBOTerm(SBMLInitialAssignment)
%===============================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the SBML InitialAssignment structure with the sboTerm attribute unset
%
%==============================================================================
% SBMLInitialAssignment = InitialAssignment_unsetSymbol(SBMLInitialAssignment)
%==============================================================================
% Takes
% 1. SBMLInitialAssignment, an SBML InitialAssignment structure
% Returns
% 1. the SBML InitialAssignment structure with the symbol attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/GetLevelVersion.m 0000644 0000000 0000000 00000011174 11703262340 025126 0 ustar root root function [level, version] = GetLevelVersion(SBMLStructure)
% [level, version] = GetLevelVersion(SBMLStructure)
%
% Takes
%
% 1. SBMLStructure, any SBML structure
%
% Returns
%
% 1. the SBML level corresponding to this structure
% 2. the SBML version corresponding to this structure
%
% *NOTE:* it is not always possible to uniquely determine the level/version from a
% structure. The most recent SBML level/version that matches will be reported.
%
% check that input is correct
if (~isValid(SBMLStructure))
error('%s\n%s', 'GetLevelVersion(SBMLStructure)', ...
'argument must be an SBML structure');
end;
% if level and version explicilty declared
if (isfield(SBMLStructure, 'level') && isfield(SBMLStructure, 'version'))
level = SBMLStructure.level;
version = SBMLStructure.version;
return;
end;
typecode = SBMLStructure.typecode;
if (strcmp(typecode, 'SBML_MODEL'))
level = SBMLStructure.SBML_level;
version = SBMLStructure.SBML_version;
return;
end;
switch (typecode)
case 'SBML_ALGEBRAIC_RULE'
fhandle = str2func('isSBML_AlgebraicRule');
case 'SBML_ASSIGNMENT_RULE'
fhandle = str2func('isSBML_AssignmentRule');
case 'SBML_COMPARTMENT'
fhandle = str2func('isSBML_Compartment');
case 'SBML_COMPARTMENT_TYPE'
fhandle = str2func('isSBML_CompartmentType');
case 'SBML_COMPARTMENT_VOLUME_RULE'
fhandle = str2func('isSBML_CompartmentVolumeRule');
case 'SBML_CONSTRAINT'
fhandle = str2func('isSBML_Constraint');
case 'SBML_DELAY'
fhandle = str2func('isSBML_Delay');
case 'SBML_EVENT'
fhandle = str2func('isSBML_Event');
case 'SBML_EVENT_ASSIGNMENT'
fhandle = str2func('isSBML_EventAssignment');
case 'SBML_FUNCTION_DEFINITION'
fhandle = str2func('isSBML_FunctionDefinition');
case 'SBML_INITIAL_ASSIGNMENT'
fhandle = str2func('isSBML_InitialAssignment');
case 'SBML_KINETIC_LAW'
fhandle = str2func('isSBML_KineticLaw');
case 'SBML_LOCAL_PARAMETER'
fhandle = str2func('isSBML_LocalParameter');
case 'SBML_MODIFIER_SPECIES_REFERENCE'
fhandle = str2func('isSBML_ModifierSpeciesReference');
case 'SBML_PARAMETER'
fhandle = str2func('isSBML_Parameter');
case 'SBML_PARAMETER_RULE'
fhandle = str2func('isSBML_ParameterRule');
case 'SBML_PRIORITY'
fhandle = str2func('isSBML_Priority');
case 'SBML_RATE_RULE'
fhandle = str2func('isSBML_RateRule');
case 'SBML_REACTION'
fhandle = str2func('isSBML_Reaction');
case 'SBML_SPECIES'
fhandle = str2func('isSBML_Species');
case 'SBML_SPECIES_CONCENTRATION_RULE'
fhandle = str2func('isSBML_SpeciesConcentrationRule');
case 'SBML_SPECIES_REFERENCE'
fhandle = str2func('isSBML_SpeciesReference');
case 'SBML_SPECIES_TYPE'
fhandle = str2func('isSBML_SpeciesType');
case 'SBML_STOICHIOMETRY_MATH'
fhandle = str2func('isSBML_StoichiometryMath');
case 'SBML_TRIGGER'
fhandle = str2func('isSBML_Trigger');
case 'SBML_UNIT'
fhandle = str2func('isSBML_Unit');
case 'SBML_UNIT_DEFINITION'
fhandle = str2func('isSBML_UnitDefinition');
otherwise
error('%s\n%s', 'GetLevelVersion(SBMLStructure)', ...
'argument must be an SBML structure');
end;
% assume highest level/version
level = 3;
version = 1;
if (~feval(fhandle, SBMLStructure, level, version))
level = 2;
version = 4;
end;
while (version > 0)
if (feval(fhandle, SBMLStructure, level, version))
break;
else
version = version - 1;
end;
end;
if (version == 0)
level = 1;
version = 2;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/GetLevel.m 0000644 0000000 0000000 00000003130 11703262336 023556 0 ustar root root function level = GetLevel(SBMLStructure)
% level = GetLevel(SBMLStructure)
%
% Takes
%
% 1. SBMLStructure, any SBML structure
%
% Returns
%
% 1. the SBML level corresponding to this structure
%
% *NOTE:* it is not always possible to uniquely determine the level from a
% structure. The most recent SBML level that matches will be reported.
%
[level, version] = GetLevelVersion(SBMLStructure);
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/ 0000755 0000000 0000000 00000000000 11704572230 025470 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unse0000644 0000000 0000000 00000003532 11703262334 032246 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_unsetSBOTerm(SBMLFunctionDefinition)
% SBMLFunctionDefinition = FunctionDefinition_unsetSBOTerm(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'sboTerm')
SBMLFunctionDefinition.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unsetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unse0000644 0000000 0000000 00000003510 11703262334 032242 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_unsetName(SBMLFunctionDefinition)
% SBMLFunctionDefinition = FunctionDefinition_unsetName(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'name')
SBMLFunctionDefinition.name = '';
else
error('name not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000156 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unse0000644 0000000 0000000 00000003524 11703262334 032247 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_unsetMetaid(SBMLFunctionDefinition)
% SBMLFunctionDefinition = FunctionDefinition_unsetMetaid(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'metaid')
SBMLFunctionDefinition.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unsetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unse0000644 0000000 0000000 00000003510 11703262334 032242 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_unsetMath(SBMLFunctionDefinition)
% SBMLFunctionDefinition = FunctionDefinition_unsetMath(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'math')
SBMLFunctionDefinition.math = '';
else
error('math not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unsetId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_unse0000644 0000000 0000000 00000003474 11703262334 032253 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_unsetId(SBMLFunctionDefinition)
% SBMLFunctionDefinition = FunctionDefinition_unsetId(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'id')
SBMLFunctionDefinition.id = '';
else
error('id not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setS0000644 0000000 0000000 00000004011 11703262334 032203 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_setSBOTerm(SBMLFunctionDefinition, sboTerm)
% SBMLFunctionDefinition = FunctionDefinition_setSBOTerm(SBMLFunctionDefinition, sboTerm)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLFunctionDefinition.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setN0000644 0000000 0000000 00000003733 11703262334 032210 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_setName(SBMLFunctionDefinition, name)
% SBMLFunctionDefinition = FunctionDefinition_setName(SBMLFunctionDefinition, name)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLFunctionDefinition.name = name;
end;
else
error('name not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setM0000644 0000000 0000000 00000003765 11703262334 032214 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_setMetaid(SBMLFunctionDefinition, metaid)
% SBMLFunctionDefinition = FunctionDefinition_setMetaid(SBMLFunctionDefinition, metaid)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLFunctionDefinition.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setM0000644 0000000 0000000 00000003751 11703262334 032207 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_setMath(SBMLFunctionDefinition, math)
% SBMLFunctionDefinition = FunctionDefinition_setMath(SBMLFunctionDefinition, math)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLFunctionDefinition.math = math;
end;
else
error('math not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_setI0000644 0000000 0000000 00000003701 11703262334 032176 0 ustar root root function SBMLFunctionDefinition = FunctionDefinition_setId(SBMLFunctionDefinition, id)
% SBMLFunctionDefinition = FunctionDefinition_setId(SBMLFunctionDefinition, id)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML FunctionDefinition structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLFunctionDefinition.id = id;
end;
else
error('id not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSe0000644 0000000 0000000 00000003472 11703262334 032202 0 ustar root root function value = FunctionDefinition_isSetSBOTerm(SBMLFunctionDefinition)
% value = FunctionDefinition_isSetSBOTerm(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'sboTerm')
value = (SBMLFunctionDefinition.sboTerm >0);
else
error('sboTerm not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSe0000644 0000000 0000000 00000003455 11703262334 032203 0 ustar root root function value = FunctionDefinition_isSetName(SBMLFunctionDefinition)
% value = FunctionDefinition_isSetName(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'name')
value = ~isempty(SBMLFunctionDefinition.name);
else
error('name not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000156 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSe0000644 0000000 0000000 00000003471 11703262334 032201 0 ustar root root function value = FunctionDefinition_isSetMetaid(SBMLFunctionDefinition)
% value = FunctionDefinition_isSetMetaid(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'metaid')
value = ~isempty(SBMLFunctionDefinition.metaid);
else
error('metaid not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSe0000644 0000000 0000000 00000003455 11703262334 032203 0 ustar root root function value = FunctionDefinition_isSetMath(SBMLFunctionDefinition)
% value = FunctionDefinition_isSetMath(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'math')
value = ~isempty(SBMLFunctionDefinition.math);
else
error('math not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSetId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_isSe0000644 0000000 0000000 00000003441 11703262334 032176 0 ustar root root function value = FunctionDefinition_isSetId(SBMLFunctionDefinition)
% value = FunctionDefinition_isSetId(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'id')
value = ~isempty(SBMLFunctionDefinition.id);
else
error('id not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getS0000644 0000000 0000000 00000003431 11703262334 032174 0 ustar root root function sboTerm = FunctionDefinition_getSBOTerm(SBMLFunctionDefinition)
% sboTerm = FunctionDefinition_getSBOTerm(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'sboTerm')
sboTerm = SBMLFunctionDefinition.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getN0000644 0000000 0000000 00000003376 11703262334 032177 0 ustar root root function name = FunctionDefinition_getName(SBMLFunctionDefinition)
% name = FunctionDefinition_getName(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'name')
name = SBMLFunctionDefinition.name;
else
error('name not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getM0000644 0000000 0000000 00000003420 11703262334 032164 0 ustar root root function metaid = FunctionDefinition_getMetaid(SBMLFunctionDefinition)
% metaid = FunctionDefinition_getMetaid(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'metaid')
metaid = SBMLFunctionDefinition.metaid;
else
error('metaid not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getM0000644 0000000 0000000 00000003376 11703262334 032176 0 ustar root root function math = FunctionDefinition_getMath(SBMLFunctionDefinition)
% math = FunctionDefinition_getMath(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'math')
math = SBMLFunctionDefinition.math;
else
error('math not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getId.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_getI0000644 0000000 0000000 00000003354 11703262334 032166 0 ustar root root function id = FunctionDefinition_getId(SBMLFunctionDefinition)
% id = FunctionDefinition_getId(SBMLFunctionDefinition)
%
% Takes
%
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFunctionDefinition);
if isfield(SBMLFunctionDefinition, 'id')
id = SBMLFunctionDefinition.id;
else
error('id not an attribute on SBML L%dV%d FunctionDefinition', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_create.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/FunctionDefinition_crea0000644 0000000 0000000 00000005602 11703262334 032206 0 ustar root root function FunctionDefinition = FunctionDefinition_create(varargin)
% FunctionDefinition = FunctionDefinition_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML FunctionDefinition structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getFunctionDefinitionFieldnames(level, version);
if (num > 0)
values = getFunctionDefinitionDefaultValues(level, version);
FunctionDefinition = cell2struct(values, fieldnames, 2);
%add level and version
FunctionDefinition.level = level;
FunctionDefinition.version = version;
%check correct structure
if ~isSBML_FunctionDefinition(FunctionDefinition, level, version)
FunctionDefinition = struct();
warning('Warn:BadStruct', 'Failed to create FunctionDefinition');
end;
else
FunctionDefinition = [];
warning('Warn:InvalidLV', 'FunctionDefinition not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/FunctionDefinition/Contents.m 0000644 0000000 0000000 00000022574 11703262334 027455 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\FunctionDefinition
%
% The functions allow users to create and work with the SBML FunctionDefinition structure.
%
%=====================================================================================
% FunctionDefinition = FunctionDefinition_create(level(optional), version(optional) )
%=====================================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML FunctionDefinition structure of the appropriate level and version
%
%=======================================================
% id = FunctionDefinition_getId(SBMLFunctionDefinition)
%=======================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the value of the id attribute
%
%===========================================================
% math = FunctionDefinition_getMath(SBMLFunctionDefinition)
%===========================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the value of the math attribute
%
%===============================================================
% metaid = FunctionDefinition_getMetaid(SBMLFunctionDefinition)
%===============================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the value of the metaid attribute
%
%===========================================================
% name = FunctionDefinition_getName(SBMLFunctionDefinition)
%===========================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the value of the name attribute
%
%=================================================================
% sboTerm = FunctionDefinition_getSBOTerm(SBMLFunctionDefinition)
%=================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the value of the sboTerm attribute
%
%============================================================
% value = FunctionDefinition_isSetId(SBMLFunctionDefinition)
%============================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%==============================================================
% value = FunctionDefinition_isSetMath(SBMLFunctionDefinition)
%==============================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%================================================================
% value = FunctionDefinition_isSetMetaid(SBMLFunctionDefinition)
%================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%==============================================================
% value = FunctionDefinition_isSetName(SBMLFunctionDefinition)
%==============================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%=================================================================
% value = FunctionDefinition_isSetSBOTerm(SBMLFunctionDefinition)
%=================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%===============================================================================
% SBMLFunctionDefinition = FunctionDefinition_setId(SBMLFunctionDefinition, id)
%===============================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML FunctionDefinition structure with the new value for the id attribute
%
%===================================================================================
% SBMLFunctionDefinition = FunctionDefinition_setMath(SBMLFunctionDefinition, math)
%===================================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML FunctionDefinition structure with the new value for the math attribute
%
%=======================================================================================
% SBMLFunctionDefinition = FunctionDefinition_setMetaid(SBMLFunctionDefinition, metaid)
%=======================================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML FunctionDefinition structure with the new value for the metaid attribute
%
%===================================================================================
% SBMLFunctionDefinition = FunctionDefinition_setName(SBMLFunctionDefinition, name)
%===================================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML FunctionDefinition structure with the new value for the name attribute
%
%=========================================================================================
% SBMLFunctionDefinition = FunctionDefinition_setSBOTerm(SBMLFunctionDefinition, sboTerm)
%=========================================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML FunctionDefinition structure with the new value for the sboTerm attribute
%
%=============================================================================
% SBMLFunctionDefinition = FunctionDefinition_unsetId(SBMLFunctionDefinition)
%=============================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the SBML FunctionDefinition structure with the id attribute unset
%
%===============================================================================
% SBMLFunctionDefinition = FunctionDefinition_unsetMath(SBMLFunctionDefinition)
%===============================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the SBML FunctionDefinition structure with the math attribute unset
%
%=================================================================================
% SBMLFunctionDefinition = FunctionDefinition_unsetMetaid(SBMLFunctionDefinition)
%=================================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the SBML FunctionDefinition structure with the metaid attribute unset
%
%===============================================================================
% SBMLFunctionDefinition = FunctionDefinition_unsetName(SBMLFunctionDefinition)
%===============================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the SBML FunctionDefinition structure with the name attribute unset
%
%==================================================================================
% SBMLFunctionDefinition = FunctionDefinition_unsetSBOTerm(SBMLFunctionDefinition)
%==================================================================================
% Takes
% 1. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. the SBML FunctionDefinition structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/ 0000755 0000000 0000000 00000000000 11704572230 025004 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetVaria0000644 0000000 0000000 00000003471 11703262340 032244 0 ustar root root function SBMLEventAssignment = EventAssignment_unsetVariable(SBMLEventAssignment)
% SBMLEventAssignment = EventAssignment_unsetVariable(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the SBML EventAssignment structure with the variable attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'variable')
SBMLEventAssignment.variable = '';
else
error('variable not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetSBOTe0000644 0000000 0000000 00000003463 11703262340 032117 0 ustar root root function SBMLEventAssignment = EventAssignment_unsetSBOTerm(SBMLEventAssignment)
% SBMLEventAssignment = EventAssignment_unsetSBOTerm(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the SBML EventAssignment structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'sboTerm')
SBMLEventAssignment.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetMetai0000644 0000000 0000000 00000003455 11703262340 032243 0 ustar root root function SBMLEventAssignment = EventAssignment_unsetMetaid(SBMLEventAssignment)
% SBMLEventAssignment = EventAssignment_unsetMetaid(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the SBML EventAssignment structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'metaid')
SBMLEventAssignment.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_unsetMath.0000644 0000000 0000000 00000003441 11703262340 032146 0 ustar root root function SBMLEventAssignment = EventAssignment_unsetMath(SBMLEventAssignment)
% SBMLEventAssignment = EventAssignment_unsetMath(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the SBML EventAssignment structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'math')
SBMLEventAssignment.math = '';
else
error('math not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_setVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_setVariabl0000644 0000000 0000000 00000003750 11703262340 032217 0 ustar root root function SBMLEventAssignment = EventAssignment_setVariable(SBMLEventAssignment, variable)
% SBMLEventAssignment = EventAssignment_setVariable(SBMLEventAssignment, variable)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. variable; a string representing the variable to be set
%
% Returns
%
% 1. the SBML EventAssignment structure with the new value for the variable attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'variable')
if ~ischar(variable)
error('variable must be character array') ;
else
SBMLEventAssignment.variable = variable;
end;
else
error('variable not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_setSBOTerm0000644 0000000 0000000 00000003742 11703262340 032113 0 ustar root root function SBMLEventAssignment = EventAssignment_setSBOTerm(SBMLEventAssignment, sboTerm)
% SBMLEventAssignment = EventAssignment_setSBOTerm(SBMLEventAssignment, sboTerm)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML EventAssignment structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLEventAssignment.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_setMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_setMetaid.0000644 0000000 0000000 00000003716 11703262340 032122 0 ustar root root function SBMLEventAssignment = EventAssignment_setMetaid(SBMLEventAssignment, metaid)
% SBMLEventAssignment = EventAssignment_setMetaid(SBMLEventAssignment, metaid)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML EventAssignment structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLEventAssignment.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_setMath.m 0000644 0000000 0000000 00000003702 11703262340 031760 0 ustar root root function SBMLEventAssignment = EventAssignment_setMath(SBMLEventAssignment, math)
% SBMLEventAssignment = EventAssignment_setMath(SBMLEventAssignment, math)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML EventAssignment structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLEventAssignment.math = math;
end;
else
error('math not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetVaria0000644 0000000 0000000 00000003447 11703262340 032200 0 ustar root root function value = EventAssignment_isSetVariable(SBMLEventAssignment)
% value = EventAssignment_isSetVariable(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the variable attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'variable')
value = ~isempty(SBMLEventAssignment.variable);
else
error('variable not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetSBOTe0000644 0000000 0000000 00000003435 11703262340 032047 0 ustar root root function value = EventAssignment_isSetSBOTerm(SBMLEventAssignment)
% value = EventAssignment_isSetSBOTerm(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'sboTerm')
value = (SBMLEventAssignment.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetMetai0000644 0000000 0000000 00000003433 11703262340 032170 0 ustar root root function value = EventAssignment_isSetMetaid(SBMLEventAssignment)
% value = EventAssignment_isSetMetaid(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'metaid')
value = ~isempty(SBMLEventAssignment.metaid);
else
error('metaid not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetMath.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_isSetMath.0000644 0000000 0000000 00000003417 11703262340 032102 0 ustar root root function value = EventAssignment_isSetMath(SBMLEventAssignment)
% value = EventAssignment_isSetMath(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'math')
value = ~isempty(SBMLEventAssignment.math);
else
error('math not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_getVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_getVariabl0000644 0000000 0000000 00000003404 11703262340 032177 0 ustar root root function variable = EventAssignment_getVariable(SBMLEventAssignment)
% variable = EventAssignment_getVariable(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the value of the variable attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'variable')
variable = SBMLEventAssignment.variable;
else
error('variable not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_getSBOTerm0000644 0000000 0000000 00000003373 11703262340 032077 0 ustar root root function sboTerm = EventAssignment_getSBOTerm(SBMLEventAssignment)
% sboTerm = EventAssignment_getSBOTerm(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'sboTerm')
sboTerm = SBMLEventAssignment.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_getMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_getMetaid.0000644 0000000 0000000 00000003362 11703262340 032103 0 ustar root root function metaid = EventAssignment_getMetaid(SBMLEventAssignment)
% metaid = EventAssignment_getMetaid(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'metaid')
metaid = SBMLEventAssignment.metaid;
else
error('metaid not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_getMath.m 0000644 0000000 0000000 00000003340 11703262340 031742 0 ustar root root function math = EventAssignment_getMath(SBMLEventAssignment)
% math = EventAssignment_getMath(SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEventAssignment);
if isfield(SBMLEventAssignment, 'math')
math = SBMLEventAssignment.math;
else
error('math not an attribute on SBML L%dV%d EventAssignment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/EventAssignment_create.m 0000644 0000000 0000000 00000005522 11703262340 031620 0 ustar root root function EventAssignment = EventAssignment_create(varargin)
% EventAssignment = EventAssignment_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML EventAssignment structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getEventAssignmentFieldnames(level, version);
if (num > 0)
values = getEventAssignmentDefaultValues(level, version);
EventAssignment = cell2struct(values, fieldnames, 2);
%add level and version
EventAssignment.level = level;
EventAssignment.version = version;
%check correct structure
if ~isSBML_EventAssignment(EventAssignment, level, version)
EventAssignment = struct();
warning('Warn:BadStruct', 'Failed to create EventAssignment');
end;
else
EventAssignment = [];
warning('Warn:InvalidLV', 'EventAssignment not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/EventAssignment/Contents.m 0000644 0000000 0000000 00000017032 11703262340 026757 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\EventAssignment
%
% The functions allow users to create and work with the SBML EventAssignment structure.
%
%===============================================================================
% EventAssignment = EventAssignment_create(level(optional), version(optional) )
%===============================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML EventAssignment structure of the appropriate level and version
%
%=====================================================
% math = EventAssignment_getMath(SBMLEventAssignment)
%=====================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the value of the math attribute
%
%=========================================================
% metaid = EventAssignment_getMetaid(SBMLEventAssignment)
%=========================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the value of the metaid attribute
%
%===========================================================
% sboTerm = EventAssignment_getSBOTerm(SBMLEventAssignment)
%===========================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the value of the sboTerm attribute
%
%=============================================================
% variable = EventAssignment_getVariable(SBMLEventAssignment)
%=============================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the value of the variable attribute
%
%========================================================
% value = EventAssignment_isSetMath(SBMLEventAssignment)
%========================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%==========================================================
% value = EventAssignment_isSetMetaid(SBMLEventAssignment)
%==========================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%===========================================================
% value = EventAssignment_isSetSBOTerm(SBMLEventAssignment)
%===========================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%============================================================
% value = EventAssignment_isSetVariable(SBMLEventAssignment)
%============================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. value =
% - 1 if the variable attribute is set
% - 0 otherwise
%
%==========================================================================
% SBMLEventAssignment = EventAssignment_setMath(SBMLEventAssignment, math)
%==========================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML EventAssignment structure with the new value for the math attribute
%
%==============================================================================
% SBMLEventAssignment = EventAssignment_setMetaid(SBMLEventAssignment, metaid)
%==============================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML EventAssignment structure with the new value for the metaid attribute
%
%================================================================================
% SBMLEventAssignment = EventAssignment_setSBOTerm(SBMLEventAssignment, sboTerm)
%================================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML EventAssignment structure with the new value for the sboTerm attribute
%
%==================================================================================
% SBMLEventAssignment = EventAssignment_setVariable(SBMLEventAssignment, variable)
%==================================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% 2. variable; a string representing the variable to be set
% Returns
% 1. the SBML EventAssignment structure with the new value for the variable attribute
%
%======================================================================
% SBMLEventAssignment = EventAssignment_unsetMath(SBMLEventAssignment)
%======================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the SBML EventAssignment structure with the math attribute unset
%
%========================================================================
% SBMLEventAssignment = EventAssignment_unsetMetaid(SBMLEventAssignment)
%========================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the SBML EventAssignment structure with the metaid attribute unset
%
%=========================================================================
% SBMLEventAssignment = EventAssignment_unsetSBOTerm(SBMLEventAssignment)
%=========================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the SBML EventAssignment structure with the sboTerm attribute unset
%
%==========================================================================
% SBMLEventAssignment = EventAssignment_unsetVariable(SBMLEventAssignment)
%==========================================================================
% Takes
% 1. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the SBML EventAssignment structure with the variable attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/ 0000755 0000000 0000000 00000000000 11704572230 022753 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetTrigger.m 0000644 0000000 0000000 00000003376 11703262310 026757 0 ustar root root function SBMLEvent = Event_unsetTrigger(SBMLEvent)
% SBMLEvent = Event_unsetTrigger(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the trigger field unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'trigger')
if (level == 2 && version < 3)
SBMLEvent.trigger = '';
else
SBMLEvent.trigger = [];
end;
else
error('trigger not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetTimeUnits.m 0000644 0000000 0000000 00000003301 11703262310 027261 0 ustar root root function SBMLEvent = Event_unsetTimeUnits(SBMLEvent)
% SBMLEvent = Event_unsetTimeUnits(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the timeUnits attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'timeUnits')
SBMLEvent.timeUnits = '';
else
error('timeUnits not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetSBOTerm.m 0000644 0000000 0000000 00000003265 11703262310 026624 0 ustar root root function SBMLEvent = Event_unsetSBOTerm(SBMLEvent)
% SBMLEvent = Event_unsetSBOTerm(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'sboTerm')
SBMLEvent.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetPriority.m 0000644 0000000 0000000 00000003267 11703262310 027174 0 ustar root root function SBMLEvent = Event_unsetPriority(SBMLEvent)
% SBMLEvent = Event_unsetPriority(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the priority field unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'priority')
SBMLEvent.priority = [];
else
error('priority not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetName.m 0000644 0000000 0000000 00000003243 11703262310 026225 0 ustar root root function SBMLEvent = Event_unsetName(SBMLEvent)
% SBMLEvent = Event_unsetName(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'name')
SBMLEvent.name = '';
else
error('name not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetMetaid.m 0000644 0000000 0000000 00000003257 11703262310 026555 0 ustar root root function SBMLEvent = Event_unsetMetaid(SBMLEvent)
% SBMLEvent = Event_unsetMetaid(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'metaid')
SBMLEvent.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetId.m 0000644 0000000 0000000 00000003227 11703262310 025703 0 ustar root root function SBMLEvent = Event_unsetId(SBMLEvent)
% SBMLEvent = Event_unsetId(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'id')
SBMLEvent.id = '';
else
error('id not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_unsetDelay.m 0000644 0000000 0000000 00000003360 11703262310 026403 0 ustar root root function SBMLEvent = Event_unsetDelay(SBMLEvent)
% SBMLEvent = Event_unsetDelay(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with the delay field unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'delay')
if (level == 2 && version < 3)
SBMLEvent.delay = '';
else
SBMLEvent.delay = [];
end;
else
error('delay not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setUseValuesFromTriggerTime.m 0000644 0000000 0000000 00000004237 11703262310 031711 0 ustar root root function SBMLEvent = Event_setUseValuesFromTriggerTime(SBMLEvent, useValuesFromTriggerTime)
% SBMLEvent = Event_setUseValuesFromTriggerTime(SBMLEvent, useValuesFromTriggerTime)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. useValuesFromTriggerTime, an integer (0/1) representing the value of useValuesFromTriggerTime to be set
%
% Returns
%
% 1. the SBML Event structure with the new value for the useValuesFromTriggerTime attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'useValuesFromTriggerTime')
if (~isIntegralNumber(useValuesFromTriggerTime) || useValuesFromTriggerTime < 0 || useValuesFromTriggerTime > 1)
error('useValuesFromTriggerTime must be an integer of value 0/1') ;
else
SBMLEvent.useValuesFromTriggerTime = useValuesFromTriggerTime;
end;
else
error('useValuesFromTriggerTime not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setTrigger.m 0000644 0000000 0000000 00000004360 11703262310 026406 0 ustar root root function SBMLEvent = Event_setTrigger(SBMLEvent, trigger)
% SBMLEvent = Event_setTrigger(SBMLEvent, SBMLTrigger)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLTrigger, an SBML Trigger structure
%
% Returns
%
% 1. the SBML Event structure with the new value for the trigger field
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isstruct(trigger)
[trigger_level, trigger_version] = GetLevelVersion(trigger);
if level ~= trigger_level
error('mismatch in levels');
elseif version ~= trigger_version
error('mismatch in versions');
end;
end;
if isfield(SBMLEvent, 'trigger')
if (level == 2 && version < 3) && ~ischar(trigger)
error('trigger must be character array') ;
elseif (((level == 2 && version > 2) || level > 2) ...
&& ~isValid(trigger, level, version))
error('trigger must be an SBML Trigger structure');
else
SBMLEvent.trigger = trigger;
end;
else
error('trigger not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setTimeUnits.m 0000644 0000000 0000000 00000003567 11703262310 026734 0 ustar root root function SBMLEvent = Event_setTimeUnits(SBMLEvent, timeUnits)
% SBMLEvent = Event_setTimeUnits(SBMLEvent, timeUnits)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. timeUnits; a string representing the timeUnits to be set
%
% Returns
%
% 1. the SBML Event structure with the new value for the timeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'timeUnits')
if ~ischar(timeUnits)
error('timeUnits must be character array') ;
else
SBMLEvent.timeUnits = timeUnits;
end;
else
error('timeUnits not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setSBOTerm.m 0000644 0000000 0000000 00000003544 11703262310 026261 0 ustar root root function SBMLEvent = Event_setSBOTerm(SBMLEvent, sboTerm)
% SBMLEvent = Event_setSBOTerm(SBMLEvent, sboTerm)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Event structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLEvent.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setPriority.m 0000644 0000000 0000000 00000004143 11703262310 026623 0 ustar root root function SBMLEvent = Event_setPriority(SBMLEvent, priority)
% SBMLEvent = Event_setPriority(SBMLEvent, SBMLPriority)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLPriority, an SBML Priority structure
%
% Returns
%
% 1. the SBML Event structure with the new value for the priority field
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isstruct(priority)
[priority_level, priority_version] = GetLevelVersion(priority);
if level ~= priority_level
error('mismatch in levels');
elseif version ~= priority_version
error('mismatch in versions');
end;
end;
if isfield(SBMLEvent, 'priority')
if ~isValid(priority, level, version)
error('priority must be an SBML Priority structure') ;
else
SBMLEvent.priority = priority;
end;
else
error('priority not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setName.m 0000644 0000000 0000000 00000003466 11703262310 025671 0 ustar root root function SBMLEvent = Event_setName(SBMLEvent, name)
% SBMLEvent = Event_setName(SBMLEvent, name)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML Event structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLEvent.name = name;
end;
else
error('name not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setMetaid.m 0000644 0000000 0000000 00000003520 11703262310 026203 0 ustar root root function SBMLEvent = Event_setMetaid(SBMLEvent, metaid)
% SBMLEvent = Event_setMetaid(SBMLEvent, metaid)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Event structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLEvent.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setId.m 0000644 0000000 0000000 00000003434 11703262310 025340 0 ustar root root function SBMLEvent = Event_setId(SBMLEvent, id)
% SBMLEvent = Event_setId(SBMLEvent, id)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML Event structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLEvent.id = id;
end;
else
error('id not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_setDelay.m 0000644 0000000 0000000 00000004305 11703262310 026040 0 ustar root root function SBMLEvent = Event_setDelay(SBMLEvent, delay)
% SBMLEvent = Event_setDelay(SBMLEvent, SBMLDelay)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. the SBML Event structure with the new value for the delay field
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isstruct(delay)
[delay_level, delay_version] = GetLevelVersion(delay);
if level ~= delay_level
error('mismatch in levels');
elseif version ~= delay_version
error('mismatch in versions');
end;
end;
if isfield(SBMLEvent, 'delay')
if (level == 2 && version < 3) && ~ischar(delay)
error('delay must be character array') ;
elseif (((level == 2 && version > 2) || level > 2) ...
&& ~isValid(delay, level, version))
error('delay must be an SBML Delay structure');
else
SBMLEvent.delay = delay;
end;
else
error('delay not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetTrigger.m 0000644 0000000 0000000 00000003301 11703262310 026674 0 ustar root root function value = Event_isSetTrigger(SBMLEvent)
% value = Event_isSetTrigger(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the trigger structure is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'trigger')
value = ~isempty(SBMLEvent.trigger);
else
error('trigger not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetTimeUnits.m 0000644 0000000 0000000 00000003315 11703262310 027217 0 ustar root root function value = Event_isSetTimeUnits(SBMLEvent)
% value = Event_isSetTimeUnits(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the timeUnits attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'timeUnits')
value = ~isempty(SBMLEvent.timeUnits);
else
error('timeUnits not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetSBOTerm.m 0000644 0000000 0000000 00000003275 11703262310 026556 0 ustar root root function value = Event_isSetSBOTerm(SBMLEvent)
% value = Event_isSetSBOTerm(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'sboTerm')
value = (SBMLEvent.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetPriority.m 0000644 0000000 0000000 00000003307 11703262310 027120 0 ustar root root function value = Event_isSetPriority(SBMLEvent)
% value = Event_isSetPriority(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the priority structure is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'priority')
value = ~isempty(SBMLEvent.priority);
else
error('priority not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetName.m 0000644 0000000 0000000 00000003257 11703262310 026163 0 ustar root root function value = Event_isSetName(SBMLEvent)
% value = Event_isSetName(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'name')
value = ~isempty(SBMLEvent.name);
else
error('name not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetMetaid.m 0000644 0000000 0000000 00000003273 11703262310 026504 0 ustar root root function value = Event_isSetMetaid(SBMLEvent)
% value = Event_isSetMetaid(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'metaid')
value = ~isempty(SBMLEvent.metaid);
else
error('metaid not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetId.m 0000644 0000000 0000000 00000003243 11703262310 025632 0 ustar root root function value = Event_isSetId(SBMLEvent)
% value = Event_isSetId(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'id')
value = ~isempty(SBMLEvent.id);
else
error('id not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_isSetDelay.m 0000644 0000000 0000000 00000003265 11703262310 026340 0 ustar root root function value = Event_isSetDelay(SBMLEvent)
% value = Event_isSetDelay(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. value =
% - 1 if the delay structure is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'delay')
value = ~isempty(SBMLEvent.delay);
else
error('delay not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getUseValuesFromTriggerTime.m 0000644 0000000 0000000 00000003464 11703262310 031676 0 ustar root root function useValuesFromTriggerTime = Event_getUseValuesFromTriggerTime(SBMLEvent)
% useValuesFromTriggerTime = Event_getUseValuesFromTriggerTime(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the value of the useValuesFromTriggerTime attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'useValuesFromTriggerTime')
useValuesFromTriggerTime = SBMLEvent.useValuesFromTriggerTime;
else
error('useValuesFromTriggerTime not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getTrigger.m 0000644 0000000 0000000 00000003223 11703262310 026367 0 ustar root root function trigger = Event_getTrigger(SBMLEvent)
% trigger = Event_getTrigger(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Trigger structure
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'trigger')
trigger = SBMLEvent.trigger;
else
error('trigger not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getTimeUnits.m 0000644 0000000 0000000 00000003255 11703262310 026712 0 ustar root root function timeUnits = Event_getTimeUnits(SBMLEvent)
% timeUnits = Event_getTimeUnits(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the value of the timeUnits attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'timeUnits')
timeUnits = SBMLEvent.timeUnits;
else
error('timeUnits not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getSBOTerm.m 0000644 0000000 0000000 00000003233 11703262310 026240 0 ustar root root function sboTerm = Event_getSBOTerm(SBMLEvent)
% sboTerm = Event_getSBOTerm(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'sboTerm')
sboTerm = SBMLEvent.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getPriority.m 0000644 0000000 0000000 00000003234 11703262310 026607 0 ustar root root function priority = Event_getPriority(SBMLEvent)
% priority = Event_getPriority(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Priority structure
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'priority')
priority = SBMLEvent.priority;
else
error('priority not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getNumEventAssignments.m 0000644 0000000 0000000 00000003345 11703262310 030746 0 ustar root root function num = Event_getNumEventAssignments(SBMLEvent)
% num = Event_getNumEventAssignments(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the number of SBML EventAssignment structures present in the Event
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'eventAssignment')
num = length(SBMLEvent.eventAssignment);
else
error('eventAssignment not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getName.m 0000644 0000000 0000000 00000003200 11703262310 025637 0 ustar root root function name = Event_getName(SBMLEvent)
% name = Event_getName(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'name')
name = SBMLEvent.name;
else
error('name not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getMetaid.m 0000644 0000000 0000000 00000003222 11703262310 026166 0 ustar root root function metaid = Event_getMetaid(SBMLEvent)
% metaid = Event_getMetaid(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'metaid')
metaid = SBMLEvent.metaid;
else
error('metaid not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getListOfEventAssignments.m 0000644 0000000 0000000 00000003357 11703262310 031412 0 ustar root root function eventAssignment = Event_getListOfEventAssignments(SBMLEvent)
% eventAssignment = Event_getListOfEventAssignments(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. an array of the eventAssignment structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'eventAssignment')
eventAssignment = SBMLEvent.eventAssignment;
else
error('eventAssignment not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getId.m 0000644 0000000 0000000 00000003156 11703262310 025325 0 ustar root root function id = Event_getId(SBMLEvent)
% id = Event_getId(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'id')
id = SBMLEvent.id;
else
error('id not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getEventAssignment.m 0000644 0000000 0000000 00000004022 11703262310 030074 0 ustar root root function eventAssignment = Event_getEventAssignment(SBMLEvent, index)
% eventAssignment = Event_getEventAssignment(SBMLEvent, index)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. index, an integer representing the index of SBML EventAssignment structure
%
% Returns
%
% 1. the SBML EventAssignment structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'eventAssignment')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLEvent.eventAssignment)
eventAssignment = SBMLEvent.eventAssignment(index);
else
error('index is out of range');
end;
else
error('eventAssignment not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_getDelay.m 0000644 0000000 0000000 00000003201 11703262310 026016 0 ustar root root function delay = Event_getDelay(SBMLEvent)
% delay = Event_getDelay(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Delay structure
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'delay')
delay = SBMLEvent.delay;
else
error('delay not an attribute on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_createTrigger.m 0000644 0000000 0000000 00000003423 11703262310 027055 0 ustar root root function SBMLEvent = Event_createTrigger(SBMLEvent)
% SBMLEvent = Event_createTrigger(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with a new SBML Trigger structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
SBMLTrigger = Trigger_create(level, version);
if isfield(SBMLEvent, 'trigger')
if ~isempty(SBMLTrigger)
SBMLEvent.trigger = SBMLTrigger;
end;
else
error('trigger not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_createPriority.m 0000644 0000000 0000000 00000003436 11703262310 027277 0 ustar root root function SBMLEvent = Event_createPriority(SBMLEvent)
% SBMLEvent = Event_createPriority(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with a new SBML Priority structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'priority')
SBMLPriority = Priority_create(level, version);
if ~isempty(SBMLPriority)
SBMLEvent.priority = SBMLPriority;
end;
else
error('priority not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_createEventAssignment.m 0000644 0000000 0000000 00000003674 11703262310 030574 0 ustar root root function SBMLEvent = Event_createEventAssignment(SBMLEvent)
% SBMLEvent = Event_acreateEventAssignment(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with a new SBML EventAssignment structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'eventAssignment')
SBMLEventAssignment = EventAssignment_create(level, version);
index = length(SBMLEvent.eventAssignment);
if index == 0
SBMLEvent.eventAssignment = SBMLEventAssignment;
else
SBMLEvent.eventAssignment(index+1) = SBMLEventAssignment;
end;
else
error('eventAssignment not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_createDelay.m 0000644 0000000 0000000 00000003400 11703262310 026503 0 ustar root root function SBMLEvent = Event_createDelay(SBMLEvent)
% SBMLEvent = Event_createDelay(SBMLEvent)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
%
% Returns
%
% 1. the SBML Event structure with a new SBML Delay structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
if isfield(SBMLEvent, 'delay')
SBMLDelay = Delay_create(level, version);
if ~isempty(SBMLDelay)
SBMLEvent.delay = SBMLDelay;
end;
else
error('delay not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_create.m 0000644 0000000 0000000 00000006335 11703262310 025536 0 ustar root root function Event = Event_create(varargin)
% Event = Event_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Event structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getEventFieldnames(level, version);
if (num > 0)
values = getEventDefaultValues(level, version);
Event = cell2struct(values, fieldnames, 2);
%add empty substructures
Event.eventAssignment = EventAssignment_create(level, version);
Event.eventAssignment(1:end) = [];
warning('off', 'Warn:InvalidLV');
t = Trigger_create(level, version);
if ~isempty(t)
Event.trigger = t;
Event.trigger(1:end) = [];
end;
d = Delay_create(level, version);
if ~isempty(d)
Event.delay = d;
Event.delay(1:end) = [];
end;
p = Priority_create(level, version);
if ~isempty(p)
Event.priority = p;
Event.priority(1:end) = [];
end;
warning('on', 'Warn:InvalidLV');
%add level and version
Event.level = level;
Event.version = version;
%check correct structure
if ~isSBML_Event(Event, level, version)
Event = struct();
warning('Warn:BadStruct', 'Failed to create Event');
end;
else
Event = [];
warning('Warn:InvalidLV', 'Event not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Event_addEventAssignment.m 0000644 0000000 0000000 00000004310 11703262310 030045 0 ustar root root function SBMLEvent = Event_addEventAssignment(SBMLEvent, SBMLEventAssignment)
% SBMLEvent = Event_addEventAssignment(SBMLEvent, SBMLEventAssignment)
%
% Takes
%
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLEventAssignment, an SBML EventAssignment structure
%
% Returns
%
% 1. the SBML Event structure with the SBML EventAssignment structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLEvent);
[eventAssignment_level, eventAssignment_version] = GetLevelVersion(SBMLEventAssignment);
if level ~= eventAssignment_level
error('mismatch in levels');
elseif version ~= eventAssignment_version
error('mismatch in versions');
end;
if isfield(SBMLEvent, 'eventAssignment')
index = length(SBMLEvent.eventAssignment);
if index == 0
SBMLEvent.eventAssignment = SBMLEventAssignment;
else
SBMLEvent.eventAssignment(index+1) = SBMLEventAssignment;
end;
else
error('eventAssignment not an element on SBML L%dV%d Event', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Event/Contents.m 0000644 0000000 0000000 00000032255 11703262310 024727 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Event
%
% The functions allow users to create and work with the SBML Event structure.
%
%======================================================================
% SBMLEvent = Event_addEventAssignment(SBMLEvent, SBMLEventAssignment)
%======================================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLEventAssignment, an SBML EventAssignment structure
% Returns
% 1. the SBML Event structure with the SBML EventAssignment structure added
%
%===========================================================
% Event = Event_create(level(optional), version(optional) )
%===========================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Event structure of the appropriate level and version
%
%==========================================
% SBMLEvent = Event_createDelay(SBMLEvent)
%==========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with a new SBML Delay structure added
%
%=====================================================
% SBMLEvent = Event_acreateEventAssignment(SBMLEvent)
%=====================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with a new SBML EventAssignment structure added
%
%=============================================
% SBMLEvent = Event_createPriority(SBMLEvent)
%=============================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with a new SBML Priority structure added
%
%============================================
% SBMLEvent = Event_createTrigger(SBMLEvent)
%============================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with a new SBML Trigger structure added
%
%===================================
% delay = Event_getDelay(SBMLEvent)
%===================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Delay structure
%
%==============================================================
% eventAssignment = Event_getEventAssignment(SBMLEvent, index)
%==============================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. index, an integer representing the index of SBML EventAssignment structure
% Returns
% 1. the SBML EventAssignment structure at the indexed position
%
%=============================
% id = Event_getId(SBMLEvent)
%=============================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the value of the id attribute
%
%==============================================================
% eventAssignment = Event_getListOfEventAssignments(SBMLEvent)
%==============================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. an array of the eventAssignment structures
%
%=====================================
% metaid = Event_getMetaid(SBMLEvent)
%=====================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the value of the metaid attribute
%
%=================================
% name = Event_getName(SBMLEvent)
%=================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the value of the name attribute
%
%===============================================
% num = Event_getNumEventAssignments(SBMLEvent)
%===============================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the number of SBML EventAssignment structures present in the Event
%
%=========================================
% priority = Event_getPriority(SBMLEvent)
%=========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Priority structure
%
%=======================================
% sboTerm = Event_getSBOTerm(SBMLEvent)
%=======================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the value of the sboTerm attribute
%
%===========================================
% timeUnits = Event_getTimeUnits(SBMLEvent)
%===========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the value of the timeUnits attribute
%
%=======================================
% trigger = Event_getTrigger(SBMLEvent)
%=======================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Trigger structure
%
%=========================================================================
% useValuesFromTriggerTime = Event_getUseValuesFromTriggerTime(SBMLEvent)
%=========================================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the value of the useValuesFromTriggerTime attribute
%
%=====================================
% value = Event_isSetDelay(SBMLEvent)
%=====================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the delay structure is set
% - 0 otherwise
%
%==================================
% value = Event_isSetId(SBMLEvent)
%==================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%======================================
% value = Event_isSetMetaid(SBMLEvent)
%======================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%====================================
% value = Event_isSetName(SBMLEvent)
%====================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%========================================
% value = Event_isSetPriority(SBMLEvent)
%========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the priority structure is set
% - 0 otherwise
%
%=======================================
% value = Event_isSetSBOTerm(SBMLEvent)
%=======================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%=========================================
% value = Event_isSetTimeUnits(SBMLEvent)
%=========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the timeUnits attribute is set
% - 0 otherwise
%
%=======================================
% value = Event_isSetTrigger(SBMLEvent)
%=======================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. value =
% - 1 if the trigger structure is set
% - 0 otherwise
%
%==================================================
% SBMLEvent = Event_setDelay(SBMLEvent, SBMLDelay)
%==================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLDelay, an SBML Delay structure
% Returns
% 1. the SBML Event structure with the new value for the delay field
%
%========================================
% SBMLEvent = Event_setId(SBMLEvent, id)
%========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML Event structure with the new value for the id attribute
%
%================================================
% SBMLEvent = Event_setMetaid(SBMLEvent, metaid)
%================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Event structure with the new value for the metaid attribute
%
%============================================
% SBMLEvent = Event_setName(SBMLEvent, name)
%============================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML Event structure with the new value for the name attribute
%
%========================================================
% SBMLEvent = Event_setPriority(SBMLEvent, SBMLPriority)
%========================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLPriority, an SBML Priority structure
% Returns
% 1. the SBML Event structure with the new value for the priority field
%
%==================================================
% SBMLEvent = Event_setSBOTerm(SBMLEvent, sboTerm)
%==================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Event structure with the new value for the sboTerm attribute
%
%======================================================
% SBMLEvent = Event_setTimeUnits(SBMLEvent, timeUnits)
%======================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. timeUnits; a string representing the timeUnits to be set
% Returns
% 1. the SBML Event structure with the new value for the timeUnits attribute
%
%======================================================
% SBMLEvent = Event_setTrigger(SBMLEvent, SBMLTrigger)
%======================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. SBMLTrigger, an SBML Trigger structure
% Returns
% 1. the SBML Event structure with the new value for the trigger field
%
%====================================================================================
% SBMLEvent = Event_setUseValuesFromTriggerTime(SBMLEvent, useValuesFromTriggerTime)
%====================================================================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% 2. useValuesFromTriggerTime, an integer (0/1) representing the value of useValuesFromTriggerTime to be set
% Returns
% 1. the SBML Event structure with the new value for the useValuesFromTriggerTime attribute
%
%=========================================
% SBMLEvent = Event_unsetDelay(SBMLEvent)
%=========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the delay field unset
%
%======================================
% SBMLEvent = Event_unsetId(SBMLEvent)
%======================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the id attribute unset
%
%==========================================
% SBMLEvent = Event_unsetMetaid(SBMLEvent)
%==========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the metaid attribute unset
%
%========================================
% SBMLEvent = Event_unsetName(SBMLEvent)
%========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the name attribute unset
%
%============================================
% SBMLEvent = Event_unsetPriority(SBMLEvent)
%============================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the priority field unset
%
%===========================================
% SBMLEvent = Event_unsetSBOTerm(SBMLEvent)
%===========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the sboTerm attribute unset
%
%=============================================
% SBMLEvent = Event_unsetTimeUnits(SBMLEvent)
%=============================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the timeUnits attribute unset
%
%===========================================
% SBMLEvent = Event_unsetTrigger(SBMLEvent)
%===========================================
% Takes
% 1. SBMLEvent, an SBML Event structure
% Returns
% 1. the SBML Event structure with the trigger field unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/ 0000755 0000000 0000000 00000000000 11704572226 022735 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_unsetSBOTerm.m 0000644 0000000 0000000 00000003261 11703262356 026564 0 ustar root root function SBMLDelay = Delay_unsetSBOTerm(SBMLDelay)
% SBMLDelay = Delay_unsetSBOTerm(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. the SBML Delay structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'sboTerm')
SBMLDelay.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_unsetMetaid.m 0000644 0000000 0000000 00000003253 11703262356 026515 0 ustar root root function SBMLDelay = Delay_unsetMetaid(SBMLDelay)
% SBMLDelay = Delay_unsetMetaid(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. the SBML Delay structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'metaid')
SBMLDelay.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_unsetMath.m 0000644 0000000 0000000 00000003237 11703262356 026205 0 ustar root root function SBMLDelay = Delay_unsetMath(SBMLDelay)
% SBMLDelay = Delay_unsetMath(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. the SBML Delay structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'math')
SBMLDelay.math = '';
else
error('math not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_setSBOTerm.m 0000644 0000000 0000000 00000003540 11703262356 026221 0 ustar root root function SBMLDelay = Delay_setSBOTerm(SBMLDelay, sboTerm)
% SBMLDelay = Delay_setSBOTerm(SBMLDelay, sboTerm)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Delay structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLDelay.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_setMetaid.m 0000644 0000000 0000000 00000003514 11703262356 026152 0 ustar root root function SBMLDelay = Delay_setMetaid(SBMLDelay, metaid)
% SBMLDelay = Delay_setMetaid(SBMLDelay, metaid)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Delay structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLDelay.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_setMath.m 0000644 0000000 0000000 00000003500 11703262356 025633 0 ustar root root function SBMLDelay = Delay_setMath(SBMLDelay, math)
% SBMLDelay = Delay_setMath(SBMLDelay, math)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML Delay structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLDelay.math = math;
end;
else
error('math not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_isSetSBOTerm.m 0000644 0000000 0000000 00000003271 11703262356 026516 0 ustar root root function value = Delay_isSetSBOTerm(SBMLDelay)
% value = Delay_isSetSBOTerm(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'sboTerm')
value = (SBMLDelay.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_isSetMetaid.m 0000644 0000000 0000000 00000003267 11703262356 026453 0 ustar root root function value = Delay_isSetMetaid(SBMLDelay)
% value = Delay_isSetMetaid(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'metaid')
value = ~isempty(SBMLDelay.metaid);
else
error('metaid not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_isSetMath.m 0000644 0000000 0000000 00000003253 11703262356 026134 0 ustar root root function value = Delay_isSetMath(SBMLDelay)
% value = Delay_isSetMath(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'math')
value = ~isempty(SBMLDelay.math);
else
error('math not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_getSBOTerm.m 0000644 0000000 0000000 00000003227 11703262356 026207 0 ustar root root function sboTerm = Delay_getSBOTerm(SBMLDelay)
% sboTerm = Delay_getSBOTerm(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'sboTerm')
sboTerm = SBMLDelay.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_getMetaid.m 0000644 0000000 0000000 00000003216 11703262356 026135 0 ustar root root function metaid = Delay_getMetaid(SBMLDelay)
% metaid = Delay_getMetaid(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'metaid')
metaid = SBMLDelay.metaid;
else
error('metaid not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_getMath.m 0000644 0000000 0000000 00000003174 11703262356 025626 0 ustar root root function math = Delay_getMath(SBMLDelay)
% math = Delay_getMath(SBMLDelay)
%
% Takes
%
% 1. SBMLDelay, an SBML Delay structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLDelay);
if isfield(SBMLDelay, 'math')
math = SBMLDelay.math;
else
error('math not an attribute on SBML L%dV%d Delay', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Delay_create.m 0000644 0000000 0000000 00000005262 11703262356 025500 0 ustar root root function Delay = Delay_create(varargin)
% Delay = Delay_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Delay structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getDelayFieldnames(level, version);
if (num > 0)
values = getDelayDefaultValues(level, version);
Delay = cell2struct(values, fieldnames, 2);
%add level and version
Delay.level = level;
Delay.version = version;
%check correct structure
if ~isSBML_Delay(Delay, level, version)
Delay = struct();
warning('Warn:BadStruct', 'Failed to create Delay');
end;
else
Delay = [];
warning('Warn:InvalidLV', 'Delay not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Delay/Contents.m 0000644 0000000 0000000 00000011461 11703262356 024712 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Delay
%
% The functions allow users to create and work with the SBML Delay structure.
%
%===========================================================
% Delay = Delay_create(level(optional), version(optional) )
%===========================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Delay structure of the appropriate level and version
%
%=================================
% math = Delay_getMath(SBMLDelay)
%=================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. the value of the math attribute
%
%=====================================
% metaid = Delay_getMetaid(SBMLDelay)
%=====================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. the value of the metaid attribute
%
%=======================================
% sboTerm = Delay_getSBOTerm(SBMLDelay)
%=======================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. the value of the sboTerm attribute
%
%====================================
% value = Delay_isSetMath(SBMLDelay)
%====================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%======================================
% value = Delay_isSetMetaid(SBMLDelay)
%======================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=======================================
% value = Delay_isSetSBOTerm(SBMLDelay)
%=======================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%============================================
% SBMLDelay = Delay_setMath(SBMLDelay, math)
%============================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML Delay structure with the new value for the math attribute
%
%================================================
% SBMLDelay = Delay_setMetaid(SBMLDelay, metaid)
%================================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Delay structure with the new value for the metaid attribute
%
%==================================================
% SBMLDelay = Delay_setSBOTerm(SBMLDelay, sboTerm)
%==================================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Delay structure with the new value for the sboTerm attribute
%
%========================================
% SBMLDelay = Delay_unsetMath(SBMLDelay)
%========================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. the SBML Delay structure with the math attribute unset
%
%==========================================
% SBMLDelay = Delay_unsetMetaid(SBMLDelay)
%==========================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. the SBML Delay structure with the metaid attribute unset
%
%===========================================
% SBMLDelay = Delay_unsetSBOTerm(SBMLDelay)
%===========================================
% Takes
% 1. SBMLDelay, an SBML Delay structure
% Returns
% 1. the SBML Delay structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Contents.m 0000644 0000000 0000000 00000005215 11703262354 023652 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions
%
% General functions for working with MATLAB_SBML structures.
%
%==================================
% level = GetLevel(SBMLStructure)
%==================================
% Takes
% 1. SBMLStructure, any SBML structure
% Returns
% 1. the SBML level corresponding to this structure
%
%====================================================
% [level, version] = GetLevelVersion(SBMLStructure)
%====================================================
% Takes
% 1. SBMLStructure, any SBML structure
% Returns
% 1. the SBML level corresponding to this structure
% 2. the SBML version corresponding to this structure
%
%=========================================================
% SBMLStructure = Object_create(typecode, level, version)
%=========================================================
% Takes
% 1. typecode; a string representing the type of object being queried
% 2. level; an integer representing an SBML level
% 3. version; an integer representing an SBML version
% Returns
% 1. an SBML structure representing the given typecode, level and version
%
%====================================================
% identical = areIdentical(SBMLStruct1, SBMLStruct2)
%====================================================
% Takes
% 1. SBMLStruct1, any SBML structure
% 2. SBMLStruct2, any SBML structure
% Returns
% 1. identical =
% - 1 if the structures are identical i.e. contain same fields and the same values
% - 0 otherwise
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/ 0000755 0000000 0000000 00000000000 11704572226 024023 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Contents.m 0000644 0000000 0000000 00000015265 11703262352 026002 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Constraint
%
% The functions allow users to create and work with the SBML Constraint structure.
%
%=====================================================================
% Constraint = Constraint_create(level(optional), version(optional) )
%=====================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Constraint structure of the appropriate level and version
%
%===========================================
% math = Constraint_getMath(SBMLConstraint)
%===========================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the value of the math attribute
%
%=================================================
% message = Constraint_getMessage(SBMLConstraint)
%=================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the value of the message attribute
%
%===============================================
% metaid = Constraint_getMetaid(SBMLConstraint)
%===============================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the value of the metaid attribute
%
%=================================================
% sboTerm = Constraint_getSBOTerm(SBMLConstraint)
%=================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the value of the sboTerm attribute
%
%==============================================
% value = Constraint_isSetMath(SBMLConstraint)
%==============================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%=================================================
% value = Constraint_isSetMessage(SBMLConstraint)
%=================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. value =
% - 1 if the message attribute is set
% - 0 otherwise
%
%================================================
% value = Constraint_isSetMetaid(SBMLConstraint)
%================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=================================================
% value = Constraint_isSetSBOTerm(SBMLConstraint)
%=================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%===========================================================
% SBMLConstraint = Constraint_setMath(SBMLConstraint, math)
%===========================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% 2. math; string representing the math expression math to be set
% Returns
% 1. the SBML Constraint structure with the new value for the math attribute
%
%=================================================================
% SBMLConstraint = Constraint_setMessage(SBMLConstraint, message)
%=================================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% 2. message; a string representing the message to be set
% Returns
% 1. the SBML Constraint structure with the new value for the message attribute
%
%===============================================================
% SBMLConstraint = Constraint_setMetaid(SBMLConstraint, metaid)
%===============================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Constraint structure with the new value for the metaid attribute
%
%=================================================================
% SBMLConstraint = Constraint_setSBOTerm(SBMLConstraint, sboTerm)
%=================================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Constraint structure with the new value for the sboTerm attribute
%
%=======================================================
% SBMLConstraint = Constraint_unsetMath(SBMLConstraint)
%=======================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the SBML Constraint structure with the math attribute unset
%
%==========================================================
% SBMLConstraint = Constraint_unsetMessage(SBMLConstraint)
%==========================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the SBML Constraint structure with the message attribute unset
%
%=========================================================
% SBMLConstraint = Constraint_unsetMetaid(SBMLConstraint)
%=========================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the SBML Constraint structure with the metaid attribute unset
%
%==========================================================
% SBMLConstraint = Constraint_unsetSBOTerm(SBMLConstraint)
%==========================================================
% Takes
% 1. SBMLConstraint, an SBML Constraint structure
% Returns
% 1. the SBML Constraint structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_unsetSBOTerm.m 0000644 0000000 0000000 00000003362 11703262352 030736 0 ustar root root function SBMLConstraint = Constraint_unsetSBOTerm(SBMLConstraint)
% SBMLConstraint = Constraint_unsetSBOTerm(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the SBML Constraint structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'sboTerm')
SBMLConstraint.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_unsetMetaid.m 0000644 0000000 0000000 00000003354 11703262352 030667 0 ustar root root function SBMLConstraint = Constraint_unsetMetaid(SBMLConstraint)
% SBMLConstraint = Constraint_unsetMetaid(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the SBML Constraint structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'metaid')
SBMLConstraint.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_unsetMessage.m 0000644 0000000 0000000 00000003362 11703262352 031047 0 ustar root root function SBMLConstraint = Constraint_unsetMessage(SBMLConstraint)
% SBMLConstraint = Constraint_unsetMessage(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the SBML Constraint structure with the message attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'message')
SBMLConstraint.message = '';
else
error('message not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_unsetMath.m 0000644 0000000 0000000 00000003340 11703262352 030350 0 ustar root root function SBMLConstraint = Constraint_unsetMath(SBMLConstraint)
% SBMLConstraint = Constraint_unsetMath(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the SBML Constraint structure with the math attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'math')
SBMLConstraint.math = '';
else
error('math not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_setSBOTerm.m 0000644 0000000 0000000 00000003641 11703262352 030373 0 ustar root root function SBMLConstraint = Constraint_setSBOTerm(SBMLConstraint, sboTerm)
% SBMLConstraint = Constraint_setSBOTerm(SBMLConstraint, sboTerm)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Constraint structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLConstraint.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_setMetaid.m 0000644 0000000 0000000 00000003615 11703262352 030324 0 ustar root root function SBMLConstraint = Constraint_setMetaid(SBMLConstraint, metaid)
% SBMLConstraint = Constraint_setMetaid(SBMLConstraint, metaid)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Constraint structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLConstraint.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_setMessage.m 0000644 0000000 0000000 00000003632 11703262352 030504 0 ustar root root function SBMLConstraint = Constraint_setMessage(SBMLConstraint, message)
% SBMLConstraint = Constraint_setMessage(SBMLConstraint, message)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
% 2. message; a string representing the message to be set
%
% Returns
%
% 1. the SBML Constraint structure with the new value for the message attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'message')
if ~ischar(message)
error('message must be character array') ;
else
SBMLConstraint.message = message;
end;
else
error('message not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_setMath.m 0000644 0000000 0000000 00000003601 11703262352 030005 0 ustar root root function SBMLConstraint = Constraint_setMath(SBMLConstraint, math)
% SBMLConstraint = Constraint_setMath(SBMLConstraint, math)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
% 2. math; string representing the math expression math to be set
%
% Returns
%
% 1. the SBML Constraint structure with the new value for the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'math')
if ~ischar(math)
error('math must be character array') ;
else
SBMLConstraint.math = math;
end;
else
error('math not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_isSetSBOTerm.m 0000644 0000000 0000000 00000003353 11703262352 030667 0 ustar root root function value = Constraint_isSetSBOTerm(SBMLConstraint)
% value = Constraint_isSetSBOTerm(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'sboTerm')
value = (SBMLConstraint.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_isSetMetaid.m 0000644 0000000 0000000 00000003351 11703262352 030615 0 ustar root root function value = Constraint_isSetMetaid(SBMLConstraint)
% value = Constraint_isSetMetaid(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'metaid')
value = ~isempty(SBMLConstraint.metaid);
else
error('metaid not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_isSetMessage.m 0000644 0000000 0000000 00000003357 11703262352 031004 0 ustar root root function value = Constraint_isSetMessage(SBMLConstraint)
% value = Constraint_isSetMessage(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. value =
% - 1 if the message attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'message')
value = ~isempty(SBMLConstraint.message);
else
error('message not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_isSetMath.m 0000644 0000000 0000000 00000003335 11703262352 030305 0 ustar root root function value = Constraint_isSetMath(SBMLConstraint)
% value = Constraint_isSetMath(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. value =
% - 1 if the math attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'math')
value = ~isempty(SBMLConstraint.math);
else
error('math not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_getSBOTerm.m 0000644 0000000 0000000 00000003311 11703262352 030351 0 ustar root root function sboTerm = Constraint_getSBOTerm(SBMLConstraint)
% sboTerm = Constraint_getSBOTerm(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'sboTerm')
sboTerm = SBMLConstraint.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_getMetaid.m 0000644 0000000 0000000 00000003300 11703262352 030277 0 ustar root root function metaid = Constraint_getMetaid(SBMLConstraint)
% metaid = Constraint_getMetaid(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'metaid')
metaid = SBMLConstraint.metaid;
else
error('metaid not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_getMessage.m 0000644 0000000 0000000 00000003311 11703262352 030462 0 ustar root root function message = Constraint_getMessage(SBMLConstraint)
% message = Constraint_getMessage(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the value of the message attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'message')
message = SBMLConstraint.message;
else
error('message not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_getMath.m 0000644 0000000 0000000 00000003256 11703262352 027777 0 ustar root root function math = Constraint_getMath(SBMLConstraint)
% math = Constraint_getMath(SBMLConstraint)
%
% Takes
%
% 1. SBMLConstraint, an SBML Constraint structure
%
% Returns
%
% 1. the value of the math attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLConstraint);
if isfield(SBMLConstraint, 'math')
math = SBMLConstraint.math;
else
error('math not an attribute on SBML L%dV%d Constraint', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Constraint/Constraint_create.m 0000644 0000000 0000000 00000005402 11703262352 027644 0 ustar root root function Constraint = Constraint_create(varargin)
% Constraint = Constraint_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Constraint structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getConstraintFieldnames(level, version);
if (num > 0)
values = getConstraintDefaultValues(level, version);
Constraint = cell2struct(values, fieldnames, 2);
%add level and version
Constraint.level = level;
Constraint.version = version;
%check correct structure
if ~isSBML_Constraint(Constraint, level, version)
Constraint = struct();
warning('Warn:BadStruct', 'Failed to create Constraint');
end;
else
Constraint = [];
warning('Warn:InvalidLV', 'Constraint not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/ 0000755 0000000 0000000 00000000000 11704572224 026206 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/Contents.m 0000644 0000000 0000000 00000015651 11703262364 030171 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\CompartmentVolumeRule
%
% The functions allow users to create and work with the SBML CompartmentVolumeRule structure.
%
%===========================================================================================
% CompartmentVolumeRule = CompartmentVolumeRule_create(level(optional), version(optional) )
%===========================================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML CompartmentVolumeRule structure of the appropriate level and version
%
%===============================================================================
% compartment = CompartmentVolumeRule_getCompartment(SBMLCompartmentVolumeRule)
%===============================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. the value of the compartment attribute
%
%=======================================================================
% formula = CompartmentVolumeRule_getFormula(SBMLCompartmentVolumeRule)
%=======================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. the value of the formula attribute
%
%=================================================================
% type = CompartmentVolumeRule_getType(SBMLCompartmentVolumeRule)
%=================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. the value of the type attribute
%
%===========================================================================
% value = CompartmentVolumeRule_isSetCompartment(SBMLCompartmentVolumeRule)
%===========================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. value =
% - 1 if the compartment attribute is set
% - 0 otherwise
%
%=======================================================================
% value = CompartmentVolumeRule_isSetFormula(SBMLCompartmentVolumeRule)
%=======================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%====================================================================
% value = CompartmentVolumeRule_isSetType(SBMLCompartmentVolumeRule)
%====================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. value =
% - 1 if the type attribute is set
% - 0 otherwise
%
%==========================================================================================================
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_setCompartment(SBMLCompartmentVolumeRule, compartment)
%==========================================================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. compartment; a string representing the compartment to be set
% Returns
% 1. the SBML CompartmentVolumeRule structure with the new value for the compartment attribute
%
%==================================================================================================
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_setFormula(SBMLCompartmentVolumeRule, formula)
%==================================================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML CompartmentVolumeRule structure with the new value for the formula attribute
%
%============================================================================================
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_setType(SBMLCompartmentVolumeRule, type)
%============================================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. type; a string representing the type to be set
% Returns
% 1. the SBML CompartmentVolumeRule structure with the new value for the type attribute
%
%===============================================================================================
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetCompartment(SBMLCompartmentVolumeRule)
%===============================================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. the SBML CompartmentVolumeRule structure with the compartment attribute unset
%
%===========================================================================================
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetFormula(SBMLCompartmentVolumeRule)
%===========================================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. the SBML CompartmentVolumeRule structure with the formula attribute unset
%
%========================================================================================
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetType(SBMLCompartmentVolumeRule)
%========================================================================================
% Takes
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% Returns
% 1. the SBML CompartmentVolumeRule structure with the type attribute unset
%
%
././@LongLink 0000000 0000000 0000000 00000000162 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_unsetType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003565 11703262364 032306 0 ustar root root function SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetType(SBMLCompartmentVolumeRule)
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetType(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. the SBML CompartmentVolumeRule structure with the type attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'type')
SBMLCompartmentVolumeRule.type = 'scalar';
else
error('type not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000165 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_unsetFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003601 11703262364 032275 0 ustar root root function SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetFormula(SBMLCompartmentVolumeRule)
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetFormula(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. the SBML CompartmentVolumeRule structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'formula')
SBMLCompartmentVolumeRule.formula = '';
else
error('formula not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_unsetCompartment.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003631 11703262364 032300 0 ustar root root function SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetCompartment(SBMLCompartmentVolumeRule)
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_unsetCompartment(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. the SBML CompartmentVolumeRule structure with the compartment attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'compartment')
SBMLCompartmentVolumeRule.compartment = '';
else
error('compartment not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000160 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_setType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000004002 11703262364 032271 0 ustar root root function SBMLCompartmentVolumeRule = CompartmentVolumeRule_setType(SBMLCompartmentVolumeRule, type)
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_setType(SBMLCompartmentVolumeRule, type)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. type; a string representing the type to be set
%
% Returns
%
% 1. the SBML CompartmentVolumeRule structure with the new value for the type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'type')
if ~ischar(type)
error('type must be character array') ;
else
SBMLCompartmentVolumeRule.type = type;
end;
else
error('type not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_setFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000004051 11703262364 032275 0 ustar root root function SBMLCompartmentVolumeRule = CompartmentVolumeRule_setFormula(SBMLCompartmentVolumeRule, formula)
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_setFormula(SBMLCompartmentVolumeRule, formula)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML CompartmentVolumeRule structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLCompartmentVolumeRule.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000167 00000000000 011571 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_setCompartment.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000004135 11703262364 032300 0 ustar root root function SBMLCompartmentVolumeRule = CompartmentVolumeRule_setCompartment(SBMLCompartmentVolumeRule, compartment)
% SBMLCompartmentVolumeRule = CompartmentVolumeRule_setCompartment(SBMLCompartmentVolumeRule, compartment)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
% 2. compartment; a string representing the compartment to be set
%
% Returns
%
% 1. the SBML CompartmentVolumeRule structure with the new value for the compartment attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'compartment')
if ~ischar(compartment)
error('compartment must be character array') ;
else
SBMLCompartmentVolumeRule.compartment = compartment;
end;
else
error('compartment not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000162 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_isSetType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003513 11703262364 032277 0 ustar root root function value = CompartmentVolumeRule_isSetType(SBMLCompartmentVolumeRule)
% value = CompartmentVolumeRule_isSetType(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. value =
% - 1 if the type attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'type')
value = ~isempty(SBMLCompartmentVolumeRule.type);
else
error('type not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000165 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_isSetFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003535 11703262364 032303 0 ustar root root function value = CompartmentVolumeRule_isSetFormula(SBMLCompartmentVolumeRule)
% value = CompartmentVolumeRule_isSetFormula(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'formula')
value = ~isempty(SBMLCompartmentVolumeRule.formula);
else
error('formula not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_isSetCompartment.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003565 11703262364 032306 0 ustar root root function value = CompartmentVolumeRule_isSetCompartment(SBMLCompartmentVolumeRule)
% value = CompartmentVolumeRule_isSetCompartment(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. value =
% - 1 if the compartment attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'compartment')
value = ~isempty(SBMLCompartmentVolumeRule.compartment);
else
error('compartment not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000160 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_getType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003434 11703262364 032301 0 ustar root root function type = CompartmentVolumeRule_getType(SBMLCompartmentVolumeRule)
% type = CompartmentVolumeRule_getType(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. the value of the type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'type')
type = SBMLCompartmentVolumeRule.type;
else
error('type not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000163 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_getFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003467 11703262364 032307 0 ustar root root function formula = CompartmentVolumeRule_getFormula(SBMLCompartmentVolumeRule)
% formula = CompartmentVolumeRule_getFormula(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'formula')
formula = SBMLCompartmentVolumeRule.formula;
else
error('formula not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000167 00000000000 011571 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_getCompartment.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000003533 11703262364 032301 0 ustar root root function compartment = CompartmentVolumeRule_getCompartment(SBMLCompartmentVolumeRule)
% compartment = CompartmentVolumeRule_getCompartment(SBMLCompartmentVolumeRule)
%
% Takes
%
% 1. SBMLCompartmentVolumeRule, an SBML CompartmentVolumeRule structure
%
% Returns
%
% 1. the value of the compartment attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentVolumeRule);
if isfield(SBMLCompartmentVolumeRule, 'compartment')
compartment = SBMLCompartmentVolumeRule.compartment;
else
error('compartment not an attribute on SBML L%dV%d CompartmentVolumeRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRule_create.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentVolumeRule/CompartmentVolumeRul0000644 0000000 0000000 00000005662 11703262364 032306 0 ustar root root function CompartmentVolumeRule = CompartmentVolumeRule_create(varargin)
% CompartmentVolumeRule = CompartmentVolumeRule_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML CompartmentVolumeRule structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getCompartmentVolumeRuleFieldnames(level, version);
if (num > 0)
values = getCompartmentVolumeRuleDefaultValues(level, version);
CompartmentVolumeRule = cell2struct(values, fieldnames, 2);
%add level and version
CompartmentVolumeRule.level = level;
CompartmentVolumeRule.version = version;
%check correct structure
if ~isSBML_CompartmentVolumeRule(CompartmentVolumeRule, level, version)
CompartmentVolumeRule = struct();
warning('Warn:BadStruct', 'Failed to create CompartmentVolumeRule');
end;
else
CompartmentVolumeRule = [];
warning('Warn:InvalidLV', 'CompartmentVolumeRule not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/ 0000755 0000000 0000000 00000000000 11704572224 025030 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/Contents.m 0000644 0000000 0000000 00000016574 11703262354 027017 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\CompartmentType
%
% The functions allow users to create and work with the SBML CompartmentType structure.
%
%===============================================================================
% CompartmentType = CompartmentType_create(level(optional), version(optional) )
%===============================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML CompartmentType structure of the appropriate level and version
%
%=================================================
% id = CompartmentType_getId(SBMLCompartmentType)
%=================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the value of the id attribute
%
%=========================================================
% metaid = CompartmentType_getMetaid(SBMLCompartmentType)
%=========================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the value of the metaid attribute
%
%=====================================================
% name = CompartmentType_getName(SBMLCompartmentType)
%=====================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the value of the name attribute
%
%===========================================================
% sboTerm = CompartmentType_getSBOTerm(SBMLCompartmentType)
%===========================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the value of the sboTerm attribute
%
%======================================================
% value = CompartmentType_isSetId(SBMLCompartmentType)
%======================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%==========================================================
% value = CompartmentType_isSetMetaid(SBMLCompartmentType)
%==========================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%========================================================
% value = CompartmentType_isSetName(SBMLCompartmentType)
%========================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%===========================================================
% value = CompartmentType_isSetSBOTerm(SBMLCompartmentType)
%===========================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%======================================================================
% SBMLCompartmentType = CompartmentType_setId(SBMLCompartmentType, id)
%======================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML CompartmentType structure with the new value for the id attribute
%
%==============================================================================
% SBMLCompartmentType = CompartmentType_setMetaid(SBMLCompartmentType, metaid)
%==============================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML CompartmentType structure with the new value for the metaid attribute
%
%==========================================================================
% SBMLCompartmentType = CompartmentType_setName(SBMLCompartmentType, name)
%==========================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML CompartmentType structure with the new value for the name attribute
%
%================================================================================
% SBMLCompartmentType = CompartmentType_setSBOTerm(SBMLCompartmentType, sboTerm)
%================================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML CompartmentType structure with the new value for the sboTerm attribute
%
%====================================================================
% SBMLCompartmentType = CompartmentType_unsetId(SBMLCompartmentType)
%====================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the SBML CompartmentType structure with the id attribute unset
%
%========================================================================
% SBMLCompartmentType = CompartmentType_unsetMetaid(SBMLCompartmentType)
%========================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the SBML CompartmentType structure with the metaid attribute unset
%
%======================================================================
% SBMLCompartmentType = CompartmentType_unsetName(SBMLCompartmentType)
%======================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the SBML CompartmentType structure with the name attribute unset
%
%=========================================================================
% SBMLCompartmentType = CompartmentType_unsetSBOTerm(SBMLCompartmentType)
%=========================================================================
% Takes
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% Returns
% 1. the SBML CompartmentType structure with the sboTerm attribute unset
%
%
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_unsetSBOTe0000644 0000000 0000000 00000003463 11703262354 032166 0 ustar root root function SBMLCompartmentType = CompartmentType_unsetSBOTerm(SBMLCompartmentType)
% SBMLCompartmentType = CompartmentType_unsetSBOTerm(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the SBML CompartmentType structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'sboTerm')
SBMLCompartmentType.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_unsetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_unsetName.0000644 0000000 0000000 00000003441 11703262354 032204 0 ustar root root function SBMLCompartmentType = CompartmentType_unsetName(SBMLCompartmentType)
% SBMLCompartmentType = CompartmentType_unsetName(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the SBML CompartmentType structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'name')
SBMLCompartmentType.name = '';
else
error('name not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_unsetMetai0000644 0000000 0000000 00000003455 11703262354 032312 0 ustar root root function SBMLCompartmentType = CompartmentType_unsetMetaid(SBMLCompartmentType)
% SBMLCompartmentType = CompartmentType_unsetMetaid(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the SBML CompartmentType structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'metaid')
SBMLCompartmentType.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_unsetId.m 0000644 0000000 0000000 00000003425 11703262354 032037 0 ustar root root function SBMLCompartmentType = CompartmentType_unsetId(SBMLCompartmentType)
% SBMLCompartmentType = CompartmentType_unsetId(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the SBML CompartmentType structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'id')
SBMLCompartmentType.id = '';
else
error('id not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_setSBOTerm0000644 0000000 0000000 00000003742 11703262354 032162 0 ustar root root function SBMLCompartmentType = CompartmentType_setSBOTerm(SBMLCompartmentType, sboTerm)
% SBMLCompartmentType = CompartmentType_setSBOTerm(SBMLCompartmentType, sboTerm)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML CompartmentType structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLCompartmentType.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_setName.m 0000644 0000000 0000000 00000003664 11703262354 032025 0 ustar root root function SBMLCompartmentType = CompartmentType_setName(SBMLCompartmentType, name)
% SBMLCompartmentType = CompartmentType_setName(SBMLCompartmentType, name)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML CompartmentType structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLCompartmentType.name = name;
end;
else
error('name not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_setMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_setMetaid.0000644 0000000 0000000 00000003716 11703262354 032171 0 ustar root root function SBMLCompartmentType = CompartmentType_setMetaid(SBMLCompartmentType, metaid)
% SBMLCompartmentType = CompartmentType_setMetaid(SBMLCompartmentType, metaid)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML CompartmentType structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLCompartmentType.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_setId.m 0000644 0000000 0000000 00000003632 11703262354 031474 0 ustar root root function SBMLCompartmentType = CompartmentType_setId(SBMLCompartmentType, id)
% SBMLCompartmentType = CompartmentType_setId(SBMLCompartmentType, id)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML CompartmentType structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLCompartmentType.id = id;
end;
else
error('id not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_isSetSBOTe0000644 0000000 0000000 00000003435 11703262354 032116 0 ustar root root function value = CompartmentType_isSetSBOTerm(SBMLCompartmentType)
% value = CompartmentType_isSetSBOTerm(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'sboTerm')
value = (SBMLCompartmentType.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_isSetName.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_isSetName.0000644 0000000 0000000 00000003417 11703262354 032140 0 ustar root root function value = CompartmentType_isSetName(SBMLCompartmentType)
% value = CompartmentType_isSetName(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'name')
value = ~isempty(SBMLCompartmentType.name);
else
error('name not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_isSetMetai0000644 0000000 0000000 00000003433 11703262354 032237 0 ustar root root function value = CompartmentType_isSetMetaid(SBMLCompartmentType)
% value = CompartmentType_isSetMetaid(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'metaid')
value = ~isempty(SBMLCompartmentType.metaid);
else
error('metaid not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_isSetId.m 0000644 0000000 0000000 00000003403 11703262354 031764 0 ustar root root function value = CompartmentType_isSetId(SBMLCompartmentType)
% value = CompartmentType_isSetId(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'id')
value = ~isempty(SBMLCompartmentType.id);
else
error('id not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_getSBOTerm0000644 0000000 0000000 00000003373 11703262354 032146 0 ustar root root function sboTerm = CompartmentType_getSBOTerm(SBMLCompartmentType)
% sboTerm = CompartmentType_getSBOTerm(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'sboTerm')
sboTerm = SBMLCompartmentType.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_getName.m 0000644 0000000 0000000 00000003340 11703262354 032000 0 ustar root root function name = CompartmentType_getName(SBMLCompartmentType)
% name = CompartmentType_getName(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'name')
name = SBMLCompartmentType.name;
else
error('name not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_getMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_getMetaid.0000644 0000000 0000000 00000003362 11703262354 032152 0 ustar root root function metaid = CompartmentType_getMetaid(SBMLCompartmentType)
% metaid = CompartmentType_getMetaid(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'metaid')
metaid = SBMLCompartmentType.metaid;
else
error('metaid not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_getId.m 0000644 0000000 0000000 00000003316 11703262354 031457 0 ustar root root function id = CompartmentType_getId(SBMLCompartmentType)
% id = CompartmentType_getId(SBMLCompartmentType)
%
% Takes
%
% 1. SBMLCompartmentType, an SBML CompartmentType structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartmentType);
if isfield(SBMLCompartmentType, 'id')
id = SBMLCompartmentType.id;
else
error('id not an attribute on SBML L%dV%d CompartmentType', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/CompartmentType/CompartmentType_create.m 0000644 0000000 0000000 00000005522 11703262354 031667 0 ustar root root function CompartmentType = CompartmentType_create(varargin)
% CompartmentType = CompartmentType_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML CompartmentType structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getCompartmentTypeFieldnames(level, version);
if (num > 0)
values = getCompartmentTypeDefaultValues(level, version);
CompartmentType = cell2struct(values, fieldnames, 2);
%add level and version
CompartmentType.level = level;
CompartmentType.version = version;
%check correct structure
if ~isSBML_CompartmentType(CompartmentType, level, version)
CompartmentType = struct();
warning('Warn:BadStruct', 'Failed to create CompartmentType');
end;
else
CompartmentType = [];
warning('Warn:InvalidLV', 'CompartmentType not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/ 0000755 0000000 0000000 00000000000 11704572224 024166 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Contents.m 0000644 0000000 0000000 00000050640 11703262324 026142 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\Compartment
%
% The functions allow users to create and work with the SBML Compartment structure.
%
%=======================================================================
% Compartment = Compartment_create(level(optional), version(optional) )
%=======================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML Compartment structure of the appropriate level and version
%
%===================================================================
% compartmentType = Compartment_getCompartmentType(SBMLCompartment)
%===================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the compartmentType attribute
%
%=====================================================
% constant = Compartment_getConstant(SBMLCompartment)
%=====================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the constant attribute
%
%=========================================
% id = Compartment_getId(SBMLCompartment)
%=========================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the id attribute
%
%=================================================
% metaid = Compartment_getMetaid(SBMLCompartment)
%=================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the metaid attribute
%
%=============================================
% name = Compartment_getName(SBMLCompartment)
%=============================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the name attribute
%
%===================================================
% outside = Compartment_getOutside(SBMLCompartment)
%===================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the outside attribute
%
%===================================================
% sboTerm = Compartment_getSBOTerm(SBMLCompartment)
%===================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the sboTerm attribute
%
%=============================================
% size = Compartment_getSize(SBMLCompartment)
%=============================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the size attribute
%
%=======================================================================
% spatialDimensions = Compartment_getSpatialDimensions(SBMLCompartment)
%=======================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the spatialDimensions attribute
%
%===============================================
% units = Compartment_getUnits(SBMLCompartment)
%===============================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the units attribute
%
%=================================================
% volume = Compartment_getVolume(SBMLCompartment)
%=================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the value of the volume attribute
%
%==================================================================
% y = Compartment_isAssignedByRateRule(SBMLCompartment, SBMLRules)
%==================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the rateRule used to assigned value to the Compartment
% - 0 if the Compartment is not assigned by rateRule
%
%
%==============================================================
% y = Compartment_isAssignedByRule(SBMLCompartment, SBMLRules)
%==============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - the index of the assignmentRule used to assigned value to the Compartment
% - 0 if the Compartment is not assigned by assignmentRule
%
%
%===============================================================
% y = Compartment_isInAlgebraicRule(SBMLCompartment, SBMLRules)
%===============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. SBMLRules; the array of rules from an SBML Model structure
% Returns
% y =
% - an array of the indices of any algebraicRules the id of the Compartment appears in
% - 0 if the Compartment appears in no algebraicRules
%
%
%===========================================================
% value = Compartment_isSetCompartmentType(SBMLCompartment)
%===========================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the compartmentType attribute is set
% - 0 otherwise
%
%==============================================
% value = Compartment_isSetId(SBMLCompartment)
%==============================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%==================================================
% value = Compartment_isSetMetaid(SBMLCompartment)
%==================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%================================================
% value = Compartment_isSetName(SBMLCompartment)
%================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%===================================================
% value = Compartment_isSetOutside(SBMLCompartment)
%===================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the outside attribute is set
% - 0 otherwise
%
%===================================================
% value = Compartment_isSetSBOTerm(SBMLCompartment)
%===================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%================================================
% value = Compartment_isSetSize(SBMLCompartment)
%================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the size attribute is set
% - 0 otherwise
%
%=============================================================
% value = Compartment_isSetSpatialDimensions(SBMLCompartment)
%=============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the spatialDimensions attribute is set
% - 0 otherwise
%
%=================================================
% value = Compartment_isSetUnits(SBMLCompartment)
%=================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%==================================================
% value = Compartment_isSetVolume(SBMLCompartment)
%==================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. value =
% - 1 if the volume attribute is set
% - 0 otherwise
%
%====================================================================================
% SBMLCompartment = Compartment_setCompartmentType(SBMLCompartment, compartmentType)
%====================================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. compartmentType; a string representing the compartmentType to be set
% Returns
% 1. the SBML Compartment structure with the new value for the compartmentType attribute
%
%======================================================================
% SBMLCompartment = Compartment_setConstant(SBMLCompartment, constant)
%======================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. constant, an integer (0/1) representing the value of constant to be set
% Returns
% 1. the SBML Compartment structure with the new value for the constant attribute
%
%==========================================================
% SBMLCompartment = Compartment_setId(SBMLCompartment, id)
%==========================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. id; a string representing the id to be set
% Returns
% 1. the SBML Compartment structure with the new value for the id attribute
%
%==================================================================
% SBMLCompartment = Compartment_setMetaid(SBMLCompartment, metaid)
%==================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML Compartment structure with the new value for the metaid attribute
%
%==============================================================
% SBMLCompartment = Compartment_setName(SBMLCompartment, name)
%==============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. name; a string representing the name to be set
% Returns
% 1. the SBML Compartment structure with the new value for the name attribute
%
%====================================================================
% SBMLCompartment = Compartment_setOutside(SBMLCompartment, outside)
%====================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. outside; a string representing the outside to be set
% Returns
% 1. the SBML Compartment structure with the new value for the outside attribute
%
%====================================================================
% SBMLCompartment = Compartment_setSBOTerm(SBMLCompartment, sboTerm)
%====================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML Compartment structure with the new value for the sboTerm attribute
%
%==============================================================
% SBMLCompartment = Compartment_setSize(SBMLCompartment, size)
%==============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. size; number representing the value of size to be set
% Returns
% 1. the SBML Compartment structure with the new value for the size attribute
%
%========================================================================================
% SBMLCompartment = Compartment_setSpatialDimensions(SBMLCompartment, spatialDimensions)
%========================================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. spatialDimensions; number representing the value of spatialDimensions to be set
% Returns
% 1. the SBML Compartment structure with the new value for the spatialDimensions attribute
%
%================================================================
% SBMLCompartment = Compartment_setUnits(SBMLCompartment, units)
%================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. units; a string representing the units to be set
% Returns
% 1. the SBML Compartment structure with the new value for the units attribute
%
%==================================================================
% SBMLCompartment = Compartment_setVolume(SBMLCompartment, volume)
%==================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% 2. volume; number representing the value of volume to be set
% Returns
% 1. the SBML Compartment structure with the new value for the volume attribute
%
%=====================================================================
% SBMLCompartment = Compartment_unsetCompartmentType(SBMLCompartment)
%=====================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the compartmentType attribute unset
%
%========================================================
% SBMLCompartment = Compartment_unsetId(SBMLCompartment)
%========================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the id attribute unset
%
%============================================================
% SBMLCompartment = Compartment_unsetMetaid(SBMLCompartment)
%============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the metaid attribute unset
%
%==========================================================
% SBMLCompartment = Compartment_unsetName(SBMLCompartment)
%==========================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the name attribute unset
%
%=============================================================
% SBMLCompartment = Compartment_unsetOutside(SBMLCompartment)
%=============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the outside attribute unset
%
%=============================================================
% SBMLCompartment = Compartment_unsetSBOTerm(SBMLCompartment)
%=============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the sboTerm attribute unset
%
%==========================================================
% SBMLCompartment = Compartment_unsetSize(SBMLCompartment)
%==========================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the size attribute unset
%
%=======================================================================
% SBMLCompartment = Compartment_unsetSpatialDimensions(SBMLCompartment)
%=======================================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the spatialDimensions attribute unset
%
%===========================================================
% SBMLCompartment = Compartment_unsetUnits(SBMLCompartment)
%===========================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the units attribute unset
%
%============================================================
% SBMLCompartment = Compartment_unsetVolume(SBMLCompartment)
%============================================================
% Takes
% 1. SBMLCompartment, an SBML Compartment structure
% Returns
% 1. the SBML Compartment structure with the volume attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetVolume.m 0000644 0000000 0000000 00000003651 11703262324 031244 0 ustar root root function SBMLCompartment = Compartment_unsetVolume(SBMLCompartment)
% SBMLCompartment = Compartment_unsetVolume(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the volume attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'volume')
if level == 1
SBMLCompartment.volume = 1;
else
SBMLCompartment.volume = NaN;
end;
if (isfield(SBMLCompartment, 'isSetVolume'))
SBMLCompartment.isSetVolume = 0;
end;
else
error('volume not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetUnits.m 0000644 0000000 0000000 00000003407 11703262324 031076 0 ustar root root function SBMLCompartment = Compartment_unsetUnits(SBMLCompartment)
% SBMLCompartment = Compartment_unsetUnits(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the units attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'units')
SBMLCompartment.units = '';
else
error('units not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetSpatialDimensions.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetSpatialDimens0000644 0000000 0000000 00000004016 11703262324 032273 0 ustar root root function SBMLCompartment = Compartment_unsetSpatialDimensions(SBMLCompartment)
% SBMLCompartment = Compartment_unsetSpatialDimensions(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the spatialDimensions attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'spatialDimensions')
if (level > 2)
SBMLCompartment.spatialDimensions = NaN;
else
SBMLCompartment.spatialDimensions = 3;
end;
if (isfield(SBMLCompartment, 'isSetSpatialDimensions'))
SBMLCompartment.isSetSpatialDimensions = 0;
end;
else
error('spatialDimensions not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetSize.m 0000644 0000000 0000000 00000003537 11703262324 030712 0 ustar root root function SBMLCompartment = Compartment_unsetSize(SBMLCompartment)
% SBMLCompartment = Compartment_unsetSize(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the size attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'size')
SBMLCompartment.size = NaN;
if (isfield(SBMLCompartment, 'isSetSize'))
SBMLCompartment.isSetSize = 0;
end;
else
error('size not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetSBOTerm.m 0000644 0000000 0000000 00000003423 11703262324 031245 0 ustar root root function SBMLCompartment = Compartment_unsetSBOTerm(SBMLCompartment)
% SBMLCompartment = Compartment_unsetSBOTerm(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'sboTerm')
SBMLCompartment.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetOutside.m 0000644 0000000 0000000 00000003423 11703262324 031406 0 ustar root root function SBMLCompartment = Compartment_unsetOutside(SBMLCompartment)
% SBMLCompartment = Compartment_unsetOutside(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the outside attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'outside')
SBMLCompartment.outside = '';
else
error('outside not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetName.m 0000644 0000000 0000000 00000003401 11703262324 030646 0 ustar root root function SBMLCompartment = Compartment_unsetName(SBMLCompartment)
% SBMLCompartment = Compartment_unsetName(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the name attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'name')
SBMLCompartment.name = '';
else
error('name not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetMetaid.m 0000644 0000000 0000000 00000003415 11703262324 031176 0 ustar root root function SBMLCompartment = Compartment_unsetMetaid(SBMLCompartment)
% SBMLCompartment = Compartment_unsetMetaid(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'metaid')
SBMLCompartment.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetId.m 0000644 0000000 0000000 00000003365 11703262324 030333 0 ustar root root function SBMLCompartment = Compartment_unsetId(SBMLCompartment)
% SBMLCompartment = Compartment_unsetId(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'id')
SBMLCompartment.id = '';
else
error('id not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetCompartmentType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_unsetCompartmentTy0000644 0000000 0000000 00000003503 11703262324 032344 0 ustar root root function SBMLCompartment = Compartment_unsetCompartmentType(SBMLCompartment)
% SBMLCompartment = Compartment_unsetCompartmentType(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the SBML Compartment structure with the compartmentType attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'compartmentType')
SBMLCompartment.compartmentType = '';
else
error('compartmentType not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setVolume.m 0000644 0000000 0000000 00000004021 11703262324 030671 0 ustar root root function SBMLCompartment = Compartment_setVolume(SBMLCompartment, volume)
% SBMLCompartment = Compartment_setVolume(SBMLCompartment, volume)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. volume; number representing the value of volume to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the volume attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'volume')
if ~isnumeric(volume)
error('volume must be numeric') ;
else
SBMLCompartment.volume = volume;
if (isfield(SBMLCompartment, 'isSetVolume'))
SBMLCompartment.isSetVolume = 1;
end;
end;
else
error('volume not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setUnits.m 0000644 0000000 0000000 00000003641 11703262324 030533 0 ustar root root function SBMLCompartment = Compartment_setUnits(SBMLCompartment, units)
% SBMLCompartment = Compartment_setUnits(SBMLCompartment, units)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. units; a string representing the units to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'units')
if ~ischar(units)
error('units must be character array') ;
else
SBMLCompartment.units = units;
end;
else
error('units not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setSpatialDimensions.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setSpatialDimensio0000644 0000000 0000000 00000004605 11703262324 032264 0 ustar root root function SBMLCompartment = Compartment_setSpatialDimensions(SBMLCompartment, spatialDimensions)
% SBMLCompartment = Compartment_setSpatialDimensions(SBMLCompartment, spatialDimensions)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. spatialDimensions; number representing the value of spatialDimensions to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the spatialDimensions attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'spatialDimensions')
if (level > 2 && ~isnumeric(spatialDimensions))
error('spatialDimensions must be numeric') ;
elseif (level < 3 && (~isIntegralNumber(spatialDimensions) ...
|| spatialDimensions < 0 || spatialDimensions > 3))
error('spatialDimensions must be integer values 0, 1, 2, or 3');
else
SBMLCompartment.spatialDimensions = spatialDimensions;
if (isfield(SBMLCompartment, 'isSetSpatialDimensions'))
SBMLCompartment.isSetSpatialDimensions = 1;
end;
end;
else
error('spatialDimensions not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setSize.m 0000644 0000000 0000000 00000003763 11703262324 030350 0 ustar root root function SBMLCompartment = Compartment_setSize(SBMLCompartment, size)
% SBMLCompartment = Compartment_setSize(SBMLCompartment, size)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. size; number representing the value of size to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the size attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'size')
if ~isnumeric(size)
error('size must be numeric') ;
else
SBMLCompartment.size = size;
if (isfield(SBMLCompartment, 'isSetSize'))
SBMLCompartment.isSetSize = 1;
end;
end;
else
error('size not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setSBOTerm.m 0000644 0000000 0000000 00000003702 11703262324 030702 0 ustar root root function SBMLCompartment = Compartment_setSBOTerm(SBMLCompartment, sboTerm)
% SBMLCompartment = Compartment_setSBOTerm(SBMLCompartment, sboTerm)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLCompartment.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setOutside.m 0000644 0000000 0000000 00000003673 11703262324 031052 0 ustar root root function SBMLCompartment = Compartment_setOutside(SBMLCompartment, outside)
% SBMLCompartment = Compartment_setOutside(SBMLCompartment, outside)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. outside; a string representing the outside to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the outside attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'outside')
if ~ischar(outside)
error('outside must be character array') ;
else
SBMLCompartment.outside = outside;
end;
else
error('outside not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setName.m 0000644 0000000 0000000 00000003624 11703262324 030312 0 ustar root root function SBMLCompartment = Compartment_setName(SBMLCompartment, name)
% SBMLCompartment = Compartment_setName(SBMLCompartment, name)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. name; a string representing the name to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'name')
if ~ischar(name)
error('name must be character array') ;
else
SBMLCompartment.name = name;
end;
else
error('name not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setMetaid.m 0000644 0000000 0000000 00000003656 11703262324 030642 0 ustar root root function SBMLCompartment = Compartment_setMetaid(SBMLCompartment, metaid)
% SBMLCompartment = Compartment_setMetaid(SBMLCompartment, metaid)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLCompartment.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setId.m 0000644 0000000 0000000 00000003572 11703262324 027770 0 ustar root root function SBMLCompartment = Compartment_setId(SBMLCompartment, id)
% SBMLCompartment = Compartment_setId(SBMLCompartment, id)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. id; a string representing the id to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLCompartment.id = id;
end;
else
error('id not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setConstant.m 0000644 0000000 0000000 00000004015 11703262324 031216 0 ustar root root function SBMLCompartment = Compartment_setConstant(SBMLCompartment, constant)
% SBMLCompartment = Compartment_setConstant(SBMLCompartment, constant)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. constant, an integer (0/1) representing the value of constant to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'constant')
if (~isIntegralNumber(constant) || constant < 0 || constant > 1)
error('constant must be an integer of value 0/1') ;
else
SBMLCompartment.constant = constant;
end;
else
error('constant not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setCompartmentType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_setCompartmentType0000644 0000000 0000000 00000004043 11703262324 032326 0 ustar root root function SBMLCompartment = Compartment_setCompartmentType(SBMLCompartment, compartmentType)
% SBMLCompartment = Compartment_setCompartmentType(SBMLCompartment, compartmentType)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. compartmentType; a string representing the compartmentType to be set
%
% Returns
%
% 1. the SBML Compartment structure with the new value for the compartmentType attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'compartmentType')
if ~ischar(compartmentType)
error('compartmentType must be character array') ;
else
SBMLCompartment.compartmentType = compartmentType;
end;
else
error('compartmentType not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetVolume.m 0000644 0000000 0000000 00000003407 11703262324 031174 0 ustar root root function value = Compartment_isSetVolume(SBMLCompartment)
% value = Compartment_isSetVolume(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the volume attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'volume')
value = SBMLCompartment.isSetVolume;
else
error('isSetVolume not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetUnits.m 0000644 0000000 0000000 00000003401 11703262324 031021 0 ustar root root function value = Compartment_isSetUnits(SBMLCompartment)
% value = Compartment_isSetUnits(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the units attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'units')
value = ~isempty(SBMLCompartment.units);
else
error('units not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetSpatialDimensions.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetSpatialDimens0000644 0000000 0000000 00000003565 11703262324 032234 0 ustar root root function value = Compartment_isSetSpatialDimensions(SBMLCompartment)
% value = Compartment_isSetSpatialDimensions(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the spatialDimensions attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'spatialDimensions')
if (level < 3)
value = 1;
else
value = SBMLCompartment.isSetSpatialDimensions;
end;
else
error('spatialDimensions not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetSize.m 0000644 0000000 0000000 00000003373 11703262324 030641 0 ustar root root function value = Compartment_isSetSize(SBMLCompartment)
% value = Compartment_isSetSize(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the size attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'size')
value = SBMLCompartment.isSetSize;
else
error('isSetSize not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetSBOTerm.m 0000644 0000000 0000000 00000003411 11703262324 031173 0 ustar root root function value = Compartment_isSetSBOTerm(SBMLCompartment)
% value = Compartment_isSetSBOTerm(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'sboTerm')
value = (SBMLCompartment.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetOutside.m 0000644 0000000 0000000 00000003415 11703262324 031340 0 ustar root root function value = Compartment_isSetOutside(SBMLCompartment)
% value = Compartment_isSetOutside(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the outside attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'outside')
value = ~isempty(SBMLCompartment.outside);
else
error('outside not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetName.m 0000644 0000000 0000000 00000003373 11703262324 030607 0 ustar root root function value = Compartment_isSetName(SBMLCompartment)
% value = Compartment_isSetName(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the name attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'name')
value = ~isempty(SBMLCompartment.name);
else
error('name not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetMetaid.m 0000644 0000000 0000000 00000003407 11703262324 031130 0 ustar root root function value = Compartment_isSetMetaid(SBMLCompartment)
% value = Compartment_isSetMetaid(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'metaid')
value = ~isempty(SBMLCompartment.metaid);
else
error('metaid not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetId.m 0000644 0000000 0000000 00000003357 11703262324 030265 0 ustar root root function value = Compartment_isSetId(SBMLCompartment)
% value = Compartment_isSetId(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'id')
value = ~isempty(SBMLCompartment.id);
else
error('id not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetCompartmentType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isSetCompartmentTy0000644 0000000 0000000 00000003475 11703262324 032305 0 ustar root root function value = Compartment_isSetCompartmentType(SBMLCompartment)
% value = Compartment_isSetCompartmentType(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. value =
% - 1 if the compartmentType attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'compartmentType')
value = ~isempty(SBMLCompartment.compartmentType);
else
error('compartmentType not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isInAlgebraicRule.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isInAlgebraicRule.0000644 0000000 0000000 00000006253 11703262324 032066 0 ustar root root function y = Compartment_isInAlgebraicRule(SBMLCompartment, SBMLRules)
% y = Compartment_isInAlgebraicRule(SBMLCompartment, SBMLRules)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - an array of the indices of any algebraicRules the id of the Compartment appears in
% - 0 if the Compartment appears in no algebraicRules
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLCompartment))
error(sprintf('%s', ...
'argument must be an SBML Compartment structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLCompartment);
if (~isSBML_Compartment(SBMLCompartment, sbmlLevel, sbmlVersion))
error('Compartment_isInAlgebraicRule(SBMLCompartment, SBMLRules)\n%s', ...
'first argument must be an SBMLCompartment structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Compartment_isInAlgebraicRule(SBMLCompartment, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Compartment_isInAlgebraicRule(SBMLCompartment, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the Compartment occurs
%determine the name or id of the Compartment
if (sbmlLevel == 1)
name = SBMLCompartment.name;
else
if (isempty(SBMLCompartment.id))
name = SBMLCompartment.name;
else
name = SBMLCompartment.id;
end;
end;
y = [];
for i = 1:NumRules
index = matchName(SBMLRules(i).formula, name);
if (~isempty(index) && strcmp(SBMLRules(i).typecode, 'SBML_ALGEBRAIC_RULE'))
y = [y;i];
end;
end;
if isempty(y)
y = 0;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isAssignedByRule.m0000644 0000000 0000000 00000006670 11703262324 032136 0 ustar root root function y = Compartment_isAssignedByRule(SBMLCompartment, SBMLRules)
% y = Compartment_isAssignedByRule(SBMLCompartment, SBMLRules)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the assignmentRule used to assigned value to the Compartment
% - 0 if the Compartment is not assigned by assignmentRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLCompartment))
error(sprintf('%s', ...
'argument must be an SBML Compartment structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLCompartment);
if (~isSBML_Compartment(SBMLCompartment, sbmlLevel, sbmlVersion))
error('Compartment_isAssignedByRule(SBMLCompartment, SBMLRules)\n%s', ...
'first argument must be an SBMLCompartment structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Compartment_isAssignedByRule(SBMLCompartment, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Compartment_isAssignedByRule(SBMLCompartment, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the species is assigned by it
%determine the name or id of the species
if (sbmlLevel == 1)
name = SBMLCompartment.name;
else
if (isempty(SBMLCompartment.id))
name = SBMLCompartment.name;
else
name = SBMLCompartment.id;
end;
end;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_ASSIGNMENT_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
elseif ((strcmp(SBMLRules(i).typecode, 'SBML_COMPARTMENT_VOLUME_RULE')) ...
&& (strcmp(SBMLRules(i).type, 'scalar')))
if (strcmp(SBMLRules(i).compartment, name))
y = i;
return;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isAssignedByRateRule.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_isAssignedByRateRu0000644 0000000 0000000 00000006700 11703262324 032170 0 ustar root root function y = Compartment_isAssignedByRateRule(SBMLCompartment, SBMLRules)
% y = Compartment_isAssignedByRateRule(SBMLCompartment, SBMLRules)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
% 2. SBMLRules; the array of rules from an SBML Model structure
%
% Returns
%
% y =
% - the index of the rateRule used to assigned value to the Compartment
% - 0 if the Compartment is not assigned by rateRule
%
%
y = 0;
%-------------------------------------------------------------------
% check input arguments are as expected
if (~isstruct(SBMLCompartment))
error(sprintf('%s', ...
'argument must be an SBML Compartment structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLCompartment);
if (~isSBML_Compartment(SBMLCompartment, sbmlLevel, sbmlVersion))
error('Compartment_isAssignedByRateRule(SBMLCompartment, SBMLRules)\n%s', ...
'first argument must be an SBMLCompartment structure');
end;
NumRules = length(SBMLRules);
if (NumRules < 1)
error('Compartment_isAssignedByRateRule(SBMLCompartment, SBMLRules)\n%s', ...
'SBMLRule structure is empty');
else
for i = 1:NumRules
if (~isSBML_Rule(SBMLRules(i), sbmlLevel, sbmlVersion))
error('Compartment_isAssignedByRateRule(SBMLCompartment, SBMLRules)\n%s', ...
'second argument must be an array of SBMLRule structures');
end;
end;
end;
%--------------------------------------------------------------------------
% loop through each rule and check whether the Compartment is assigned by it
%determine the name or id of the Compartment
if (sbmlLevel == 1)
name = SBMLCompartment.name;
else
if (isempty(SBMLCompartment.id))
name = SBMLCompartment.name;
else
name = SBMLCompartment.id;
end;
end;
for i = 1:NumRules
if (strcmp(SBMLRules(i).typecode, 'SBML_RATE_RULE'))
if (strcmp(SBMLRules(i).variable, name))
% once found return as cannot occur more than once
y = i;
return;
end;
elseif ((strcmp(SBMLRules(i).typecode, 'SBML_COMPARTMENT_VOLUME_RULE')) ...
&& (strcmp(SBMLRules(i).type, 'rate')))
if (strcmp(SBMLRules(i).Compartment, name))
y = i;
return;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getVolume.m 0000644 0000000 0000000 00000003346 11703262324 030666 0 ustar root root function volume = Compartment_getVolume(SBMLCompartment)
% volume = Compartment_getVolume(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the volume attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'volume')
volume = SBMLCompartment.volume;
else
error('volume not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getUnits.m 0000644 0000000 0000000 00000003335 11703262324 030517 0 ustar root root function units = Compartment_getUnits(SBMLCompartment)
% units = Compartment_getUnits(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the units attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'units')
units = SBMLCompartment.units;
else
error('units not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getSpatialDimensions.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getSpatialDimensio0000644 0000000 0000000 00000003511 11703262324 032243 0 ustar root root function spatialDimensions = Compartment_getSpatialDimensions(SBMLCompartment)
% spatialDimensions = Compartment_getSpatialDimensions(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the spatialDimensions attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'spatialDimensions')
spatialDimensions = SBMLCompartment.spatialDimensions;
else
error('spatialDimensions not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getSize.m 0000644 0000000 0000000 00000003324 11703262324 030325 0 ustar root root function size = Compartment_getSize(SBMLCompartment)
% size = Compartment_getSize(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the size attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'size')
size = SBMLCompartment.size;
else
error('size not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getSBOTerm.m 0000644 0000000 0000000 00000003357 11703262324 030674 0 ustar root root function sboTerm = Compartment_getSBOTerm(SBMLCompartment)
% sboTerm = Compartment_getSBOTerm(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'sboTerm')
sboTerm = SBMLCompartment.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getOutside.m 0000644 0000000 0000000 00000003357 11703262324 031035 0 ustar root root function outside = Compartment_getOutside(SBMLCompartment)
% outside = Compartment_getOutside(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the outside attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'outside')
outside = SBMLCompartment.outside;
else
error('outside not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getName.m 0000644 0000000 0000000 00000003324 11703262324 030273 0 ustar root root function name = Compartment_getName(SBMLCompartment)
% name = Compartment_getName(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the name attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'name')
name = SBMLCompartment.name;
else
error('name not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getMetaid.m 0000644 0000000 0000000 00000003346 11703262324 030622 0 ustar root root function metaid = Compartment_getMetaid(SBMLCompartment)
% metaid = Compartment_getMetaid(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'metaid')
metaid = SBMLCompartment.metaid;
else
error('metaid not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getId.m 0000644 0000000 0000000 00000003302 11703262324 027743 0 ustar root root function id = Compartment_getId(SBMLCompartment)
% id = Compartment_getId(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'id')
id = SBMLCompartment.id;
else
error('id not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getConstant.m 0000644 0000000 0000000 00000003370 11703262324 031205 0 ustar root root function constant = Compartment_getConstant(SBMLCompartment)
% constant = Compartment_getConstant(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the constant attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'constant')
constant = SBMLCompartment.constant;
else
error('constant not an attribute on SBML L%dV%d Compartment', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getCompartmentType.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_getCompartmentType0000644 0000000 0000000 00000003467 11703262324 032323 0 ustar root root function compartmentType = Compartment_getCompartmentType(SBMLCompartment)
% compartmentType = Compartment_getCompartmentType(SBMLCompartment)
%
% Takes
%
% 1. SBMLCompartment, an SBML Compartment structure
%
% Returns
%
% 1. the value of the compartmentType attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLCompartment);
if isfield(SBMLCompartment, 'compartmentType')
compartmentType = SBMLCompartment.compartmentType;
else
error('compartmentType not an attribute on SBML L%dV%d Compartment', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/Compartment/Compartment_create.m 0000644 0000000 0000000 00000005456 11703262324 030166 0 ustar root root function Compartment = Compartment_create(varargin)
% Compartment = Compartment_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML Compartment structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getCompartmentFieldnames(level, version);
if (num > 0)
values = getCompartmentDefaultValues(level, version);
Compartment = cell2struct(values, fieldnames, 2);
%add level and version
Compartment.level = level;
Compartment.version = version;
%check correct structure
if ~isSBML_Compartment(Compartment, level, version)
Compartment = struct();
warning('Warn:BadStruct', 'Failed to create Compartment');
end;
else
Compartment = [];
warning('Warn:InvalidLV', 'Compartment not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/ 0000755 0000000 0000000 00000000000 11704572222 024633 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/Contents.m 0000644 0000000 0000000 00000016653 11703262360 026617 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\AssignmentRule
%
% The functions allow users to create and work with the SBML AssignmentRule structure.
%
%=============================================================================
% AssignmentRule = AssignmentRule_create(level(optional), version(optional) )
%=============================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML AssignmentRule structure of the appropriate level and version
%
%=========================================================
% formula = AssignmentRule_getFormula(SBMLAssignmentRule)
%=========================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the value of the formula attribute
%
%=======================================================
% metaid = AssignmentRule_getMetaid(SBMLAssignmentRule)
%=======================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the value of the metaid attribute
%
%=========================================================
% sboTerm = AssignmentRule_getSBOTerm(SBMLAssignmentRule)
%=========================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the value of the sboTerm attribute
%
%===========================================================
% variable = AssignmentRule_getVariable(SBMLAssignmentRule)
%===========================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the value of the variable attribute
%
%=========================================================
% value = AssignmentRule_isSetFormula(SBMLAssignmentRule)
%=========================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%========================================================
% value = AssignmentRule_isSetMetaid(SBMLAssignmentRule)
%========================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=========================================================
% value = AssignmentRule_isSetSBOTerm(SBMLAssignmentRule)
%=========================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==========================================================
% value = AssignmentRule_isSetVariable(SBMLAssignmentRule)
%==========================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. value =
% - 1 if the variable attribute is set
% - 0 otherwise
%
%=============================================================================
% SBMLAssignmentRule = AssignmentRule_setFormula(SBMLAssignmentRule, formula)
%=============================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML AssignmentRule structure with the new value for the formula attribute
%
%===========================================================================
% SBMLAssignmentRule = AssignmentRule_setMetaid(SBMLAssignmentRule, metaid)
%===========================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML AssignmentRule structure with the new value for the metaid attribute
%
%=============================================================================
% SBMLAssignmentRule = AssignmentRule_setSBOTerm(SBMLAssignmentRule, sboTerm)
%=============================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML AssignmentRule structure with the new value for the sboTerm attribute
%
%===============================================================================
% SBMLAssignmentRule = AssignmentRule_setVariable(SBMLAssignmentRule, variable)
%===============================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. variable; a string representing the variable to be set
% Returns
% 1. the SBML AssignmentRule structure with the new value for the variable attribute
%
%======================================================================
% SBMLAssignmentRule = AssignmentRule_unsetFormula(SBMLAssignmentRule)
%======================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the SBML AssignmentRule structure with the formula attribute unset
%
%=====================================================================
% SBMLAssignmentRule = AssignmentRule_unsetMetaid(SBMLAssignmentRule)
%=====================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the SBML AssignmentRule structure with the metaid attribute unset
%
%======================================================================
% SBMLAssignmentRule = AssignmentRule_unsetSBOTerm(SBMLAssignmentRule)
%======================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the SBML AssignmentRule structure with the sboTerm attribute unset
%
%=======================================================================
% SBMLAssignmentRule = AssignmentRule_unsetVariable(SBMLAssignmentRule)
%=======================================================================
% Takes
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% Returns
% 1. the SBML AssignmentRule structure with the variable attribute unset
%
%
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetVariabl0000644 0000000 0000000 00000003454 11703262356 032246 0 ustar root root function SBMLAssignmentRule = AssignmentRule_unsetVariable(SBMLAssignmentRule)
% SBMLAssignmentRule = AssignmentRule_unsetVariable(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the SBML AssignmentRule structure with the variable attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'variable')
SBMLAssignmentRule.variable = '';
else
error('variable not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetSBOTerm0000644 0000000 0000000 00000003446 11703262360 032135 0 ustar root root function SBMLAssignmentRule = AssignmentRule_unsetSBOTerm(SBMLAssignmentRule)
% SBMLAssignmentRule = AssignmentRule_unsetSBOTerm(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the SBML AssignmentRule structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'sboTerm')
SBMLAssignmentRule.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetMetaid.0000644 0000000 0000000 00000003440 11703262360 032135 0 ustar root root function SBMLAssignmentRule = AssignmentRule_unsetMetaid(SBMLAssignmentRule)
% SBMLAssignmentRule = AssignmentRule_unsetMetaid(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the SBML AssignmentRule structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'metaid')
SBMLAssignmentRule.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_unsetFormula0000644 0000000 0000000 00000003446 11703262360 032267 0 ustar root root function SBMLAssignmentRule = AssignmentRule_unsetFormula(SBMLAssignmentRule)
% SBMLAssignmentRule = AssignmentRule_unsetFormula(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the SBML AssignmentRule structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'formula')
SBMLAssignmentRule.formula = '';
else
error('formula not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_setVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_setVariable.0000644 0000000 0000000 00000003733 11703262360 032121 0 ustar root root function SBMLAssignmentRule = AssignmentRule_setVariable(SBMLAssignmentRule, variable)
% SBMLAssignmentRule = AssignmentRule_setVariable(SBMLAssignmentRule, variable)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. variable; a string representing the variable to be set
%
% Returns
%
% 1. the SBML AssignmentRule structure with the new value for the variable attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'variable')
if ~ischar(variable)
error('variable must be character array') ;
else
SBMLAssignmentRule.variable = variable;
end;
else
error('variable not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_setSBOTerm.m0000644 0000000 0000000 00000003725 11703262360 032025 0 ustar root root function SBMLAssignmentRule = AssignmentRule_setSBOTerm(SBMLAssignmentRule, sboTerm)
% SBMLAssignmentRule = AssignmentRule_setSBOTerm(SBMLAssignmentRule, sboTerm)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML AssignmentRule structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLAssignmentRule.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_setMetaid.m 0000644 0000000 0000000 00000003701 11703262360 031747 0 ustar root root function SBMLAssignmentRule = AssignmentRule_setMetaid(SBMLAssignmentRule, metaid)
% SBMLAssignmentRule = AssignmentRule_setMetaid(SBMLAssignmentRule, metaid)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML AssignmentRule structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLAssignmentRule.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_setFormula.m0000644 0000000 0000000 00000003716 11703262360 032157 0 ustar root root function SBMLAssignmentRule = AssignmentRule_setFormula(SBMLAssignmentRule, formula)
% SBMLAssignmentRule = AssignmentRule_setFormula(SBMLAssignmentRule, formula)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML AssignmentRule structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLAssignmentRule.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetVariabl0000644 0000000 0000000 00000003435 11703262360 032171 0 ustar root root function value = AssignmentRule_isSetVariable(SBMLAssignmentRule)
% value = AssignmentRule_isSetVariable(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. value =
% - 1 if the variable attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'variable')
value = ~isempty(SBMLAssignmentRule.variable);
else
error('variable not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetSBOTerm0000644 0000000 0000000 00000003423 11703262360 032061 0 ustar root root function value = AssignmentRule_isSetSBOTerm(SBMLAssignmentRule)
% value = AssignmentRule_isSetSBOTerm(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'sboTerm')
value = (SBMLAssignmentRule.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetMetaid.0000644 0000000 0000000 00000003421 11703262360 032065 0 ustar root root function value = AssignmentRule_isSetMetaid(SBMLAssignmentRule)
% value = AssignmentRule_isSetMetaid(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'metaid')
value = ~isempty(SBMLAssignmentRule.metaid);
else
error('metaid not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetFormula.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_isSetFormula0000644 0000000 0000000 00000003427 11703262360 032217 0 ustar root root function value = AssignmentRule_isSetFormula(SBMLAssignmentRule)
% value = AssignmentRule_isSetFormula(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'formula')
value = ~isempty(SBMLAssignmentRule.formula);
else
error('formula not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_getVariable.m SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_getVariable.0000644 0000000 0000000 00000003372 11703262360 032104 0 ustar root root function variable = AssignmentRule_getVariable(SBMLAssignmentRule)
% variable = AssignmentRule_getVariable(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the value of the variable attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'variable')
variable = SBMLAssignmentRule.variable;
else
error('variable not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_getSBOTerm.m0000644 0000000 0000000 00000003361 11703262356 032012 0 ustar root root function sboTerm = AssignmentRule_getSBOTerm(SBMLAssignmentRule)
% sboTerm = AssignmentRule_getSBOTerm(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'sboTerm')
sboTerm = SBMLAssignmentRule.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_getMetaid.m 0000644 0000000 0000000 00000003350 11703262360 031733 0 ustar root root function metaid = AssignmentRule_getMetaid(SBMLAssignmentRule)
% metaid = AssignmentRule_getMetaid(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'metaid')
metaid = SBMLAssignmentRule.metaid;
else
error('metaid not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_getFormula.m0000644 0000000 0000000 00000003361 11703262356 032144 0 ustar root root function formula = AssignmentRule_getFormula(SBMLAssignmentRule)
% formula = AssignmentRule_getFormula(SBMLAssignmentRule)
%
% Takes
%
% 1. SBMLAssignmentRule, an SBML AssignmentRule structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAssignmentRule);
if isfield(SBMLAssignmentRule, 'formula')
formula = SBMLAssignmentRule.formula;
else
error('formula not an attribute on SBML L%dV%d AssignmentRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AssignmentRule/AssignmentRule_create.m 0000644 0000000 0000000 00000005502 11703262360 031274 0 ustar root root function AssignmentRule = AssignmentRule_create(varargin)
% AssignmentRule = AssignmentRule_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML AssignmentRule structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getAssignmentRuleFieldnames(level, version);
if (num > 0)
values = getAssignmentRuleDefaultValues(level, version);
AssignmentRule = cell2struct(values, fieldnames, 2);
%add level and version
AssignmentRule.level = level;
AssignmentRule.version = version;
%check correct structure
if ~isSBML_AssignmentRule(AssignmentRule, level, version)
AssignmentRule = struct();
warning('Warn:BadStruct', 'Failed to create AssignmentRule');
end;
else
AssignmentRule = [];
warning('Warn:InvalidLV', 'AssignmentRule not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/areIdentical.m 0000644 0000000 0000000 00000005107 11703262346 024442 0 ustar root root function identical = areIdentical(struct1, struct2)
% identical = areIdentical(SBMLStruct1, SBMLStruct2)
%
% Takes
%
% 1. SBMLStruct1, any SBML structure
% 2. SBMLStruct2, any SBML structure
%
% Returns
%
% 1. identical =
% - 1 if the structures are identical i.e. contain same fields and the same values
% - 0 otherwise
%
if ~isValid(struct1)
error('first argument must be an SBML Structure');
elseif ~isValid(struct2)
error('second argument must be an SBML Structure');
end;
identical = 1;
fields1 = fieldnames(struct1);
fields2 = fieldnames(struct2);
if length(fields1) ~= length(fields2)
identical = 0;
end;
% fieldnames the same
if (identical)
i = 1;
while identical && i <= length(fields1)
if ~strcmp(fields1{i}, fields2{i})
identical = 0;
end;
i = i + 1;
end;
end;
%fieldvalues the same
if (identical)
i = 1;
while identical && i < length(fields1)
value1 = getfield(struct1, fields1{i});
value2 = getfield(struct2, fields1{i});
if isstruct(value1)
if length(value1) > 0 && ~areIdentical(value1, value2)
identical = 0;
end;
elseif isnan(value1)
if ~isnan(value2)
identical = 0;
end;
elseif isnumeric(value1)
if value1 ~= value2
identical = 0;
end;
elseif ischar(value1)
if ~strcmp(value1, value2)
identical = 0;
end;
end;
i = i + 1;
end;
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/ 0000755 0000000 0000000 00000000000 11704572222 024374 5 ustar root root SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/Contents.m 0000644 0000000 0000000 00000013563 11703262334 026356 0 ustar root root % toolbox\MATLAB_SBML_Structure_Functions\AlgebraicRule
%
% The functions allow users to create and work with the SBML AlgebraicRule structure.
%
%===========================================================================
% AlgebraicRule = AlgebraicRule_create(level(optional), version(optional) )
%===========================================================================
% Takes
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
% Returns
% 1. a MATLAB_SBML AlgebraicRule structure of the appropriate level and version
%
%=======================================================
% formula = AlgebraicRule_getFormula(SBMLAlgebraicRule)
%=======================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. the value of the formula attribute
%
%=====================================================
% metaid = AlgebraicRule_getMetaid(SBMLAlgebraicRule)
%=====================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. the value of the metaid attribute
%
%=======================================================
% sboTerm = AlgebraicRule_getSBOTerm(SBMLAlgebraicRule)
%=======================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. the value of the sboTerm attribute
%
%=======================================================
% value = AlgebraicRule_isSetFormula(SBMLAlgebraicRule)
%=======================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%======================================================
% value = AlgebraicRule_isSetMetaid(SBMLAlgebraicRule)
%======================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=======================================================
% value = AlgebraicRule_isSetSBOTerm(SBMLAlgebraicRule)
%=======================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==========================================================================
% SBMLAlgebraicRule = AlgebraicRule_setFormula(SBMLAlgebraicRule, formula)
%==========================================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. formula; a string representing the formula to be set
% Returns
% 1. the SBML AlgebraicRule structure with the new value for the formula attribute
%
%========================================================================
% SBMLAlgebraicRule = AlgebraicRule_setMetaid(SBMLAlgebraicRule, metaid)
%========================================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. metaid; a string representing the metaid to be set
% Returns
% 1. the SBML AlgebraicRule structure with the new value for the metaid attribute
%
%==========================================================================
% SBMLAlgebraicRule = AlgebraicRule_setSBOTerm(SBMLAlgebraicRule, sboTerm)
%==========================================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. sboTerm, an integer representing the sboTerm to be set
% Returns
% 1. the SBML AlgebraicRule structure with the new value for the sboTerm attribute
%
%===================================================================
% SBMLAlgebraicRule = AlgebraicRule_unsetFormula(SBMLAlgebraicRule)
%===================================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. the SBML AlgebraicRule structure with the formula attribute unset
%
%==================================================================
% SBMLAlgebraicRule = AlgebraicRule_unsetMetaid(SBMLAlgebraicRule)
%==================================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. the SBML AlgebraicRule structure with the metaid attribute unset
%
%===================================================================
% SBMLAlgebraicRule = AlgebraicRule_unsetSBOTerm(SBMLAlgebraicRule)
%===================================================================
% Takes
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% Returns
% 1. the SBML AlgebraicRule structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_unsetSBOTerm.m0000644 0000000 0000000 00000003431 11703262334 031665 0 ustar root root function SBMLAlgebraicRule = AlgebraicRule_unsetSBOTerm(SBMLAlgebraicRule)
% SBMLAlgebraicRule = AlgebraicRule_unsetSBOTerm(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. the SBML AlgebraicRule structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'sboTerm')
SBMLAlgebraicRule.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_unsetMetaid.m 0000644 0000000 0000000 00000003423 11703262334 031616 0 ustar root root function SBMLAlgebraicRule = AlgebraicRule_unsetMetaid(SBMLAlgebraicRule)
% SBMLAlgebraicRule = AlgebraicRule_unsetMetaid(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. the SBML AlgebraicRule structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'metaid')
SBMLAlgebraicRule.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_unsetFormula.m0000644 0000000 0000000 00000003431 11703262334 032017 0 ustar root root function SBMLAlgebraicRule = AlgebraicRule_unsetFormula(SBMLAlgebraicRule)
% SBMLAlgebraicRule = AlgebraicRule_unsetFormula(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. the SBML AlgebraicRule structure with the formula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'formula')
SBMLAlgebraicRule.formula = '';
else
error('formula not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_setSBOTerm.m 0000644 0000000 0000000 00000003710 11703262334 031322 0 ustar root root function SBMLAlgebraicRule = AlgebraicRule_setSBOTerm(SBMLAlgebraicRule, sboTerm)
% SBMLAlgebraicRule = AlgebraicRule_setSBOTerm(SBMLAlgebraicRule, sboTerm)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. sboTerm, an integer representing the sboTerm to be set
%
% Returns
%
% 1. the SBML AlgebraicRule structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'sboTerm')
if ~isIntegralNumber(sboTerm)
error('sboTerm must be an integer') ;
else
SBMLAlgebraicRule.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_setMetaid.m 0000644 0000000 0000000 00000003664 11703262334 031262 0 ustar root root function SBMLAlgebraicRule = AlgebraicRule_setMetaid(SBMLAlgebraicRule, metaid)
% SBMLAlgebraicRule = AlgebraicRule_setMetaid(SBMLAlgebraicRule, metaid)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. metaid; a string representing the metaid to be set
%
% Returns
%
% 1. the SBML AlgebraicRule structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLAlgebraicRule.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_setFormula.m 0000644 0000000 0000000 00000003701 11703262334 031454 0 ustar root root function SBMLAlgebraicRule = AlgebraicRule_setFormula(SBMLAlgebraicRule, formula)
% SBMLAlgebraicRule = AlgebraicRule_setFormula(SBMLAlgebraicRule, formula)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
% 2. formula; a string representing the formula to be set
%
% Returns
%
% 1. the SBML AlgebraicRule structure with the new value for the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'formula')
if ~ischar(formula)
error('formula must be character array') ;
else
SBMLAlgebraicRule.formula = formula;
end;
else
error('formula not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_isSetSBOTerm.m0000644 0000000 0000000 00000003413 11703262334 031616 0 ustar root root function value = AlgebraicRule_isSetSBOTerm(SBMLAlgebraicRule)
% value = AlgebraicRule_isSetSBOTerm(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'sboTerm')
value = (SBMLAlgebraicRule.sboTerm > 0);
else
error('sboTerm not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_isSetMetaid.m 0000644 0000000 0000000 00000003411 11703262334 031544 0 ustar root root function value = AlgebraicRule_isSetMetaid(SBMLAlgebraicRule)
% value = AlgebraicRule_isSetMetaid(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'metaid')
value = ~isempty(SBMLAlgebraicRule.metaid);
else
error('metaid not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_isSetFormula.m0000644 0000000 0000000 00000003417 11703262334 031754 0 ustar root root function value = AlgebraicRule_isSetFormula(SBMLAlgebraicRule)
% value = AlgebraicRule_isSetFormula(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. value =
% - 1 if the formula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'formula')
value = ~isempty(SBMLAlgebraicRule.formula);
else
error('formula not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_getSBOTerm.m 0000644 0000000 0000000 00000003351 11703262334 031307 0 ustar root root function sboTerm = AlgebraicRule_getSBOTerm(SBMLAlgebraicRule)
% sboTerm = AlgebraicRule_getSBOTerm(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'sboTerm')
sboTerm = SBMLAlgebraicRule.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_getMetaid.m 0000644 0000000 0000000 00000003340 11703262334 031235 0 ustar root root function metaid = AlgebraicRule_getMetaid(SBMLAlgebraicRule)
% metaid = AlgebraicRule_getMetaid(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'metaid')
metaid = SBMLAlgebraicRule.metaid;
else
error('metaid not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_getFormula.m 0000644 0000000 0000000 00000003351 11703262334 031441 0 ustar root root function formula = AlgebraicRule_getFormula(SBMLAlgebraicRule)
% formula = AlgebraicRule_getFormula(SBMLAlgebraicRule)
%
% Takes
%
% 1. SBMLAlgebraicRule, an SBML AlgebraicRule structure
%
% Returns
%
% 1. the value of the formula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLAlgebraicRule);
if isfield(SBMLAlgebraicRule, 'formula')
formula = SBMLAlgebraicRule.formula;
else
error('formula not an attribute on SBML L%dV%d AlgebraicRule', level, version);
end;
SBMLToolbox-4.1.0/toolbox/MATLAB_SBML_Structure_Functions/AlgebraicRule/AlgebraicRule_create.m 0000644 0000000 0000000 00000005464 11703262334 030606 0 ustar root root function AlgebraicRule = AlgebraicRule_create(varargin)
% AlgebraicRule = AlgebraicRule_create(level(optional), version(optional) )
%
% Takes
%
% 1. level, an integer representing an SBML level (optional)
% 2. version, an integer representing an SBML version (optional)
%
% Returns
%
% 1. a MATLAB_SBML AlgebraicRule structure of the appropriate level and version
%
% *NOTE:* the optional level and version preserve backwards compatibility
% a missing version argument will default to L1V2; L2V4 or L3V1
% missing both arguments will default to L3V1
%
%check the input arguments are appropriate
if (nargin > 2)
error('too many input arguments');
end;
switch (nargin)
case 2
level = varargin{1};
version = varargin{2};
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
otherwise
level = 3;
version = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getAlgebraicRuleFieldnames(level, version);
if (num > 0)
values = getAlgebraicRuleDefaultValues(level, version);
AlgebraicRule = cell2struct(values, fieldnames, 2);
%add level and version
AlgebraicRule.level = level;
AlgebraicRule.version = version;
%check correct structure
if ~isSBML_AlgebraicRule(AlgebraicRule, level, version)
AlgebraicRule = struct();
warning('Warn:BadStruct', 'Failed to create AlgebraicRule');
end;
else
AlgebraicRule = [];
warning('Warn:InvalidLV', 'AlgebraicRule not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/isBindingInstalled.m 0000644 0000000 0000000 00000005726 11703272000 017732 0 ustar root root function installed = isBindingInstalled()
% installed = isBindingInstalled()
%
% Returns
%
% 1. installed =
% - 1 if the libSBML executables are installed
% - 0 otherwise
%
%
%
installed = 1;
if (~exist('OCTAVE_VERSION'))
filename = fullfile(tempdir, 'test.xml');
outFile = fullfile(tempdir, 'test-out.xml');
else
if isWindows()
filename = fullfile(pwd, 'test.xml');
outFile = [tempdir, 'temp', filesep, 'test-out.xml'];
else
filename = fullfile(pwd, 'test.xml');
outFile = [tempdir, 'test-out.xml'];
end;
end;
writeTempFile(filename);
try
M = TranslateSBML(filename);
catch
installed = 0;
return;
end;
if (installed == 1)
try
OutputSBML(M, outFile, 1);
catch
installed = 0;
return;
end;
end;
delete(filename);
delete(outFile);
%
%
% Is this windows
% Mac OS X 10.7 Lion returns true for a call to ispc()
% since we were using that to distinguish between windows and macs we need
% to catch this
% ------------------------------------------------------------------------
function y = isWindows()
y = 1;
if isunix()
y = 0;
return;
end;
if ismac()
y = 0;
return;
end;
if ~ispc()
message = sprintf('\n%s\n%s\n', ...
'Unable to determine the type of operating system in use.', ...
'Please contact libsbml-team@caltech.edu to help resolve this problem.');
error(message);
end;
% write out a temporary file
function writeTempFile(filename)
fout = fopen(filename, 'w');
fprintf(fout, '\n');
fprintf(fout, '\n');
fprintf(fout, ' \n\n');
fclose(fout);
SBMLToolbox-4.1.0/toolbox/install.m 0000644 0000000 0000000 00000021600 11703265336 015635 0 ustar root root function install
% install
%
% 1. reports whether the libsbml binding is installed
% 2. adds the toolbox dirctories to the Path
%
% =========================================================================
% Main loop.
% =========================================================================
disp(sprintf('\nInstalling the SBMLToolbox.\n'));
[matlab_octave, bit64] = check_system();
disp(sprintf('\nChecking for libSBML %s binding\n', matlab_octave));
if isBindingInstalled() == 1
disp(sprintf('libSBML %s binding found and working\n', matlab_octave));
else
disp(sprintf('libSBML %s binding not found\n\n%s\n%s\n%s', matlab_octave, ...
'NOTE: This is not a fatal error.', ...
'You will not be able to import or export SBML but can still use the toolbox', ...
'to create and manipulate MATLAB_SBML structures'));
end;
% add the current directory and all subdirectories to the MATLAB search
% path
ToolboxPath = genpath(pwd);
addpath(ToolboxPath);
s = savepath;
if (s ~= 0)
disp(sprintf('\nInstallation failed\n%s', ...
'The directories were not added to the Path'));
else
disp(sprintf('\nInstallation successful'));
end;
% =========================================================================
% Support functions.
% =========================================================================
%
% Assess our computing environment.
% -------------------------------------------------------------------------
function [matlab_octave, bit64] = check_system()
disp('* Doing preliminary checks of runtime environment ...');
if (~exist('OCTAVE_VERSION'))
matlab_octave = 'MATLAB';
disp(' - This appears to be MATLAB and not Octave.');
else
matlab_octave = 'Octave';
disp(' - This appears to be Octave and not MATLAB.');
end;
bit64 = 32;
if ispc()
if strcmp(computer(), 'PCWIN64') == 1
bit64 = 64;
disp(sprintf(' - %s reports the OS is Windows 64-bit.', matlab_octave));
else
disp(sprintf(' - %s reports the OS is Windows 32-bit.', matlab_octave));
end;
elseif ismac()
if strcmp(computer(), 'MACI64') == 1
bit64 = 64;
disp(sprintf(' - %s reports the OS is 64-bit MacOS.', matlab_octave));
else
% Reading http://www.mathworks.com/help/techdoc/ref/computer.html
% it is still not clear to me what a non-64-bit MacOS will report.
% Let's not assume the only other alternative is 32-bit, since we
% actually don't care here. Let's just say "macos".
%
disp(sprintf(' - %s reports the OS is MacOS.', matlab_octave));
end;
elseif isunix()
if strcmp(computer(), 'GLNXA64') == 1
bit64 = 64;
disp(sprintf(' - %s reports the OS is 64-bit Linux.', matlab_octave));
else
disp(sprintf(' - %s reports the OS is 32-bit Linux.', matlab_octave));
end;
end;
%
% Assess our location in the file system.
% -------------------------------------------------------------------------
% Possible values returned:
% LOCATION:
% 'installed' -> installation directory
% 'source' -> libsbml source tree
%
% WRITEACCESS:
% 1 -> we can write in this directory
% 0 -> we can't write in this directory
%
function [location, writeAccess, in_installer] = check_location(matlab_octave, ...
functioning)
myDisp('* Trying to establish our location ...', functioning);
% This is where things get iffy. There are a lot of possibilities, and
% we have to resort to heuristics.
%
% Linux and Mac: we look for 2 possibilities
% - installation dir ends in "libsbml/bindings/matlab"
% Detect it by looking for ../../VERSION.txt.
% Assume we're in .../share/libsbml/bindings/matlab and that our
% library is in .../lib/
%
% - source dir ends in "libsbml/src/bindings/matlab"
% Detect it by looking for ../../../VERSION.txt.
% Assume our library is in ../../
%
in_installer = 0;
[remain, first] = fileparts(pwd);
if strcmpi(matlab_octave, 'matlab')
if ~strcmp(first, 'matlab')
if ~ispc()
error_incorrect_dir('matlab');
else
in_installer = 1;
end;
else
myDisp(' - We are in the libSBML subdirectory for Matlab.', functioning);
end;
else
if ~strcmp(first, 'octave')
if ~ispc()
error_incorrect_dir('octave');
else
in_installer = 1;
end;
else
myDisp(' - We are in the libSBML subdirectory for Octave.', functioning);
end;
end;
location = '';
% if in_installer == 1 then we are in the windows installer but in
% path provided by the user
% checking further is pointless
if (in_installer == 0)
[above_bindings, bindings] = fileparts(remain);
if exist(fullfile(above_bindings, 'VERSION.txt'))
myDisp(' - We appear to be in the installation target directory.', functioning);
in_installer = 1;
if ispc()
location = above_bindings;
else
location = 'installed';
end;
else
[libsbml_root, src] = fileparts(above_bindings);
if exist(fullfile(libsbml_root, 'Makefile.in'))
myDisp(' - We appear to be in the libSBML source tree.', functioning);
if ispc()
location = libsbml_root;
else
location = 'source';
end;
else
if ispc()
% we might be in the windows installer but in a location the user chose
% for the bindings
% Makefile.in will not exist in this directory
if (exist([pwd, filesep, 'Makefile.in']) == 0)
in_installer = 1;
else
% We don't know where we are.
if strcmpi(matlab_octave, 'MATLAB')
error_incorrect_dir('matlab');
else
error_incorrect_dir('octave');
end;
end;
else
% We don't know where we are.
if strcmpi(matlab_octave, 'MATLAB')
error_incorrect_dir('matlab');
else
error_incorrect_dir('octave');
end;
end;
end;
end;
end;
% if we are in the windows installer but in a location the user chose
% for the bindings
% we need the user to tell use the root directory for the rest of libsbml
% unless we are already functioning
if (ispc() && functioning == 0 && in_installer == 1 && isempty(location))
count = 1;
while(exist(location, 'dir') == 0 && count < 3)
location = input(sprintf('%s: ', ...
'Please enter the location of the top-level libsbml directory'), 's');
count = count + 1;
end;
if (exist(location, 'dir') == 0)
error('Failed to find libsbml directory');
end;
end;
% Test that it looks like we have the expected pieces in this directory.
% We don't want to assume particular paths, because we might be
% getting run from the libSBML source tree or the installed copy of
% the matlab bindings sources. So, we test for just a couple of
% things: the tail of the name of the directory in which this file is
% located (should be either "matlab" or "octave") and the presence of
% another file, "OutputSBML.c", which became part of libsbml at the
% same time this new build scheme was introduced.
our_name = sprintf('%s.m', mfilename);
other_name = 'OutputSBML.c';
if ~exist(fullfile(pwd, our_name), 'file') ...
|| ~exist(fullfile(pwd, other_name), 'file')
error_incorrect_dir('matlab');
end;
% Check whether we have write access to this directory.
fid = fopen('temp.txt', 'w');
writeAccess = 1;
if fid == -1
myDisp(' - We do not have write access here -- will write elsewhere.', functioning);
writeAccess = 0;
else
myDisp(' - We have write access here! That makes us happy.', functioning);
fclose(fid);
delete('temp.txt');
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/ 0000755 0000000 0000000 00000000000 11704572250 016214 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/ 0000755 0000000 0000000 00000000000 11704572250 024045 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/ 0000755 0000000 0000000 00000000000 11704572250 025024 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/test_fbc_valid.m 0000644 0000000 0000000 00000007000 11703262374 030151 0 ustar root root function y = test_fbc_valid(varargin)
%
fbcBindingEnabled = 1;
if (nargin == 0)
if isBindingFbcEnabled() == 0
disp ('The libsbml binding for fbc is not enabled');
disp ('not all tests can be run');
fbcBindingEnabled = 0;
end;
else
fbcBindingEnabled = varargin{1};
end;
test = 0;
Totalfail = 0;
test = test + 44;
fail = TestIsSBML_FBC_FluxBound;
if (fail > 0)
disp('isSBML_FBC_FluxBound failed');
end;
Totalfail = Totalfail + fail;
test = test + 66;
fail = TestIsSBML_FBC_Objective;
if (fail > 0)
disp('isSBML_FBC_Objective failed');
end;
Totalfail = Totalfail + fail;
test = test + 44;
fail = TestIsSBML_FBC_FluxObjective;
if (fail > 0)
disp('isSBML_FBC_FluxObjective failed');
end;
Totalfail = Totalfail + fail;
test = test + 42;
fail = TestIsSBML_FBC_Species;
if (fail > 0)
disp('isSBML_FBC_Species failed');
end;
Totalfail = Totalfail + fail;
test = test + 22;
fail = TestIsSBML_FBC_Model;
if (fail > 0)
disp('isSBML_FBC_Model failed');
end;
Totalfail = Totalfail + fail;
% tests that need fbc libsbml binding enabled
if fbcBindingEnabled == 1
m = TranslateSBML('../../test/test-data/fbc.xml');
fb = m.fbc_fluxBound(1);
o = m.fbc_objective(1);
fo = o.fbc_fluxObjective(1);
s = m.species(1);
test = test + 7;
fail = 0;
pass = isValidSBML_Model(m);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Model failed');
end;
pass = isSBML_FBC_Model(m, 3, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 fbc Model failed');
end;
pass = isSBML_FBC_FluxBound(fb,3, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 FluxBound failed');
end;
pass = isSBML_FBC_Objective(o,3, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Objective failed');
end;
pass = isSBML_FBC_FluxObjective(fo,3, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 FluxObjective failed');
end;
pass = isSBML_Species(s, 3, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 Species failed');
end;
pass = isSBML_FBC_Species(s, 3, 1, 1);
if (pass == 0)
fail = fail + 1;
disp('l3v1 FBC Species failed');
end;
end;
Totalfail = Totalfail + fail;
disp(sprintf('Number tests: %d', test));
disp(sprintf('Number fails: %d', Totalfail));
disp(sprintf('Pass rate: %d%%', ((test-Totalfail)/test)*100));
y = Totalfail;
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_Species.m 0000644 0000000 0000000 00000012555 11703262374 031232 0 ustar root root function fail = TestIsSBML_FBC_Species
%
s_l3v1 = struct('typecode', {'SBML_SPECIES'}, 'metaid', {''}, 'notes', {''}, ...
'annotation', {''}, 'sboTerm', {''}, 'name', {''}, 'id', {''}, ...
'compartment', {''}, 'initialAmount', {''}, 'initialConcentration', {''}, ...
'substanceUnits', {''}, 'hasOnlySubstanceUnits', {''}, ...
'boundaryCondition', {''}, 'constant', {''}, 'conversionFactor', {''}, ...
'isSetInitialAmount', {''}, 'isSetInitialConcentration', {''}, ...
'fbc_charge', {''}, 'isSetfbc_charge', {0}, 'fbc_chemicalFormula', {''}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
s_l3v1_incorrect = struct('typecode', {'SBML_SPECIES'}, 'metaid', {''}, 'notes', {''}, ...
'annotation', {''}, 'sboTerm', {''}, 'name', {''}, 'id', {''}, ...
'compartment', {''}, 'initialAmount', {''}, 'initialConcentration', {''}, ...
'substanceUnits', {''}, 'hasOnlySubstanceUnits', {''}, ...
'boundaryCondition', {''}, 'constant', {''}, 'conversionFactor', {''}, ...
'isSetInitialAmount', {''}, 'isSetInitialConcentration', {''}, ...
'fbc_charge', {''}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
fail = TestFunction('isSBML_FBC_Species', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isSBML_FBC_Species', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isSBML_FBC_Species', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isSBML_FBC_Species', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 4, 1, s_l3v1_incorrect, 3, 1, 1, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 3, 1, s_l3v1_incorrect, 3, 1, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 3, 1, s_l3v1_incorrect, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 2, 1, s_l3v1_incorrect, 3, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 2, 1, s_l3v1_incorrect, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Species', 1, 1, s_l3v1_incorrect, 0);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1_incorrect, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_incorrect, 3, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_incorrect, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_incorrect, 3, 1, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_incorrect, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_incorrect, 3, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_incorrect, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_incorrect, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1_incorrect, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_incorrect, 3, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_incorrect, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_incorrect, 3, 1, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_incorrect, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_incorrect, 3, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_incorrect, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_incorrect, 3, 1, 2, 0);
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_Objective.m SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_Objective.0000644 0000000 0000000 00000015603 11703262374 031371 0 ustar root root function fail = TestIsSBML_FBC_Objective
%
fo_l3v1 = struct('typecode', {'SBML_FBC_FLUXOBJECTIVE'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'fbc_reaction', {''}, ...
'fbc_coefficient', {''}, 'isSetfbc_coefficient', {0}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
fo_l3v1_bad = struct('typecode', {'SBML_FBC_FLUXOBJECTIVE'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'fbc_reaction', {''}, ...
'fbc_coefficient', {''}, 'isSetfbc_coefficient', {0}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
s_l3v1 = struct('typecode', {'SBML_FBC_OBJECTIVE'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'fbc_id', {''}, ...
'fbc_type', {''}, 'fbc_fluxObjective', fo_l3v1, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
s_l3v1_bad = struct('typecode', {'SBML_FBC_OBJECTIVE'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'fbc_id', {''}, ...
'fbc_type', {''}, 'fbc_fluxObjective', fo_l3v1_bad, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
s_l3v1_bad1 = struct('typecode', {'SBML_FBC_OBJECTIVE'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'fbc_id', {''}, ...
'fbc_type', {''}, 'fbc_fluxObjective', fo_l3v1, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
fail = TestFunction('isSBML_FBC_Objective', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isSBML_FBC_Objective', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isSBML_FBC_Objective', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isSBML_FBC_Objective', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 3, 1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 3, 1, s_l3v1_bad1, 3, 1, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 3, 1, s_l3v1_bad1, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 2, 1, s_l3v1_bad1, 3, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 2, 1, s_l3v1_bad1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Objective', 1, 1, s_l3v1_bad1, 0);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1_bad1, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad1, 3, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad1, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad1, 3, 1, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad1, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad1, 3, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad1, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad1, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1_bad1, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad1, 3, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad1, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad1, 3, 1, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad1, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad1, 3, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad1, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad1, 3, 1, 2, 0);
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_Model.m 0000644 0000000 0000000 00000010617 11703262374 030674 0 ustar root root function fail = TestIsSBML_FBC_Model
%
s_l3v1 = Model_create(3,1);
s_l3v1_incorrect = Model_create(3,1);
s_l3v1_incorrect.fbc_version = 1;
fail = 0;
% fail = TestFunction('isSBML_FBC_Model', 4, 1, s_l3v1, 3, 1, 1, 1);
% fail = fail + TestFunction('isSBML_FBC_Model', 3, 1, s_l3v1, 3, 1, 1);
% fail = fail + TestFunction('isSBML_FBC_Model', 3, 1, s_l3v1, 2, 4, 0);
% fail = fail + TestFunction('isSBML_FBC_Model', 2, 1, s_l3v1, 3, 1);
% fail = fail + TestFunction('isSBML_FBC_Model', 2, 1, s_l3v1, 2, 0);
% fail = fail + TestFunction('isSBML_FBC_Model', 1, 1, s_l3v1, 1);
% fail = fail + TestFunction('isValid', 1, 1, s_l3v1, 1);
% fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 3, 1);
% fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 2, 0);
% fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 3, 1, 1);
% fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 2, 4, 0);
% fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 1, 1);
% fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 2, 1, 1, 0);
% fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 2, 0);
% fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1, 1);
% fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 3, 1);
% fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 2, 0);
% fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 3, 1, 1);
% fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 2, 4, 0);
% fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 1, 1);
% fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 2, 1, 1, 0);
% fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Model', 4, 1, s_l3v1_incorrect, 3, 1, 1, 0);
fail = fail + TestFunction('isSBML_FBC_Model', 3, 1, s_l3v1_incorrect, 3, 1, 0);
fail = fail + TestFunction('isSBML_FBC_Model', 3, 1, s_l3v1_incorrect, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_Model', 2, 1, s_l3v1_incorrect, 3, 0);
fail = fail + TestFunction('isSBML_FBC_Model', 2, 1, s_l3v1_incorrect, 2, 0);
fail = fail + TestFunction('isSBML_FBC_Model', 1, 1, s_l3v1_incorrect, 0);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1_incorrect, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_incorrect, 3, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_incorrect, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_incorrect, 3, 1, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_incorrect, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_incorrect, 3, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_incorrect, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_incorrect, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1_incorrect, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_incorrect, 3, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_incorrect, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_incorrect, 3, 1, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_incorrect, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_incorrect, 3, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_incorrect, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_incorrect, 3, 1, 2, 0);
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_FluxObjective.m SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_FluxObject0000644 0000000 0000000 00000011376 11703262374 031451 0 ustar root root function fail = TestIsSBML_FBC_FluxObjective
%
s_l3v1_bad = struct('typecode', {'SBML_FBC_FLUXOBJETIVE'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'fbc_reaction', {''}, ...
'fbc_coefficient', {''}, 'isSetfbc_coefficient', {0}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
s_l3v1 = struct('typecode', {'SBML_FBC_FLUXOBJECTIVE'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'fbc_reaction', {''}, ...
'fbc_coefficient', {''}, 'isSetfbc_coefficient', {0}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
fail = TestFunction('isSBML_FBC_FluxObjective', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isSBML_FBC_FluxObjective', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 3, 1, 2, 0);
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_FluxBound.m SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/test/TestIsSBML_FBC_FluxBound.0000644 0000000 0000000 00000011366 11703262374 031367 0 ustar root root function fail = TestIsSBML_FBC_FluxBound
%
s_l3v1_bad = struct('typecode', {'SBML_FBC_FLUXBOUND'}, 'metaid', {''}, ...
'notes', {''}, 'sboTerm', {''}, 'fbc_id', {''}, ...
'fbc_reaction', {''}, 'fbc_operation', {''}, 'fbc_value', {''}, ...
'isSetfbc_value', {0}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
s_l3v1 = struct('typecode', {'SBML_FBC_FLUXBOUND'}, 'metaid', {''}, ...
'notes', {''}, 'annotation', {''}, 'sboTerm', {''}, 'fbc_id', {''}, ...
'fbc_reaction', {''}, 'fbc_operation', {''}, 'fbc_value', {''}, ...
'isSetfbc_value', {0}, ...
'level', {3}, 'version', {1}, 'fbc_version', {1});
fail = TestFunction('isSBML_FBC_FluxBound', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 3, 1);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 3, 1, 1);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 1, 1);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1, 3, 1, 2, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isSBML_FBC_FluxBound', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValid', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isValid', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isValid', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 2, 1, 1, 0);
fail = fail + TestFunction('isValid', 4, 1, s_l3v1_bad, 3, 1, 2, 0);
fail = fail + TestFunction('isValidFBC', 1, 1, s_l3v1_bad, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad, 3, 0);
fail = fail + TestFunction('isValidFBC', 2, 1, s_l3v1_bad, 2, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad, 3, 1, 0);
fail = fail + TestFunction('isValidFBC', 3, 1, s_l3v1_bad, 2, 4, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 3, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 2, 1, 1, 0);
fail = fail + TestFunction('isValidFBC', 4, 1, s_l3v1_bad, 3, 1, 2, 0);
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/isValidFBC.m 0000644 0000000 0000000 00000006445 11703262374 026144 0 ustar root root function y = isValidFBC(varargin)
% [valid, message] = isValidFBC(SBMLStruct, level, version, pkgVersion)
%
% Takes
%
% 1. SBMLStruct, an SBML structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing the FBC package version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML structure of the appropriate
% level and version can be found using getFieldnames(typecode, level, version)
%
%
if (nargin < 1)
error('need input argument');
end;
switch nargin
case 1
sbml_struct = varargin{1};
level = 3;
version = 1;
fbc_version = 1;
case 2
sbml_struct = varargin{1};
level = varargin{2};
version = 1;
fbc_version = 1;
case 3
sbml_struct = varargin{1};
level = varargin{2};
version = varargin{3};
fbc_version = 1;
case 4
sbml_struct = varargin{1};
level = varargin{2};
version = varargin{3};
fbc_version = varargin{4};
otherwise
error('too many input arguments');
end;
if (length(sbml_struct) > 1)
error('cannot deal with arrays of structures');
end;
if ~isstruct(sbml_struct) || isempty(fieldnames(sbml_struct))
y = 0;
return;
end;
if isfield(sbml_struct, 'fbc_version') == 0
y = 0;
return;
end;
isValidLevelVersionCombination(level, version);
typecode = sbml_struct.typecode;
switch (typecode)
case 'SBML_SPECIES'
fhandle = str2func('isSBML_FBC_Species');
case 'SBML_MODEL'
fhandle = str2func('isSBML_FBC_Model');
case 'SBML_FBC_FLUXBOUND'
fhandle = str2func('isSBML_FBC_FluxBound');
case 'SBML_FBC_FLUXOBJECTIVE'
fhandle = str2func('isSBML_FBC_FluxObjective');
case 'SBML_FBC_OBJECTIVE'
fhandle = str2func('isSBML_FBC_Objective');
otherwise
y = 0;
return;
end;
if strcmp(typecode, 'SBML_MODEL')
y = feval(fhandle, sbml_struct);
else
y = feval(fhandle, sbml_struct, level, version, fbc_version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/isSBML_FBC_Species.m 0000644 0000000 0000000 00000010550 11703262374 027444 0 ustar root root function [valid, message] = isSBML_FBC_Species(varargin)
% [valid, message] = isSBML_FBC_Species(SBMLFBCSpecies, level, version, pkgVersion)
%
% Takes
%
% 1. SBMLStructure, an SBML FBC Species structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC Species structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML FBC Species structure of the appropriate
% level and version can be found using getSpeciesFieldnames(level, version, pkgVersion)
%
%
switch (nargin)
case 4
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = varargin{4};
case 3
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = 1;
case 2
SBMLStructure = varargin{1};
level = varargin{2};
version = 1;
pkgVersion = 1;
case 1
SBMLStructure = varargin{1};
level = 3;
version = 1;
pkgVersion = 1;
otherwise
error('need at least one argument');
end;
if (length(SBMLStructure) > 1)
message = 'cannot deal with arrays of structures';
valid = 0;
return;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_SPECIES';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'typecode field missing';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'fbc_version') && ~isempty(SBMLStructure))
if ~isequal(pkgVersion, SBMLStructure.fbc_version)
valid = 0;
message = 'FBC version mismatch';
end;
end;
if (valid == 1)
[valid, message] = isSBML_Species(SBMLStructure, level, version);
end;
% check that structure contains all the fbc fields
if (valid == 1)
[SBMLfieldnames, numFields] = getFieldnames('SBML_FBC_SPECIES', level, ...
version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid FBC Species\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/isSBML_FBC_Objective.m 0000644 0000000 0000000 00000011133 11703262374 027761 0 ustar root root function [valid, message] = isSBML_FBC_Objective(varargin)
% [valid, message] = isSBML_FBC_Objective(SBMLFBCObjective, level, version, pkgVersion)
%
% Takes
%
% 1. SBMLStructure, an SBML FBC Objective structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC Objective structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML FBC Objective structure of the appropriate
% level and version can be found using getObjectiveFieldnames(level, version, pkgVersion)
%
%
switch (nargin)
case 4
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = varargin{4};
case 3
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = 1;
case 2
SBMLStructure = varargin{1};
level = varargin{2};
version = 1;
pkgVersion = 1;
case 1
SBMLStructure = varargin{1};
level = 3;
version = 1;
pkgVersion = 1;
otherwise
error('need at least one argument');
end;
if (length(SBMLStructure) > 1)
message = 'cannot deal with arrays of structures';
valid = 0;
return;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_FBC_OBJECTIVE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'typecode field missing';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'fbc_version') && ~isempty(SBMLStructure))
if ~isequal(pkgVersion, SBMLStructure.fbc_version)
valid = 0;
message = 'FBC version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_FBC_OBJECTIVE', level, ...
version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% fluxObjective
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.fbc_fluxObjective))
[valid, message] = isSBML_FBC_FluxObjective(SBMLStructure.fbc_fluxObjective(index), ...
level, version, pkgVersion);
index = index + 1;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid FBC Objective\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/isSBML_FBC_Model.m 0000644 0000000 0000000 00000012450 11703262374 027112 0 ustar root root function [valid, message] = isSBML_FBC_Model(varargin)
% [valid, message] = isSBML_FBC_Model(SBMLFBCModel, level, version, pkgVersion)
%
% Takes
%
% 1. SBMLStructure, an SBML FBC Model structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC Model structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML FBC Model structure of the appropriate
% level and version can be found using getModelFieldnames(level, version, pkgVersion)
%
%
switch (nargin)
case 4
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = varargin{4};
case 3
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = 1;
case 2
SBMLStructure = varargin{1};
level = varargin{2};
version = 1;
pkgVersion = 1;
case 1
SBMLStructure = varargin{1};
level = 3;
version = 1;
pkgVersion = 1;
otherwise
error('need at least one argument');
end;
if (length(SBMLStructure) > 1)
message = 'cannot deal with arrays of structures';
valid = 0;
return;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_MODEL';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'typecode field missing';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'SBML_level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.SBML_level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'SBML_version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.SBML_version)
valid = 0;
message = 'version mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'fbc_version') && ~isempty(SBMLStructure))
if ~isequal(pkgVersion, SBMLStructure.fbc_version)
valid = 0;
message = 'FBC version mismatch';
end;
end;
if (valid == 1)
[valid, message] = isValidSBML_Model(SBMLStructure);
end;
% check that structure contains all the fbc fields
if (valid == 1)
[SBMLfieldnames, numFields] = getFieldnames('SBML_FBC_MODEL', level, ...
version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
%check that any nested structures are appropriate
% fluxBound
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.fbc_fluxBound))
[valid, message] = isSBML_FBC_FluxBound(SBMLStructure.fbc_fluxBound(index), ...
level, version, pkgVersion);
index = index + 1;
end;
end;
% objective
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.fbc_objective))
[valid, message] = isSBML_FBC_Objective(SBMLStructure.fbc_objective(index), ...
level, version, pkgVersion);
index = index + 1;
end;
end;
%species
if (valid == 1)
index = 1;
while (valid == 1 && index <= length(SBMLStructure.species))
[valid, message] = isSBML_FBC_Species(SBMLStructure.species(index), ...
level, version, pkgVersion);
index = index + 1;
end;
end;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid FBC Model\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/isSBML_FBC_FluxObjective.m 0000644 0000000 0000000 00000010431 11703262374 030620 0 ustar root root function [valid, message] = isSBML_FBC_FluxObjective(varargin)
% [valid, message] = isSBML_FBC_FluxObjective(SBMLFBCFluxObjective, level, version, pkgVersion)
%
% Takes
%
% 1. SBMLStructure, an SBML FBC FluxObjective structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC FluxObjective structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML FBC FluxObjective structure of the appropriate
% level and version can be found using getFluxObjectiveFieldnames(level, version, pkgVersion)
%
%
switch (nargin)
case 4
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = varargin{4};
case 3
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = 1;
case 2
SBMLStructure = varargin{1};
level = varargin{2};
version = 1;
pkgVersion = 1;
case 1
SBMLStructure = varargin{1};
level = 3;
version = 1;
pkgVersion = 1;
otherwise
error('need at least one argument');
end;
if (length(SBMLStructure) > 1)
message = 'cannot deal with arrays of structures';
valid = 0;
return;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_FBC_FLUXOBJECTIVE';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'typecode field missing';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'fbc_version') && ~isempty(SBMLStructure))
if ~isequal(pkgVersion, SBMLStructure.fbc_version)
valid = 0;
message = 'FBC version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_FBC_FLUXOBJECTIVE', level, ...
version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid FBC FluxObjective\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/isSBML_FBC_FluxBound.m 0000644 0000000 0000000 00000010361 11703262374 027757 0 ustar root root function [valid, message] = isSBML_FBC_FluxBound(varargin)
% [valid, message] = isSBML_FBC_FluxBound(SBMLFBCFluxBound, level, version, pkgVersion)
%
% Takes
%
% 1. SBMLStructure, an SBML FBC FluxBound structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
%
% Returns
%
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC FluxBound structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
% *NOTE:* The fields present in a MATLAB_SBML FBC FluxBound structure of the appropriate
% level and version can be found using getFluxBoundFieldnames(level, version, pkgVersion)
%
%
switch (nargin)
case 4
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = varargin{4};
case 3
SBMLStructure = varargin{1};
level = varargin{2};
version = varargin{3};
pkgVersion = 1;
case 2
SBMLStructure = varargin{1};
level = varargin{2};
version = 1;
pkgVersion = 1;
case 1
SBMLStructure = varargin{1};
level = 3;
version = 1;
pkgVersion = 1;
otherwise
error('need at least one argument');
end;
if (length(SBMLStructure) > 1)
message = 'cannot deal with arrays of structures';
valid = 0;
return;
end;
isValidLevelVersionCombination(level, version);
message = '';
% check that argument is a structure
valid = isstruct(SBMLStructure);
% check the typecode
typecode = 'SBML_FBC_FLUXBOUND';
if (valid == 1 && ~isempty(SBMLStructure))
if isfield(SBMLStructure, 'typecode')
if (strcmp(typecode, SBMLStructure.typecode) ~= 1)
valid = 0;
message = 'typecode mismatch';
return;
end;
else
valid = 0;
message = 'typecode field missing';
return;
end;
end;
% if the level and version fields exist they must match
if (valid == 1 && isfield(SBMLStructure, 'level') && ~isempty(SBMLStructure))
if ~isequal(level, SBMLStructure.level)
valid = 0;
message = 'level mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'version') && ~isempty(SBMLStructure))
if ~isequal(version, SBMLStructure.version)
valid = 0;
message = 'version mismatch';
end;
end;
if (valid == 1 && isfield(SBMLStructure, 'fbc_version') && ~isempty(SBMLStructure))
if ~isequal(pkgVersion, SBMLStructure.fbc_version)
valid = 0;
message = 'FBC version mismatch';
end;
end;
% check that structure contains all the necessary fields
[SBMLfieldnames, numFields] = getFieldnames('SBML_FBC_FLUXBOUND', level, ...
version);
if (numFields ==0)
valid = 0;
message = 'invalid level/version';
end;
index = 1;
while (valid == 1 && index <= numFields)
valid = isfield(SBMLStructure, char(SBMLfieldnames(index)));
if (valid == 0);
message = sprintf('%s field missing', char(SBMLfieldnames(index)));
end;
index = index + 1;
end;
% report failure
if (valid == 0)
message = sprintf('Invalid FBC FluxBound\n%s\n', message);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/Validate_MATLAB_SBML_Structures/Contents.m 0000644 0000000 0000000 00000013101 11703262374 026016 0 ustar root root % toolbox\fbc_package\Validate_MATLAB_SBML_Structures
%
% This folder contains tests that checks that the structure supplied as argument
% is of the appropriate form to represent the intended element of an SBML model
% that includes the fbc package.
%
%=======================================================================================
% [valid, message] = isSBML_FBC_FluxBound(SBMLFBCFluxBound, level, version, pkgVersion)
%=======================================================================================
% Takes
% 1. SBMLStructure, an SBML FBC FluxBound structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC FluxBound structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
%===============================================================================================
% [valid, message] = isSBML_FBC_FluxObjective(SBMLFBCFluxObjective, level, version, pkgVersion)
%===============================================================================================
% Takes
% 1. SBMLStructure, an SBML FBC FluxObjective structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC FluxObjective structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
%===============================================================================
% [valid, message] = isSBML_FBC_Model(SBMLFBCModel, level, version, pkgVersion)
%===============================================================================
% Takes
% 1. SBMLStructure, an SBML FBC Model structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC Model structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
%=======================================================================================
% [valid, message] = isSBML_FBC_Objective(SBMLFBCObjective, level, version, pkgVersion)
%=======================================================================================
% Takes
% 1. SBMLStructure, an SBML FBC Objective structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC Objective structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
%===================================================================================
% [valid, message] = isSBML_FBC_Species(SBMLFBCSpecies, level, version, pkgVersion)
%===================================================================================
% Takes
% 1. SBMLStructure, an SBML FBC Species structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing an FBC package version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC Species structure of the appropriate
% level, version and FBC version
% - 0, otherwise
% 2. a message explaining any failure
%
%=======================================================================
% [valid, message] = isValidFBC(SBMLStruct, level, version, pkgVersion)
%=======================================================================
% Takes
% 1. SBMLStruct, an SBML structure
% 2. level, an integer representing an SBML level
% 3. version, an integer representing an SBML version
% 4. pkgVersion, an integer representing the FBC package version
% Returns
% 1. valid =
% - 1, if the structure represents
% a MATLAB_SBML FBC structure of the appropriate
% level and version
% - 0, otherwise
% 2. a message explaining any failure
%
%
SBMLToolbox-4.1.0/toolbox/fbc_package/test/ 0000755 0000000 0000000 00000000000 11704572250 017173 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/test/test-data/ 0000755 0000000 0000000 00000000000 11704572250 021061 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/test/test-data/fbc.xml 0000644 0000000 0000000 00000006751 11701333242 022337 0 ustar root root
SBMLToolbox-4.1.0/toolbox/fbc_package/test/runFBCTest.m 0000644 0000000 0000000 00000003430 11703262556 021334 0 ustar root root function y = runFBCTest
%
fbcBindingEnabled = 1;
if isBindingFbcEnabled() == 0
disp ('The libsbml binding for fbc is not enabled');
disp ('not all tests can be run');
fbcBindingEnabled = 0;
end;
cd ..;
cd MATLAB_SBML_Structures;
cd test;
disp('Performing tests in fbc_packages/MATLAB_SBML_Structures directory');
st = testFBCStructures(fbcBindingEnabled);
cd ..;
cd ..;
cd Validate_MATLAB_SBML_Structures;
cd test;
disp('Performing tests in fbc_packages/Validate_MATLAB_SBML_Structures directory');
valid = test_fbc_valid(fbcBindingEnabled);
cd ..;
y = st + valid;
cd ..;
cd test;
SBMLToolbox-4.1.0/toolbox/fbc_package/test/createFBCExample.m 0000644 0000000 0000000 00000012052 11703262366 022446 0 ustar root root function m = createFBCExample
%
m = FBCModel_create(3, 1, 1);
c = Compartment_create(3, 1);
c = Compartment_setId(c, 'compartment');
c = Compartment_setSize(c, 1);
c = Compartment_setConstant(c, 1);
m = Model_addCompartment(m, c);
s = FBCSpecies_create(3,1,1);
s = Species_setCompartment(s, 'compartment');
s = Species_setHasOnlySubstanceUnits(s, 0);
s = Species_setBoundaryCondition(s, 0);
s = Species_setConstant(s, 0);
s1 = Species_setId(s, 'Node1');
m = Model_addSpecies(m, s1);
s2 = Species_setId(s, 'Node2');
m = Model_addSpecies(m, s2);
s3 = Species_setId(s, 'Node3');
m = Model_addSpecies(m, s3);
s4 = Species_setId(s, 'Node4');
m = Model_addSpecies(m, s4);
s5 = Species_setId(s, 'Node5');
m = Model_addSpecies(m, s5);
s6 = Species_setId(s, 'Node6');
m = Model_addSpecies(m, s6);
s7 = Species_setId(s, 'Node7');
m = Model_addSpecies(m, s7);
s8 = Species_setId(s, 'Node8');
m = Model_addSpecies(m, s8);
s0 = Species_setId(s, 'Node0');
s0 = Species_setBoundaryCondition(s0, 1);
m = Model_addSpecies(m, s0);
s9 = Species_setId(s, 'Node9');
s9 = Species_setBoundaryCondition(s9, 1);
m = Model_addSpecies(m, s9);
sr = SpeciesReference_create(3,1);
sr = SpeciesReference_setStoichiometry(sr, 1);
sr = SpeciesReference_setConstant(sr, 1);
sr0 = SpeciesReference_setSpecies(sr, 'Node0');
sr1 = SpeciesReference_setSpecies(sr, 'Node1');
sr2 = SpeciesReference_setSpecies(sr, 'Node2');
sr3 = SpeciesReference_setSpecies(sr, 'Node3');
sr4 = SpeciesReference_setSpecies(sr, 'Node4');
sr5 = SpeciesReference_setSpecies(sr, 'Node5');
sr6 = SpeciesReference_setSpecies(sr, 'Node6');
sr7 = SpeciesReference_setSpecies(sr, 'Node7');
sr8 = SpeciesReference_setSpecies(sr, 'Node8');
sr9 = SpeciesReference_setSpecies(sr, 'Node9');
r = Reaction_create(3, 1);
r = Reaction_setFast(r, 0);
r = Reaction_setReversible(r, 0);
rj0 = Reaction_setId(r, 'J0');
rj0 = Reaction_addReactant(rj0, sr0);
rj0 = Reaction_addProduct(rj0, sr1);
m = Model_addReaction(m, rj0);
rj1 = Reaction_setId(r, 'J1');
rj1 = Reaction_addReactant(rj1, sr1);
rj1 = Reaction_addProduct(rj1, sr2);
m = Model_addReaction(m, rj1);
rj2 = Reaction_setId(r, 'J2');
rj2 = Reaction_addReactant(rj2, sr2);
rj2 = Reaction_addProduct(rj2, sr3);
m = Model_addReaction(m, rj2);
rj3 = Reaction_setId(r, 'J3');
rj3 = Reaction_addReactant(rj3, sr1);
rj3 = Reaction_addProduct(rj3, sr4);
m = Model_addReaction(m, rj3);
rj4 = Reaction_setId(r, 'J4');
rj4 = Reaction_addReactant(rj4, sr4);
rj4 = Reaction_addProduct(rj4, sr3);
m = Model_addReaction(m, rj4);
rj5 = Reaction_setId(r, 'J5');
rj5 = Reaction_addReactant(rj5, sr3);
rj5 = Reaction_addProduct(rj5, sr5);
m = Model_addReaction(m, rj5);
rj6 = Reaction_setId(r, 'J6');
rj6 = Reaction_addReactant(rj6, sr5);
rj6 = Reaction_addProduct(rj6, sr6);
m = Model_addReaction(m, rj6);
rj7 = Reaction_setId(r, 'J7');
rj7 = Reaction_addReactant(rj7, sr6);
rj7 = Reaction_addProduct(rj7, sr7);
m = Model_addReaction(m, rj7);
rj8 = Reaction_setId(r, 'J8');
rj8 = Reaction_addReactant(rj8, sr5);
rj8 = Reaction_addProduct(rj8, sr8);
m = Model_addReaction(m, rj8);
rj9 = Reaction_setId(r, 'J9');
rj9 = Reaction_addReactant(rj9, sr8);
rj9 = Reaction_addProduct(rj9, sr7);
m = Model_addReaction(m, rj9);
rj10 = Reaction_setId(r, 'J10');
rj10 = Reaction_addReactant(rj10, sr7);
rj10 = Reaction_addProduct(rj10, sr9);
m = Model_addReaction(m, rj10);
fb = FluxBound_create(3, 1, 1);
fb = FluxBound_setId(fb, 'bound1');
fb = FluxBound_setReaction(fb, 'J0');
fb = FluxBound_setOperation(fb, 'equal');
fb = FluxBound_setValue(fb, 10);
m = FBCModel_addFluxBound(m, fb);
fo = FluxObjective_create(3,1,1);
fo = FluxObjective_setReaction(fo, 'J8');
fo = FluxObjective_setCoefficient(fo, 1);
o = Objective_create(3, 1, 1);
o = Objective_setId(o, 'obj1');
o = Objective_setType(o, 'maximize');
o = Objective_addFluxObjective(o, fo);
m = FBCModel_addObjective(m, o);
m = FBCModel_setActiveObjective(m, 'obj1');
OutputSBML(m, 'test_example.xml');
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/ 0000755 0000000 0000000 00000000000 11704572220 022231 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/test/ 0000755 0000000 0000000 00000000000 11704572250 023213 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/test/testObjective.m 0000644 0000000 0000000 00000005775 11703262366 026224 0 ustar root root function [fail, num, message] = testObjective()
%
% testObjective
%
% returns
% the number of fails
% the number of tests
% and an array of any messages
% Filename : % Description :
% Author(s) : SBML Development Group
% $Id: $
% $Source v $
%
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing Objective');
disp('Testing L1V1');
obj = Objective_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Objective', fail, num, message);
disp('Testing L1V2');
obj = Objective_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Objective', fail, num, message);
disp('Testing L2V1');
obj = Objective_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Objective', fail, num, message);
disp('Testing L2V2');
obj = Objective_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Objective', fail, num, message);
disp('Testing L2V3');
obj = Objective_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Objective', fail, num, message);
disp('Testing L2V4');
obj = Objective_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'Objective', fail, num, message);
disp('Testing L3V1');
obj = Objective_create(3, 1, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Fbc_id', 1}...
{'Fbc_type', 1}...
{'Fbc_fluxObjective', 9}...
};
[fail, num, message] = testObject(obj, attributes, 'Objective', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/test/testFluxObjective.m 0000644 0000000 0000000 00000006042 11703262366 027047 0 ustar root root function [fail, num, message] = testFluxObjective()
%
% testFluxObjective
%
% returns
% the number of fails
% the number of tests
% and an array of any messages
% Filename : % Description :
% Author(s) : SBML Development Group
% $Id: $
% $Source v $
%
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing FluxObjective');
disp('Testing L1V1');
obj = FluxObjective_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxObjective', fail, num, message);
disp('Testing L1V2');
obj = FluxObjective_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxObjective', fail, num, message);
disp('Testing L2V1');
obj = FluxObjective_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxObjective', fail, num, message);
disp('Testing L2V2');
obj = FluxObjective_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxObjective', fail, num, message);
disp('Testing L2V3');
obj = FluxObjective_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxObjective', fail, num, message);
disp('Testing L2V4');
obj = FluxObjective_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxObjective', fail, num, message);
disp('Testing L3V1');
obj = FluxObjective_create(3, 1, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Fbc_reaction', 1}...
{'Fbc_coefficient', 3}...
};
[fail, num, message] = testObject(obj, attributes, 'FluxObjective', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/test/testFluxBound.m 0000644 0000000 0000000 00000006037 11703262366 026210 0 ustar root root function [fail, num, message] = testFluxBound()
%
% testFluxBound
%
% returns
% the number of fails
% the number of tests
% and an array of any messages
% Filename : % Description :
% Author(s) : SBML Development Group
% $Id: $
% $Source v $
%
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing FluxBound');
disp('Testing L1V1');
obj = FluxBound_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxBound', fail, num, message);
disp('Testing L1V2');
obj = FluxBound_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxBound', fail, num, message);
disp('Testing L2V1');
obj = FluxBound_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxBound', fail, num, message);
disp('Testing L2V2');
obj = FluxBound_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxBound', fail, num, message);
disp('Testing L2V3');
obj = FluxBound_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxBound', fail, num, message);
disp('Testing L2V4');
obj = FluxBound_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FluxBound', fail, num, message);
disp('Testing L3V1');
obj = FluxBound_create(3, 1, 1);
attributes = {...
{'Metaid', 1}...
{'SBOTerm', 2}...
{'Fbc_id', 1}...
{'Fbc_reaction', 1}...
{'Fbc_operation', 1}...
{'Fbc_value', 3}...
};
[fail, num, message] = testObject(obj, attributes, 'FluxBound', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/test/testFBCStructures.m 0000644 0000000 0000000 00000003241 11703262366 026772 0 ustar root root function y = testFBCStructures(varargin)
%
fbcBindingEnabled = 1;
if (nargin == 0)
if isBindingFbcEnabled() == 0
disp ('The libsbml binding for fbc is not enabled');
disp ('not all tests can be run');
fbcBindingEnabled = 0;
end;
else
fbcBindingEnabled = varargin{1};
end;
fail = 0;
fail = fail + testFluxBound();
fail = fail + testFluxObjective();
fail = fail + testObjective();
fail = fail + testFBCSpecies();
fail = fail + testFBCModel();
y = fail;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/test/testFBCSpecies.m 0000644 0000000 0000000 00000005664 11703262366 026215 0 ustar root root function [fail, num, message] = testFBCSpecies()
%
% testFBCSpecies
%
% returns
% the number of fails
% the number of tests
% and an array of any messages
% Filename : % Description :
% Author(s) : SBML Development Group
% $Id: $
% $Source v $
%
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing FBCSpecies');
disp('Testing L1V1');
obj = FBCSpecies_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCSpecies', fail, num, message);
disp('Testing L1V2');
obj = FBCSpecies_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCSpecies', fail, num, message);
disp('Testing L2V1');
obj = FBCSpecies_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCSpecies', fail, num, message);
disp('Testing L2V2');
obj = FBCSpecies_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCSpecies', fail, num, message);
disp('Testing L2V3');
obj = FBCSpecies_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCSpecies', fail, num, message);
disp('Testing L2V4');
obj = FBCSpecies_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCSpecies', fail, num, message);
disp('Testing L3V1');
obj = FBCSpecies_create(3, 1, 1);
attributes = {...
{'Fbc_charge', 3}...
{'Fbc_chemicalFormula', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'FBCSpecies', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/test/testFBCModel.m 0000644 0000000 0000000 00000005673 11703262366 025662 0 ustar root root function [fail, num, message] = testFBCModel()
%
% testFBCModel
%
% returns
% the number of fails
% the number of tests
% and an array of any messages
% Filename : % Description :
% Author(s) : SBML Development Group
% $Id: $
% $Source v $
%
%
fail = 0;
num = 0;
message = {};
warning('off', 'Warn:InvalidLV');
disp('Testing FBCModel');
disp('Testing L1V1');
obj = FBCModel_create(1, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCModel', fail, num, message);
disp('Testing L1V2');
obj = FBCModel_create(1, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCModel', fail, num, message);
disp('Testing L2V1');
obj = FBCModel_create(2, 1);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCModel', fail, num, message);
disp('Testing L2V2');
obj = FBCModel_create(2, 2);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCModel', fail, num, message);
disp('Testing L2V3');
obj = FBCModel_create(2, 3);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCModel', fail, num, message);
disp('Testing L2V4');
obj = FBCModel_create(2, 4);
attributes = {};
[fail, num, message] = testObject(obj, attributes, 'FBCModel', fail, num, message);
disp('Testing L3V1');
obj = FBCModel_create(3, 1, 1);
attributes = {...
{'Fbc_fluxBound', 9}...
{'Fbc_objective', 9}...
{'Fbc_activeObjective', 1}...
};
[fail, num, message] = testObject(obj, attributes, 'FBCModel', fail, num, message);
disp(sprintf('Number tests: %d', num));
disp(sprintf('Number fails: %d', fail));
disp(sprintf('Pass rate: %d%%', ((num-fail)/num)*100));
warning('on', 'Warn:InvalidLV');
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/ 0000755 0000000 0000000 00000000000 11704572252 025552 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getObjectiveFieldnames.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getObjectiveFieldnames0000644 0000000 0000000 00000005074 11703262372 032103 0 ustar root root function [SBMLfieldnames, nNumberFields] = getObjectiveFieldnames(level, ...
version, pkgVersion)
% [fieldnames, num] = getObjectiveFieldnames(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of fieldnames for an SBML Objective structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
% need a check on package version
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'fbc_id', ...
'fbc_type', ...
'fbc_fluxObjective', ...
'level', ...
'version', ...
'fbc_version', ...
};
nNumberFields = 11;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getObjectiveDefaultValues.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getObjectiveDefaultVal0000644 0000000 0000000 00000004765 11703262372 032071 0 ustar root root function [defaultValues] = getObjectiveDefaultValues(level, version, pkgVersion)
% [values] = getObjectiveDefaultValues(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of default values for an SBML Objective structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML Objective structure can be found using
% the function `getObjectiveFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
defaultValues = [];
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
defaultValues = {
'SBML_FBC_OBJECTIVE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
[], ...
int32(3), ...
int32(1), ...
int32(1), ...
};
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxObjectiveFieldnames.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxObjectiveFieldn0000644 0000000 0000000 00000005130 11703262372 032065 0 ustar root root function [SBMLfieldnames, nNumberFields] = getFluxObjectiveFieldnames(level, ...
version, pkgVersion)
% [fieldnames, num] = getFluxObjectiveFieldnames(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of fieldnames for an SBML FluxObjective structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
% need a check on package version
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'fbc_reaction', ...
'fbc_coefficient', ...
'isSetfbc_coefficient', ...
'level', ...
'version', ...
'fbc_version', ...
};
nNumberFields = 11;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000156 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxObjectiveDefaultValues.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxObjectiveDefaul0000644 0000000 0000000 00000005025 11703262372 032067 0 ustar root root function [defaultValues] = getFluxObjectiveDefaultValues(level, version, pkgVersion)
% [values] = getFluxObjectivesDefaultValues(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of default values for an SBML FluxObjective structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML FluxObjective structure can be found using
% the function `getFluxObjectiveFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
defaultValues = [];
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
defaultValues = {
'SBML_FBC_FLUXOBJECTIVE', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
0/0, ...
int32(0), ...
int32(3), ...
int32(1), ...
int32(1), ...
};
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxBoundFieldnames.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxBoundFieldnames0000644 0000000 0000000 00000005225 11703262372 032075 0 ustar root root function [SBMLfieldnames, nNumberFields] = getFluxBoundFieldnames(level, ...
version, pkgVersion)
% [fieldnames, num] = getFluxBoundFieldnames(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of fieldnames for an SBML FluxBound structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
% need a check on package version
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
SBMLfieldnames = { 'typecode', ...
'metaid', ...
'notes', ...
'annotation', ...
'sboTerm', ...
'fbc_id', ...
'fbc_reaction', ...
'fbc_operation', ...
'fbc_value', ...
'isSetfbc_value', ...
'level', ...
'version', ...
'fbc_version', ...
};
nNumberFields = 13;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxBoundDefaultValues.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFluxBoundDefaultVal0000644 0000000 0000000 00000005073 11703262372 032056 0 ustar root root function [defaultValues] = getFluxBoundDefaultValues(level, version, pkgVersion)
% [values] = getFluxBoundsDefaultValues(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of default values for an SBML FluxBound structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML FluxBound structure can be found using
% the function `getFluxBoundFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
defaultValues = [];
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
defaultValues = {
'SBML_FBC_FLUXBOUND', ...
'', ...
'', ...
'', ...
int32(-1), ...
'', ...
'', ...
'', ...
0/0, ...
int32(0), ...
int32(3), ...
int32(1), ...
int32(1), ...
};
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCSpeciesFieldnames.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCSpeciesFieldname0000644 0000000 0000000 00000004464 11703262372 031716 0 ustar root root function [SBMLfieldnames, nNumberFields] = getFBCSpeciesFieldnames(level, ...
version, pkgVersion)
% [fieldnames, num] = getFBCSpeciesFieldnames(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of fieldnames for an SBML FBCSpecies structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
% need a check on package version
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
SBMLfieldnames = { 'fbc_charge', ...
'isSetfbc_charge', ...
'fbc_chemicalFormula', ...
'fbc_version', ...
};
nNumberFields = 4;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCSpeciesDefaultValues.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCSpeciesDefaultVa0000644 0000000 0000000 00000004426 11703262372 031703 0 ustar root root function [defaultValues] = getFBCSpeciesDefaultValues(level, version, pkgVersion)
% [values] = getFBCSpeciesDefaultValues(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of default values for teh FBC attributes SBML Species structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML FBC Species structure can be found using
% the function `getFBCSpeciesFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
if (level == 1)
defaultValues = [];
elseif (level == 2)
defaultValues = [];
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
defaultValues = {
int32(0), ...
int32(0), ...
'', ...
int32(1), ...
};
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCModelFieldnames.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCModelFieldnames.0000644 0000000 0000000 00000004457 11703262372 031626 0 ustar root root function [SBMLfieldnames, nNumberFields] = getFBCModelFieldnames(level, ...
version, pkgVersion)
% [fieldnames, num] = getFBCModelFieldnames(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of fieldnames for an SBML FBCModel structure of the given level and version
% 2. the number of fieldnames
%
%
if (~isValidLevelVersionCombination(level, version))
error ('invalid level/version combination');
end;
% need a check on package version
if (level == 1)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 2)
SBMLfieldnames = [];
nNumberFields = 0;
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
SBMLfieldnames = { 'fbc_version', ...
'fbc_fluxBound', ...
'fbc_objective', ...
'fbc_activeObjective', ...
};
nNumberFields = 4;
end;
end;
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCModelDefaultValues.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/getFBCModelDefaultValu0000644 0000000 0000000 00000004572 11703262372 031713 0 ustar root root function [defaultValues, prefix, ns] = getFBCModelDefaultValues(level, version, pkgVersion)
% [values] = getFBCModelDefaultValues(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. an array of default values for teh FBC attributes SBML Model structure of the given level and version
%
% *NOTE:* The corresponding fields present in an SBML FBC Model structure can be found using
% the function `getFBCModelFieldnames`
%
%check the input arguments are appropriate
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
prefix = '';
ns = '';
if (level == 1)
defaultValues = [];
elseif (level == 2)
defaultValues = [];
elseif (level == 3)
if (version == 1)
if (pkgVersion == 1)
defaultValues = {
int32(1), ...
[], ...
[], ...
'', ...
};
prefix = 'fbc';
ns = 'http://www.sbml.org/sbml/level3/version1/fbc/version1';
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/structFieldnames/Contents.m 0000644 0000000 0000000 00000014620 11703262372 027526 0 ustar root root % toolbox\fbc_package\MATLAB_SBML_Structures\structFieldnames
%
% These functions return the fieldnames and default values for the
% MATLAB_SBML FBC structures.
%
%=================================================================
% [values] = getFBCModelDefaultValues(level, version, pkgVersion)
%=================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of default values for teh FBC attributes SBML Model structure of the given level and version
%
%=======================================================================
% [fieldnames, num] = getFBCModelFieldnames(level, version, pkgVersion)
%=======================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of fieldnames for an SBML FBCModel structure of the given level and version
% 2. the number of fieldnames
%
%===================================================================
% [values] = getFBCSpeciesDefaultValues(level, version, pkgVersion)
%===================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of default values for teh FBC attributes SBML Species structure of the given level and version
%
%=========================================================================
% [fieldnames, num] = getFBCSpeciesFieldnames(level, version, pkgVersion)
%=========================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of fieldnames for an SBML FBCSpecies structure of the given level and version
% 2. the number of fieldnames
%
%===================================================================
% [values] = getFluxBoundsDefaultValues(level, version, pkgVersion)
%===================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of default values for an SBML FluxBound structure of the given level and version
%
%========================================================================
% [fieldnames, num] = getFluxBoundFieldnames(level, version, pkgVersion)
%========================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of fieldnames for an SBML FluxBound structure of the given level and version
% 2. the number of fieldnames
%
%=======================================================================
% [values] = getFluxObjectivesDefaultValues(level, version, pkgVersion)
%=======================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of default values for an SBML FluxObjective structure of the given level and version
%
%============================================================================
% [fieldnames, num] = getFluxObjectiveFieldnames(level, version, pkgVersion)
%============================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of fieldnames for an SBML FluxObjective structure of the given level and version
% 2. the number of fieldnames
%
%==================================================================
% [values] = getObjectiveDefaultValues(level, version, pkgVersion)
%==================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of default values for an SBML Objective structure of the given level and version
%
%========================================================================
% [fieldnames, num] = getObjectiveFieldnames(level, version, pkgVersion)
%========================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. an array of fieldnames for an SBML Objective structure of the given level and version
% 2. the number of fieldnames
%
%
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/ 0000755 0000000 0000000 00000000000 11704572252 024150 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_unsetType.m 0000644 0000000 0000000 00000003341 11703262370 030315 0 ustar root root function SBMLObjective = Objective_unsetType(SBMLObjective)
% SBMLObjective = Objective_unsetType(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the SBML FBC Objective structure with the fbc_type attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_type')
SBMLObjective.fbc_type = '';
else
error('type not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_unsetSBOTerm.m 0000644 0000000 0000000 00000003350 11703262370 030647 0 ustar root root function SBMLObjective = Objective_unsetSBOTerm(SBMLObjective)
% SBMLObjective = Objective_unsetSBOTerm(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the SBML FBC Objective structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'sboTerm')
SBMLObjective.sboTerm = NaN;
else
error('sboTerm not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_unsetMetaid.m 0000644 0000000 0000000 00000003341 11703262370 030577 0 ustar root root function SBMLObjective = Objective_unsetMetaid(SBMLObjective)
% SBMLObjective = Objective_unsetMetaid(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the SBML FBC Objective structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'metaid')
SBMLObjective.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_unsetId.m 0000644 0000000 0000000 00000003325 11703262370 027732 0 ustar root root function SBMLObjective = Objective_unsetId(SBMLObjective)
% SBMLObjective = Objective_unsetId(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the SBML FBC Objective structure with the fbc_id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_id')
SBMLObjective.fbc_id = '';
else
error('id not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_setType.m 0000644 0000000 0000000 00000003570 11703262370 027756 0 ustar root root function SBMLObjective = Objective_setType(SBMLObjective, type)
% SBMLObjective = Objective_setType(SBMLObjective, type)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
% 2. type, a string representing the fbc_type to be set
%
% Returns
%
% 1. the SBML FBC Objective structure with the new value for the fbc_type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_type')
if ~ischar(type)
error('type must be character array') ;
else
SBMLObjective.fbc_type = type;
end;
else
error('type not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_setSBOTerm.m 0000644 0000000 0000000 00000003612 11703262370 030305 0 ustar root root function SBMLObjective = Objective_setSBOTerm(SBMLObjective, sboTerm)
% SBMLObjective = Objective_setSBOTerm(SBMLObjective, sboTerm)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
% 2. sboTerm, a number representing the sboTerm to be set
%
% Returns
%
% 1. the SBML FBC Objective structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'sboTerm')
if ~isnumeric(sboTerm)
error('sboTerm must be numeric') ;
else
SBMLObjective.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_setMetaid.m 0000644 0000000 0000000 00000003602 11703262370 030234 0 ustar root root function SBMLObjective = Objective_setMetaid(SBMLObjective, metaid)
% SBMLObjective = Objective_setMetaid(SBMLObjective, metaid)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
% 2. metaid, a string representing the metaid to be set
%
% Returns
%
% 1. the SBML FBC Objective structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLObjective.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_setId.m 0000644 0000000 0000000 00000003536 11703262370 027373 0 ustar root root function SBMLObjective = Objective_setId(SBMLObjective, id)
% SBMLObjective = Objective_setId(SBMLObjective, id)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
% 2. id, a string representing the fbc_id to be set
%
% Returns
%
% 1. the SBML FBC Objective structure with the new value for the fbc_id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLObjective.fbc_id = id;
end;
else
error('id not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_isSetType.m 0000644 0000000 0000000 00000003334 11703262370 030250 0 ustar root root function value = Objective_isSetType(SBMLObjective)
% type = Objective_isSetType(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_type attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_type')
value = ~isempty(SBMLObjective.fbc_type);
else
error('type not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_isSetSBOTerm.m 0000644 0000000 0000000 00000003346 11703262370 030605 0 ustar root root function value = Objective_isSetSBOTerm(SBMLObjective)
% sboTerm = Objective_isSetSBOTerm(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'sboTerm')
value = (SBMLObjective.sboTerm > 0);
else
error('isSetSboTerm not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_isSetMetaid.m 0000644 0000000 0000000 00000003336 11703262370 030534 0 ustar root root function value = Objective_isSetMetaid(SBMLObjective)
% metaid = Objective_isSetMetaid(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'metaid')
value = ~isempty(SBMLObjective.metaid);
else
error('metaid not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_isSetId.m 0000644 0000000 0000000 00000003316 11703262370 027663 0 ustar root root function value = Objective_isSetId(SBMLObjective)
% id = Objective_isSetId(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_id')
value = ~isempty(SBMLObjective.fbc_id);
else
error('id not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getType.m 0000644 0000000 0000000 00000003256 11703262370 027743 0 ustar root root function type = Objective_getType(SBMLObjective)
% type = Objective_getType(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the value of the fbc_type attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_type')
type = SBMLObjective.fbc_type;
else
error('type not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getSBOTerm.m 0000644 0000000 0000000 00000003275 11703262370 030276 0 ustar root root function sboTerm = Objective_getSBOTerm(SBMLObjective)
% sboTerm = Objective_getSBOTerm(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'sboTerm')
sboTerm = SBMLObjective.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d Objective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getNumFluxObjectives.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getNumFluxObjective0000644 0000000 0000000 00000003407 11703262370 032016 0 ustar root root function num = Objective_getNumFluxObjectives(SBMLObjective)
% num = Objective_getNumFluxObjectives(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the number of SBML FluxObjective structures present in the Objective
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_fluxObjective')
num = length(SBMLObjective.fbc_fluxObjective);
else
error('fluxObjective not an element on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getMetaid.m 0000644 0000000 0000000 00000003264 11703262370 030224 0 ustar root root function metaid = Objective_getMetaid(SBMLObjective)
% metaid = Objective_getMetaid(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'metaid')
metaid = SBMLObjective.metaid;
else
error('metaid not an attribute on SBML L%dV%d Objective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getListOfFluxObjectives.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getListOfFluxObject0000644 0000000 0000000 00000003407 11703262370 031753 0 ustar root root function fluxObjective = Objective_getListOfFluxObjectives(SBMLObjective)
% fluxObjective = Objective_getListOfFluxObjectives(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. an array of the fluxObjective structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_fluxObjective')
fluxObjective = SBMLObjective.fbc_fluxObjective;
else
error('fluxObjective not an element on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getId.m 0000644 0000000 0000000 00000003234 11703262370 027352 0 ustar root root function id = Objective_getId(SBMLObjective)
% id = Objective_getId(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the value of the fbc_id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_id')
id = SBMLObjective.fbc_id;
else
error('id not an attribute on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_getFluxObjective.m 0000644 0000000 0000000 00000004047 11703262370 031572 0 ustar root root function fluxObjective = Objective_getFluxObjective(SBMLObjective, index)
% fluxObjective = Objective_getFluxObjective(SBMLObjective, index)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
% 2. index, an integer representing the index of SBML FluxObjective structure
%
% Returns
%
% 1. the SBML FluxObjective structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_fluxObjective')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLObjective.fbc_fluxObjective)
fluxObjective = SBMLObjective.fbc_fluxObjective;
else
error('index is out of range');
end;
else
error('fluxObjective not an element on SBML L%dV%d Objective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_createFluxObjective.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_createFluxObjective0000644 0000000 0000000 00000004012 11703262370 032013 0 ustar root root function SBMLObjective = Objective_createFluxObjective(SBMLObjective)
% SBMLObjective = Objective_createFluxObjective(SBMLObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the SBML Objective structure with a new SBML FluxObjective structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
if isfield(SBMLObjective, 'fbc_fluxObjective')
SBMLFluxObjective = FluxObjective_create(level, version, SBMLObjective.fbc_version);
index = length(SBMLObjective.fbc_fluxObjective);
if index == 0
SBMLObjective.fbc_fluxObjective = SBMLFluxObjective;
else
SBMLObjective.fbc_fluxObjective(index+1) = SBMLFluxObjective;
end;
else
error('fluxObjective not an element on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_create.m 0000644 0000000 0000000 00000005727 11703262370 027572 0 ustar root root function Objective = Objective_create(varargin)
% Objective = Objective_create(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. a MATLAB_SBML FBC Objective structure of the appropriate level, version and pkgVersion
%
%
%check the input arguments are appropriate
if (nargin > 3)
error('too many input arguments');
end;
switch (nargin)
case 3
level = varargin{1};
version = varargin{2};
pkgVersion = varargin{3};
case 2
level = varargin{1};
version = varargin{2};
pkgVersion = 1;
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
pkgVersion = 1;
otherwise
level = 3;
version = 1;
pkgVersion = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getObjectiveFieldnames(level, version, pkgVersion);
if (num > 0)
values = getObjectiveDefaultValues(level, version, pkgVersion);
Objective = cell2struct(values, fieldnames, 2);
%add empty substructures
Objective.fbc_fluxObjective = FluxObjective_create(level, version, pkgVersion);
Objective.fbc_fluxObjective(1:end) = [];
%add level and version
Objective.level = level;
Objective.version = version;
Objective.fbc_version = pkgVersion;
%check correct structure
if ~isSBML_FBC_Objective(Objective, level, version)
Objective = struct();
warning('Warn:BadStruct', 'Failed to create Objective');
end;
else
Objective = [];
warning('Warn:InvalidLV', 'Objective not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Objective_addFluxObjective.m 0000644 0000000 0000000 00000004350 11703262370 031540 0 ustar root root function SBMLObjective = Objective_addFluxObjective(SBMLObjective, SBMLFluxObjective)
% SBMLObjective = Objective_addFluxObjective(SBMLObjective, SBMLFluxObjective)
%
% Takes
%
% 1. SBMLObjective, an SBML Objective structure
% 2. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the SBML Objective structure with the SBML FluxObjective structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLObjective);
[fluxObjective_level, fluxObjective_version] = GetLevelVersion(SBMLFluxObjective);
if level ~= fluxObjective_level
error('mismatch in levels');
elseif version ~= fluxObjective_version
error('mismatch in versions');
end;
if isfield(SBMLObjective, 'fbc_fluxObjective')
index = length(SBMLObjective.fbc_fluxObjective);
if index == 0
SBMLObjective.fbc_fluxObjective = SBMLFluxObjective;
else
SBMLObjective.fbc_fluxObjective(index+1) = SBMLFluxObjective;
end;
else
error('fluxObjective not an element on SBML L%dV%d Objective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/Objective/Contents.m 0000644 0000000 0000000 00000020406 11703262370 026121 0 ustar root root % toolbox\fbc_package\MATLAB_SBML_Structures\Objective
%
% The functions allow users to create and work with the SBML FBC Objective structure.
%
%==============================================================================
% SBMLObjective = Objective_addFluxObjective(SBMLObjective, SBMLFluxObjective)
%==============================================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% 2. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the SBML Objective structure with the SBML FluxObjective structure added
%
%==========================================================
% Objective = Objective_create(level, version, pkgVersion)
%==========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. a MATLAB_SBML FBC Objective structure of the appropriate level, version and pkgVersion
%
%==============================================================
% SBMLObjective = Objective_createFluxObjective(SBMLObjective)
%==============================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the SBML Objective structure with a new SBML FluxObjective structure added
%
%==================================================================
% fluxObjective = Objective_getFluxObjective(SBMLObjective, index)
%==================================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% 2. index, an integer representing the index of SBML FluxObjective structure
% Returns
% 1. the SBML FluxObjective structure at the indexed position
%
%=====================================
% id = Objective_getId(SBMLObjective)
%=====================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the value of the fbc_id attribute
%
%==================================================================
% fluxObjective = Objective_getListOfFluxObjectives(SBMLObjective)
%==================================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. an array of the fluxObjective structures
%
%=============================================
% metaid = Objective_getMetaid(SBMLObjective)
%=============================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the value of the metaid attribute
%
%=====================================================
% num = Objective_getNumFluxObjectives(SBMLObjective)
%=====================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the number of SBML FluxObjective structures present in the Objective
%
%===============================================
% sboTerm = Objective_getSBOTerm(SBMLObjective)
%===============================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the value of the sboTerm attribute
%
%=========================================
% type = Objective_getType(SBMLObjective)
%=========================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the value of the fbc_type attribute
%
%=======================================
% id = Objective_isSetId(SBMLObjective)
%=======================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. value =
% - 1 if the fbc_id attribute is set
% - 0 otherwise
%
%===============================================
% metaid = Objective_isSetMetaid(SBMLObjective)
%===============================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=================================================
% sboTerm = Objective_isSetSBOTerm(SBMLObjective)
%=================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%===========================================
% type = Objective_isSetType(SBMLObjective)
%===========================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. value =
% - 1 if the fbc_type attribute is set
% - 0 otherwise
%
%====================================================
% SBMLObjective = Objective_setId(SBMLObjective, id)
%====================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% 2. id, a string representing the fbc_id to be set
% Returns
% 1. the SBML FBC Objective structure with the new value for the fbc_id attribute
%
%============================================================
% SBMLObjective = Objective_setMetaid(SBMLObjective, metaid)
%============================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% 2. metaid, a string representing the metaid to be set
% Returns
% 1. the SBML FBC Objective structure with the new value for the metaid attribute
%
%==============================================================
% SBMLObjective = Objective_setSBOTerm(SBMLObjective, sboTerm)
%==============================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% 2. sboTerm, a number representing the sboTerm to be set
% Returns
% 1. the SBML FBC Objective structure with the new value for the sboTerm attribute
%
%========================================================
% SBMLObjective = Objective_setType(SBMLObjective, type)
%========================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% 2. type, a string representing the fbc_type to be set
% Returns
% 1. the SBML FBC Objective structure with the new value for the fbc_type attribute
%
%==================================================
% SBMLObjective = Objective_unsetId(SBMLObjective)
%==================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the SBML FBC Objective structure with the fbc_id attribute unset
%
%======================================================
% SBMLObjective = Objective_unsetMetaid(SBMLObjective)
%======================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the SBML FBC Objective structure with the metaid attribute unset
%
%=======================================================
% SBMLObjective = Objective_unsetSBOTerm(SBMLObjective)
%=======================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the SBML FBC Objective structure with the sboTerm attribute unset
%
%====================================================
% SBMLObjective = Objective_unsetType(SBMLObjective)
%====================================================
% Takes
% 1. SBMLObjective, an SBML Objective structure
% Returns
% 1. the SBML FBC Objective structure with the fbc_type attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/ 0000755 0000000 0000000 00000000000 11704572252 025007 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetSBOTerm.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetSBOTer0000644 0000000 0000000 00000003433 11703262366 031744 0 ustar root root function SBMLFluxObjective = FluxObjective_unsetSBOTerm(SBMLFluxObjective)
% SBMLFluxObjective = FluxObjective_unsetSBOTerm(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'sboTerm')
SBMLFluxObjective.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetReaction.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetReacti0000644 0000000 0000000 00000003455 11703262366 032061 0 ustar root root function SBMLFluxObjective = FluxObjective_unsetReaction(SBMLFluxObjective)
% SBMLFluxObjective = FluxObjective_unsetReaction(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the fbc_reaction attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'fbc_reaction')
SBMLFluxObjective.fbc_reaction = '';
else
error('reaction not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetMetaid.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetMetaid0000644 0000000 0000000 00000003425 11703262366 032052 0 ustar root root function SBMLFluxObjective = FluxObjective_unsetMetaid(SBMLFluxObjective)
% SBMLFluxObjective = FluxObjective_unsetMetaid(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'metaid')
SBMLFluxObjective.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetCoefficient.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_unsetCoeffi0000644 0000000 0000000 00000003556 11703262366 032047 0 ustar root root function SBMLFluxObjective = FluxObjective_unsetCoefficient(SBMLFluxObjective)
% SBMLFluxObjective = FluxObjective_unsetCoefficient(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the fbc_coefficient attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'fbc_coefficient')
SBMLFluxObjective.fbc_coefficient = NaN;
SBMLFluxObjective.isSetfbc_coefficient = 0;
else
error('coefficient not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_setSBOTerm.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_setSBOTerm.0000644 0000000 0000000 00000003676 11703262366 031645 0 ustar root root function SBMLFluxObjective = FluxObjective_setSBOTerm(SBMLFluxObjective, sboTerm)
% SBMLFluxObjective = FluxObjective_setSBOTerm(SBMLFluxObjective, sboTerm)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. sboTerm, a number representing the sboTerm to be set
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'sboTerm')
if ~isnumeric(sboTerm)
error('sboTerm must be numeric') ;
else
SBMLFluxObjective.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_setReaction.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_setReaction0000644 0000000 0000000 00000003740 11703262366 032050 0 ustar root root function SBMLFluxObjective = FluxObjective_setReaction(SBMLFluxObjective, reaction)
% SBMLFluxObjective = FluxObjective_setReaction(SBMLFluxObjective, reaction)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. reaction, a string representing the fbc_reaction to be set
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the new value for the fbc_reaction attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'fbc_reaction')
if ~ischar(reaction)
error('reaction must be character array') ;
else
SBMLFluxObjective.fbc_reaction = reaction;
end;
else
error('reaction not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_setMetaid.m0000644 0000000 0000000 00000003666 11703262366 031751 0 ustar root root function SBMLFluxObjective = FluxObjective_setMetaid(SBMLFluxObjective, metaid)
% SBMLFluxObjective = FluxObjective_setMetaid(SBMLFluxObjective, metaid)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. metaid, a string representing the metaid to be set
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLFluxObjective.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_setCoefficient.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_setCoeffici0000644 0000000 0000000 00000004060 11703262366 032007 0 ustar root root function SBMLFluxObjective = FluxObjective_setCoefficient(SBMLFluxObjective, coefficient)
% SBMLFluxObjective = FluxObjective_setCoefficient(SBMLFluxObjective, coefficient)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. coefficient, a number representing the fbc_coefficient to be set
%
% Returns
%
% 1. the SBML FBC FluxObjective structure with the new value for the fbc_coefficient attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'fbc_coefficient')
if ~isnumeric(coefficient)
error('coefficient must be numeric') ;
else
SBMLFluxObjective.fbc_coefficient = coefficient;
SBMLFluxObjective.isSetfbc_coefficient = 1;
end;
else
error('coefficient not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetSBOTerm.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetSBOTer0000644 0000000 0000000 00000003416 11703262366 031676 0 ustar root root function value = FluxObjective_isSetSBOTerm(SBMLFluxObjective)
% sboTerm = FluxObjective_isSetSBOTerm(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'sboTerm')
value = (SBMLFluxObjective.sboTerm) > 0;
else
error('isSetSBOTerm not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetReaction.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetReacti0000644 0000000 0000000 00000003440 11703262366 032004 0 ustar root root function value = FluxObjective_isSetReaction(SBMLFluxObjective)
% reaction = FluxObjective_isSetReaction(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_reaction attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'fbc_reaction')
value = ~isempty(SBMLFluxObjective.fbc_reaction);
else
error('reaction not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetMetaid.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetMetaid0000644 0000000 0000000 00000003406 11703262366 032002 0 ustar root root function value = FluxObjective_isSetMetaid(SBMLFluxObjective)
% metaid = FluxObjective_isSetMetaid(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'metaid')
value = ~isempty(SBMLFluxObjective.metaid);
else
error('metaid not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetCoefficient.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_isSetCoeffi0000644 0000000 0000000 00000003472 11703262366 031775 0 ustar root root function value = FluxObjective_isSetCoefficient(SBMLFluxObjective)
% coefficient = FluxObjective_isSetCoefficient(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_coefficient attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'isSetfbc_coefficient')
value = SBMLFluxObjective.isSetfbc_coefficient;
else
error('isSetCoefficient not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_getSBOTerm.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_getSBOTerm.0000644 0000000 0000000 00000003345 11703262366 031622 0 ustar root root function sboTerm = FluxObjective_getSBOTerm(SBMLFluxObjective)
% sboTerm = FluxObjective_getSBOTerm(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'sboTerm')
sboTerm = SBMLFluxObjective.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_getReaction.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_getReaction0000644 0000000 0000000 00000003372 11703262366 032035 0 ustar root root function reaction = FluxObjective_getReaction(SBMLFluxObjective)
% reaction = FluxObjective_getReaction(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the value of the fbc_reaction attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'fbc_reaction')
reaction = SBMLFluxObjective.fbc_reaction;
else
error('reaction not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_getMetaid.m0000644 0000000 0000000 00000003334 11703262366 031725 0 ustar root root function metaid = FluxObjective_getMetaid(SBMLFluxObjective)
% metaid = FluxObjective_getMetaid(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'metaid')
metaid = SBMLFluxObjective.metaid;
else
error('metaid not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_getCoefficient.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_getCoeffici0000644 0000000 0000000 00000003425 11703262366 031777 0 ustar root root function coefficient = FluxObjective_getCoefficient(SBMLFluxObjective)
% coefficient = FluxObjective_getCoefficient(SBMLFluxObjective)
%
% Takes
%
% 1. SBMLFluxObjective, an SBML FluxObjective structure
%
% Returns
%
% 1. the value of the fbc_coefficient attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxObjective);
if isfield(SBMLFluxObjective, 'fbc_coefficient')
coefficient = SBMLFluxObjective.fbc_coefficient;
else
error('coefficient not an attribute on SBML L%dV%d FluxObjective', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/FluxObjective_create.m 0000644 0000000 0000000 00000005612 11703262366 031266 0 ustar root root function FluxObjective = FluxObjective_create(varargin)
% FluxObjective = FluxObjective_create(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. a MATLAB_SBML FBC FluxObjective structure of the appropriate level, version and pkgVersion
%
%
%check the input arguments are appropriate
if (nargin > 3)
error('too many input arguments');
end;
switch (nargin)
case 3
level = varargin{1};
version = varargin{2};
pkgVersion = varargin{3};
case 2
level = varargin{1};
version = varargin{2};
pkgVersion = 1;
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
pkgVersion = 1;
otherwise
level = 3;
version = 1;
pkgVersion = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getFluxObjectiveFieldnames(level, version, pkgVersion);
if (num > 0)
values = getFluxObjectiveDefaultValues(level, version, pkgVersion);
FluxObjective = cell2struct(values, fieldnames, 2);
%add level and version
FluxObjective.level = level;
FluxObjective.version = version;
FluxObjective.fbc_version = pkgVersion;
%check correct structure
if ~isSBML_FBC_FluxObjective(FluxObjective, level, version, pkgVersion)
FluxObjective = struct();
warning('Warn:BadStruct', 'Failed to create FluxObjective');
end;
else
FluxObjective = [];
warning('Warn:InvalidLV', 'FluxObjective not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxObjective/Contents.m 0000644 0000000 0000000 00000016763 11703262366 027000 0 ustar root root % toolbox\fbc_package\MATLAB_SBML_Structures\FluxObjective
%
% The functions allow users to create and work with the SBML FBC FluxObjective structure.
%
%==================================================================
% FluxObjective = FluxObjective_create(level, version, pkgVersion)
%==================================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. a MATLAB_SBML FBC FluxObjective structure of the appropriate level, version and pkgVersion
%
%===============================================================
% coefficient = FluxObjective_getCoefficient(SBMLFluxObjective)
%===============================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the value of the fbc_coefficient attribute
%
%=====================================================
% metaid = FluxObjective_getMetaid(SBMLFluxObjective)
%=====================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the value of the metaid attribute
%
%=========================================================
% reaction = FluxObjective_getReaction(SBMLFluxObjective)
%=========================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the value of the fbc_reaction attribute
%
%=======================================================
% sboTerm = FluxObjective_getSBOTerm(SBMLFluxObjective)
%=======================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the value of the sboTerm attribute
%
%=================================================================
% coefficient = FluxObjective_isSetCoefficient(SBMLFluxObjective)
%=================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. value =
% - 1 if the fbc_coefficient attribute is set
% - 0 otherwise
%
%=======================================================
% metaid = FluxObjective_isSetMetaid(SBMLFluxObjective)
%=======================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%===========================================================
% reaction = FluxObjective_isSetReaction(SBMLFluxObjective)
%===========================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. value =
% - 1 if the fbc_reaction attribute is set
% - 0 otherwise
%
%=========================================================
% sboTerm = FluxObjective_isSetSBOTerm(SBMLFluxObjective)
%=========================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%==================================================================================
% SBMLFluxObjective = FluxObjective_setCoefficient(SBMLFluxObjective, coefficient)
%==================================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. coefficient, a number representing the fbc_coefficient to be set
% Returns
% 1. the SBML FBC FluxObjective structure with the new value for the fbc_coefficient attribute
%
%========================================================================
% SBMLFluxObjective = FluxObjective_setMetaid(SBMLFluxObjective, metaid)
%========================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. metaid, a string representing the metaid to be set
% Returns
% 1. the SBML FBC FluxObjective structure with the new value for the metaid attribute
%
%============================================================================
% SBMLFluxObjective = FluxObjective_setReaction(SBMLFluxObjective, reaction)
%============================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. reaction, a string representing the fbc_reaction to be set
% Returns
% 1. the SBML FBC FluxObjective structure with the new value for the fbc_reaction attribute
%
%==========================================================================
% SBMLFluxObjective = FluxObjective_setSBOTerm(SBMLFluxObjective, sboTerm)
%==========================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% 2. sboTerm, a number representing the sboTerm to be set
% Returns
% 1. the SBML FBC FluxObjective structure with the new value for the sboTerm attribute
%
%=======================================================================
% SBMLFluxObjective = FluxObjective_unsetCoefficient(SBMLFluxObjective)
%=======================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the SBML FBC FluxObjective structure with the fbc_coefficient attribute unset
%
%==================================================================
% SBMLFluxObjective = FluxObjective_unsetMetaid(SBMLFluxObjective)
%==================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the SBML FBC FluxObjective structure with the metaid attribute unset
%
%====================================================================
% SBMLFluxObjective = FluxObjective_unsetReaction(SBMLFluxObjective)
%====================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the SBML FBC FluxObjective structure with the fbc_reaction attribute unset
%
%===================================================================
% SBMLFluxObjective = FluxObjective_unsetSBOTerm(SBMLFluxObjective)
%===================================================================
% Takes
% 1. SBMLFluxObjective, an SBML FluxObjective structure
% Returns
% 1. the SBML FBC FluxObjective structure with the sboTerm attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/ 0000755 0000000 0000000 00000000000 11704572252 024144 5 ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_unsetValue.m 0000644 0000000 0000000 00000003413 11703262366 030445 0 ustar root root function SBMLFluxBound = FluxBound_unsetValue(SBMLFluxBound)
% SBMLFluxBound = FluxBound_unsetValue(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the fbc_value attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_value')
SBMLFluxBound.fbc_value = NaN;
SBMLFluxBound.isSetfbc_value = 0;
else
error('value not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_unsetSBOTerm.m 0000644 0000000 0000000 00000003347 11703262366 030652 0 ustar root root function SBMLFluxBound = FluxBound_unsetSBOTerm(SBMLFluxBound)
% SBMLFluxBound = FluxBound_unsetSBOTerm(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the sboTerm attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'sboTerm')
SBMLFluxBound.sboTerm = -1;
else
error('sboTerm not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_unsetReaction.m 0000644 0000000 0000000 00000003371 11703262366 031140 0 ustar root root function SBMLFluxBound = FluxBound_unsetReaction(SBMLFluxBound)
% SBMLFluxBound = FluxBound_unsetReaction(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the fbc_reaction attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_reaction')
SBMLFluxBound.fbc_reaction = '';
else
error('reaction not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_unsetOperation.m 0000644 0000000 0000000 00000003377 11703262366 031342 0 ustar root root function SBMLFluxBound = FluxBound_unsetOperation(SBMLFluxBound)
% SBMLFluxBound = FluxBound_unsetOperation(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the fbc_operation attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_operation')
SBMLFluxBound.fbc_operation = '';
else
error('operation not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_unsetMetaid.m 0000644 0000000 0000000 00000003341 11703262366 030574 0 ustar root root function SBMLFluxBound = FluxBound_unsetMetaid(SBMLFluxBound)
% SBMLFluxBound = FluxBound_unsetMetaid(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the metaid attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'metaid')
SBMLFluxBound.metaid = '';
else
error('metaid not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_unsetId.m 0000644 0000000 0000000 00000003325 11703262366 027727 0 ustar root root function SBMLFluxBound = FluxBound_unsetId(SBMLFluxBound)
% SBMLFluxBound = FluxBound_unsetId(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the fbc_id attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_id')
SBMLFluxBound.fbc_id = '';
else
error('id not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_setValue.m 0000644 0000000 0000000 00000003644 11703262366 030110 0 ustar root root function SBMLFluxBound = FluxBound_setValue(SBMLFluxBound, value)
% SBMLFluxBound = FluxBound_setValue(SBMLFluxBound, value)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. value, a number representing the fbc_value to be set
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the new value for the fbc_value attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_value')
if ~isnumeric(value)
error('value must be numeric') ;
else
SBMLFluxBound.fbc_value = value;
SBMLFluxBound.isSetfbc_value = 1;
end;
else
error('value not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_setSBOTerm.m 0000644 0000000 0000000 00000003612 11703262366 030302 0 ustar root root function SBMLFluxBound = FluxBound_setSBOTerm(SBMLFluxBound, sboTerm)
% SBMLFluxBound = FluxBound_setSBOTerm(SBMLFluxBound, sboTerm)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. sboTerm, a number representing the sboTerm to be set
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the new value for the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'sboTerm')
if ~isnumeric(sboTerm)
error('sboTerm must be numeric') ;
else
SBMLFluxBound.sboTerm = sboTerm;
end;
else
error('sboTerm not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_setReaction.m 0000644 0000000 0000000 00000003654 11703262366 030601 0 ustar root root function SBMLFluxBound = FluxBound_setReaction(SBMLFluxBound, reaction)
% SBMLFluxBound = FluxBound_setReaction(SBMLFluxBound, reaction)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. reaction, a string representing the fbc_reaction to be set
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the new value for the fbc_reaction attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_reaction')
if ~ischar(reaction)
error('reaction must be character array') ;
else
SBMLFluxBound.fbc_reaction = reaction;
end;
else
error('reaction not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_setOperation.m 0000644 0000000 0000000 00000003671 11703262366 030774 0 ustar root root function SBMLFluxBound = FluxBound_setOperation(SBMLFluxBound, operation)
% SBMLFluxBound = FluxBound_setOperation(SBMLFluxBound, operation)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. operation, a string representing the fbc_operation to be set
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the new value for the fbc_operation attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_operation')
if ~ischar(operation)
error('operation must be character array') ;
else
SBMLFluxBound.fbc_operation = operation;
end;
else
error('operation not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_setMetaid.m 0000644 0000000 0000000 00000003602 11703262366 030231 0 ustar root root function SBMLFluxBound = FluxBound_setMetaid(SBMLFluxBound, metaid)
% SBMLFluxBound = FluxBound_setMetaid(SBMLFluxBound, metaid)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. metaid, a string representing the metaid to be set
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the new value for the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'metaid')
if ~ischar(metaid)
error('metaid must be character array') ;
else
SBMLFluxBound.metaid = metaid;
end;
else
error('metaid not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_setId.m 0000644 0000000 0000000 00000003536 11703262366 027370 0 ustar root root function SBMLFluxBound = FluxBound_setId(SBMLFluxBound, id)
% SBMLFluxBound = FluxBound_setId(SBMLFluxBound, id)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. id, a string representing the fbc_id to be set
%
% Returns
%
% 1. the SBML FBC FluxBound structure with the new value for the fbc_id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_id')
if ~ischar(id)
error('id must be character array') ;
else
SBMLFluxBound.fbc_id = id;
end;
else
error('id not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_isSetValue.m 0000644 0000000 0000000 00000003350 11703262366 030376 0 ustar root root function value = FluxBound_isSetValue(SBMLFluxBound)
% value = FluxBound_isSetValue(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_value attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'isSetfbc_value')
value = SBMLFluxBound.isSetfbc_value;
else
error('isSetValue not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_isSetSBOTerm.m 0000644 0000000 0000000 00000003346 11703262366 030602 0 ustar root root function value = FluxBound_isSetSBOTerm(SBMLFluxBound)
% sboTerm = FluxBound_isSetSBOTerm(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'sboTerm')
value = (SBMLFluxBound.sboTerm > 0);
else
error('isSetSboTerm not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_isSetReaction.m 0000644 0000000 0000000 00000003370 11703262366 031070 0 ustar root root function value = FluxBound_isSetReaction(SBMLFluxBound)
% reaction = FluxBound_isSetReaction(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_reaction attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_reaction')
value = ~isempty(SBMLFluxBound.fbc_reaction);
else
error('reaction not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_isSetOperation.m 0000644 0000000 0000000 00000003377 11703262366 031273 0 ustar root root function value = FluxBound_isSetOperation(SBMLFluxBound)
% operation = FluxBound_isSetOperation(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_operation attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_operation')
value = ~isempty(SBMLFluxBound.fbc_operation);
else
error('operation not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_isSetMetaid.m 0000644 0000000 0000000 00000003336 11703262366 030531 0 ustar root root function value = FluxBound_isSetMetaid(SBMLFluxBound)
% metaid = FluxBound_isSetMetaid(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'metaid')
value = ~isempty(SBMLFluxBound.metaid);
else
error('metaid not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_isSetId.m 0000644 0000000 0000000 00000003316 11703262366 027660 0 ustar root root function value = FluxBound_isSetId(SBMLFluxBound)
% id = FluxBound_isSetId(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_id attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_id')
value = ~isempty(SBMLFluxBound.fbc_id);
else
error('id not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_getValue.m 0000644 0000000 0000000 00000003267 11703262366 030075 0 ustar root root function value = FluxBound_getValue(SBMLFluxBound)
% value = FluxBound_getValue(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the value of the fbc_value attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_value')
value = SBMLFluxBound.fbc_value;
else
error('value not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_getSBOTerm.m 0000644 0000000 0000000 00000003275 11703262366 030273 0 ustar root root function sboTerm = FluxBound_getSBOTerm(SBMLFluxBound)
% sboTerm = FluxBound_getSBOTerm(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the value of the sboTerm attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'sboTerm')
sboTerm = SBMLFluxBound.sboTerm;
else
error('sboTerm not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_getReaction.m 0000644 0000000 0000000 00000003322 11703262366 030555 0 ustar root root function reaction = FluxBound_getReaction(SBMLFluxBound)
% reaction = FluxBound_getReaction(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the value of the fbc_reaction attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_reaction')
reaction = SBMLFluxBound.fbc_reaction;
else
error('reaction not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_getOperation.m 0000644 0000000 0000000 00000003333 11703262366 030753 0 ustar root root function operation = FluxBound_getOperation(SBMLFluxBound)
% operation = FluxBound_getOperation(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the value of the fbc_operation attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_operation')
operation = SBMLFluxBound.fbc_operation;
else
error('operation not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_getMetaid.m 0000644 0000000 0000000 00000003264 11703262366 030221 0 ustar root root function metaid = FluxBound_getMetaid(SBMLFluxBound)
% metaid = FluxBound_getMetaid(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the value of the metaid attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'metaid')
metaid = SBMLFluxBound.metaid;
else
error('metaid not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_getId.m 0000644 0000000 0000000 00000003234 11703262366 027347 0 ustar root root function id = FluxBound_getId(SBMLFluxBound)
% id = FluxBound_getId(SBMLFluxBound)
%
% Takes
%
% 1. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the value of the fbc_id attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFluxBound);
if isfield(SBMLFluxBound, 'fbc_id')
id = SBMLFluxBound.fbc_id;
else
error('id not an attribute on SBML L%dV%d FluxBound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/FluxBound_create.m 0000644 0000000 0000000 00000005507 11703262366 027563 0 ustar root root function FluxBound = FluxBound_create(varargin)
% FluxBound = FluxBound_create(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. a MATLAB_SBML FBC FluxBound structure of the appropriate level, version and pkgVersion
%
%
%check the input arguments are appropriate
if (nargin > 3)
error('too many input arguments');
end;
switch (nargin)
case 3
level = varargin{1};
version = varargin{2};
pkgVersion = varargin{3};
case 2
level = varargin{1};
version = varargin{2};
pkgVersion = 1;
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
pkgVersion = 1;
otherwise
level = 3;
version = 1;
pkgVersion = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
[fieldnames, num] = getFluxBoundFieldnames(level, version, pkgVersion);
if (num > 0)
values = getFluxBoundDefaultValues(level, version, pkgVersion);
FluxBound = cell2struct(values, fieldnames, 2);
%add level and version
FluxBound.level = level;
FluxBound.version = version;
FluxBound.fbc_version = pkgVersion;
%check correct structure
if ~isSBML_FBC_FluxBound(FluxBound, level, version, pkgVersion)
FluxBound = struct();
warning('Warn:BadStruct', 'Failed to create FluxBound');
end;
else
FluxBound = [];
warning('Warn:InvalidLV', 'FluxBound not an element in SBML L%dV%d', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FluxBound/Contents.m 0000644 0000000 0000000 00000022116 11703262366 026122 0 ustar root root % toolbox\fbc_package\MATLAB_SBML_Structures\FluxBound
%
% The functions allow users to create and work with the SBML FBC FluxBound structure.
%
%==========================================================
% FluxBound = FluxBound_create(level, version, pkgVersion)
%==========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. a MATLAB_SBML FBC FluxBound structure of the appropriate level, version and pkgVersion
%
%=====================================
% id = FluxBound_getId(SBMLFluxBound)
%=====================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the value of the fbc_id attribute
%
%=============================================
% metaid = FluxBound_getMetaid(SBMLFluxBound)
%=============================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the value of the metaid attribute
%
%===================================================
% operation = FluxBound_getOperation(SBMLFluxBound)
%===================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the value of the fbc_operation attribute
%
%=================================================
% reaction = FluxBound_getReaction(SBMLFluxBound)
%=================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the value of the fbc_reaction attribute
%
%===============================================
% sboTerm = FluxBound_getSBOTerm(SBMLFluxBound)
%===============================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the value of the sboTerm attribute
%
%===========================================
% value = FluxBound_getValue(SBMLFluxBound)
%===========================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the value of the fbc_value attribute
%
%=======================================
% id = FluxBound_isSetId(SBMLFluxBound)
%=======================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. value =
% - 1 if the fbc_id attribute is set
% - 0 otherwise
%
%===============================================
% metaid = FluxBound_isSetMetaid(SBMLFluxBound)
%===============================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. value =
% - 1 if the metaid attribute is set
% - 0 otherwise
%
%=====================================================
% operation = FluxBound_isSetOperation(SBMLFluxBound)
%=====================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. value =
% - 1 if the fbc_operation attribute is set
% - 0 otherwise
%
%===================================================
% reaction = FluxBound_isSetReaction(SBMLFluxBound)
%===================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. value =
% - 1 if the fbc_reaction attribute is set
% - 0 otherwise
%
%=================================================
% sboTerm = FluxBound_isSetSBOTerm(SBMLFluxBound)
%=================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. value =
% - 1 if the sboTerm attribute is set
% - 0 otherwise
%
%=============================================
% value = FluxBound_isSetValue(SBMLFluxBound)
%=============================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. value =
% - 1 if the fbc_value attribute is set
% - 0 otherwise
%
%====================================================
% SBMLFluxBound = FluxBound_setId(SBMLFluxBound, id)
%====================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. id, a string representing the fbc_id to be set
% Returns
% 1. the SBML FBC FluxBound structure with the new value for the fbc_id attribute
%
%============================================================
% SBMLFluxBound = FluxBound_setMetaid(SBMLFluxBound, metaid)
%============================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. metaid, a string representing the metaid to be set
% Returns
% 1. the SBML FBC FluxBound structure with the new value for the metaid attribute
%
%==================================================================
% SBMLFluxBound = FluxBound_setOperation(SBMLFluxBound, operation)
%==================================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. operation, a string representing the fbc_operation to be set
% Returns
% 1. the SBML FBC FluxBound structure with the new value for the fbc_operation attribute
%
%================================================================
% SBMLFluxBound = FluxBound_setReaction(SBMLFluxBound, reaction)
%================================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. reaction, a string representing the fbc_reaction to be set
% Returns
% 1. the SBML FBC FluxBound structure with the new value for the fbc_reaction attribute
%
%==============================================================
% SBMLFluxBound = FluxBound_setSBOTerm(SBMLFluxBound, sboTerm)
%==============================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. sboTerm, a number representing the sboTerm to be set
% Returns
% 1. the SBML FBC FluxBound structure with the new value for the sboTerm attribute
%
%==========================================================
% SBMLFluxBound = FluxBound_setValue(SBMLFluxBound, value)
%==========================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% 2. value, a number representing the fbc_value to be set
% Returns
% 1. the SBML FBC FluxBound structure with the new value for the fbc_value attribute
%
%==================================================
% SBMLFluxBound = FluxBound_unsetId(SBMLFluxBound)
%==================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the SBML FBC FluxBound structure with the fbc_id attribute unset
%
%======================================================
% SBMLFluxBound = FluxBound_unsetMetaid(SBMLFluxBound)
%======================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the SBML FBC FluxBound structure with the metaid attribute unset
%
%=========================================================
% SBMLFluxBound = FluxBound_unsetOperation(SBMLFluxBound)
%=========================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the SBML FBC FluxBound structure with the fbc_operation attribute unset
%
%========================================================
% SBMLFluxBound = FluxBound_unsetReaction(SBMLFluxBound)
%========================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the SBML FBC FluxBound structure with the fbc_reaction attribute unset
%
%=======================================================
% SBMLFluxBound = FluxBound_unsetSBOTerm(SBMLFluxBound)
%=======================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the SBML FBC FluxBound structure with the sboTerm attribute unset
%
%=====================================================
% SBMLFluxBound = FluxBound_unsetValue(SBMLFluxBound)
%=====================================================
% Takes
% 1. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the SBML FBC FluxBound structure with the fbc_value attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/ 0000755 0000000 0000000 00000000000 11704572250 024142 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_unsetChemicalFormula.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_unsetChemicalForm0000644 0000000 0000000 00000003460 11703262366 031471 0 ustar root root function SBMLFBCSpecies = FBCSpecies_unsetChemicalFormula(SBMLFBCSpecies)
% SBMLFBCSpecies = FBCSpecies_unsetChemicalFormula(SBMLFBCSpecies)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
%
% Returns
%
% 1. the SBML FBC FBCSpecies structure with the fbc_chemicalFormula attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'fbc_chemicalFormula')
SBMLFBCSpecies.fbc_chemicalFormula = '';
else
error('chemicalFormula not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_unsetCharge.m 0000644 0000000 0000000 00000003436 11703262366 030567 0 ustar root root function SBMLFBCSpecies = FBCSpecies_unsetCharge(SBMLFBCSpecies)
% SBMLFBCSpecies = FBCSpecies_unsetCharge(SBMLFBCSpecies)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
%
% Returns
%
% 1. the SBML FBC FBCSpecies structure with the fbc_charge attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'fbc_charge')
SBMLFBCSpecies.fbc_charge = 0;
SBMLFBCSpecies.isSetfbc_charge = 0;
else
error('charge not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_setChemicalFormula.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_setChemicalFormul0000644 0000000 0000000 00000004024 11703262366 031464 0 ustar root root function SBMLFBCSpecies = FBCSpecies_setChemicalFormula(SBMLFBCSpecies, chemicalFormula)
% SBMLFBCSpecies = FBCSpecies_setChemicalFormula(SBMLFBCSpecies, chemicalFormula)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% 2. chemicalFormula, a string representing the fbc_chemicalFormula to be set
%
% Returns
%
% 1. the SBML FBC FBCSpecies structure with the new value for the fbc_chemicalFormula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'fbc_chemicalFormula')
if ~ischar(chemicalFormula)
error('chemicalFormula must be character array') ;
else
SBMLFBCSpecies.fbc_chemicalFormula = chemicalFormula;
end;
else
error('chemicalFormula not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_setCharge.m 0000644 0000000 0000000 00000003700 11703262366 030216 0 ustar root root function SBMLFBCSpecies = FBCSpecies_setCharge(SBMLFBCSpecies, charge)
% SBMLFBCSpecies = FBCSpecies_setCharge(SBMLFBCSpecies, charge)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% 2. charge, a number representing the fbc_charge to be set
%
% Returns
%
% 1. the SBML FBC FBCSpecies structure with the new value for the fbc_charge attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'fbc_charge')
if ~isnumeric(charge)
error('charge must be numeric') ;
else
SBMLFBCSpecies.fbc_charge = charge;
SBMLFBCSpecies.isSetfbc_charge = 1;
end;
else
error('charge not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_isSetChemicalFormula.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_isSetChemicalForm0000644 0000000 0000000 00000003463 11703262366 031425 0 ustar root root function value = FBCSpecies_isSetChemicalFormula(SBMLFBCSpecies)
% chemicalFormula = FBCSpecies_isSetChemicalFormula(SBMLFBCSpecies)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_chemicalFormula attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'fbc_chemicalFormula')
value = ~isempty(SBMLFBCSpecies.fbc_chemicalFormula);
else
error('chemicalFormula not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_isSetCharge.m 0000644 0000000 0000000 00000003371 11703262366 030516 0 ustar root root function value = FBCSpecies_isSetCharge(SBMLFBCSpecies)
% charge = FBCSpecies_isSetCharge(SBMLFBCSpecies)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_charge attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'isSetfbc_charge')
value = SBMLFBCSpecies.isSetfbc_charge;
else
error('isSetCharge not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_getChemicalFormula.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_getChemicalFormul0000644 0000000 0000000 00000003433 11703262366 031453 0 ustar root root function chemicalFormula = FBCSpecies_getChemicalFormula(SBMLFBCSpecies)
% chemicalFormula = FBCSpecies_getChemicalFormula(SBMLFBCSpecies)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
%
% Returns
%
% 1. the value of the fbc_chemicalFormula attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'fbc_chemicalFormula')
chemicalFormula = SBMLFBCSpecies.fbc_chemicalFormula;
else
error('chemicalFormula not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_getCharge.m 0000644 0000000 0000000 00000003312 11703262366 030201 0 ustar root root function charge = FBCSpecies_getCharge(SBMLFBCSpecies)
% charge = FBCSpecies_getCharge(SBMLFBCSpecies)
%
% Takes
%
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
%
% Returns
%
% 1. the value of the fbc_charge attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCSpecies);
if isfield(SBMLFBCSpecies, 'fbc_charge')
charge = SBMLFBCSpecies.fbc_charge;
else
error('charge not an attribute on SBML L%dV%d FBCSpecies', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/FBCSpecies_create.m 0000644 0000000 0000000 00000005516 11703262366 027563 0 ustar root root function FBCSpecies = FBCSpecies_create(varargin)
% FBCSpecies = FBCSpecies_create(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. a MATLAB_SBML FBC FBCSpecies structure of the appropriate level, version and pkgVersion
%
%
%check the input arguments are appropriate
if (nargin > 3)
error('too many input arguments');
end;
switch (nargin)
case 3
level = varargin{1};
version = varargin{2};
pkgVersion = varargin{3};
case 2
level = varargin{1};
version = varargin{2};
pkgVersion = 1;
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
pkgVersion = 1;
otherwise
level = 3;
version = 1;
pkgVersion = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
FBCSpecies = Species_create(level, version);
if ~isempty(FBCSpecies)
[fieldnames, num] = getFBCSpeciesFieldnames(level, version, pkgVersion);
if (num > 0)
values = getFBCSpeciesDefaultValues(level, version, pkgVersion);
for i=1:num
FBCSpecies = setfield(FBCSpecies, fieldnames{i}, values{i});
end;
%check correct structure
if ~isSBML_FBC_Species(FBCSpecies, level, version, pkgVersion)
FBCSpecies = struct();
warning('Warn:BadStruct', 'Failed to create FBCSpecies');
end;
else
FBCSpecies = [];
warning('Warn:InvalidLV', 'FBCSpecies not an element in SBML L%dV%d', level, version);
end;
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCSpecies/Contents.m 0000644 0000000 0000000 00000011120 11703262366 026113 0 ustar root root % toolbox\fbc_package\MATLAB_SBML_Structures\FBCSpecies
%
% The functions allow users to create and work with the FBC elements
% and attributes of an SBML FBC Species structure.
%
%============================================================
% FBCSpecies = FBCSpecies_create(level, version, pkgVersion)
%============================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. a MATLAB_SBML FBC FBCSpecies structure of the appropriate level, version and pkgVersion
%
%===============================================
% charge = FBCSpecies_getCharge(SBMLFBCSpecies)
%===============================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% Returns
% 1. the value of the fbc_charge attribute
%
%=================================================================
% chemicalFormula = FBCSpecies_getChemicalFormula(SBMLFBCSpecies)
%=================================================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% Returns
% 1. the value of the fbc_chemicalFormula attribute
%
%=================================================
% charge = FBCSpecies_isSetCharge(SBMLFBCSpecies)
%=================================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% Returns
% 1. value =
% - 1 if the fbc_charge attribute is set
% - 0 otherwise
%
%===================================================================
% chemicalFormula = FBCSpecies_isSetChemicalFormula(SBMLFBCSpecies)
%===================================================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% Returns
% 1. value =
% - 1 if the fbc_chemicalFormula attribute is set
% - 0 otherwise
%
%===============================================================
% SBMLFBCSpecies = FBCSpecies_setCharge(SBMLFBCSpecies, charge)
%===============================================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% 2. charge, a number representing the fbc_charge to be set
% Returns
% 1. the SBML FBC FBCSpecies structure with the new value for the fbc_charge attribute
%
%=================================================================================
% SBMLFBCSpecies = FBCSpecies_setChemicalFormula(SBMLFBCSpecies, chemicalFormula)
%=================================================================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% 2. chemicalFormula, a string representing the fbc_chemicalFormula to be set
% Returns
% 1. the SBML FBC FBCSpecies structure with the new value for the fbc_chemicalFormula attribute
%
%=========================================================
% SBMLFBCSpecies = FBCSpecies_unsetCharge(SBMLFBCSpecies)
%=========================================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% Returns
% 1. the SBML FBC FBCSpecies structure with the fbc_charge attribute unset
%
%==================================================================
% SBMLFBCSpecies = FBCSpecies_unsetChemicalFormula(SBMLFBCSpecies)
%==================================================================
% Takes
% 1. SBMLFBCSpecies, an SBML FBCSpecies structure
% Returns
% 1. the SBML FBC FBCSpecies structure with the fbc_chemicalFormula attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/ 0000755 0000000 0000000 00000000000 11704572250 023607 5 ustar root root ././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_unsetActiveObjective.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_unsetActiveObjective.0000644 0000000 0000000 00000003426 11703262372 031375 0 ustar root root function SBMLFBCModel = FBCModel_unsetActiveObjective(SBMLFBCModel)
% SBMLFBCModel = FBCModel_unsetActiveObjective(SBMLFBCModel)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. the SBML FBC FBCModel structure with the fbc_activeObjective attribute unset
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_activeObjective')
SBMLFBCModel.fbc_activeObjective = '';
else
error('activeObjective not an attribute on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_setActiveObjective.m 0000644 0000000 0000000 00000003772 11703262372 031213 0 ustar root root function SBMLFBCModel = FBCModel_setActiveObjective(SBMLFBCModel, activeObjective)
% SBMLFBCModel = FBCModel_setActiveObjective(SBMLFBCModel, activeObjective)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. activeObjective, a string representing the fbc_activeObjective to be set
%
% Returns
%
% 1. the SBML FBC FBCModel structure with the new value for the fbc_activeObjective attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_activeObjective')
if ~ischar(activeObjective)
error('activeObjective must be character array') ;
else
SBMLFBCModel.fbc_activeObjective = activeObjective;
end;
else
error('activeObjective not an attribute on SBML L%dV%d FBCModel', level, version);
end;
././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_isSetActiveObjective.m SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_isSetActiveObjective.0000644 0000000 0000000 00000003437 11703262372 031330 0 ustar root root function value = FBCModel_isSetActiveObjective(SBMLFBCModel)
% activeObjective = FBCModel_isSetActiveObjective(SBMLFBCModel)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. value =
% - 1 if the fbc_activeObjective attribute is set
% - 0 otherwise
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_activeObjective')
value = ~isempty(SBMLFBCModel.fbc_activeObjective);
else
error('activeObjective not an attribute on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_getObjective.m 0000644 0000000 0000000 00000003760 11703262372 030040 0 ustar root root function objective = FBCModel_getObjective(SBMLFBCModel, index)
% objective = FBCModel_getObjective(SBMLFBCModel, index)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. index, an integer representing the index of SBML Objective structure
%
% Returns
%
% 1. the SBML Objective structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_objective')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLFBCModel.fbc_objective)
objective = SBMLFBCModel.fbc_objective;
else
error('index is out of range');
end;
else
error('objective not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_getNumObjectives.m 0000644 0000000 0000000 00000003344 11703262372 030701 0 ustar root root function num = FBCModel_getNumObjectives(SBMLFBCModel)
% num = FBCModel_getNumObjectives(SBMLFBCModel)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. the number of SBML Objective structures present in the FBCModel
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_objective')
num = length(SBMLFBCModel.fbc_objective);
else
error('objective not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_getNumFluxBounds.m 0000644 0000000 0000000 00000003344 11703262372 030675 0 ustar root root function num = FBCModel_getNumFluxBounds(SBMLFBCModel)
% num = FBCModel_getNumFluxBounds(SBMLFBCModel)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. the number of SBML FluxBound structures present in the FBCModel
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_fluxBound')
num = length(SBMLFBCModel.fbc_fluxBound);
else
error('fluxBound not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_getListOfObjectives.m0000644 0000000 0000000 00000003331 11703262372 031336 0 ustar root root function objective = FBCModel_getListOfObjectives(SBMLFBCModel)
% objective = FBCModel_getListOfObjectives(SBMLFBCModel)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. an array of the objective structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_objective')
objective = SBMLFBCModel.fbc_objective;
else
error('objective not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_getListOfFluxBounds.m0000644 0000000 0000000 00000003331 11703262372 031332 0 ustar root root function fluxBound = FBCModel_getListOfFluxBounds(SBMLFBCModel)
% fluxBound = FBCModel_getListOfFluxBounds(SBMLFBCModel)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. an array of the fluxBound structures
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_fluxBound')
fluxBound = SBMLFBCModel.fbc_fluxBound;
else
error('fluxBound not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_getFluxBound.m 0000644 0000000 0000000 00000003760 11703262372 030034 0 ustar root root function fluxBound = FBCModel_getFluxBound(SBMLFBCModel, index)
% fluxBound = FBCModel_getFluxBound(SBMLFBCModel, index)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. index, an integer representing the index of SBML FluxBound structure
%
% Returns
%
% 1. the SBML FluxBound structure at the indexed position
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_fluxBound')
if (~isIntegralNumber(index) || index <= 0)
error('index must be a positive integer');
elseif index <= length(SBMLFBCModel.fbc_fluxBound)
fluxBound = SBMLFBCModel.fbc_fluxBound;
else
error('index is out of range');
end;
else
error('fluxBound not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_getActiveObjective.m 0000644 0000000 0000000 00000003407 11703262372 031172 0 ustar root root function activeObjective = FBCModel_getActiveObjective(SBMLFBCModel)
% activeObjective = FBCModel_getActiveObjective(SBMLFBCModel)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. the value of the fbc_activeObjective attribute
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
if isfield(SBMLFBCModel, 'fbc_activeObjective')
activeObjective = SBMLFBCModel.fbc_activeObjective;
else
error('activeObjective not an attribute on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_createObjective.m 0000644 0000000 0000000 00000003643 11703262372 030524 0 ustar root root function FBCModel = FBCModel_createObjective(FBCModel)
% SBMLFBCModel = FBCModel_createObjective(SBMLFBCModel)
%
% Takes
%
% 1. FBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. the SBML FBCModel structure with a new SBML Objective structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(FBCModel);
if isfield(FBCModel, 'fbc_objective')
SBMLObjective = Objective_create(level, version, FBCModel.fbc_version);
index = length(FBCModel.fbc_objective);
if index == 0
FBCModel.fbc_objective = SBMLObjective;
else
FBCModel.fbc_objective(index+1) = SBMLObjective;
end;
else
error('objective not an element on SBML L%dV%d Bound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_createFluxBound.m 0000644 0000000 0000000 00000003643 11703262372 030520 0 ustar root root function FBCModel = FBCModel_createFluxBound(FBCModel)
% SBMLFBCModel = FBCModel_createFluxBound(SBMLFBCModel)
%
% Takes
%
% 1. FBCModel, an SBML FBCModel structure
%
% Returns
%
% 1. the SBML FBCModel structure with a new SBML FluxBound structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(FBCModel);
if isfield(FBCModel, 'fbc_fluxBound')
SBMLFluxBound = FluxBound_create(level, version, FBCModel.fbc_version);
index = length(FBCModel.fbc_fluxBound);
if index == 0
FBCModel.fbc_fluxBound = SBMLFluxBound;
else
FBCModel.fbc_fluxBound(index+1) = SBMLFluxBound;
end;
else
error('fluxBound not an element on SBML L%dV%d Bound', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_create.m 0000644 0000000 0000000 00000006307 11703262372 026671 0 ustar root root function FBCModel = FBCModel_create(varargin)
% FBCModel = FBCModel_create(level, version, pkgVersion)
%
% Takes
%
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
%
% Returns
%
% 1. a MATLAB_SBML FBC FBCModel structure of the appropriate level, version and pkgVersion
%
%
%check the input arguments are appropriate
if (nargin > 3)
error('too many input arguments');
end;
switch (nargin)
case 3
level = varargin{1};
version = varargin{2};
pkgVersion = varargin{3};
case 2
level = varargin{1};
version = varargin{2};
pkgVersion = 1;
case 1
level = varargin{1};
if (level == 1)
version = 2;
elseif (level == 2)
version = 4;
else
version = 1;
end;
pkgVersion = 1;
otherwise
level = 3;
version = 1;
pkgVersion = 1;
end;
if ~isValidLevelVersionCombination(level, version)
error('invalid level/version combination');
end;
%get fields and values and create the structure
FBCModel = Model_create(level, version);
if ~isempty(FBCModel)
[fieldnames, num] = getFBCModelFieldnames(level, version, pkgVersion);
if (num > 0)
[values, prefix, ns] = getFBCModelDefaultValues(level, version, pkgVersion);
for i=1:num
FBCModel = setfield(FBCModel, fieldnames{i}, values{i});
end;
%add empty substructures
FBCModel.fbc_fluxBound = FluxBound_create(level, version, pkgVersion);
FBCModel.fbc_fluxBound(1:end) = [];
FBCModel.fbc_objective = Objective_create(level, version, pkgVersion);
FBCModel.fbc_objective(1:end) = [];
if length(prefix) > 0
namespace.prefix = prefix;
namespace.uri = ns;
FBCModel = setfield(FBCModel, 'namespaces', namespace);
end;
%check correct structure
if ~isSBML_FBC_Model(FBCModel, level, version, pkgVersion)
FBCModel = struct();
warning('Warn:BadStruct', 'Failed to create FBCModel');
end;
else
FBCModel = [];
warning('Warn:InvalidLV', 'FBCModel not an element in SBML L%dV%d', level, version);
end;
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_addObjective.m 0000644 0000000 0000000 00000004215 11703262372 030005 0 ustar root root function SBMLFBCModel = FBCModel_addObjective(SBMLFBCModel, SBMLObjective)
% SBMLFBCModel = FBCModel_addObjective(SBMLFBCModel, SBMLObjective)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. SBMLObjective, an SBML Objective structure
%
% Returns
%
% 1. the SBML FBCModel structure with the SBML Objective structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
[objective_level, objective_version] = GetLevelVersion(SBMLObjective);
if level ~= objective_level
error('mismatch in levels');
elseif version ~= objective_version
error('mismatch in versions');
end;
if isfield(SBMLFBCModel, 'fbc_objective')
index = length(SBMLFBCModel.fbc_objective);
if index == 0
SBMLFBCModel.fbc_objective = SBMLObjective;
else
SBMLFBCModel.fbc_objective(index+1) = SBMLObjective;
end;
else
error('objective not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/FBCModel_addFluxBound.m 0000644 0000000 0000000 00000004215 11703262372 030001 0 ustar root root function SBMLFBCModel = FBCModel_addFluxBound(SBMLFBCModel, SBMLFluxBound)
% SBMLFBCModel = FBCModel_addFluxBound(SBMLFBCModel, SBMLFluxBound)
%
% Takes
%
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. SBMLFluxBound, an SBML FluxBound structure
%
% Returns
%
% 1. the SBML FBCModel structure with the SBML FluxBound structure added
%
%
%get level and version and check the input arguments are appropriate
[level, version] = GetLevelVersion(SBMLFBCModel);
[fluxBound_level, fluxBound_version] = GetLevelVersion(SBMLFluxBound);
if level ~= fluxBound_level
error('mismatch in levels');
elseif version ~= fluxBound_version
error('mismatch in versions');
end;
if isfield(SBMLFBCModel, 'fbc_fluxBound')
index = length(SBMLFBCModel.fbc_fluxBound);
if index == 0
SBMLFBCModel.fbc_fluxBound = SBMLFluxBound;
else
SBMLFBCModel.fbc_fluxBound(index+1) = SBMLFluxBound;
end;
else
error('fluxBound not an element on SBML L%dV%d FBCModel', level, version);
end;
SBMLToolbox-4.1.0/toolbox/fbc_package/MATLAB_SBML_Structures/FBCModel/Contents.m 0000644 0000000 0000000 00000014652 11703262372 025572 0 ustar root root % toolbox\fbc_package\MATLAB_SBML_Structures\FBCModel
%
% The functions allow users to create and work with the FBC elements
% and attributes of an SBML FBC Model structure.
%
%===================================================================
% SBMLFBCModel = FBCModel_addFluxBound(SBMLFBCModel, SBMLFluxBound)
%===================================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. SBMLFluxBound, an SBML FluxBound structure
% Returns
% 1. the SBML FBCModel structure with the SBML FluxBound structure added
%
%===================================================================
% SBMLFBCModel = FBCModel_addObjective(SBMLFBCModel, SBMLObjective)
%===================================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. SBMLObjective, an SBML Objective structure
% Returns
% 1. the SBML FBCModel structure with the SBML Objective structure added
%
%========================================================
% FBCModel = FBCModel_create(level, version, pkgVersion)
%========================================================
% Takes
% 1. level, an integer representing an SBML level
% 2. version, an integer representing an SBML version
% 3. pkgVersion, an integer representing an SBML package version
% Returns
% 1. a MATLAB_SBML FBC FBCModel structure of the appropriate level, version and pkgVersion
%
%=======================================================
% SBMLFBCModel = FBCModel_createFluxBound(SBMLFBCModel)
%=======================================================
% Takes
% 1. FBCModel, an SBML FBCModel structure
% Returns
% 1. the SBML FBCModel structure with a new SBML FluxBound structure added
%
%=======================================================
% SBMLFBCModel = FBCModel_createObjective(SBMLFBCModel)
%=======================================================
% Takes
% 1. FBCModel, an SBML FBCModel structure
% Returns
% 1. the SBML FBCModel structure with a new SBML Objective structure added
%
%=============================================================
% activeObjective = FBCModel_getActiveObjective(SBMLFBCModel)
%=============================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% Returns
% 1. the value of the fbc_activeObjective attribute
%
%========================================================
% fluxBound = FBCModel_getFluxBound(SBMLFBCModel, index)
%========================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. index, an integer representing the index of SBML FluxBound structure
% Returns
% 1. the SBML FluxBound structure at the indexed position
%
%========================================================
% fluxBound = FBCModel_getListOfFluxBounds(SBMLFBCModel)
%========================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% Returns
% 1. an array of the fluxBound structures
%
%========================================================
% objective = FBCModel_getListOfObjectives(SBMLFBCModel)
%========================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% Returns
% 1. an array of the objective structures
%
%===============================================
% num = FBCModel_getNumFluxBounds(SBMLFBCModel)
%===============================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% Returns
% 1. the number of SBML FluxBound structures present in the FBCModel
%
%===============================================
% num = FBCModel_getNumObjectives(SBMLFBCModel)
%===============================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% Returns
% 1. the number of SBML Objective structures present in the FBCModel
%
%========================================================
% objective = FBCModel_getObjective(SBMLFBCModel, index)
%========================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. index, an integer representing the index of SBML Objective structure
% Returns
% 1. the SBML Objective structure at the indexed position
%
%===============================================================
% activeObjective = FBCModel_isSetActiveObjective(SBMLFBCModel)
%===============================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% Returns
% 1. value =
% - 1 if the fbc_activeObjective attribute is set
% - 0 otherwise
%
%===========================================================================
% SBMLFBCModel = FBCModel_setActiveObjective(SBMLFBCModel, activeObjective)
%===========================================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% 2. activeObjective, a string representing the fbc_activeObjective to be set
% Returns
% 1. the SBML FBC FBCModel structure with the new value for the fbc_activeObjective attribute
%
%============================================================
% SBMLFBCModel = FBCModel_unsetActiveObjective(SBMLFBCModel)
%============================================================
% Takes
% 1. SBMLFBCModel, an SBML FBCModel structure
% Returns
% 1. the SBML FBC FBCModel structure with the fbc_activeObjective attribute unset
%
%
SBMLToolbox-4.1.0/toolbox/fbc_package/isBindingFbcEnabled.m 0000644 0000000 0000000 00000004331 11703266144 022170 0 ustar root root function fbcEnabled = isBindingFbcEnabled()
% fbcEnabled = isBindingFbcEnabled()
%
% Returns
%
% 1. fbcEnabled =
% - 1 if the executables are enabled with fbc support
% - 0 otherwise
%
%
%
% assume not enabled
fbcEnabled = 0;
if isBindingInstalled() == 0
return;
end;
if (isoctave() == '0')
filename = fullfile(tempdir, 'fbc.xml');
else
filename = fullfile(pwd, 'fbc.xml');
end;
writeTempFile(filename);
try
[m, e] = TranslateSBML(filename, 1, 0);
if (length(e) == 0 && isfield(m, 'fbc_version') == 1 )
fbcEnabled = 1;
end;
delete(filename);
catch
delete(filename);
return
end;
function writeTempFile(filename)
fout = fopen(filename, 'w');
fprintf(fout, '\n');
fprintf(fout, '\n');
fprintf(fout, ' \n\n');
fclose(fout);
SBMLToolbox-4.1.0/toolbox/fbc_package/Contents.m 0000644 0000000 0000000 00000003032 11703263056 020165 0 ustar root root % toolbox\fbc_package
%
% Functions for using the SBML L3V1 fbc package
%
%===========================================================
% fbcEnabled = isBindingFbcEnabled()
%===========================================================
% Returns
% 1. fbcEnabled =
% - 1 if the executables are enabled with fbc support
% - 0 otherwise
%
%
SBMLToolbox-4.1.0/toolbox/Convenience/ 0000755 0000000 0000000 00000000000 11704572220 016240 5 ustar root root SBMLToolbox-4.1.0/toolbox/Convenience/testmember.m 0000644 0000000 0000000 00000003254 11703262406 020572 0 ustar root root function y = testmember (num, array)
% y = testmember(value, array)
%
% Takes
%
% 1. value, any number/string
% 2. array, an array of objects
%
% Returns
%
% 1. y =
% - 1 if value is a member of the array
% - 0 otherwise
%
% *NOTE:* this function is necessary for octave to emulate the MATLAB
% functionality of the 'ismember' function
%
%
y = 0;
[m, n] = size(array);
for i=1:m
for j=1:n
if (num == array(m,n))
y = 1;
return;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/Test/ 0000755 0000000 0000000 00000000000 11704572220 017157 5 ustar root root SBMLToolbox-4.1.0/toolbox/Convenience/Test/test_fbc_conv.m 0000644 0000000 0000000 00000003035 11703262404 022153 0 ustar root root function y = test_fbc_conv()
%
fbcBindingEnabled = 1;
if isBindingFbcEnabled() == 0
fbcBindingEnabled = 0;
end;
if (fbcBindingEnabled == 0)
y = 0;
else
fail = 0;
m = TranslateSBML('../../fbc_package/test/test-data/fbc.xml');
formula = 'S1*2';
fail = fail + TestFunction('Substitute', 2, 1, formula, m, 2);
y = fail;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/Test/test_conv.m 0000644 0000000 0000000 00000006123 11703266772 021356 0 ustar root root function y = test_conv()
%
test = 0;
Totalfail = 0;
if isBindingInstalled() == 1
test = test + 4;
fail = TestisValidUnitKind;
if (fail > 0)
disp('isValidUnitKind failed');
end;
Totalfail = Totalfail + fail;
test = test + 9;
fail = TestSubstituteFunction;
if (fail > 0)
disp('SubstituteFunction failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestSubstitute;
if (fail > 0)
disp('Substitute failed');
end;
Totalfail = Totalfail + fail;
test = test + 4;
fail = TestSubstituteConstants;
if (fail > 0)
disp('Substitute failed');
end;
Totalfail = Totalfail + fail;
test = test + 1;
fail = test_fbc_conv;
if (fail > 0)
disp('test_fbc_conv failed');
end;
Totalfail = Totalfail + fail;
else
disp('LibSBML binding not installed - some tests could not be run');
end;
test = test + 22;
fail = TestRearrange;
if (fail > 0)
disp('Rearrange failed');
end;
Totalfail = Totalfail + fail;
test = test + 12;
fail = TestMatchName;
if (fail > 0)
disp('matchName failed');
end;
Totalfail = Totalfail + fail;
test = test + 12;
fail = TestMatchFunctionName;
if (fail > 0)
disp('matchFunctionName failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestisIntegralNumber;
if (fail > 0)
disp('isIntegralNumber failed');
end;
Totalfail = Totalfail + fail;
test = test + 1;
fail = TestLoseWhiteSpace;
if (fail > 0)
disp('LoseWhiteSpace failed');
end;
Totalfail = Totalfail + fail;
test = test + 1;
fail = TestPairBrackets;
if (fail > 0)
disp('PairBrackets failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestRemoveDuplicates;
if (fail > 0)
disp('RemoveDuplicates failed');
end;
Totalfail = Totalfail + fail;
disp(sprintf('Number tests: %d', test));
disp(sprintf('Number fails: %d', Totalfail));
disp(sprintf('Pass rate: %d%%', ((test-Totalfail)/test)*100));
y = Totalfail;
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestSubstituteFunction.m 0000644 0000000 0000000 00000004604 11703262404 024061 0 ustar root root function fail = TestSubstituteFunction
%
m = TranslateSBML('../../Test/test-data/species.xml');
fd = m.functionDefinition;
formula = 'f(a, b)';
result = '(a*b)';
fail = TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 'f(x, d)';
result = '(x*d)';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 'f(d, y)';
result = '(d*y)';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 'f(y, z)';
result = '(y*z)';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 'f1(a, b)';
result = '';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 's+f(a, b)';
result = 's+(a*b)';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 'f(a, f1(b))';
result = '(a*f1(b))';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 'f1(a, f(b, c))';
result = 'f1(a,(b*c))';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
formula = 'f(x, f(a,d))';
result = '(x*(a*d))';
fail = fail + TestFunction('SubstituteFunction', 2, 1, formula, fd, result);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestSubstituteConstants.m 0000644 0000000 0000000 00000003530 11703262404 024245 0 ustar root root function fail = TestSubstituteConstants
%
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
formula = 'S1*2';
output = 'S1*2';
fail = TestFunction('SubstituteConstants', 2, 1, formula, m, output);
formula = 'k * S1';
output = '6 * S1';
fail = fail + TestFunction('SubstituteConstants', 2, 1, formula, m, output);
formula = 'compartment * S1';
output = '3 * S1';
fail = fail + TestFunction('SubstituteConstants', 2, 1, formula, m, output);
m = TranslateSBML('../../Test/test-data/l1v1.xml');
formula = '(x0 + vm) * (km*2)';
output = '(x0 + 2) * (2*2)';
fail = fail + TestFunction('SubstituteConstants', 2, 1, formula, m, output);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestSubstitute.m 0000644 0000000 0000000 00000003022 11703262404 022344 0 ustar root root function fail = TestSubstitute
%
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
formula = 'S1*2';
fail = TestFunction('Substitute', 2, 1, formula, m, 6);
m = TranslateSBML('../../Test/test-data/l1v1.xml');
formula = '(x0 + vm) * (km*2)';
fail = fail + TestFunction('Substitute', 2, 1, formula, m, 12);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestRemoveDuplicates.m 0000644 0000000 0000000 00000002726 11703262404 023456 0 ustar root root function fail = TestRemoveDuplicates
%
input1 = [1, 3, 4, 3, 1, 5];
output1 = [1, 3, 4, 5];
input2 = 'adasfeds';
output2 = 'adsfe';
fail = TestFunction('RemoveDuplicates', 1, 1, input1, output1);
fail = fail + TestFunction('RemoveDuplicates', 1, 1, input2, output2);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestRearrange.m 0000644 0000000 0000000 00000007650 11703262404 022112 0 ustar root root function fail = TestRearrange
%
formula = 'a+b';
var = 'c';
output = 'a+b';
fail = TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'a+b';
var = 'b';
output = '-a';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'a+b-c';
var = 'b';
output = '-a+c';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'b/a';
var = 'b';
output = '0';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = '3b/a';
var = 'b';
output = '0';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'a/b';
var = 'b';
output = '';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'b + c/a';
var = 'b';
output = '-c/a';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + a/b';
var = 'b';
output = '(a/1)*(1/(-c))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + a/b';
var = 'a';
output = '-c*(b/1)';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + 3*a/b';
var = 'a';
output = '-c*(b/3)';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + a/4*b';
var = 'a';
output = '-c*(4/(1*b))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + 2*a/5*b';
var = 'a';
output = '-c*(5/(2*b))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + 3*a/b';
var = 'b';
output = '((3*a)/1)*(1/(-c))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + a/4*b';
var = 'b';
output = '-c*(4/a)';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c + 2*a/5*b';
var = 'b';
output = '-c*(5/(2*a))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'a+b-c+2*c';
var = 'c';
output = '(-a-b)/(-1+2)';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'a+ 2/c +d';
var = 'c';
output = '(1/0.5)*(1/(-a-d))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = '(a+b) -c';
var = 'c';
output = '-(-(a+b))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c/(a+b) + d';
var = 'c';
output = '-d*((a+b)/1)';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = '(a+b)/c + d';
var = 'c';
output = '((a+b)/1)*(1/(-d))';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c/a + c/d -e';
var = 'c';
output = '(+e)/(1/a+1/d)';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
formula = 'c/a + c/d';
var = 'c';
output = '0';
fail = fail + TestFunction('Rearrange', 2, 1, formula, var, output);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestPairBrackets.m 0000644 0000000 0000000 00000002553 11703262404 022553 0 ustar root root function fail = TestPairBrackets
%
input = '(a+((b*c)/(a+b)))';
output = [1, 17; 4, 16; 5, 9; 11, 15];
fail = TestFunction('PairBrackets', 1, 1, input, output);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestMatchName.m 0000644 0000000 0000000 00000005117 11703262404 022035 0 ustar root root function fail = TestMatchName
%
formula = 'a+b+c';
var = 'c';
output = 5;
fail = TestFunction('matchName', 2, 1, formula, var, output);
formula = 'a+b+c';
var = 'b';
output = 3;
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'a+b-c';
var = 'a';
output = 1;
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'a+b-(b*c)';
var = 'b';
output = [3, 6];
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'b2/a';
var = 'b';
output = [];
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'a/b2';
var = 'b';
output = [];
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'b + c1/a';
var = 'c1';
output = 5;
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'b1/a + a/b';
var = 'b';
output = 10;
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'c + a/b';
var = 'a1';
output = [];
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'c + 3*a2/b';
var = 'a1';
output = [];
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'a(4*b)';
var = 'a';
output = [];
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
formula = 'a(4*b)';
var = 'b';
output = 5;
fail = fail + TestFunction('matchName', 2, 1, formula, var, output);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestMatchFunctionName.m 0000644 0000000 0000000 00000005361 11703262404 023544 0 ustar root root function fail = TestMatchFunctionName
%
formula = 'a+b+c';
var = 'c';
output = [];
fail = TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'a+f(b,c)';
var = 'b';
output = [];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'a+f(b,c)';
var = 'f';
output = 3;
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'a+b(2,3)';
var = 'b';
output = 3;
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'b(a)/b(c)';
var = 'b';
output = [1, 6];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'a/b2(f)';
var = 'b';
output = [];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'b2(hhh) + c1/a';
var = 'b2';
output = 1;
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'b(b(a,3),b(1,2))';
var = 'b';
output = [1, 3, 10];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'b(b(a,3),b1(1,2))';
var = 'b';
output = [1, 3];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'b(b(a,3),b1(1,2))';
var = 'b1';
output = [10];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'a(4*b)';
var = 'a';
output = [1];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
formula = 'a(4*b)';
var = 'b';
output = [];
fail = fail + TestFunction('matchFunctionName', 2, 1, formula, var, output);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestLoseWhiteSpace.m 0000644 0000000 0000000 00000002532 11703262404 023055 0 ustar root root function fail = TestLoseWhiteSpace
%
input = ' exa mp le ';
output = 'example';
fail = TestFunction('LoseWhiteSpace', 1, 1, input, output);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestisValidUnitKind.m 0000644 0000000 0000000 00000003267 11703262404 023245 0 ustar root root function fail = TestisValidUnitKind
%
m = TranslateSBML('../../Test/test-data/l1v1.xml');
kind1 = m.unitDefinition(1).unit.kind;
kind2 = m.unitDefinition(2).unit(2).kind;
kind3 = m.unitDefinition(2).unit(3).kind;
kind4 = m.unitDefinition(3).name;
fail = TestFunction('isValidUnitKind', 1, 1, kind1, 1);
fail = fail + TestFunction('isValidUnitKind', 1, 1, kind2, 1);
fail = fail + TestFunction('isValidUnitKind', 1, 1, kind3, 1);
fail = fail + TestFunction('isValidUnitKind', 1, 1, kind4, 0);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestisIntegralNumber.m 0000644 0000000 0000000 00000002562 11703262404 023453 0 ustar root root function fail = TestisIntegralNumber
%
a = 2;
b = 3.5;
fail = TestFunction('isIntegralNumber', 1, 1, a, 1);
fail = fail + TestFunction('isIntegralNumber', 1, 1, b, 0);
SBMLToolbox-4.1.0/toolbox/Convenience/Test/TestCheckValidUnitKind.m 0000644 0000000 0000000 00000003304 11703262404 023637 0 ustar root root function fail = TestCheckValidUnitKind
%
m = TranslateSBML('../../Test/test-data/l1v1.xml');
kind1 = m.unitDefinition(1).unit.kind;
kind2 = m.unitDefinition(2).unit(2).kind;
kind3 = m.unitDefinition(2).unit(3).kind;
kind4 = m.unitDefinition(3).id;
fail = TestFunction('CheckValidUnitKind', 1, 1, kind1, 1);
fail = fail + TestFunction('CheckValidUnitKind', 1, 1, kind2, 1);
fail = fail + TestFunction('CheckValidUnitKind', 1, 1, kind3, 1);
fail = fail + TestFunction('CheckValidUnitKind', 1, 1, kind4, 0);
SBMLToolbox-4.1.0/toolbox/Convenience/SubstituteFunction.m 0000644 0000000 0000000 00000012043 11703262406 022300 0 ustar root root function Formula = SubstituteFunction(OriginalFormula, SBMLFunctionDefinition)
% newExpression = SubstituteFunction(expression, SBMLFunctionDefinition)
%
% Takes
%
% 1. expression, a string representation of a math expression
% 2. SBMLFunctionDefinition, an SBML FunctionDefinition structure
%
% Returns
%
% 1. newExpression
% - the string representation of the expression when any instances of the
% functionDefinition have been substituted
% - an empty string if the functiondefinition is not in the original
% expression
%
% *EXAMPLE:*
%
% Consider fD to be an SBMLFunctionDefinition
% with id = 'g' and math = 'lambda(x,x+0.5)'
%
% formula = SubstituteFormula('g(y)', fD)
%
% formula = 'y+0.5'
%
%
% formula = SubstituteFormula('h(y)', fD)
%
% formula = ''
%
%
%check arguments are appropriate
if (~isstruct(SBMLFunctionDefinition))
error(sprintf('%s', ...
'first argument must be an SBML functionDefinition structure'));
end;
[sbmlLevel, sbmlVersion] = GetLevelVersion(SBMLFunctionDefinition);
if (~ischar(OriginalFormula))
error('SubstituteFunction(OriginalFormula, SBMLFunctionDefinition)\n%s', 'first argument must be a character array containing the id of the function definition');
elseif (~isSBML_FunctionDefinition(SBMLFunctionDefinition, sbmlLevel, sbmlVersion))
error('SubstituteFunction(OriginalFormula, SBMLFunctionDefinition)\n%s', 'second argument must be an SBML function definition structure');
end;
OriginalFormula = LoseWhiteSpace(OriginalFormula);
startPoint = matchFunctionName(OriginalFormula, SBMLFunctionDefinition.id);
if (isempty(startPoint))
Formula = '';
return;
end;
ElementsOfFuncDef = GetArgumentsFromLambdaFunction(SBMLFunctionDefinition.math);
% get the arguments of the application of the formula
Formula = '';
index = length(startPoint);
StartFunctionInFormula = startPoint(index);
j = StartFunctionInFormula + length(SBMLFunctionDefinition.id);
pairs = PairBrackets(OriginalFormula);
for i=1:length(pairs)
if (pairs(i, 1) == j)
endPt = pairs(i, 2);
break;
end;
end;
[NoElements, ElementsInFormula] = GetElementsOfFunction(OriginalFormula(j:endPt));
OriginalFunction = '';
for i = StartFunctionInFormula:endPt
OriginalFunction = strcat(OriginalFunction, OriginalFormula(i));
end;
% check got right number
if (NoElements ~= length(ElementsOfFuncDef) - 1)
error('SubstituteFunction(OriginalFormula, SBMLFunctionDefinition)\n%s', 'mismatch in number of arguments between formula and function');
end;
% check that same arguments have not been used
for i = 1:NoElements
for j = 1:NoElements
if (strcmp(ElementsInFormula{i}, ElementsOfFuncDef{j}))
newElem = strcat(ElementsInFormula{i}, '_new');
ElementsOfFuncDef{j} = newElem;
ElementsOfFuncDef{end} = strrep(ElementsOfFuncDef{end}, ElementsInFormula{i}, newElem);
end;
end;
end;
% replace the arguments in function definition with those in the formula
FuncFormula = '(';
FuncFormula = strcat(FuncFormula, ElementsOfFuncDef{end});
FuncFormula = strcat(FuncFormula, ')');
for i = 1:NoElements
FuncFormula = strrep(FuncFormula, ElementsOfFuncDef{i}, ElementsInFormula{i});
end;
Formula = strrep(OriginalFormula, OriginalFunction, FuncFormula);
% if the function occurred more than once
if (index - 1) > 0
Formula = SubstituteFunction(Formula, SBMLFunctionDefinition);
end;
function [NoElements, ElementsInFormula] = GetElementsOfFunction(OriginalFormula);
j = 2;
c = OriginalFormula(j);
element = '';
NoElements = 1;
ElementsInFormula = {};
while (j < length(OriginalFormula))
if (strcmp(c, ','))
ElementsInFormula{NoElements} = element;
element = '';
NoElements = NoElements + 1;
else
element = strcat(element, c);
end;
j = j + 1;
c = OriginalFormula(j);
end;
ElementsInFormula{NoElements} = element;
SBMLToolbox-4.1.0/toolbox/Convenience/SubstituteConstants.m 0000644 0000000 0000000 00000006677 11703262406 022507 0 ustar root root function subsFormula = SubstituteConstants(OriginalFormula, SBMLModel)
% newExpression = SubstituteConstants(expression, SBMLModel)
%
% Takes
%
% 1. expression, a string representation of a math expression
% 2. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the string representation of the expression when all constants within the
% model have been substituted
%
% *EXAMPLE:*
%
% Consider m to be an SBMLModel containing a parameter
% with id = 'g', constant = '1' and value = 3'
%
% newExpression = SubstituteConstants('2 * g * S1', SBMLModel)
%
% newExpression = '2 * 3 * S1'
%
%
%check arguments are appropriate
if (~ischar(OriginalFormula))
error('SubstituteConstants(OriginalFormula, SBMLModel)\n%s', 'first argument must be a character array representing a formula');
elseif (~isValidSBML_Model(SBMLModel))
error('SubstituteConstants(OriginalFormula, SBMLModel)\n%s', 'second argument must be an SBML model structure');
end;
subsFormula = OriginalFormula;
[Comp, comp_values] = GetCompartments(SBMLModel);
for i=1:length(SBMLModel.compartment)
if (SBMLModel.SBML_level == 1)
if (~isnan(comp_values(i)))
subsFormula = strrep(subsFormula, SBMLModel.compartment(i).name, sprintf('%g', comp_values(i)));
end;
elseif (SBMLModel.compartment(i).constant == 1)
if (~isnan(comp_values(i)))
subsFormula = strrep(subsFormula, SBMLModel.compartment(i).id, sprintf('%g', comp_values(i)));
end;
end;
end;
[Param, param_values] = GetGlobalParameters(SBMLModel);
for i=1:length(SBMLModel.parameter)
if (SBMLModel.SBML_level == 1)
if (~isnan(param_values(i)))
subsFormula = strrep(subsFormula, SBMLModel.parameter(i).name, sprintf('%g', param_values(i)));
end;
elseif (SBMLModel.parameter(i).constant == 1)
if (~isnan(param_values(i)))
subsFormula = strrep(subsFormula, SBMLModel.parameter(i).id, sprintf('%g', param_values(i)));
end;
end;
end;
[Species, species_values] = GetSpecies(SBMLModel);
for i=1:length(SBMLModel.species)
if (SBMLModel.SBML_level > 1 && SBMLModel.species(i).constant == 1)
if (~isnan(species_values(i)))
subsFormula = strrep(subsFormula, SBMLModel.species(i).id, sprintf('%g', species_values(i)));
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/Substitute.m 0000644 0000000 0000000 00000011713 11703262406 020575 0 ustar root root function value = Substitute(original_formula, model)
% value = Substitute(expression, SBMLModel)
%
% Takes
%
% 1. expression, a string representation of a math expression
% 2. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the value of the expression when all variables within the model have
% been substituted
%
% *EXAMPLE:*
%
% Consider m to be an SBMLModel containing a species with
% id = 'g' and initialConcentration = '3'
%
% value = Substitute('g*2', m)
%
% value = 6
%
%
% This function was radically improved by Pieter Pareit
if (model.SBML_level > 1 && ~isempty(model.time_symbol))
assert(exist(model.time_symbol,'var')==false);
assignin('caller',model.time_symbol,0);
end
% handle easy case where formula can be calculated without variables
value = str2double(original_formula);
if ~isnan(value)
return;
else
try
value = evalin('caller', original_formula);
if ~isnan(value)
return;
end;
catch
end;
end
% put everything in MATLAB and evaluate the formule
[Species, speciesValues] = GetSpecies(model);
[Parameters, paramValues] = GetAllParametersUnique(model);
[Compartments, compValues] = GetCompartments(model);
% if (model.SBML_level > 1 && ~isempty(model.time_symbol))
% assert(exist(model.time_symbol,'var')==false);
% assignin('caller',model.time_symbol,0);
% end
for i = 1:length(Species)
assert(exist(Species{i},'var')==false);
assignin('caller',Species{i}, speciesValues(i));
end;
for i = 1:length(Parameters)
assert(exist(Parameters{i},'var')==false);
assignin('caller',Parameters{i}, paramValues(i));
end;
for i = 1:length(Compartments)
assert(exist(Compartments{i},'var')==false);
assignin('caller',Compartments{i}, compValues(i));
end;
% this replaces all rules in the original formula
formula = original_formula;
rule_applied = 1;
iterations_left = Model_getNumAssignmentRules(model) + 1;
while rule_applied > 0 && iterations_left > 0
rule_applied = 0;
for rule = model.rule
if (strcmp(rule.typecode, 'SBML_ASSIGNMENT_RULE') ...
|| (isfield(rule, 'type') && strcmp(rule.type, 'scalar')))
str = formula;
exp = strcat('\<',rule.variable,'\>');
repstr = rule.formula;
formula = regexprep(str,exp,repstr);
for fd = 1:Model_getNumFunctionDefinitions(model)
newFormula = SubstituteFunction(formula, Model_getFunctionDefinition(model, fd));
if ~isempty(newFormula)
formula = newFormula;
end;
end;
rule_applied = rule_applied + strcmp(str, formula)==false;
end;
end
iterations_left = iterations_left - 1;
end
assert(rule_applied == 0, ...
'Substitute(): Cyclic dependency of rules dedected');
if model.SBML_level > 2 || (model.SBML_level == 2 && model.SBML_version > 1)
ia_applied = 1;
iterations_left = Model_getNumInitialAssignments(model) + 1;
while ia_applied > 0 && iterations_left > 0
ia_applied = 0;
for rule = model.initialAssignment
str = formula;
exp = strcat('\<',rule.symbol,'\>');
repstr = rule.math;
formula = regexprep(str,exp,repstr);
for fd = 1:Model_getNumFunctionDefinitions(model)
newFormula = SubstituteFunction(formula, Model_getFunctionDefinition(model, fd));
if ~isempty(newFormula)
formula = newFormula;
end;
end;
ia_applied = ia_applied + strcmp(str, formula)==false;
end
iterations_left = iterations_left - 1;
end
assert(ia_applied == 0, ...
'Substitute(): Cyclic dependency of rules dedected');
end;
try
value = evalin('caller',formula);
catch
error('Substitute(): Ill formed formula');
end
end
SBMLToolbox-4.1.0/toolbox/Convenience/RemoveDuplicates.m 0000644 0000000 0000000 00000005522 11703262406 021676 0 ustar root root function y = RemoveDuplicates(FullArray)
% newArray = RemoveDuplicates(array)
%
% Takes
%
% 1. array, any array
%
% Returns
%
% 1. the array with any duplicate entries removed
%
% *EXAMPLE:*
%
% newArray = RemoveDuplicates([2, 3, 4, 3, 2, 5])
% newArray = [2, 3, 4, 5]
%
%
% check whether array is a column vector
[size_x, size_y] = size(FullArray);
if (size_y == 1 && size_x ~= 1)
y = RemoveDuplicatesColumn(FullArray);
return;
end;
%-------------------------------------------------------------
% find number of elements in existing array
NoElements = length(FullArray);
if (NoElements == 0)
y = [];
return;
end;
% copy first element of the array to the new array
newArrayIndex = 1;
NewArray(1) = FullArray(1);
%loop through all elements
% if they do not already exist in new array copy them into it
for i = 2:NoElements
element = FullArray(i);
if (~ismember(element, NewArray))
newArrayIndex = newArrayIndex + 1;
NewArray(newArrayIndex) = element;
end;
end;
y = NewArray;
function y = RemoveDuplicatesColumn(FullArray)
% RemoveDuplicatesCell takes column vector
% and returns it with any duplicates removed
% find number of elements in existing array
[NoElements, x] = size(FullArray);
% copy first element of the array to the new array
newArrayIndex = 1;
NewArray(1,x) = FullArray(1);
%loop through all elements
% if they already exist in new array do not copy
for i = 2:NoElements
element = FullArray(i);
if (~ismember(element, NewArray))
newArrayIndex = newArrayIndex + 1;
NewArray(newArrayIndex,x) = element;
end;
end;
y = NewArray;
SBMLToolbox-4.1.0/toolbox/Convenience/Rearrange.m 0000644 0000000 0000000 00000026327 11703262406 020337 0 ustar root root function output = Rearrange(formula, x)
% output = Rearrange(expression, name)
%
% Takes
%
% 1. expression, a string representation of a math expression
% 2. name, a string representing the name of a variable
%
% Returns
%
% 1. the expression rearranged in terms of the variable
%
% *EXAMPLE:*
%
% output = Rearrange('X + Y - Z', 'X')
%
% output = '-Y+Z'
%
%
f = LoseWhiteSpace(formula);
if (~isempty(strfind(f, '+-')))
f = strrep(f, '+-', '-');
end;
if (~isempty(strfind(f, '-+')))
f = strrep(f, '-+', '-');
end;
% if x is not in the formula just return the formula
if (~ismember(f, x))
output = f;
return;
end;
% if there are brackets these need to switch sides of the equation
% "intact" ie x+(y+z) rearranges to x = -(y+z)
brackets = PairBrackets(f);
num = 0;
if (length(brackets)>1)
[num, m] = size(brackets);
for b=1:num
group{b} = f(brackets(1): brackets(2));
if (sum(ismember(group{b}, x)) > 0)
error('Cannot deal with formula in this form: %s', f);
end;
newvar{b} = strcat('var', num2str(b));
f = strrep(f, group{b}, newvar{b});
end;
end;
ops = '+-';
operators = ismember(f, ops);
OpIndex = find(operators == 1);
if(~isempty(OpIndex))
%--------------------------------------------------
% divide formula up into elements seperated by +/-
if (OpIndex(1) == 1)
% leading sign i.e. +x-y
NumElements = length(OpIndex);
j = 2;
index = 2;
else
NumElements = length(OpIndex) + 1;
j = 1;
index = 1;
end;
for i = 1:NumElements-1
element = '';
while (j < OpIndex(index))
element = strcat(element, f(j));
j = j+1;
end;
Elements{i} = element;
j = j + 1;
index = index + 1;
end;
% get last element
j = OpIndex(end)+1;
element = '';
while (j <= length(f))
element = strcat(element, f(j));
j = j+1;
end;
Elements{NumElements} = element;
else
NumElements = 0;
LHSElements{1} = f;
LHSOps(1) = '+';
end;
%--------------------------------------------------
% check whether element contains x
% if does keep on lhs else move to rhs changing sign
output = '';
lhs = 1;
for i = 1:NumElements
if (matchName(Elements{i}, x))
% element contains x
LHSElements{lhs} = Elements{i};
if (OpIndex(1) == 1)
LHSOps(lhs) = f(OpIndex(i));
elseif (i == 1)
LHSOps(lhs) = '+';
else
LHSOps(lhs) = f(OpIndex(i-1));
end;
lhs = lhs + 1;
elseif (i == 1)
% first element does not contain x
if (OpIndex(1) == 1)
if (strcmp(f(1), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
else
% no sign so +
output = strcat(output, '-');
end;
output = strcat(output, Elements{i});
else
% element not first and does not contain x
if (OpIndex(1) == 1)
if (strcmp(f(OpIndex(i)), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
else
if (strcmp(f(OpIndex(i-1)), '-'))
output = strcat(output, '+');
else
output = strcat(output, '-');
end;
end;
output = strcat(output, Elements{i});
end;
end;
%------------------------------------------------------
% look at remaining LHS
for i = 1:length(LHSElements)
[Mult{i}, invert(i)] = ParseElement(LHSElements{i}, x);
end;
operators = '+-/*^';
if (length(LHSElements) == 1)
% only one element with x
% check signs and multipliers
if (strcmp(LHSOps(1), '-'))
output = strcat('-(', output, ')');
end;
if (~strcmp(Mult{1}, '1'))
if (isempty(output))
if (invert(1) == 0)
output = '0';
end;
else
if (sum(ismember(Mult{1}, '/')) > 0)
if (invert(1) == 0)
output = strcat(output, '*(', Invert(Mult{1}, x), ')');
else
output = strcat('(', Mult{1}, ')*(', Invert(output, x), ')');
end;
else
output = strcat(output, '/', Mult{1});
end;
end;
end;
else
if (isempty(output))
if (invert == 0)
output = '0';
end;
else
divisor = '';
if (strcmp(LHSOps(1), '+'))
divisor = strcat(divisor, '(', Mult{1});
else
divisor = strcat(divisor, '(-', Mult{1});
end;
for i = 2:length(LHSElements)
divisor = strcat(divisor, LHSOps(i), Mult{i});
end;
divisor = strcat(divisor, ')');
if (sum(ismember(output, operators)) > 0)
output = strcat('(', output, ')/', divisor);
else
output = strcat(output, '/', divisor);
end;
end;
end;
% replaced substituted vars
for b=1:num
output = strrep(output, newvar{b}, group{b});
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [multiplier, invert] = ParseElement(element, x)
if (strcmp(element, x))
multiplier = '1';
invert = 0;
return;
end;
multipliers = strfind(element, '*');
if (length(multipliers) > 2)
error('Too many multipliers');
end;
VarIndex = matchName(element, x);
if (isempty(multipliers))
MultIndex = 1;
else
if (length(multipliers) == 1)
MultIndex = multipliers(1);
else
if (VarIndex > multipliers(2))
MultIndex = multipliers(2);
else
MultIndex = multipliers(1);
end;
end;
end;
DivIndex = strfind(element, '/');
if (isempty(DivIndex))
DivIndex = length(element);
end;
% if we have x/5*b
if (DivIndex < MultIndex)
MultIndex = 1;
end;
% if we have b/x
if (VarIndex > DivIndex)
[element, noinvert] = Invert(element, x);
multiplier = ParseElement(element, x);
if (noinvert == 0)
multiplier = Invert(multiplier, x);
invert = 1;
else
invert = 0;
end;
return;
end;
% if we have x*c
if (VarIndex < MultIndex)
element = SwapMultiplier(element, x);
[multiplier, invert] = ParseElement(element, x);
return;
end;
if ((DivIndex < MultIndex) ||(VarIndex < MultIndex) || (VarIndex > DivIndex))
error('Cannot deal with formula in this form: %s', element);
end;
n = '';
m = '';
for i = 1:MultIndex-1
if (element(i) ~= '(' && element(i) ~= ')')
n = strcat(n, element(i));
end;
end;
if (isempty(n))
n = '1';
end;
for i = DivIndex+1:length(element)
m = strcat(m, element(i));
end;
if (isempty(m))
m = '1';
end;
% if both m and n represenet numbers then they can be simplified
Num_n = str2num(n);
Num_m = str2num(m);
if (~isempty(Num_n) && ~isempty(Num_m))
multiplier = num2str(Num_n/Num_m);
else
if (strcmp(m, '1'))
multiplier = n;
else
multiplier = strcat(n, '/', m);
end;
end;
invert = 0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [y, noinvert] = Invert(formula, x)
% need to consider a/x*b
% which is really (b*a)/x
operators = '+-/*^';
noinvert = 0;
divider = strfind(formula, '/');
if (length(divider) > 1)
error('Too many divide signs');
end;
if (isempty(divider))
nominator = formula;
denominator = '1';
else
nominator = formula(1:divider-1);
denominator = formula(divider+1:end);
end;
if (~IsSingleBracketed(denominator))
multiplier = strfind(denominator, '*');
if (length(multiplier) > 1)
error('Too may multiplication signs');
end;
if (~isempty(multiplier))
lhs = denominator(1:multiplier-1);
rhs = denominator(multiplier+1:end);
if (sum(ismember(nominator, operators)) > 0)
if (IsSingleBracketed(nominator))
nominator = strcat(nominator, '*', rhs);
else
nominator = strcat('(', nominator, ')*', rhs);
end;
else
nominator = strcat(nominator, '*', rhs);
end;
denominator = lhs;
end;
end;
% if x is now part of the nominator dont invert
if (matchName(nominator, x))
if (sum(ismember(nominator, operators)) > 0)
if (IsSingleBracketed(nominator))
y = strcat(nominator, '/');
else
y = strcat ('(', nominator, ')/');
end;
else
y = strcat(nominator, '/');
end;
if (sum(ismember(denominator, operators)) > 0)
if (IsSingleBracketed(denominator))
y = strcat(y, denominator);
else
y = strcat(y, '(', denominator, ')');
end;
else
y = strcat(y, denominator);
end;
noinvert = 1;
else
if (sum(ismember(denominator, operators)) > 0)
if (IsSingleBracketed(denominator))
y = strcat(denominator, '/');
else
y = strcat ('(', denominator, ')/');
end;
else
y = strcat(denominator, '/');
end;
if (sum(ismember(nominator, operators)) > 0)
if (IsSingleBracketed(nominator))
y = strcat(y, nominator);
else
y = strcat(y, '(', nominator, ')');
end;
else
y = strcat(y, nominator);
end;
end;
%y = strcat('(', denominator, ')/(', nominator, ')');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function y = IsSingleBracketed(formula)
y = 0;
Open = strfind(formula, '(');
if (isempty(Open) || length(Open)> 1)
return;
end;
if (Open ~= 1)
return;
end;
len = length(formula);
Close = strfind(formula, ')');
if (length(Close)> 1)
return;
end;
if (Close ~= len)
return;
end;
y = 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function y = SwapMultiplier(formula, x)
% formula will have only * and /
% x will occur before both
% * will occur before /
index = matchName(formula, x);
start = index(1);
index = strfind(formula, '*');
multiplier = index(1);
nextop = 0;
if (length(index) > 1)
nextop = index(2);
end;
index = strfind(formula, '/');
if (length(index) > 0)
end_after = index(1)-1;
else
if (nextop > 0)
end_after = nextop-1;
else
end_after = length(formula);
end;
end;
replace = '';
for i = multiplier+1:end_after
replace = strcat(replace, formula(i));
end;
newformula = replace;
newformula = strcat(newformula, '*');
newformula = strcat(newformula, x);
for i = end_after+1:length(formula)
newformula = strcat(newformula, formula(i));
end;
y = newformula;
SBMLToolbox-4.1.0/toolbox/Convenience/piecewise.m 0000644 0000000 0000000 00000003617 11703262406 020403 0 ustar root root function value = piecewise(val1, test, val2)
% value = piecewise(value1, test, value2)
%
% Takes
%
% 1. value1, the value to return if the test is true
% 2. test, a boolean test that will return true or false
% 3. value2, the value to return if the test is false
%
% Returns
%
% 1. value =
% - value1, if test returns true
% - value2, if test returns false
%
% *EXAMPLE:*
%
% value = piecewise(3, 1<2, 4)
% value = 3
%
% value = piecewise(3, 1>2, 4)
% value = 4
%
% *NOTE:* This function provides the functionality of the MathML 'piecewise' function.
%
%
if test == 1
value = val1;
else
value = val2;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/PairBrackets.m 0000644 0000000 0000000 00000005624 11703262406 021000 0 ustar root root function pairs = PairBrackets(formula)
% pairs = PairBrackets(expression)
%
% Takes
%
% 1. expression, a string representation of a math expression
%
% Returns
%
% 1. an array of the indices of each pair of brackets ordered from
% the opening bracket index
%
% *EXAMPLE:*
%
% pairs = PairBrackets('(a+((b*c)/(a+b)))')
%
% pairs =
% 1 17
% 4 16
% 5 9
% 11 15
%
%
if (~ischar(formula))
error(sprintf('%s\n%s', 'PairBrackets(formula)', 'first argument must be a string'));
end;
OpeningBracketIndex = strfind(formula, '(');
ClosingBracketIndex = strfind(formula, ')');
% check that the number of brackets matches
if (length(OpeningBracketIndex) ~= length(ClosingBracketIndex))
error('Bracket mismatch');
end;
if (isempty(OpeningBracketIndex))
pairs = 0;
return;
end;
for i = 1:length(OpeningBracketIndex)
j = length(OpeningBracketIndex);
while(j > 0)
if (OpeningBracketIndex(j) < ClosingBracketIndex(i))
pairs(i,1) = OpeningBracketIndex(j);
pairs(i,2) = ClosingBracketIndex(i);
OpeningBracketIndex(j) = max(ClosingBracketIndex);
j = 0;
else
j = j - 1;
end;
end;
end;
% order the pairs so that the opening bracket index is in ascending order
OriginalPairs = pairs;
% function 'sort' changes in version 7.0.1
v = version;
v_num = str2num(v(1));
if (v_num < 7)
TempPairs = sort(pairs, 1);
else
TempPairs = sort(pairs, 1, 'ascend');
end;
for i = 1:length(OpeningBracketIndex)
pairs(i, 1) = TempPairs(i, 1);
j = find(OriginalPairs == pairs(i, 1));
pairs(i, 2) = OriginalPairs(j, 2);
end;
SBMLToolbox-4.1.0/toolbox/Convenience/matchName.m 0000644 0000000 0000000 00000004450 11703262406 020317 0 ustar root root function index = matchName(expr, name)
% index = matchName(expression, name)
%
% Takes
%
% 1. expression, a string representation of a math expression
% 2. name, a string representing the name of a variable
%
% Returns
%
% 1. the index of the starting point of 'name' in the 'expression'
%
%
% *EXAMPLE:*
%
% index = matchName('f*g', 'g')
%
% index = 3
%
%
% index = matchName('f*g_1', 'g')
%
% index = []
%
%
% index = matchName('f*g(a,g)', 'g')
%
% index = 7
%
%
% *NOTE:* This differs from the 'strfind' function in that it checks
% that the name is used as a variable.
%
operators = '+-*/^,)';
maxSize = length(expr);
tempIndex = strfind(expr, name);
index = [];
if ~isempty(tempIndex)
% we found name - but is is followed by a math symbol
for i=1:length(tempIndex)
followIndex = tempIndex(i) + length(name);
if (followIndex <= maxSize)
followChar = expr(followIndex);
if ismember(followChar, operators)
index = [index, tempIndex(i)];
end;
else
index = [index, tempIndex(i)];
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/matchFunctionName.m 0000644 0000000 0000000 00000004515 11703262406 022027 0 ustar root root function index = matchFunctionName(expr, name)
% index = matchFunctionName(expression, name)
%
% Takes
%
% 1. expression, a string representation of a math expression
% 2. name, a string representing the name of a function
%
% Returns
%
% 1. the index of the starting point of 'name' in the 'expression'
%
% *EXAMPLE:*
%
% index = matchFunctionName('f*g', 'g')
%
% index = []
%
%
% index = matchFunctionName('add(d,g_1)', 'add')
%
% index = 0
%
%
% index = matchFunctionName('add(add(a,b), c)', 'add')
%
% index = [1, 5]
%
%
%
% *NOTE:* This differs from the 'strfind' function in that it checks
% that the name is used as a function call.
%
%
operators = '(';
maxSize = length(expr);
tempIndex = strfind(expr, name);
index = [];
if ~isempty(tempIndex)
% we found name - but is is followed by a math symbol
for i=1:length(tempIndex)
followIndex = tempIndex(i) + length(name);
if (followIndex < maxSize)
followChar = expr(followIndex);
if ismember(followChar, operators)
index = [index, tempIndex(i)];
end;
end;
end;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/LoseWhiteSpace.m 0000644 0000000 0000000 00000004753 11703262406 021307 0 ustar root root function y = LoseWhiteSpace(charArray)
% newArray = LoseWhiteSpace(charArray)
%
% Takes
%
% 1. charArray, an array of characters
%
% Returns
%
% 1. the array with any white space removed
%
% *EXAMPLE:*
%
% newArray = LoseWhiteSpace(' exa mp le')
%
% newArray = 'example'
%
%
%------------------------------------------------------------
% check input is an array of characters
if (~ischar(charArray))
error('LoseWhiteSpace(input)\n%s', 'input must be an array of characters');
end;
%-------------------------------------------------------------
% get the length of the array
NoChars = length(charArray);
%-------------------------------------------------------------
% create an array that indicates whether the elements of charArray are
% spaces
% e.g. WSpace = isspace(' v b') = [1, 1, 0, 1, 0]
% and determine how many
WSpace = isspace(charArray);
NoSpaces = sum(WSpace);
%-----------------------------------------------------------
% rewrite the array to leaving out any spaces
% remove any numbers from the array of symbols
if (NoSpaces > 0)
NewArrayCount = 1;
for i = 1:NoChars
if (~isspace(charArray(i)))
y(NewArrayCount) = charArray(i);
NewArrayCount = NewArrayCount + 1;
end;
end;
else
y = charArray;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/isValidUnitKind.m 0000644 0000000 0000000 00000003701 11703262406 021461 0 ustar root root function value = isValidUnitKind(kind)%
% y = isValidUnitKind(kind)
%
% Takes
%
% 1. kind, a string representing a unit kind
%
% returns
%
% 1. y =
% - 1 if the string represents a valid unit kind
% - 0 otherwise
%
% *NOTE:* This is identical to the function CheckValidUnitKind
%
%
UNIT_KIND_STRINGS = {'ampere', 'becquerel', 'candela', 'Celsius', 'coulomb', 'dimensionless', 'farad',...
'gram', 'gray', 'henry', 'hertz', 'item', 'joule', 'katal', 'kelvin', 'kilogram', 'liter', 'litre',...
'lumen', 'lux', 'meter', 'metre', 'mole', 'newton', 'ohm', 'pascal', 'radian', 'second', 'siemens',...
'sievert', 'steradian', 'tesla', 'volt', 'watt', 'weber', '(Invalid UnitKind)'};
value = 0;
if (ismember(kind, UNIT_KIND_STRINGS))
value = 1;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/isIntegralNumber.m 0000644 0000000 0000000 00000004475 11703262406 021703 0 ustar root root function value = isIntegralNumber(number)
% y = isIntegralNumber(number)
%
% Takes
%
% 1. number, any number
%
% Returns
%
% 1. y =
% - 1 if the number represents an integer
% - 0 otherwise
%
% *EXAMPLE:*
%
% y = isIntegralNumber(int32(3))
% y = 1
%
% y = isIntegralNumber(double(3.2))
% y = 0
%
% y = isIntegralNumber(double(3))
% y = 1
%
% *NOTE:* The inbuilt 'isinteger' function only returns true if the number
% has been declared as having an integer type, whereas the default type for numbers
% in MATLAB is double. This function will return '1' if the number
% represents an integer.
%
%
value = 0;
integerClasses = {'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'};
% since the function isinteger does not exist in MATLAB Rel 13
% this is not used
%if (isinteger(number))
if (ismember(class(number), integerClasses))
value = 1;
elseif (isnumeric(number))
% if it is an integer
if (number == fix(number))
value = 1;
end;
end;
SBMLToolbox-4.1.0/toolbox/Convenience/Contents.m 0000644 0000000 0000000 00000013223 11703262406 020215 0 ustar root root % toolbox\Convenience
%
% The Convenience folder contains a number of convenience functions for
% checking information or manipulating math expressions.
%
%==============================
% y = CheckValidUnitKind(kind)
%==============================
% Takes
% 1. kind, a string representing a unit kind
% Returns
% 1. y =
% - 1 if the string represents a valid unit kind
% - 0 otherwise
%
%======================================
% newArray = LoseWhiteSpace(charArray)
%======================================
% Takes
% 1. charArray, an array of characters
% Returns
% 1. the array with any white space removed
%
%===================================
% pairs = PairBrackets(expression)
%===================================
% Takes
% 1. expression, a string representation of a math expression
% Returns
% 1. an array of the indices of each pair of brackets ordered from
% the opening bracket index
%
%======================================
% output = Rearrange(expression, name)
%======================================
% Takes
% 1. expression, a string representation of a math expression
% 2. name, a string representing the name of a variable
% Returns
% 1. the expression rearranged in terms of the variable
%
%=====================================
% newArray = RemoveDuplicates(array)
%=====================================
% Takes
% 1. array, any array
% Returns
% 1. the array with any duplicate entries removed
%
%============================================
% value = Substitute(expression, SBMLModel)
%============================================
% Takes
% 1. expression, a string representation of a math expression
% 2. SBMLModel, an SBML Model structure
% Returns
% 1. the value of the expression when all variables within the model have
% been substituted
%
%=============================================================
% newExpression = SubstituteConstants(expression, SBMLModel)
%=============================================================
% Takes
% 1. expression, a string representation of a math expression
% 2. SBMLModel, an SBML Model structure
% Returns
% 1. the string representation of the expression when all constants within the
% model have been substituted
%
%=========================================================================
% newExpression = SubstituteFunction(expression, SBMLFunctionDefinition)
%=========================================================================
% Takes
% 1. expression, a string representation of a math expression
% 2. SBMLFunctionDefinition, an SBML FunctionDefinition structure
% Returns
% 1. newExpression
% - the string representation of the expression when any instances of the
% functionDefinition have been substituted
% - an empty string if the functiondefinition is not in the original
% expression
%
%==============================
% y = isIntegralNumber(number)
%==============================
% Takes
% 1. number, any number
% Returns
% 1. y =
% - 1 if the number represents an integer
% - 0 otherwise
%
%===========================
% y = isValidUnitKind(kind)
%===========================
% Takes
% 1. kind, a string representing a unit kind
% returns
% 1. y =
% - 1 if the string represents a valid unit kind
% - 0 otherwise
%
%=============================================
% index = matchFunctionName(expression, name)
%=============================================
% Takes
% 1. expression, a string representation of a math expression
% 2. name, a string representing the name of a function
% Returns
% 1. the index of the starting point of 'name' in the 'expression'
%
%=====================================
% index = matchName(expression, name)
%=====================================
% Takes
% 1. expression, a string representation of a math expression
% 2. name, a string representing the name of a variable
% Returns
% 1. the index of the starting point of 'name' in the 'expression'
%
%=========================================
% value = piecewise(value1, test, value2)
%=========================================
% Takes
% 1. value1, the value to return if the test is true
% 2. test, a boolean test that will return true or false
% 3. value2, the value to return if the test is false
% Returns
% 1. value =
% - value1, if test returns true
% - value2, if test returns false
%
%
%==============================
% y = testmember(value, array)
%==============================
% Takes
% 1. value, any number/string
% 2. array, an array of objects
% Returns
% 1. y =
% - 1 if value is a member of the array
% - 0 otherwise
%
%
SBMLToolbox-4.1.0/toolbox/Convenience/CheckValidUnitKind.m 0000644 0000000 0000000 00000003013 11703262406 022057 0 ustar root root function value = CheckValidUnitKind(kind)
% y = CheckValidUnitKind(kind)
%
% Takes
%
% 1. kind, a string representing a unit kind
%
% Returns
%
% 1. y =
% - 1 if the string represents a valid unit kind
% - 0 otherwise
%
% *NOTE:* This is identical to the function isValidUnitKind
%
%
value = isValidUnitKind(kind);
SBMLToolbox-4.1.0/toolbox/Contents.m 0000644 0000000 0000000 00000005531 11703275674 015777 0 ustar root root % toolbox\
%
% SBMLToolbox is an open-source MATLAB/Octave toolbox that
% provides both MATLAB and Octave users with functions for
% reading, writing and manipulation data expressed in the
% Systems Biology Markup Language (SBML).
%
% It works on Windows, Linux, and MacOS systems.
%
% The SBMLToolbox supports reading and writing of all levels
% and versions of SBML up to Level 3 Version 1 Core.
%
%
% FUNCTIONS include:
%
%===========================================================
% installed = isBindingInstalled()
%===========================================================
% Returns
% 1. installed
% - 1 if the libSBML executables are installed
% - 0 otherwise
%
%
% toolbox\AccessModel
%
% This directory contains functions that allow the user to
% derive information from an SBML Model.
%
% toolbox\Convenience
%
% This directory contains a number of convenience functions
% for checking information or manipulating math expressions.
%
% toolbox\fbc_package
%
% This directory contains functions that allow the user to
% manipulate the additional elements of a MATLAB_SBML Model
% structure introduced to support the SBML L3 'fbc' package.
%
% toolbox\MATLAB_SBML_Structure_Functions
%
% This directory contains functions that allow the user to
% manipulate a MATLAB_SBML Model structure. The majority of
% functions mimic their equivalent within the libSBML C API.
%
% toolbox\Simulation
%
% This directory contains functions to simulate an SBML model.
%
% toolbox\Validate_MATLAB_SBML_Structures
%
% This directory contains functions to validate the MATLAB_SBML
% structures.
%
%
SBMLToolbox-4.1.0/toolbox/AccessModel/ 0000755 0000000 0000000 00000000000 11704572220 016166 5 ustar root root SBMLToolbox-4.1.0/toolbox/AccessModel/Test/ 0000755 0000000 0000000 00000000000 11704572220 017105 5 ustar root root SBMLToolbox-4.1.0/toolbox/AccessModel/Test/test_fbc.m 0000644 0000000 0000000 00000003717 11703262254 021066 0 ustar root root function y = test_fbc()
%
fbcBindingEnabled = 1;
if isBindingFbcEnabled() == 0
fbcBindingEnabled = 0;
end;
if (fbcBindingEnabled == 0)
y = 0;
else
fail = 0;
m = TranslateSBML('../../fbc_package/test/test-data/fbc.xml');
s1 = m.species(2);
r1 = m.reaction(1);
names = {'k', 'k'};
names_unique = {'k_R1', 'k_R2'};
values = [0.1, 0.1];
sp_names = {'S', 'S1', 'S2', 'S3', 'S4'};
sp_values = [1,1,1,1,1];
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s1, r1, [0,1,0,0,1]);
fail = fail + TestFunction('GetAllParameters', 1, 2, m, names, values);
fail = fail + TestFunction('GetAllParametersUnique', 1, 2, m, names_unique, values);
fail = fail + TestFunction('GetSpecies', 1, 2, m, sp_names, sp_values);
y = fail;
end;
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/test_am.m 0000644 0000000 0000000 00000011555 11703266706 020736 0 ustar root root function y = test_am()
%
test = 0;
Totalfail = 0;
if (isBindingInstalled() == 1)
test = test + 11;
fail = TestDetermineSpeciesRoleInReaction;
if (fail > 0)
disp('DetermineSpeciesRoleInReaction failed');
end;
Totalfail = Totalfail + fail;
test = test + 3;
fail = TestGetAllParameters;
if (fail > 0)
disp('GetAllParameters failed');
end;
Totalfail = Totalfail + fail;
test = test + 3;
fail = TestGetAllParametersUnique;
if (fail > 0)
disp('GetAllParametersUnique failed');
end;
Totalfail = Totalfail + fail;
test = test + 4;
fail = TestGetGlobalParameters;
if (fail > 0)
disp('GetGlobalParameters failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetParameterFromReaction;
if (fail > 0)
disp('GetParameterFromReaction failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetParameterFromReactionUnique;
if (fail > 0)
disp('GetParameterFromReactionUnique failed');
end;
Totalfail = Totalfail + fail;
test = test + 4;
fail = TestGetRateLawsFromReactions;
if (fail > 0)
disp('GetRateLawsFromReactions failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetRateLawsFromRules;
if (fail > 0)
disp('GetRateLawsFromRules failed');
end;
Totalfail = Totalfail + fail;
test = test + 3;
fail = TestGetSpecies;
if (fail > 0)
disp('GetSpecies failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetSpeciesAlgebraicRules;
if (fail > 0)
disp('GetSpeciesAlgebraicRules failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetSpeciesAssignmentRules;
if (fail > 0)
disp('GetSpeciesAssignmentRules failed');
end;
Totalfail = Totalfail + fail;
test = test + 3;
fail = TestGetStoichiometryMatrix;
if (fail > 0)
disp('GetStoichiometryMatrix failed');
end;
Totalfail = Totalfail + fail;
test = test + 5;
fail = TestIsSpeciesInReaction;
if (fail > 0)
disp('IsSpeciesInReaction failed');
end;
Totalfail = Totalfail + fail;
test = test + 5;
fail = TestGetCompartments;
if (fail > 0)
disp('GetCompartments failed');
end;
Totalfail = Totalfail + fail;
test = test + 1;
fail = TestGetCompartmentTypes;
if (fail > 0)
disp('GetCompartmentTypes failed');
end;
Totalfail = Totalfail + fail;
test = test + 1;
fail = TestGetSpeciesTypes;
if (fail > 0)
disp('GetSpeciesTypes failed');
end;
Totalfail = Totalfail + fail;
test = test + 4;
fail = TestGetStoichiometrySparse;
if (fail > 0)
disp('GetStoichiometrySparse failed');
end;
Totalfail = Totalfail + fail;
test = test + 4;
fail = TestGetVaryingParameters;
if (fail > 0)
disp('GetVaryingParameters failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetParameterAssignmentRules;
if (fail > 0)
disp('GetParametersAssignmentRules failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetParameterRateRules;
if (fail > 0)
disp('GetParametersRateRules failed');
end;
Totalfail = Totalfail + fail;
test = test + 2;
fail = TestGetParameterAlgebraicRules;
if (fail > 0)
disp('GetParametersAlgebraicRules failed');
end;
Totalfail = Totalfail + fail;
test = test + 5;
fail = test_fbc;
if (fail > 0)
disp('test_fbc in AccessModel failed');
end;
Totalfail = Totalfail + fail;
disp(sprintf('Number tests: %d', test));
disp(sprintf('Number fails: %d', Totalfail));
disp(sprintf('Pass rate: %d%%', ((test-Totalfail)/test)*100));
else
disp('LibSBML binding not installed - no tests could be run');
end;
y = Totalfail;
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestIsSpeciesInReaction.m 0000644 0000000 0000000 00000003512 11703262254 023771 0 ustar root root function fail = TestIsSpeciesInReaction
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
r1 = m.reaction(1);
s1 = m.species(1);
s2 = m.species(3);
fail = TestFunction('IsSpeciesInReaction', 2, 1, s1, r1, 1);
fail = fail + TestFunction('IsSpeciesInReaction', 2, 1, s2, r1, 0);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
r1 = m.reaction(1);
s1 = m.species(1);
s2 = m.species(2);
s3 = m.species(3);
fail = fail + TestFunction('IsSpeciesInReaction', 2, 1, s1, r1, 1);
fail = fail + TestFunction('IsSpeciesInReaction', 2, 1, s2, r1, 0);
fail = fail + TestFunction('IsSpeciesInReaction', 2, 1, s2, r1, 0);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetVaryingParameters.m 0000644 0000000 0000000 00000003514 11703262254 024233 0 ustar root root function fail = TestGetVaryingParameters
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
names = {'s2'};
values = [4];
fail = 0;
fail = TestFunction('GetVaryingParameters', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/functionDefinition.xml');
names = {'p', 'c', 'c1', 'x', 'x1', 't', 'k_s'};
values = [2, 3, 18, 3, 3, 3, 3 ];
fail = fail + TestFunction('GetVaryingParameters', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
names = {'p', 'p1', 'p2', 'p3'};
values = [2, 4, 4, 2 ];
fail = fail + TestFunction('GetVaryingParameters', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetStoichiometrySparse.m 0000644 0000000 0000000 00000004262 11703262254 024611 0 ustar root root function fail = TestGetStoichiometrySparse
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
matrix = sparse(zeros(5,2));
matrix(1,1) = -1;
matrix(2,1) = 1;
matrix(2,2) = -1;
matrix(5,2) = 1;
fail = TestFunction('GetStoichiometrySparse', 1, 1, m, matrix);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
matrix1 = sparse(zeros(5,2));
matrix1(1,1) = -1;
matrix1(2,1) = 1;
matrix1(2,2) = -1;
matrix1(5,2) = 1;
fail = fail + TestFunction('GetStoichiometrySparse', 1, 1, m, matrix1);
m = TranslateSBML('../../Test/test-data/sparseStoichiometry.xml');
matrix2 = sparse(zeros(12,4));
matrix2(1,1) = -1;
matrix2(2,2) = -1;
matrix2(11,3) = -1;
matrix2(5,4) = -1;
matrix2(2,1) = 1;
matrix2(3,2) = 1;
matrix2(12,3) = 1;
matrix2(6,4) = 1;
fail = fail + TestFunction('GetStoichiometrySparse', 1, 1, m, matrix2);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
matrix3 = [NaN; 0; 1];
fail = fail + TestFunction('GetStoichiometrySparse', 1, 1, m, matrix3);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetStoichiometryMatrix.m 0000644 0000000 0000000 00000003547 11703262254 024625 0 ustar root root function fail = TestGetStoichiometryMatrix
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
matrix = [-1, 0; 1, -1; 0, 1; 0, 0];
species = {'S1', 'S2', 'S3', 'X'};
fail = TestFunction('GetStoichiometryMatrix', 1, 2, m, matrix, species);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
matrix = [-1, 0; 1, -1; 0, 0; 0, 0; 0, 1];
species = {'S1', 'S2', 'S3', 'X', 'S4'};
fail = TestFunction('GetStoichiometryMatrix', 1, 2, m, matrix, species);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
matrix = [NaN; 0; 1];
species = {'s', 's1', 's2'};
fail = TestFunction('GetStoichiometryMatrix', 1, 2, m, matrix, species);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetSpeciesTypes.m 0000644 0000000 0000000 00000002610 11703262254 023204 0 ustar root root function fail = TestGetSpeciesTypes
%
m = TranslateSBML('../../Test/test-data/l2v2-newComponents.xml');
names = {'Glucose'};
fail = TestFunction('GetSpeciesTypes', 1, 1, m, names);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetSpeciesAssignmentRules.m 0000644 0000000 0000000 00000003235 11703262254 025227 0 ustar root root function fail = TestGetSpeciesAssignmentRules
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
species = {'S1', 'S2', 'S3', 'X', 'S4'};
rules = {'0', '0', 's1+s2', '0', '0'};
fail = TestFunction('GetSpeciesAssignmentRules', 1, 2, m, species, rules);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
species = {'s', 's1', 's2'};
rules = {'0', '0', '0'};
fail = fail + TestFunction('GetSpeciesAssignmentRules', 1, 2, m, species, rules);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetSpeciesAlgebraicRules.m 0000644 0000000 0000000 00000003303 11703262254 024764 0 ustar root root function fail = TestGetSpeciesAlgebraicRules
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
species = {'S1', 'S2', 'S3', 'X', 'S4'};
rules = {{'X+S1-S3'}, {'S2+S3-s2'}, {'X+S1-S3', 'S2+S3-s2'}, {'X+S1-S3'}, '0'};
fail = TestFunction('GetSpeciesAlgebraicRules', 1, 2, m, species, rules);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
species = {'s', 's1', 's2'};
rules = {'0', '0', '0'};
fail = fail + TestFunction('GetSpeciesAlgebraicRules', 1, 2, m, species, rules);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetSpecies.m 0000644 0000000 0000000 00000003756 11703262254 022173 0 ustar root root function fail = TestGetSpecies
%
m = TranslateSBML('../../Test/test-data/l1v1.xml');
names = {'S1', 'S2', 'x0'};
values = [1.5, 1.45, 1];
fail = TestFunction('GetSpecies', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
names = {'S1', 'S2', 'S3', 'X', 'S4'};
values = [3, 6, 7, 9, 0];
fail = fail + TestFunction('GetSpecies', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/funcDefsWithInitialAssignments.xml');
names = {'S1', 'S2', 'S3', 'X', 'S4'};
values = [3, 6, 0, 9, 0];
fail = fail + TestFunction('GetSpecies', 1, 2, m, names, values);
% m = TranslateSBML('../../Test/test-data/l3v1core.xml');
%
% names = {'s', 's1', 's2'};
% values = [0, 2.2, NaN];
%
% fail = fail + TestFunction('GetSpecies', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetRateLawsFromRules.m 0000644 0000000 0000000 00000003147 11703262254 024153 0 ustar root root function fail = TestGetRateLawsFromRules
%
m = TranslateSBML('../../Test/test-data/rateRules.xml');
species = {'s1', 's2'};
rules = {'k', '0'};
fail = TestFunction('GetRateLawsFromRules', 1, 2, m, species, rules);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
species = {'s', 's1', 's2'};
rules = {'0', '0', '0'};
fail = fail + TestFunction('GetRateLawsFromRules', 1, 2, m, species, rules);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetRateLawsFromReactions.m 0000644 0000000 0000000 00000004513 11703262254 025006 0 ustar root root function fail = TestGetRateLawsFromReactions
%
fail = 0;
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
species = {'S1', 'S2', 'S3', 'X', 'S4'};
rateLaws = {' - (k*S1)', ' + (k*S1) - (k_R2*S2)', '0', '0', ' + (k_R2*S2)'};
fail = fail + TestFunction('GetRateLawsFromReactions', 1, 2, m, species, rateLaws);
m = TranslateSBML('../../Test/test-data/l2v2-newComponents.xml');
species = {'X0', 'X1'};
rateLaws = {' - (v_in*X0/t_in)', '0'};
fail = fail + TestFunction('GetRateLawsFromReactions', 1, 2, m, species, rateLaws);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
species = {'s', 's1', 's2'};
rateLaws = {' - (s*p) * (s*k_r/p)', '0', ' + (s*k_r/p)'};
fail = fail + TestFunction('GetRateLawsFromReactions', 1, 2, m, species, rateLaws);
m = TranslateSBML('../../Test/test-data/testNegativeLocalParameter.xml');
species = {'E', 'ES', 'S', 'P'};
rateLaws = {' - (cell*(k1_R1*E*S-k2_R1*ES)) + (cell*k3_R2*ES)', ...
' + (cell*(k1_R1*E*S-k2_R1*ES)) - (cell*k3_R2*ES)', ...
' - (cell*(k1_R1*E*S-k2_R1*ES))', ' + (cell*k3_R2*ES)'};
fail = fail + TestFunction('GetRateLawsFromReactions', 1, 2, m, species, rateLaws);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetParameterRateRules.m 0000644 0000000 0000000 00000003302 11703262254 024332 0 ustar root root function fail = TestGetParameterRateRules
%
m = TranslateSBML('../../Test/test-data/varyingParameters.xml');
Parameter = {'t', 'k', 'k1', 'v1', 'v2', 'v3'};
rules = {'0', '0', '0', '0', 'v1/t', '0'};
fail = TestFunction('GetParameterRateRules', 1, 2, m, Parameter, rules);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
names = {'p', 'p1', 'p2', 'p3', 'x', 'd'};
values = {'0', '0', '0', 'p1/p', '0', '0'};
fail = fail + TestFunction('GetParameterRateRules', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetParameterFromReactionUnique.m 0000644 0000000 0000000 00000003207 11703262254 026207 0 ustar root root function fail = TestGetParameterFromReactionUnique
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
r = m.reaction(2);
names = {'k_R2'};
values = 0.1;
fail = TestFunction('GetParameterFromReactionUnique', 1, 2, r, names, values);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
r = m.reaction(1);
names = {'k_r'};
values = 9;
fail = fail + TestFunction('GetParameterFromReactionUnique', 1, 2, r, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetParameterFromReaction.m 0000644 0000000 0000000 00000003160 11703262254 025016 0 ustar root root function fail = TestGetParameterFromReaction
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
r = m.reaction(2);
names = {'k'};
values = 0.1;
fail = TestFunction('GetParameterFromReaction', 1, 2, r, names, values);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
r = m.reaction(1);
names = {'k'};
values = 9;
fail = fail + TestFunction('GetParameterFromReaction', 1, 2, r, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetParameterAssignmentRules.m 0000644 0000000 0000000 00000003324 11703262254 025553 0 ustar root root function fail = TestGetParameterAssignmentRules
%
m = TranslateSBML('../../Test/test-data/varyingParameters.xml');
Parameter = {'t', 'k', 'k1', 'v1', 'v2', 'v3'};
rules = {'0', '0', '0', 'k1+k', '0', '0'};
fail = TestFunction('GetParameterAssignmentRules', 1, 2, m, Parameter, rules);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
names = {'p', 'p1', 'p2', 'p3', 'x', 'd'};
values = {'0', '0', 'x*p3', '0', '0', '0'};
fail = fail + TestFunction('GetParameterAssignmentRules', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetParameterAlgebraicRules.m 0000644 0000000 0000000 00000003360 11703262254 025314 0 ustar root root function fail = TestGetParameterAlgebraicRules
%
m = TranslateSBML('../../Test/test-data/varyingParameters.xml');
Parameter = {'t', 'k', 'k1', 'v1', 'v2', 'v3'};
rules = {'0', '0', {'v3+k1-v2'}, '0', {'v3+k1-v2'}, {'v3+k1-v2'}};
fail = TestFunction('GetParameterAlgebraicRules', 1, 2, m, Parameter, rules);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
Parameter = {'p', 'p1', 'p2', 'p3', 'x', 'd'};
rules = {'0', '0', '0', '0', {'x-2'}, '0'};
fail = fail + TestFunction('GetParameterAlgebraicRules', 1, 2, m, Parameter, rules);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetGlobalParameters.m 0000644 0000000 0000000 00000004115 11703262254 024012 0 ustar root root function fail = TestGetGlobalParameters
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
names = {'k', 's1', 's2'};
values = [1, 3, 4];
fail = TestFunction('GetGlobalParameters', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
names = {'k', 'k1', 's1', 's2', 's3', 'c', 'c1'};
values = [6, 2, 3, 4, 1, 6, 2];
fail = fail + TestFunction('GetGlobalParameters', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/funcDefsWithInitialAssignments.xml');
names = {'k', 'k1', 's1', 's2', 's3', 'c', 'c1'};
values = [6, 2, 3, 4, 1, 6, 2];
fail = fail + TestFunction('GetGlobalParameters', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
names = {'p', 'p1', 'p2', 'p3', 'x', 'd'};
values = [2, 4, 4, 2, 2, NaN];
fail = fail + TestFunction('GetGlobalParameters', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetCompartmentTypes.m 0000644 0000000 0000000 00000002625 11703262254 024110 0 ustar root root function fail = TestGetCompartmentTypes
%
m = TranslateSBML('../../Test/test-data/l2v2-newComponents.xml');
names = {'mitochondria'};
fail = TestFunction('GetCompartmentTypes', 1, 1, m, names);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetCompartments.m 0000644 0000000 0000000 00000004135 11703262254 023244 0 ustar root root function fail = TestGetCompartments
%
m = TranslateSBML('../../Test/test-data/l1v1.xml');
names = {'compartment'};
values = [1];
fail = TestFunction('GetCompartments', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/l2v1-all.xml');
names = {'a', 'c', 'c1'};
values = [1, 2, 1];
fail = fail + TestFunction('GetCompartments', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
names = {'compartment'};
values = [3];
fail = fail + TestFunction('GetCompartments', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/funcDefsWithInitialAssignments.xml');
names = {'compartment'};
values = [3];
fail = fail + TestFunction('GetCompartments', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
names = {'a', 'a1'};
values = [1, 3];
fail = fail + TestFunction('GetCompartments', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetAllParametersUnique.m 0000644 0000000 0000000 00000003617 11703262254 024517 0 ustar root root function fail = TestGetAllParametersUnique
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
names = {'k', 's1', 's2', 'k_R2'};
values = [1, 3, 4, 0.1];
fail = TestFunction('GetAllParametersUnique', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
names = {'k', 'k1', 's1', 's2', 's3', 'c', 'c1', 'k_R2'};
values = [6, 2, 3, 4, 1, 6, 2, 0.1];
fail = fail + TestFunction('GetAllParametersUnique', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
names = {'p', 'p1', 'p2', 'p3', 'x', 'd', 'k_r'};
values = [2, 4, 4, 2, 2, NaN, 9];
fail = fail + TestFunction('GetAllParametersUnique', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestGetAllParameters.m 0000644 0000000 0000000 00000003557 11703262254 023333 0 ustar root root function fail = TestGetAllParameters
%
m = TranslateSBML('../../Test/test-data/algebraicRules.xml');
names = {'k', 's1', 's2', 'k'};
values = [1, 3, 4, 0.1];
fail = TestFunction('GetAllParameters', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
names = {'k', 'k1', 's1', 's2', 's3', 'c', 'c1', 'k'};
values = [6, 2, 3, 4, 1, 6, 2, 0.1];
fail = fail + TestFunction('GetAllParameters', 1, 2, m, names, values);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
names = {'p', 'p1', 'p2', 'p3', 'x', 'd', 'k'};
values = [2, 4, 4, 2, 2, NaN, 9];
fail = fail + TestFunction('GetAllParameters', 1, 2, m, names, values);
SBMLToolbox-4.1.0/toolbox/AccessModel/Test/TestDetermineSpeciesRoleInReaction.m 0000644 0000000 0000000 00000005461 11703262254 026161 0 ustar root root function fail = TestDetermineSpeciesRoleInReaction
%
m = TranslateSBML('../../Test/test-data/species.xml');
s1 = m.species(1);
s2 = m.species(2);
s4 = m.species(4);
r1 = m.reaction(1);
r2 = m.reaction(2);
r3 = m.reaction(3);
fail = TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s4, r1, 0);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s2, r2, [1,0,0,2,0]);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s1, r1, [0,1,0,0,1]);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s4, r3, [0,0,1,0,0]);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s2, r3, [1,1,0,1,2]);
m = TranslateSBML('../../Test/test-data/l1v2-all.xml');
s1 = m.species(1);
s4 = m.species(4);
r1 = m.reaction(1);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s4, r1, 0);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s1, r1, [0,1,0,0,1]);
m = TranslateSBML('../../Test/test-data/initialAssignments.xml');
s1 = m.species(1);
s2 = m.species(3);
r1 = m.reaction(1);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s2, r1, 0);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s1, r1, [0,1,0,0, 1]);
m = TranslateSBML('../../Test/test-data/l2v2-newComponents.xml');
s1 = m.species(1);
r1 = m.reaction(1);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s1, r1, [0,1,0,0, 1]);
m = TranslateSBML('../../Test/test-data/l3v1core.xml');
s1 = m.species(1);
r1 = m.reaction(1);
fail = fail + TestFunction('DetermineSpeciesRoleInReaction', 2, 1, s1, r1, [0,1,0,0, 1]);
SBMLToolbox-4.1.0/toolbox/AccessModel/IsSpeciesInReaction.m 0000644 0000000 0000000 00000006642 11703262254 022221 0 ustar root root function y = IsSpeciesInReaction(SBMLSpecies, SBMLReaction)
% num = IsSpeciesInReaction(SBMLSpecies, SBMLReaction)
%
% Takes
%
% 1. SBMLSpecies, an SBML Species structure
% 2. SBMLReaction, an SBML Reaction structure
%
% Returns
%
% 1. the number of times the species occurs within the reaction
% Filename : IsSpeciesInReaction.m
% Description : IsSpeciesInReaction(SBMLSpecies, SBMLReaction)takes a SBML species and reaction
% and determines where the species takes part in the reaction
% Author(s) : SBML Development Group
% Organization: University of Hertfordshire STRC
% Created : 2004-02-02
% Revision : $Id: IsSpeciesInReaction.m 15207 2012-01-10 18:07:47Z mhucka $
% Source : $Source $
%
%
% check that input is valid
if (~isValid(SBMLSpecies))
error('IsSpeciesInReaction(SBMLSpecies, SBMLReaction)\n%s', 'first input must be an SBML Species structure');
end;
if(~isValid(SBMLReaction))
error('IsSpeciesInReaction(SBMLSpecies, SBMLReaction)\n%s', 'second input must be an SBML Reaction structure');
end;
SBMLLevel = GetLevel(SBMLSpecies);
%--------------------------------------------------------------------------
% determine the name of the species
% this will match to the speciesreference within the reaction
if (SBMLLevel == 1)
name = SBMLSpecies.name;
else
if (isempty(SBMLSpecies.id))
name = SBMLSpecies.name;
else
name = SBMLSpecies.id;
end;
end;
%--------------------------------------------------------------------------
%determine number of each type of species included within this reaction
NumProducts = length(SBMLReaction.product);
NumReactants = length(SBMLReaction.reactant);
if (SBMLLevel > 1)
NumModifiers = length(SBMLReaction.modifier);
else
NumModifiers = 0;
end;
%-------------------------------------------------------------------------
% find species in this reaction
y = 0;
for c = 1:NumProducts
if (strcmp(name, SBMLReaction.product(c).species))
y = y + 1;
end;
end;
for c = 1:NumReactants
if (strcmp(name, SBMLReaction.reactant(c).species))
y = y + 1;
end;
end;
for c = 1:NumModifiers
if (strcmp(name, SBMLReaction.modifier(c).species))
y = y + 1;
end;
end;
SBMLToolbox-4.1.0/toolbox/AccessModel/GetVaryingParameters.m 0000644 0000000 0000000 00000010027 11606041610 022442 0 ustar root root function varargout = GetVaryingParameters(SBMLModel)
% [names, values] = GetVaryingParameters(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of strings representing the identifiers of any non-constant parameters
% within the model
% 2. an array of the values of each of these parameter
%
% *NOTE:* the value returned will be (in order)
%
% - determined from assignmentRules/initialAssignments where appropriate
% - the attribute 'value' for the given parameter
% - NaN; if the value is not specified in any way within the model
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('GetVaryingParameters(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
%------------------------------------------------------------
% determine the number of parameters within the model
NumParams = length(SBMLModel.parameter);
count = 1;
%------------------------------------------------------------
% loop through the list of parameters
for i = 1:NumParams
%determine the name or id of the parameter
if (SBMLModel.SBML_level == 1)
name = SBMLModel.parameter(i).name;
else
if (isempty(SBMLModel.parameter(i).id))
name = SBMLModel.parameter(i).name;
else
name = SBMLModel.parameter(i).id;
end;
end;
% if the parameter is not constant add to arrays
if SBMLModel.parameter(i).constant == 0
% save into an array of character names
CharArray{count} = name;
% put the value into the array
Values(count) = SBMLModel.parameter(i).value;
% might be set by assignment rule
AR = Model_getAssignmentRuleByVariable(SBMLModel, name);
if (~isempty(AR))
newSBMLModel = SBMLModel;
newSBMLModel.parameter(i) = [];
for fd = 1:Model_getNumFunctionDefinitions(SBMLModel)
newFormula = SubstituteFunction(AR.formula, Model_getFunctionDefinition(SBMLModel, fd));
if (~isempty(newFormula))
AR.formula = newFormula;
end;
end;
Values(count) = Substitute(AR.formula, newSBMLModel);
end;
% might be an initial assignment in l2v2
if ((SBMLModel.SBML_level == 2 && SBMLModel.SBML_version > 1) ...
|| SBMLModel.SBML_level == 3)
IA = Model_getInitialAssignmentBySymbol(SBMLModel, name);
if (~isempty(IA))
% remove this from the substtution
newSBMLModel = SBMLModel;
newSBMLModel.parameter(i) = [];
for fd = 1:Model_getNumFunctionDefinitions(SBMLModel)
newFormula = SubstituteFunction(IA.math, Model_getFunctionDefinition(SBMLModel, fd));
if (~isempty(newFormula))
IA.math = newFormula;
end;
end;
Values(count) = Substitute(IA.math, newSBMLModel);
end;
end;
count = count + 1;
end;
end;
%--------------------------------------------------------------------------
% assign output
if (count ~= 1)
varargout{1} = CharArray;
varargout{2} = Values;
else
varargout{1} = [];
varargout{2} = [];
end;
SBMLToolbox-4.1.0/toolbox/AccessModel/GetStoichiometrySparse.m 0000644 0000000 0000000 00000010022 11606041610 023012 0 ustar root root function S=GetStoichiometrySparse(model)
% S = GetStoichiometrySparse(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. a sparse stoichiometry matrix produced from the reactions/species
%
% *NOTE:* This function was contributed by: Arsen Batagov (2006)
%
% check input is an SBML model
if (~isValidSBML_Model(model))
error('GetStoichiometrySparse(model)\n%s', 'input must be an SBMLModel structure');
end;
if (model.SBML_level > 1)
SpeciesID={model.species.id};
ReactionID={model.reaction.id};
else
SpeciesID={model.species.name};
ReactionID={model.reaction.name};
end;
NS=length(SpeciesID);
NR=length(ReactionID);
LNS=zeros(NS,1);
S=sparse(zeros(NS,NR));
for i=1:NS
LNS(i)=length(SpeciesID{i});
end
% Create a hash-table for the future search
MaxLNS=max(LNS);
InitialApprox=cell(MaxLNS);
LIA=zeros(MaxLNS);
for i=min(LNS):MaxLNS
InitialApprox{i}=find(LNS==i);
LIA(i)=length(InitialApprox{i});
end
% Search
for i=1:NR
t={model.reaction(i).reactant.species};
if ((model.SBML_level == 2) && (~isempty(model.reaction(i).reactant.stoichiometryMath)))
error('GetStoichiometrySparse(SBMLModel)\n%s', 'stoichiometry has been entered as a formula');
end;
if ((model.SBML_level == 2 && model.SBML_version > 1) ...
|| model.SBML_level == 3)
denominator = 1.0;
else
denominator = [model.reaction(i).reactant.denominator];
end;
s=[model.reaction(i).reactant.stoichiometry]./double(denominator);
rl=length(t);
if ~isempty(s)
if rl>1
for j=1:rl
lt=length(t{j});
for k=1:LIA(lt)
if cell2mat(SpeciesID(InitialApprox{lt}(k)))==t{j}
S(InitialApprox{lt}(k),i)=-s(j);
end
end
end
else
t=cell2mat(t);
lt=length(t);
for k=1:LIA(lt)
if cell2mat(SpeciesID(InitialApprox{lt}(k)))==t
S(InitialApprox{lt}(k),i)=-s;
end
end
end
end
t={model.reaction(i).product.species};
if ((model.SBML_level == 2) && (~isempty(model.reaction(i).product.stoichiometryMath)))
error('GetStoichiometrySparse(SBMLModel)\n%s', 'stoichiometry has been entered as a formula');
end;
if ((model.SBML_level == 2 && model.SBML_version > 1) ...
|| model.SBML_level == 3)
denominator = 1.0;
else
denominator = [model.reaction(i).product.denominator];
end;
s=[model.reaction(i).product.stoichiometry]./double(denominator);
rl=length(t);
if ~isempty(s)
if rl>1
for j=1:rl
lt=length(t{j});
for k=1:LIA(lt)
if cell2mat(SpeciesID(InitialApprox{lt}(k)))==t{j}
S(InitialApprox{lt}(k),i)=s(j);
end
end
end
else
t=cell2mat(t);
lt=length(t);
for k=1:LIA(lt)
if cell2mat(SpeciesID(InitialApprox{lt}(k)))==t
S(InitialApprox{lt}(k),i)=s;
end
end
end
end
end
SBMLToolbox-4.1.0/toolbox/AccessModel/GetStoichiometryMatrix.m 0000644 0000000 0000000 00000014266 11703262254 023046 0 ustar root root function varargout = GetStoichiometryMatrix(SBMLModel)
% [matrix, species] = GetStoichiometryMatrix(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. the stoichiometry matrix produced from the reactions/species
% 2. an array of strings representing the identifiers of all species within the model
% (in the order in which the matrix deals with them)
%
% *EXAMPLE:*
%
% model has 5 species (s1, s2, s3, s4, s5)
% and 3 reactions: s1 -> s2
% s3 -> s5
% 2s1 -> s5
%
% [matrix, species] = GetRateLawsFromReactions(model)
%
% matrix = -1 0 -2
% 1 0 0
% 0 -1 0
% 0 1 1
% species = ['s1', 's2', 's3', 's5']
%
% (species s4 does not play a role in any reaction)
%
%--------------------------------------------------------------------------
%
% Filename : GetStoichiometryMatrix.m
% Description : takes 1. SBMLModel; an SBML Model structure and returns the stoichiometry matrix
% and an array of strings representing the ids of all species
% Author(s) : SBML Development Group
% Organization: University of Hertfordshire STRC
% Created : 2004-02-02
% Revision : $Id: GetStoichiometryMatrix.m 15207 2012-01-10 18:07:47Z mhucka $
% Source : $Source $
%
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('GetStoichiometryMatrix(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
%------------------------------------------------------------
% determine the number of species and reactions
NumSpecies = length(SBMLModel.species);
NumReactions = length(SBMLModel.reaction);
%--------------------------------------------------------------------------
% for each species loop through each reaction and determine whether the species
% takes part and in what capacity
for i = 1:NumSpecies
%determine which reactions it occurs within
for j = 1:NumReactions
SpeciesRole = DetermineSpeciesRoleInReaction(SBMLModel.species(i), SBMLModel.reaction(j));
if (sum(SpeciesRole) == 0)
% not in this reaction
StoichiometryMatrix(i,j) = 0;
TotalOccurences = 0;
else
% record numbers of occurences of species as reactant/product
% and check that we can deal with reaction
NoReactants = SpeciesRole(2);
NoProducts = SpeciesRole(1);
TotalOccurences = NoReactants + NoProducts;
%--------------------------------------------------------------
% check that a species does not occur twice on one side of the
% reaction
if (NoReactants > 1 || NoProducts > 1)
error('GetStoichiometryMatrix(SBMLModel)\n%s', 'SPECIES OCCURS MORE THAN ONCE ON ONE SIDE OF REACTION');
end;
end;
% species has been found in this reaction
while (TotalOccurences > 0) %
if(NoProducts > 0)
if ((SBMLModel.SBML_level == 2) && (~isempty(SBMLModel.reaction(j).product(SpeciesRole(4)).stoichiometryMath)))
error('GetStoichiometryMatrix(SBMLModel)\n%s', 'stoichiometry has been entered as a formula');
end;
if ((SBMLModel.SBML_level == 2 && SBMLModel.SBML_version > 1) ...
|| SBMLModel.SBML_level == 3)
denominator = 1.0;
else
denominator = double(SBMLModel.reaction(j).product(SpeciesRole(4)).denominator);
end;
stoichiometry = SBMLModel.reaction(j).product(SpeciesRole(4)).stoichiometry/denominator;
StoichiometryMatrix(i,j) = stoichiometry;
NoProducts = NoProducts - 1;
elseif (NoReactants > 0)
if ((SBMLModel.SBML_level == 2) && (~isempty(SBMLModel.reaction(j).reactant(SpeciesRole(5)).stoichiometryMath)))
error('GetStoichiometryMatrix(SBMLModel)\n%s', 'stoichiometry has been entered as a formula');
end;
if ((SBMLModel.SBML_level == 2 && SBMLModel.SBML_version > 1) ...
|| SBMLModel.SBML_level == 3)
denominator = 1.0;
else
denominator = double(SBMLModel.reaction(j).reactant(SpeciesRole(5)).denominator);
end;
stoichiometry = SBMLModel.reaction(j).reactant(SpeciesRole(5)).stoichiometry/denominator;
StoichiometryMatrix(i,j) = - stoichiometry;
NoReactants = NoReactants - 1;
end;
TotalOccurences = TotalOccurences - 1;
end; % while found > 0
end; % for NumReactions
end; % for NumSpecies
%--------------------------------------------------------------------------
% assign outputs
varargout{1} = StoichiometryMatrix;
varargout{2} = GetSpecies(SBMLModel);
SBMLToolbox-4.1.0/toolbox/AccessModel/GetSpeciesTypes.m 0000644 0000000 0000000 00000005046 11703262254 021433 0 ustar root root function varargout = GetSpeciesTypes(SBMLModel)
% names = GetSpeciesTypes(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of strings representing the identifiers of all SpeciesTypes within the model
%
%--------------------------------------------------------------------------
%
% Filename : GetSpeciesTypes.m
% Description : returns SpeciesTypes
% Author(s) : SBML Development Group
% Organization: University of Hertfordshire STRC
% Created : 2004-02-02
% Revision : $Id: GetSpeciesTypes.m 15207 2012-01-10 18:07:47Z mhucka $
% Source : $Source $
%
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('GetSpeciesTypes(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
%------------------------------------------------------------
% determine the number of SpeciesTypes within the model
NumSpeciesTypes = length(SBMLModel.speciesType);
%------------------------------------------------------------
% loop through the list of Speciess
for i = 1:NumSpeciesTypes
% and array of the character names
CharArray{i} = SBMLModel.speciesType(i).id;
end;
%--------------------------------------------------------------------------
% assign output
if (NumSpeciesTypes ~= 0)
varargout{1} = CharArray;
else
varargout{1} = [];
end;
SBMLToolbox-4.1.0/toolbox/AccessModel/GetSpeciesAssignmentRules.m 0000644 0000000 0000000 00000006155 11703262254 023454 0 ustar root root function [Species, AssignmentRules] = GetSpeciesAssignmentRules(SBMLModel)
% [species, assignmentRules] = GetSpeciesAssignmentRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of strings representing the identifiers of all species
% 2. an array of
%
% - the character representation of the assignment rule used to
% assign value to a given species
% - '0' if the species is not assigned by a rule
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('GetSpeciesAssignmentRules(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
%--------------------------------------------------------------
% get information from the model
Species = GetSpecies(SBMLModel);
NumberSpecies = length(SBMLModel.species);
AssignRules = Model_getListOfAssignmentRules(SBMLModel);
NumAssignRules = Model_getNumAssignmentRules(SBMLModel);
% for each species loop through each reaction and determine whether the species
% takes part and in what capacity
for i = 1:NumberSpecies
output = '';
% if species is constant in level 2
% concentration cannot be changed by a rule
boundary = SBMLModel.species(i).boundaryCondition;
if (SBMLModel.SBML_level > 1)
constant = SBMLModel.species(i).constant;
else
constant = -1;
end;
if (constant == 1)
output = '0';
else
if (NumAssignRules > 0)
%determine which rules it occurs within
RuleNo = Species_isAssignedByRule(SBMLModel.species(i), AssignRules);
if (RuleNo > 0)
output = AssignRules(RuleNo).formula;
end;
end;
end; % if constant
% finished looking for this species
% record rate law and loop to next species
% rate = 0 if no law found
if (isempty(output))
AssignmentRules{i} = '0';
else
AssignmentRules{i} = output;
end;
end; % for NumSpecies
SBMLToolbox-4.1.0/toolbox/AccessModel/GetSpeciesAlgebraicRules.m 0000644 0000000 0000000 00000005764 11703262254 023222 0 ustar root root function [Species, AlgebraicRules] = GetSpeciesAlgebraicRules(SBMLModel)
% [names, values] = GetSpeciesAlgebraicRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of strings representing the identifiers of all species
% 2. an array of
%
% - the character representation of each algebraic
% rule the species appears in
% - '0' if the particular species is not in an algebraic rule
%
% *EXAMPLE:*
%
% model has 3 species (s1, s2, s3)
% and 2 algebraic rules with formula 's2+7' and 's2-s3'
%
% [species, algebraicRules] = GetSpeciesAlgebraicRules(model)
%
% species = ['s1', 's2', 's3']
% algebraicRules = {'0', ['s2+7', 's2-s3'], ['k2-k3']}
%
%
%
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('GetSpeciesAlgebraicRules(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
%--------------------------------------------------------------
% get information from the model
Species = GetSpecies(SBMLModel);
NumberSpecies = length(SBMLModel.species);
Rules = Model_getListOfAlgebraicRules(SBMLModel);
NumRules = Model_getNumAlgebraicRules(SBMLModel);
for i = 1:NumberSpecies
output = '';
if (NumRules > 0)
%determine which rules it occurs within
RuleNo = Species_isInAlgebraicRule(SBMLModel.species(i), Rules);
for j = 1:length(RuleNo)
if (RuleNo(j) > 0)
output{j} = Rules(RuleNo(j)).formula;
end;
end;
end;
% finished looking for this species
% record rate law and loop to next species
% rate = 0 if no law found
if (isempty(output))
AlgebraicRules{i} = '0';
else
AlgebraicRules{i} = output;
end;
end; % for NumSpecies
SBMLToolbox-4.1.0/toolbox/AccessModel/GetSpecies.m 0000644 0000000 0000000 00000010425 11703262254 020403 0 ustar root root function varargout = GetSpecies(SBMLModel)
% [names, values] = GetSpecies(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of strings representing the identifiers of all species within the model
% 2. an array of the initial concentration/amount values of each species
%
% *NOTE:* the value returned will be (in order)
%
% - determined from assignmentRules/initialAssignments where appropriate
% - the attribute 'initialAmount' or 'initialConcentration' for the given parameter
% - NaN, if the value is not specified in any way within the model
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('GetSpecies(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
%------------------------------------------------------------
% determine the number of species within the model
NumSpecies = length(SBMLModel.species);
%------------------------------------------------------------
% loop through the list of species
for i = 1:NumSpecies
%determine the name or id of the species
if (SBMLModel.SBML_level == 1)
name = SBMLModel.species(i).name;
else
if (isempty(SBMLModel.species(i).id))
name = SBMLModel.species(i).name;
else
name = SBMLModel.species(i).id;
end;
end;
% and array of the character names
CharArray{i} = name;
% get the initial concentration values
% add to an array
Values(i) = SBMLModel.species(i).initialAmount;
if (SBMLModel.SBML_level > 1)
if (SBMLModel.species(i).isSetInitialConcentration)
Values(i) = SBMLModel.species(i).initialConcentration;
end;
end;
% might be set by assignment rule
AR = Model_getAssignmentRuleByVariable(SBMLModel, name);
if (~isempty(AR))
newSBMLModel = SBMLModel;
newSBMLModel.species(i) = [];
for fd = 1:Model_getNumFunctionDefinitions(SBMLModel)
newFormula = SubstituteFunction(AR.formula, Model_getFunctionDefinition(SBMLModel, fd));
if (~isempty(newFormula))
AR.formula = newFormula;
end;
end;
Values(i) = Substitute(AR.formula, newSBMLModel);
end;
% might be an initial assignment in l2v2
if ((SBMLModel.SBML_level == 2 && SBMLModel.SBML_version > 1) ...
|| SBMLModel.SBML_level == 3)
IA = Model_getInitialAssignmentBySymbol(SBMLModel, name);
if (~isempty(IA))
% remove this from the substtution
newSBMLModel = SBMLModel;
newSBMLModel.species(i) = [];
for fd = 1:Model_getNumFunctionDefinitions(SBMLModel)
newFormula = SubstituteFunction(IA.math, Model_getFunctionDefinition(SBMLModel, fd));
if (~isempty(newFormula))
IA.math = newFormula;
end;
end;
Values(i) = Substitute(IA.math, newSBMLModel);
end;
end;
end;
%--------------------------------------------------------------------------
% assign output
if (NumSpecies ~= 0)
varargout{1} = CharArray;
varargout{2} = Values;
else
varargout{1} = [];
varargout{2} = [];
end;
SBMLToolbox-4.1.0/toolbox/AccessModel/GetRateLawsFromRules.m 0000644 0000000 0000000 00000006411 11703262254 022371 0 ustar root root function [Species, RateLaws] = GetRateLawsFromRules(SBMLModel)
% [species, rateLaws] = GetRateLawsFromRules(SBMLModel)
%
% Takes
%
% 1. SBMLModel, an SBML Model structure
%
% Returns
%
% 1. an array of strings representing the identifiers of all species
% 2. an array of
%
% - the character representation of the rateRule that determines
% the particular species
% - '0' if the particular species is not assigned by a rateRule
%
% check input is an SBML model
if (~isValidSBML_Model(SBMLModel))
error('GetRateLawsFromRules(SBMLModel)\n%s', 'input must be an SBMLModel structure');
end;
%--------------------------------------------------------------
% get information from the model
Species = GetSpecies(SBMLModel);
NumberSpecies = length(SBMLModel.species);
RateRules = Model_getListOfRateRules(SBMLModel);
NumRateRules = Model_getNumRateRules(SBMLModel);
% for each species loop through each reaction and determine whether the species
% takes part and in what capacity
for i = 1:NumberSpecies
output = '';
% if species is constant in level 2
% concentration cannot be changed by a rate rule
boundary = SBMLModel.species(i).boundaryCondition;
if (SBMLModel.SBML_level > 1)
constant = SBMLModel.species(i).constant;
else
constant = -1;
end;
if (constant == 1)
output = '0';
else
%determine which rules it occurs within
j = 0;
while (j