diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fcfee62
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+.ipynb_checkpoints
+subsbml.egg-info/
+build/
+dist/
+examples/.ipynb_checkpoints/
+__pycache__/
+*.pyc
+*.orig
\ No newline at end of file
diff --git a/examples/A nimply B/A0sim.py b/examples/A nimply B/A0sim.py
index 05f90d4..4d1d734 100644
--- a/examples/A nimply B/A0sim.py
+++ b/examples/A nimply B/A0sim.py
@@ -1,16 +1,13 @@
import numpy as np
-from libsbml import *
-from modules.Subsystem import *
-from modules.System import *
+from subsbml import *
cell = System('cell')
# A0 - promoter sig28 -tetO - utr1 - deGFP
A0 = cell.createSubsystem('models/A0.xml','A0')
-# SBML model gets converted to Level 3 Version 1
-writeSBML(A0.getSubsystemDoc(),'models/A0converted.xml')
+# SBML model gets converted to Level 3 Version 2
+# libsbml.writeSBML(A0.getSBMLDocument(),'models/A0converted.xml')
# Simulate using bioscrape
timepoints = np.linspace(0,14*60*60,1000)
-plotSbmlWithBioscrape('models/A0converted.xml',0,
-timepoints,['protein deGFP*','protein sigma28'],'Time',
-'concentration (nM)',14,14)
+A0.plotBioscrape(['protein deGFP*','protein sigma28'],timepoints, xlabel = 'Time',
+ylabel = 'concentration (nM)',sizeOfXLabels = 14,sizeOfYLabels = 14)
diff --git a/examples/A nimply B/A1sim.py b/examples/A nimply B/A1sim.py
index 4800edc..c8f78aa 100644
--- a/examples/A nimply B/A1sim.py
+++ b/examples/A nimply B/A1sim.py
@@ -1,7 +1,5 @@
import numpy as np
-from libsbml import *
-from modules.Subsystem import *
-from modules.System import *
+from subsbml import *
cell = System('cell')
cell.ListOfSharedResources = ['RNAP','Ribo','ATP']
@@ -10,10 +8,8 @@
# A1 - pLac - utr1 - sigma28 (constituitively expressed protein sigma28 - input plasmid)
A1 = cell.createSubsystem('models/A1.xml','A1')
# SBML model gets converted to Level 3 Version 1
-writeSBML(A1.getSubsystemDoc(),'models/A1converted.xml')
+libsbml.writeSBML(A1.getSBMLDocument(),'models/A1converted.xml')
# Simulate using bioscrape
timepoints = np.linspace(0,14*60*6000,1000)
-plotSbmlWithBioscrape('models/A1converted.xml',0,
-timepoints,['protein deGFP*','protein sigma28'],'Time',
-'concentration (nM)',14,14)
+A1.plotBioscrape(['protein deGFP*','protein sigma28'],timepoints)
diff --git a/examples/A nimply B/AnimplyB.py b/examples/A nimply B/AnimplyB.py
index d105959..63ee023 100644
--- a/examples/A nimply B/AnimplyB.py
+++ b/examples/A nimply B/AnimplyB.py
@@ -1,7 +1,5 @@
import numpy as np
-from libsbml import *
-from modules.Subsystem import *
-from modules.System import *
+from subsbml import *
cell = System('cell')
# cell.ListOfSharedResources = ['RNAP']
@@ -11,30 +9,30 @@
B1 = cell.createSubsystem('models/B1.xml','B1')
AnB = cell.createSubsystem('models/AnimplyB.xml','AnB')
-writeSBML(AnB.getSBMLDocument(), 'models/AnimplyB_mod.xml')
-# combined00 = createNewSubsystem(3,1)
+libsbml.writeSBML(AnB.getSBMLDocument(), 'models/AnimplyB_mod.xml')
+# combined00 = createNewSubsystem()
# combined00.combineSubsystems([A0, B0],True, 'virtual')
-# writeSBML(combined00.getSBMLDocument(),'models/combined00.xml')
+# libsbml.writeSBML(combined00.getSBMLDocument(),'models/combined00.xml')
-# combined01 = createNewSubsystem(3,1)
+# combined01 = createNewSubsystem()
# combined01.combineSubsystems([A0,B1],True, 'volume')
-# writeSBML(combined01.getSBMLDocument(),'models/combined01.xml')
+# libsbml.writeSBML(combined01.getSBMLDocument(),'models/combined01.xml')
-# combined10 = createNewSubsystem(3,1)
+# combined10 = createNewSubsystem()
# combined10.combineSubsystems([A1, B0],True, 'volume')
-# writeSBML(combined10.getSBMLDocument(),'models/combined10.xml')
+# libsbml.writeSBML(combined10.getSBMLDocument(),'models/combined10.xml')
-combined11 = createNewSubsystem(3,1)
+combined11 = createNewSubsystem()
combined11.combineSubsystems([A1, B1],True, 'virtual')
-writeSBML(combined11.getSBMLDocument(),'models/combined11.xml')
+libsbml.writeSBML(combined11.getSBMLDocument(),'models/combined11.xml')
# Simulate using bioscrape
t_end = 14*60*60
points = 1200
timepoints = np.linspace(0, t_end, points)
-# combined = createNewSubsystem(3,1)
+# combined = createNewSubsystem()
# combined.combineSubsystems([A1, B1],True, 'virtual')
# ListOfInputs = ['DNA plac--utr1--sigma28','DNA plac--utr1--sigmaX']
@@ -62,5 +60,4 @@
# timepoints,['protein deGFP', 'protein sigma28', 'protein sigmaX', 'protein deGFP*', 'protein tetR', 'protein tetRdimer'],'Time',
# timepoints,['protein deGFP*', 'protein tetRdimer', 'protein sigmaX'],'Time',
# timepoints,['protein deGFP*', 'protein tetRdimer', 'protein sigma28'],'Time',
-timepoints,['protein deGFP*','protein sigma28', 'protein sigmaX', 'protein tetRdimer', 'protein deGFP', 'protein tetR'],'Time',
-'concentration (nM)')
+timepoints,['protein deGFP*','protein sigma28', 'protein sigmaX', 'protein tetRdimer', 'protein deGFP', 'protein tetR'])
diff --git a/examples/A nimply B/AnimplyB_withAHL.py b/examples/A nimply B/AnimplyB_withAHL.py
index 774f83f..8b235a5 100644
--- a/examples/A nimply B/AnimplyB_withAHL.py
+++ b/examples/A nimply B/AnimplyB_withAHL.py
@@ -1,7 +1,5 @@
import numpy as np
-from libsbml import *
-from modules.Subsystem import *
-from modules.System import *
+from subsbml import *
cell = System('cell')
@@ -21,41 +19,40 @@
check(plux_par.setValue(0), 'setting leaky parameter zero')
check(plas_par.setValue(0), 'setting leaky parameter zero')
-connected = createNewSubsystem(3,1)
-# connected.connectSubsystems([AnB_ss, Input], connection_logic, 'virtual', True)
-connected.connectSubsystems([AnB_ss, Input], connection_logic, 'virtual', True)
-writeSBML(connected.getSBMLDocument(), 'models/AnBconnected.xml')
+connected = createNewSubsystem()
+doc = connected.connectSubsystems([AnB_ss, Input], connection_logic, 'virtual', True)
+libsbml.writeSBML(doc, 'models/AnBconnected00.xml')
# Simulate 00 case
timepoints = np.linspace(0,14*60*60,2000)
-# plotSbmlWithBioscrape('models/AnBconnected.xml',0,timepoints,['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'])
+connected.plotBioscrape(['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'], timepoints)
simpleModel = SimpleModel(connected.getSBMLDocument().getModel())
-oc6 = simpleModel.getSpeciesByName('OC6HSL')
-oc12 = simpleModel.getSpeciesByName('OC12HSL')
+oc6 = simpleModel.getSpeciesByName('inputA')
+oc12 = simpleModel.getSpeciesByName('inputB')
oc6.setInitialAmount(0)
oc12.setInitialAmount(500)
-writeSBML(connected.getSBMLDocument(), 'models/AnBconnected01.xml')
+libsbml.writeSBML(doc, 'models/AnBconnected01.xml')
# Simulate 01 case
timepoints = np.linspace(0,14*60*60,2000)
-# plotSbmlWithBioscrape('models/AnBconnected01.xml',0,timepoints,['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'])
+connected.plotBioscrape(['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'], timepoints)
oc6.setInitialAmount(500)
oc12.setInitialAmount(0)
-writeSBML(connected.getSBMLDocument(), 'models/AnBconnected10.xml')
+libsbml.writeSBML(doc, 'models/AnBconnected10.xml')
# Simulate 10 case
timepoints = np.linspace(0,14*60*60,500)
-# plotSbmlWithBioscrape('models/AnBconnected10.xml',0,timepoints,['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'])
+connected.plotBioscrape(['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'], timepoints)
oc6.setInitialAmount(500)
oc12.setInitialAmount(500)
-writeSBML(connected.getSBMLDocument(), 'models/AnBconnected11.xml')
+libsbml.writeSBML(doc, 'models/AnBconnected11.xml')
# Simulate 11 case
timepoints = np.linspace(0,14*60*60,100)
-plotSbmlWithBioscrape('models/AnBconnected11.xml',0,timepoints,['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'])
-
+connected.plotBioscrape(['protein tetRdimer', 'protein deGFP*', 'protein lasR', 'protein luxR'],timepoints)
+print('Successfully completed simulations. GFP expression should only be high for the 10 case (the third plot that was displayed)')
\ No newline at end of file
diff --git a/examples/A nimply B/B0sim.py b/examples/A nimply B/B0sim.py
index a3c364a..91ee81e 100644
--- a/examples/A nimply B/B0sim.py
+++ b/examples/A nimply B/B0sim.py
@@ -1,16 +1,12 @@
import numpy as np
-from libsbml import *
-from modules.Subsystem import *
-from modules.System import *
+from subsbml import *
cell = System('cell')
# B0 - promoter sigX - utr1 - tetR
B0 = cell.createSubsystem('models/B0.xml','B0')
# SBML model gets converted to Level 3 Version 1
-writeSBML(B0.getSubsystemDoc(),'models/B0converted.xml')
+libsbml.writeSBML(B0.getSBMLDocument(),'models/B0converted.xml')
# Simulate using bioscrape
timepoints = np.linspace(0,14*60*60,1000)
-plotSbmlWithBioscrape('models/B0converted.xml',0,
-timepoints,['protein tetRdimer'],'Time',
-'concentration (nM)',14,14)
+B0.plotBioscrape(['protein tetRdimer'],timepoints)
diff --git a/examples/A nimply B/B1sim.py b/examples/A nimply B/B1sim.py
index 4a66f21..748c2e5 100644
--- a/examples/A nimply B/B1sim.py
+++ b/examples/A nimply B/B1sim.py
@@ -1,7 +1,5 @@
import numpy as np
-from libsbml import *
-from modules.Subsystem import *
-from modules.System import *
+from subsbml import *
cell = System('cell')
@@ -9,10 +7,8 @@
# B1 - pLac - utr1 - sigmaX (constituitively expressed protein sigmaX - input plasmid)
B1 = cell.createSubsystem('models/B1.xml','B1')
# SBML model gets converted to Level 3 Version 1
-writeSBML(B1.getSubsystemDoc(),'models/B1converted.xml')
+libsbml.writeSBML(B1.getSBMLDocument(),'models/B1converted.xml')
# Simulate using bioscrape
timepoints = np.linspace(0,14*60*60000,1000)
-plotSbmlWithBioscrape('models/B1converted.xml',0,
-timepoints,['protein tetRdimer','protein sigmaX'],'Time',
-'concentration (nM)',14,14)
+B1.plotBioscrape(['protein tetRdimer','protein sigmaX'],timepoints)
diff --git a/examples/A nimply B/models/A0converted.xml b/examples/A nimply B/models/A0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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/A1converted.xml b/examples/A nimply B/models/A1converted.xml
new file mode 100644
index 0000000..9092088
--- /dev/null
+++ b/examples/A nimply B/models/A1converted.xml
@@ -0,0 +1,1821 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/AnBconnected00.xml b/examples/A nimply B/models/AnBconnected00.xml
new file mode 100644
index 0000000..b0d83ea
--- /dev/null
+++ b/examples/A nimply B/models/AnBconnected00.xml
@@ -0,0 +1,5115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/AnBconnected01.xml b/examples/A nimply B/models/AnBconnected01.xml
new file mode 100644
index 0000000..0604979
--- /dev/null
+++ b/examples/A nimply B/models/AnBconnected01.xml
@@ -0,0 +1,5115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/AnBconnected10.xml b/examples/A nimply B/models/AnBconnected10.xml
new file mode 100644
index 0000000..41bc14c
--- /dev/null
+++ b/examples/A nimply B/models/AnBconnected10.xml
@@ -0,0 +1,5115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/AnBconnected11.xml b/examples/A nimply B/models/AnBconnected11.xml
new file mode 100644
index 0000000..d15a1d3
--- /dev/null
+++ b/examples/A nimply B/models/AnBconnected11.xml
@@ -0,0 +1,5115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/AnimplyB_mod.xml b/examples/A nimply B/models/AnimplyB_mod.xml
index 605684d..77f8c0c 100644
--- a/examples/A nimply B/models/AnimplyB_mod.xml
+++ b/examples/A nimply B/models/AnimplyB_mod.xml
@@ -1,5 +1,5 @@
-
+
@@ -120,7 +120,7 @@
-
+
@@ -155,7 +155,7 @@
-
+
@@ -188,7 +188,7 @@
-
+
@@ -219,7 +219,7 @@
-
+
@@ -250,7 +250,7 @@
-
+
@@ -270,7 +270,7 @@
-
+
@@ -291,7 +291,7 @@
-
+
@@ -322,7 +322,7 @@
-
+
@@ -353,7 +353,7 @@
-
+
@@ -384,7 +384,7 @@
-
+
@@ -415,7 +415,7 @@
-
+
@@ -436,7 +436,7 @@
-
+
@@ -467,7 +467,7 @@
-
+
@@ -502,7 +502,7 @@
-
+
@@ -522,7 +522,7 @@
-
+
@@ -543,7 +543,7 @@
-
+
@@ -564,7 +564,7 @@
-
+
@@ -595,7 +595,7 @@
-
+
@@ -615,7 +615,7 @@
-
+
@@ -646,7 +646,7 @@
-
+
@@ -667,7 +667,7 @@
-
+
@@ -698,7 +698,7 @@
-
+
@@ -721,7 +721,7 @@
-
+
@@ -752,7 +752,7 @@
-
+
@@ -773,7 +773,7 @@
-
+
@@ -804,7 +804,7 @@
-
+
@@ -826,7 +826,7 @@
-
+
@@ -846,7 +846,7 @@
-
+
@@ -877,7 +877,7 @@
-
+
@@ -908,7 +908,7 @@
-
+
@@ -939,7 +939,7 @@
-
+
@@ -970,7 +970,7 @@
-
+
@@ -1001,7 +1001,7 @@
-
+
@@ -1021,7 +1021,7 @@
-
+
@@ -1042,7 +1042,7 @@
-
+
@@ -1073,7 +1073,7 @@
-
+
@@ -1104,7 +1104,7 @@
-
+
@@ -1135,7 +1135,7 @@
-
+
@@ -1166,7 +1166,7 @@
-
+
@@ -1187,7 +1187,7 @@
-
+
@@ -1207,7 +1207,7 @@
-
+
@@ -1229,7 +1229,7 @@
-
+
@@ -1260,7 +1260,7 @@
-
+
@@ -1291,7 +1291,7 @@
-
+
@@ -1322,7 +1322,7 @@
-
+
@@ -1353,7 +1353,7 @@
-
+
@@ -1374,7 +1374,7 @@
-
+
@@ -1405,7 +1405,7 @@
-
+
@@ -1440,7 +1440,7 @@
-
+
@@ -1460,7 +1460,7 @@
-
+
@@ -1481,7 +1481,7 @@
-
+
@@ -1502,7 +1502,7 @@
-
+
@@ -1533,7 +1533,7 @@
-
+
@@ -1553,7 +1553,7 @@
-
+
@@ -1584,7 +1584,7 @@
-
+
@@ -1605,7 +1605,7 @@
-
+
@@ -1636,7 +1636,7 @@
-
+
@@ -1659,7 +1659,7 @@
-
+
@@ -1690,7 +1690,7 @@
-
+
@@ -1711,7 +1711,7 @@
-
+
@@ -1742,7 +1742,7 @@
-
+
@@ -1764,7 +1764,7 @@
-
+
@@ -1795,7 +1795,7 @@
-
+
@@ -1826,7 +1826,7 @@
-
+
@@ -1857,7 +1857,7 @@
-
+
@@ -1877,7 +1877,7 @@
-
+
@@ -1898,7 +1898,7 @@
-
+
@@ -1929,7 +1929,7 @@
-
+
@@ -1960,7 +1960,7 @@
-
+
@@ -1991,7 +1991,7 @@
-
+
@@ -2022,7 +2022,7 @@
-
+
@@ -2043,7 +2043,7 @@
-
+
@@ -2074,7 +2074,7 @@
-
+
@@ -2109,7 +2109,7 @@
-
+
@@ -2129,7 +2129,7 @@
-
+
@@ -2150,7 +2150,7 @@
-
+
@@ -2171,7 +2171,7 @@
-
+
@@ -2202,7 +2202,7 @@
-
+
@@ -2222,7 +2222,7 @@
-
+
@@ -2253,7 +2253,7 @@
-
+
@@ -2274,7 +2274,7 @@
-
+
@@ -2305,7 +2305,7 @@
-
+
@@ -2328,7 +2328,7 @@
-
+
@@ -2359,7 +2359,7 @@
-
+
@@ -2380,7 +2380,7 @@
-
+
@@ -2411,7 +2411,7 @@
-
+
@@ -2433,7 +2433,7 @@
-
+
@@ -2464,7 +2464,7 @@
-
+
@@ -2495,7 +2495,7 @@
-
+
@@ -2526,7 +2526,7 @@
-
+
@@ -2546,7 +2546,7 @@
-
+
@@ -2567,7 +2567,7 @@
-
+
@@ -2598,7 +2598,7 @@
-
+
@@ -2629,7 +2629,7 @@
-
+
@@ -2660,7 +2660,7 @@
-
+
@@ -2691,7 +2691,7 @@
-
+
@@ -2712,7 +2712,7 @@
-
+
@@ -2743,7 +2743,7 @@
-
+
@@ -2778,7 +2778,7 @@
-
+
@@ -2798,7 +2798,7 @@
-
+
@@ -2819,7 +2819,7 @@
-
+
@@ -2840,7 +2840,7 @@
-
+
@@ -2871,7 +2871,7 @@
-
+
@@ -2891,7 +2891,7 @@
-
+
@@ -2922,7 +2922,7 @@
-
+
@@ -2943,7 +2943,7 @@
-
+
@@ -2974,7 +2974,7 @@
-
+
@@ -2997,7 +2997,7 @@
-
+
@@ -3028,7 +3028,7 @@
-
+
@@ -3049,7 +3049,7 @@
-
+
@@ -3080,7 +3080,7 @@
-
+
@@ -3102,7 +3102,7 @@
-
+
diff --git a/examples/A nimply B/models/B0converted.xml b/examples/A nimply B/models/B0converted.xml
new file mode 100644
index 0000000..31aeb62
--- /dev/null
+++ b/examples/A nimply B/models/B0converted.xml
@@ -0,0 +1,827 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/B1converted.xml b/examples/A nimply B/models/B1converted.xml
new file mode 100644
index 0000000..6908e4b
--- /dev/null
+++ b/examples/A nimply B/models/B1converted.xml
@@ -0,0 +1,1513 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/combined11.xml b/examples/A nimply B/models/combined11.xml
new file mode 100644
index 0000000..cdc68c5
--- /dev/null
+++ b/examples/A nimply B/models/combined11.xml
@@ -0,0 +1,3291 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/A nimply B/models/twoInput.xml b/examples/A nimply B/models/twoInput.xml
index 9def4a7..72690f0 100644
--- a/examples/A nimply B/models/twoInput.xml
+++ b/examples/A nimply B/models/twoInput.xml
@@ -1,5 +1,5 @@
-
+
@@ -14,11 +14,11 @@
-
+
-
-
+
+
diff --git a/examples/A nimply B/twoInput_subsystem.py b/examples/A nimply B/twoInput_subsystem.py
index 9bed8fa..59b85cf 100644
--- a/examples/A nimply B/twoInput_subsystem.py
+++ b/examples/A nimply B/twoInput_subsystem.py
@@ -1,26 +1,24 @@
-from modules.System import *
-from modules.Subsystem import *
-from modules.SimpleModel import *
-from modules.NewReaction import *
+from subsbml import *
# Create a System to hold the Subsystems
cell = System('cell')
# Create a new SBML Document to hold the subsystem model
-twoInput = cell.createNewSubsystem(3,1)
+twoInput = cell.createNewSubsystem()
# Create a new model inside the document
model = twoInput.createNewModel('in','second','mole','count')
# Creating the model object to use simple model creation commands that follow
simpleModel = SimpleModel(model)
-count = simpleModel.createNewUnitDefinition('count',UNIT_KIND_DIMENSIONLESS, 1, 0, 1)
-per_second = simpleModel.createNewUnitDefinition('per_second',UNIT_KIND_SECOND,-1,0,1)
+count = simpleModel.createNewUnitDefinition('count',libsbml.UNIT_KIND_DIMENSIONLESS, 1, 0, 1)
+per_second = simpleModel.createNewUnitDefinition('per_second',libsbml.UNIT_KIND_SECOND,-1,0,1)
simpleModel.createNewCompartment('cell','cell',1,'litre',True)
simpleModel.createNewSpecies('inputA','cell',0,False,'count')
simpleModel.createNewSpecies('inputB','cell',0,False,'count')
-writeSBML(twoInput.getSubsystemDoc(), 'models/twoInput.xml')
+if libsbml.writeSBML(twoInput.getSBMLDocument(), 'models/twoInput.xml'):
+ print('Successfully written SBML file')
diff --git a/examples/IPTG transport/Effect of alHL and deGFP.png b/examples/IPTG transport/Effect of alHL and deGFP.png
new file mode 100644
index 0000000..4803b20
Binary files /dev/null and b/examples/IPTG transport/Effect of alHL and deGFP.png differ
diff --git a/examples/IPTG transport/IPTG_membrane.py b/examples/IPTG transport/IPTG_membrane.py
index e7a84a5..0ad5279 100644
--- a/examples/IPTG transport/IPTG_membrane.py
+++ b/examples/IPTG transport/IPTG_membrane.py
@@ -18,10 +18,8 @@
simpleModel.createNewSpecies( 'protein alHL*','internal',0,False,'substance')
simpleModel.createNewSpecies( 'IPTG:protein alHL*','internal',0,False,'substance')
-simpleModel.createNewParameter( 'k1f',1,False,'per_second')
-simpleModel.createNewParameter( 'k1r',1,False,'per_second')
-
-simpleModel.createNewParameter( 'k2f',1,False,'per_second')
+simpleModel.createNewParameter( 'kb',2,False,'per_second')
+simpleModel.createNewParameter( 'kd',1,False,'per_second')
r1 = SimpleReaction(model.createReaction())
r1.setId('r1')
@@ -29,16 +27,16 @@
r1.createNewReactant('IPTG',False,1)
r1.createNewReactant('xxprotein_alHL', False, 1)
r1.createNewProduct('xxIPTG_protein_alHL', False, 1)
-math_r1 = r1.createMath('k1f * IPTG * xxprotein_alHL - k1r * xxIPTG_protein_alHL')
+math_r1 = r1.createMath('kb * IPTG * xxprotein_alHL - kd * xxIPTG_protein_alHL')
r1.createRate(math_r1)
r2 = SimpleReaction(model.createReaction())
r2.setId('r2')
-r2.setReversible(False)
+r2.setReversible(True)
r2.createNewReactant('xxIPTG_protein_alHL',False,1)
r2.createNewProduct('IPTG_1',False,1)
r2.createNewProduct('xxprotein_alHL',False,1)
-math_r2 = r2.createMath('k2f * xxIPTG_protein_alHL')
+math_r2 = r2.createMath('kd * xxIPTG_protein_alHL - kb * IPTG_1 * xxprotein_alHL')
r2.createRate(math_r2)
diff --git a/examples/IPTG transport/IPTG_transport.py b/examples/IPTG transport/IPTG_transport.py
deleted file mode 100644
index cce7adc..0000000
--- a/examples/IPTG transport/IPTG_transport.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from subsbml import *
-
-alHL = createSubsystem('models/alHL.xml')
-GFP = createSubsystem('models/GFP.xml')
-membrane = createSubsystem('models/IPTG_membrane.xml')
-
-external = createSubsystem('models/IPTG_reservoir.xml')
-
-cell = System('cell')
-
-cell.setInternal([alHL, GFP])
-cell.setExternal(external)
-
-cell.setMembrane(membrane)
-cell_model, cell_sub = cell.getModel()
-
-cell_sub.setSpeciesAmount('IPTG',0, 'cell_external')
-libsbml.writeSBML(cell_model,'models/cell_transport_model.xml')
-
-### If bioscrape is installed, uncomment the following to simulate the model. Otherwise, use your own preferred simulator with the SBML model generated above.
-timepoints = np.linspace(0,14*60*60,100)
-cell_sub.simulateVariableInputsBioscrape('IPTG',[0, 20, 30, 60, 80], ['protein deGFP*'], timepoints, 'reset', 'cell_external')
-
diff --git a/examples/IPTG transport/Varying alHL.png b/examples/IPTG transport/Varying alHL.png
new file mode 100644
index 0000000..9986f02
Binary files /dev/null and b/examples/IPTG transport/Varying alHL.png differ
diff --git a/examples/IPTG transport/main_IPTG_transport.py b/examples/IPTG transport/main_IPTG_transport.py
new file mode 100644
index 0000000..9994558
--- /dev/null
+++ b/examples/IPTG transport/main_IPTG_transport.py
@@ -0,0 +1,67 @@
+from subsbml import *
+import time
+alHL = createSubsystem('models/alHL.xml')
+GFP = createSubsystem('models/GFP.xml')
+membrane = createSubsystem('models/IPTG_membrane.xml')
+
+external = createSubsystem('models/IPTG_reservoir.xml')
+
+cell = System('cell')
+
+cell.setInternal([alHL, GFP])
+cell.setExternal(external)
+
+cell.setMembrane(membrane)
+cell_model, cell_sub = cell.getModel()
+
+cell_sub.setSpeciesAmount('IPTG',500, 'cell_external')
+# cell_sub.setSpeciesAmount('RNAP',50000000)
+# cell_sub.setSpeciesAmount('Ribo',50000000)
+libsbml.writeSBML(cell_model,'models/cell_transport_model.xml')
+print('######################### Model written successfully to an SBML file named "cell_transport_model" in the model subfolder. Different kinds of simulation options follow now###############################')
+time.sleep(3)
+# Simulations
+gfp = cell_sub.getSpeciesByName('protein deGFP*')
+timepoints = np.linspace(0,10*60*60,100)
+
+# Use Road Runner
+import roadrunner
+rr = roadrunner.RoadRunner('models/cell_transport_model.xml')
+# result = rr.simulate(0,10*60*60,100)
+result = rr.simulate(0,24*60*60,1000, selections= ['time', gfp.getId()])
+rr.plot()
+
+### If bioscrape is installed, uncomment the following to simulate the model. Otherwise, use your own preferred simulator with the SBML model generated above.
+cell_sub.simulateVariableInputs('IPTG',[0, 40, 60, 80, 100], ['protein deGFP*'], timepoints, Simulator = 'roadrunner', mode = 'reset', compartmentInput= 'cell_external',compartmentSpecies = 'cell_internal')
+# cell_sub.simulateVariableInputs('DNA pOR1OR2--utr1--alHL',[0, 5, 10, 100, 15, 30], ['IPTG'], timepoints, mode = 'reset', compartmentInput= 'cell_internal',compartmentSpecies = 'cell_internal')
+# cell_sub.simulateVariableInputs('DNA pOR1OR2--utr1--alHL',[0, 5, 10, 100, 15, 30], ['IPTG'], timepoints, mode = 'reset', compartmentInput= 'cell_internal',compartmentSpecies = 'cell_external')
+# cell_sub.simulateVariableInputs('DNA pOR1OR2--utr1--alHL',[6, 10, 15, 20], ['protein deGFP*'], timepoints, plotShow = 'single')
+# cell_sub.simulateVariableInputs('DNA pOR1OR2--utr1--alHL',[0,5, 10, 20, 100], ['protein deGFP*'],
+ # timepoints, mode = 'reset', compartmentInput = 'cell_internal', compartmentSpecies= 'cell_internal',
+ # plotShow = 'single', xlabel = 'time', ylabel = 'concentration',title = 'deGFP with varying DNA-alHL (without resource limits)',
+ # lineWidth = 2, sizeOfXLabels = 12, sizeOfYLabels = 12, legendFontSize= 8)
+# cell_sub.simulateVariableInputs(ListOfInputs = ['DNA plac--utr1--deGFP', 'DNA pOR1OR2--utr1--alHL'], ListOfListOfAmounts = [[5,5],[5,15],[5,25],[15,5],[15,15],[15,20],[20,5],[20,15],[20,25]], ListOfSpeciesToPlot = ['protein deGFP*'], timepoints = timepoints, mode = 'reset', compartmentInput = ['cell_internal','cell_internal'],compartmentSpecies= 'cell_internal', plotShow = 'matrix', xlabel = 'time', ylabel = 'concentration', lineWidth = 2, sizeOfXLabels = 12, sizeOfYLabels = 12, legendFontSize= 6)
+# cell_sub.simulateVariableInputs(ListOfInputs = ['DNA plac--utr1--deGFP', 'DNA pOR1OR2--utr1--alHL'], ListOfListOfAmounts = [[5,5],[5,10],[20,5],[20,10]], ListOfSpeciesToPlot = ['protein deGFP*'], timepoints = timepoints, mode = 'reset', plotShow = 'matrix', legendFontSize = 6)
+
+# More simulation options and optimizations in simulations
+
+# DNA_alHl = np.linspace(0,20,20)
+# DNA_gfp = np.linspace(0,20,20)
+# count = 0
+# max_data = []
+# for i in range(len(DNA_gfp)):
+# gfp = DNA_gfp[i]
+# for j in range(len(DNA_alHl)):
+# alhl = DNA_alHl[j]
+# count += 1
+# data, time, plt = cell_sub.simulateVariableInputs(['DNA plac--utr1--deGFP', 'DNA pOR1OR2--utr1--alHL'],
+# [[gfp,alhl]], ['protein deGFP*'], timepoints, plotShow = False)
+# max_data.append(max(data))
+
+# max_index = max_data.index(max(max_data))
+# n = len(DNA_alHl)
+# x = (max_index // n)
+# y = max_index % n
+# print(DNA_alHl, DNA_gfp)
+# print(max(max_data))
+# print('{0},{1}'.format(DNA_alHl[y],DNA_gfp[x] ))
diff --git a/examples/IPTG transport/models/IPTG_membrane.xml b/examples/IPTG transport/models/IPTG_membrane.xml
index 5839598..601e4f8 100644
--- a/examples/IPTG transport/models/IPTG_membrane.xml
+++ b/examples/IPTG transport/models/IPTG_membrane.xml
@@ -14,19 +14,18 @@
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
@@ -43,20 +42,20 @@
- k1f
+ kb
IPTG
xxprotein_alHL
- k1r
+ kd
xxIPTG_protein_alHL
-
+
@@ -67,9 +66,18 @@
diff --git a/examples/IPTG transport/models/IPTG_reservoir.xml b/examples/IPTG transport/models/IPTG_reservoir.xml
index f68d6eb..dc9e074 100644
--- a/examples/IPTG transport/models/IPTG_reservoir.xml
+++ b/examples/IPTG transport/models/IPTG_reservoir.xml
@@ -14,10 +14,10 @@
-
+
-
+
diff --git a/examples/IPTG transport/models/cell_transport_model.xml b/examples/IPTG transport/models/cell_transport_model.xml
index 52861c7..0340b9e 100644
--- a/examples/IPTG transport/models/cell_transport_model.xml
+++ b/examples/IPTG transport/models/cell_transport_model.xml
@@ -25,7 +25,7 @@
-
+
@@ -92,16 +92,15 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
@@ -2217,20 +2216,20 @@
- k1f
+ kb
IPTG_1_combined
mw8581196a_7c77_4da8_879e_f2c6f24b1932_1_combined
- k1r
+ kd
xxIPTG_protein_alHL
-
+
@@ -2241,9 +2240,18 @@
diff --git a/examples/IPTG transport/models/temp.xml b/examples/IPTG transport/models/temp.xml
new file mode 100644
index 0000000..70af540
--- /dev/null
+++ b/examples/IPTG transport/models/temp.xml
@@ -0,0 +1,2335 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/IPTG transport/models/temp_simulate.xml b/examples/IPTG transport/models/temp_simulate.xml
index 2ec0ac9..e9e75e0 100644
--- a/examples/IPTG transport/models/temp_simulate.xml
+++ b/examples/IPTG transport/models/temp_simulate.xml
@@ -28,6 +28,142 @@
+<<<<<<< HEAD:examples/IPTG transport/models/temp_simulate.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+||||||| merged common ancestors
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+=======
@@ -94,14 +230,19 @@
+>>>>>>> 9eb45918691ab2422a75ffe6141f35cef71bae4d:examples/IPTG transport/models/temp_simulate.xml
+<<<<<<< HEAD:examples/IPTG transport/models/temp_simulate.xml
+
+||||||| merged common ancestors
+=======
+>>>>>>> 9eb45918691ab2422a75ffe6141f35cef71bae4d:examples/IPTG transport/models/temp_simulate.xml
-
-
-
+
+
@@ -2217,20 +2358,36 @@
+<<<<<<< HEAD:examples/IPTG transport/models/temp_simulate.xml
+ kb
+ IPTG_1_combined
+ mw8581196a_7c77_4da8_879e_f2c6f24b1932_1_combined
+||||||| merged common ancestors
+ k1f
+ IPTG_SS3_1_combined
+ mw8581196a_7c77_4da8_879e_f2c6f24b1932_SS1_1_combined
+=======
k1f
IPTG_1_combined
mw8581196a_7c77_4da8_879e_f2c6f24b1932_1_combined
+>>>>>>> 9eb45918691ab2422a75ffe6141f35cef71bae4d:examples/IPTG transport/models/temp_simulate.xml
- k1r
+ kd
xxIPTG_protein_alHL
+<<<<<<< HEAD:examples/IPTG transport/models/temp_simulate.xml
+
+||||||| merged common ancestors
+
+=======
+>>>>>>> 9eb45918691ab2422a75ffe6141f35cef71bae4d:examples/IPTG transport/models/temp_simulate.xml
@@ -2241,9 +2398,18 @@
diff --git a/subsbml/SimpleModel.py b/subsbml/SimpleModel.py
index 6521b27..776e8f6 100644
--- a/subsbml/SimpleModel.py
+++ b/subsbml/SimpleModel.py
@@ -43,8 +43,8 @@ def createNewUnitDefinition(self, uid, ukind, exponent, scale = 0, multiplier =
Creates a new UnitDefinition inside the
Model with the given attributes and returns a pointer to the new libSBML object created
'''
- if type(uid) is not str or type(scale) is not int or type(multiplier) is not int:
- raise ValueError('The arguments are not of expected type. uid must be a string of valid SId format and all others must be integers')
+ if type(uid) is not str:
+ raise ValueError('The arguments are not of expected type. uid must be a string of valid SId format')
model = self.getModel()
check(model,'retreiving libSBML model object')
@@ -167,7 +167,10 @@ def createNewSpecies(self, ListOfSpecies, sComp, ListOfAmounts, sConstant, sSubs
check(s_obj.setId(sId), 'set s_obj ID')
check(s_obj.setName(sName), 'set s_obj name')
check(s_obj.setCompartment(sComp), 'set s_obj compartment')
- check(s_obj.setInitialAmount(sInitial), 'set s_obj initial amount')
+ if sHasOnlySubstance:
+ check(s_obj.setInitialAmount(sInitial), 'set s_obj initial amount')
+ else:
+ check(s_obj.setInitialConcentration(sInitial), 'set s_obj initial amount')
check(s_obj.setConstant(sConstant), 'set s_obj constant')
check(s_obj.setBoundaryCondition(sBoundary),
'set boundary s_obj condition false')
diff --git a/subsbml/Subsystem.py b/subsbml/Subsystem.py
index 6537136..7b07ace 100644
--- a/subsbml/Subsystem.py
+++ b/subsbml/Subsystem.py
@@ -133,7 +133,7 @@ def convertSubsystemLevelAndVersion(self, newLevel, newVersion):
check(document.setLevelAndVersion(newLevel,newVersion), 'converting SBMLDocument to new level and version')
# To check errors, uncomment:
# if document.getNumErrors():
- # print(document.printErrors())
+ # print(' The SBML document has errors {0}'.format(document.printErrors()))
# raise ValueError('Invalid SBMLDocument error.')
# else:
# return self.getSBMLDocument()
@@ -499,8 +499,7 @@ def shareSubsystems(self, ListOfSubsystems, ListOfSharedResources, mode = 'virtu
raise ValueError('All objects in ListOfSubsystems input argument list must be Subsystem objects')
# Merge all other components first and then add species
- self.mergeSubsystemModels(ListOfSubsystems)
- model = self.getSBMLDocument().getModel()
+ model = self.mergeSubsystemModels(ListOfSubsystems).getModel()
check(model,'retreiving model in shareSubsystems')
mod_id = ''
total_size = 0
@@ -570,9 +569,7 @@ def combineSubsystems(self, ListOfSubsystems, mode = 'virtual', combineNames = T
total_size = 0
for subsystem in ListOfSubsystems:
total_size += subsystem.getSBMLDocument().getModel().getCompartment(0).getSize()
-
- self.mergeSubsystemModels(ListOfSubsystems)
- model = self.getSBMLDocument().getModel()
+ model = self.mergeSubsystemModels(ListOfSubsystems).getModel()
check(model,'retreiving model in combineSubsystems')
mod_id = ''
@@ -1619,30 +1616,30 @@ def setSpeciesAmount(self, inputSpecies, amount, comp_name = ''):
'''
if comp_name == '':
if type(inputSpecies) is list:
- for inp_sp in inputSpecies:
+ for inp_sp,amt in zip(inputSpecies,amount):
if type(inp_sp) is not str:
raise ValueError('All items of inputSpecies must be strings.')
sp = self.getSpeciesByName(inp_sp)
if type(sp) is list:
for s_i in sp:
- if type(amount) is not float and type(amount) is not int:
+ if not isinstance(amt, (float,int)):
raise ValueError('The amount should be either a float or an int')
- check(s_i.setInitialAmount(amount),'setting initial amount to 0 in connectSubsystem')
+ check(s_i.setInitialAmount(amt),'setting initial amount to 0 in connectSubsystem')
else:
- if type(amount) is not float and type(amount) is not int:
+ if not isinstance(amt, (float,int)):
raise ValueError('The amount should be either a float or an int')
- check(sp.setInitialAmount(amount),'setting initial amount')
+ check(sp.setInitialAmount(amt),'setting initial amount')
else:
if type(inputSpecies) is not str:
raise ValueError('inputSpecies argument must be a string or a list of strings.')
sp = self.getSpeciesByName(inputSpecies)
if type(sp) is list:
for s_i in sp:
- if type(amount) is not float and type(amount) is not int:
+ if not isinstance(amt, (float,int)):
raise ValueError('The amount should be either a float or an int')
check(s_i.setInitialAmount(amount),'setting initial amount')
else:
- if type(amount) is not float and type(amount) is not int:
+ if not isinstance(amt, (float,int)):
raise ValueError('The amount should be either a float or an int')
check(sp.setInitialAmount(amount),'setting initial amount')
else:
@@ -1903,6 +1900,31 @@ def unsetReversibleReactions(self, indexList, rateFormulaList = None):
# else:
# species.setInitialAmount(0)
# return reducedSubsystem
+ def simulateRoadRunner(self, initialTime, timepoints):
+ '''
+ To simulate a Subsystem without generating the plot.
+ Returns the data for all species which can be used to find out species indexes.
+ NOTE : Needs RoadRunner package installed to simulate.
+ '''
+ filename = 'models/temp.xml'
+ libsbml.writeSBML(self.getSBMLDocument(), filename)
+ m = bioscrape.types.read_model_from_sbml(filename)
+ s = bioscrape.simulator.ModelCSimInterface(m)
+ s.py_prep_deterministic_simulation()
+ s.py_set_initial_time(initialTime)
+ sim = bioscrape.simulator.DeterministicSimulator()
+ result = sim.py_simulate(s, timepoints)
+ return result.py_get_result(), m
+
+ def plotRoadRunner(self, ListOfSpeciesToPlot, timepoints, xlabel = 'Time', ylabel = 'Concentration (AU)', sizeOfXLabels = 14, sizeOfYLabels = 14):
+ '''
+ To plot a Subsystem model using RoadRunner.
+ NOTE : Needs RoadRunner package installed to plot the Subsystem
+ TODO : Not Implemented
+ '''
+ filename = 'models/temp.xml'
+ libsbml.writeSBML(self.getSBMLDocument(), filename)
+ # plotRoadRunner(filename, timepoints[0], timepoints, ListOfSpeciesToPlot, xlabel, ylabel, sizeOfXLabels, sizeOfYLabels)
def simulateBioscrape(self, initialTime, timepoints):
'''
@@ -1910,7 +1932,7 @@ def simulateBioscrape(self, initialTime, timepoints):
Returns the data for all species and bioscrape model object which can be used to find out species indexes.
NOTE : Needs bioscrape package installed to simulate.
'''
- filename = 'models/temp_simulate.xml'
+ filename = 'models/temp.xml'
libsbml.writeSBML(self.getSBMLDocument(), filename)
m = bioscrape.types.read_model_from_sbml(filename)
s = bioscrape.simulator.ModelCSimInterface(m)
@@ -1925,11 +1947,14 @@ def plotBioscrape(self, ListOfSpeciesToPlot, timepoints, xlabel = 'Time', ylabel
To plot a Subsystem model using bioscrape.
NOTE : Needs bioscrape package installed to plot the Subsystem
'''
- filename = 'models/temp_plot.xml'
+ filename = 'models/temp.xml'
libsbml.writeSBML(self.getSBMLDocument(), filename)
- plotSbmlWithBioscrape(filename, timepoints[0], timepoints, ListOfSpeciesToPlot, xlabel, ylabel, sizeOfXLabels, sizeOfYLabels)
+ plotSbmlWithBioscrape(filename, timepoints[0], timepoints, ListOfSpeciesToPlot, xlabel = xlabel, ylabel = ylabel, sizeOfXLabels = sizeOfXLabels, sizeOfYLabels = sizeOfYLabels)
- def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, ListOfSpeciesToPlot, timepoints, mode = 'reset', compartmentInput = '', compartmentSpecies = '', plotShow = True, xlabel = 'Time', ylabel = 'Concentration (AU)', lineWidth = 2, sizeOfXLabels = 16, sizeOfYLabels = 16, legendFontSize = 14):
+ # def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, ListOfSpeciesToPlot, timepoints, mode = 'reset', compartmentInput = '', compartmentSpecies = '',
+ # plotShow = 'single', xlabel = 'Time', ylabel = 'Concentration (AU)', title = '', lineWidth = 2, sizeOfXLabels = 16, sizeOfYLabels = 16, legendFontSize = 14):
+ def simulateVariableInputs(self, ListOfInputs, ListOfListOfAmounts, ListOfSpeciesToPlot, timepoints, **kwargs):
+
''''
Simulates the Subsystem model with the input species amounts varying
Mode : continue - Continues simulation from the simulation data of the previous simulation of the variable value
@@ -1939,6 +1964,47 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
Returns data, time vectors post simulation
NOTE : Needs bioscrape package installed to simulate.
'''
+ # Default values
+ Simulator = 'roadrunner'
+ mode = 'reset'
+ compartmentInput = ''
+ compartmentSpecies = ''
+ plotShow = 'single'
+ compartmentSpecies = ''
+ xlabel = 'Time'
+ ylabel = 'Concentration'
+ title = 'Varying ' + str(ListOfInputs) + ' over ' + str(ListOfListOfAmounts) + ' and plotting ' + str(ListOfSpeciesToPlot)
+ lineWidth = 2
+ sizeOfXLabels = 16
+ sizeOfYLabels = 16
+ legendFontSize = 12
+
+ for key, value in kwargs.items():
+ if key == 'mode':
+ mode = value
+ if key == 'compartmentInput':
+ compartmentInput = value
+ if key == 'compartmentSpecies':
+ compartmentSpecies = value
+ if key == 'plotShow':
+ plotShow = value
+ if key == 'xlabel':
+ xlabel = value
+ if key == 'ylabel':
+ ylabel = value
+ if key == 'title':
+ title = value
+ if key == 'lineWidth':
+ lineWidth = value
+ if key == 'sizeOfXLabels':
+ sizeOfXLabels = value
+ if key == 'sizeOfYLabels':
+ sizeOfYLabels = value
+ if key == 'legendFontSize':
+ legendFontSize = value
+ if key == 'Simulator':
+ Simulator = value
+
model = self.getSBMLDocument().getModel()
simpleModel = SimpleModel(model)
species_list = []
@@ -1946,16 +2012,22 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
total_time = {}
if type(ListOfSpeciesToPlot) is str:
ListOfSpeciesToPlot = [ListOfSpeciesToPlot]
-
SpeciesToPlot = ListOfSpeciesToPlot[:]
- for species_name in ListOfSpeciesToPlot:
+ for i in range(len(ListOfSpeciesToPlot)):
+ species_name = ListOfSpeciesToPlot[i]
species = simpleModel.getSpeciesByName(species_name)
+ if type(compartmentSpecies) is list:
+ compartment = compartmentSpecies[i]
+ elif type(compartmentSpecies) is str and compartmentSpecies != '':
+ compartment = compartmentSpecies
+ else:
+ compartment = ''
if type(species) is list:
warnings.warn('There are multiple species with the name ' + species_name + 'Suffixed species will be plotted ')
for species_i in species:
- if compartmentSpecies != '' and model.getElementBySId(species_i.getCompartment()).getName() != compartmentSpecies:
+ if model.getElementBySId(species_i.getCompartment()).getName() != compartment and compartment != '':
continue
- elif compartmentSpecies != '' and model.getElementBySId(species_i.getCompartment()).getName() == compartmentSpecies:
+ elif model.getElementBySId(species_i.getCompartment()).getName() == compartment and compartment != '':
species_list.append(species_i.getId())
else:
species_list.append(species_i.getId())
@@ -1963,7 +2035,6 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
if mode == 'continue':
total_time[species_i.getId()] = []
else:
- total_time = []
total_time = timepoints
key_ind = ListOfSpeciesToPlot.index(species_name)
insert_new = []
@@ -1971,9 +2042,9 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
insert_new.append(species_name + str(j+1))
SpeciesToPlot[key_ind+1:key_ind+1] = insert_new
else:
- if compartmentSpecies != '' and model.getElementBySId(species.getCompartment()).getName() != compartmentSpecies:
+ if model.getElementBySId(species.getCompartment()).getName() != compartment and compartment != '':
continue
- elif compartmentSpecies != '' and model.getElementBySId(species.getCompartment()).getName() == compartmentSpecies:
+ elif model.getElementBySId(species.getCompartment()).getName() == compartment and compartment != '':
species_list.append(species.getId())
else:
species_list.append(species.getId())
@@ -1981,7 +2052,6 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
if mode == 'continue':
total_time[species.getId()] = []
else:
- total_time = []
total_time = timepoints
initialTime = timepoints[0]
t_end = timepoints[-1]
@@ -1999,7 +2069,6 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
species_inp = simpleModel.getSpeciesByName(input, compartmentInput)
else:
species_inp = simpleModel.getSpeciesByName(input)
-
if type(species_inp) is list:
raise ValueError('Multiple input species found in the model for the input name given.')
for amount in ListOfListOfAmounts:
@@ -2021,19 +2090,28 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
for species in model.getListOfSpecies():
species.setInitialAmount(data[:,m.get_species_index(species.getId())][-1])
- else:
+ elif type(ListOfInputs) is list:
t = initialTime
ListOfSpecies = []
+ for i in range(len(ListOfListOfAmounts)):
+ if (type(ListOfListOfAmounts[i]) is not list):
+ raise ValueError('For multiple inputs, all items of ListOfListOfAmounts argument should be list type')
+ if type(compartmentInput) is list:
+ if len(ListOfInputs) != len(compartmentInput):
+ raise ValueError('The length of compartmentInput argument when it is a list must be equal to the length of ListOfInputs argument')
for i in range(len(ListOfInputs)):
input = ListOfInputs[i]
- species_inp = simpleModel.getSpeciesByName(input)
+ if compartmentInput != '':
+ compartment = compartmentInput[i]
+ species_inp = simpleModel.getSpeciesByName(input, compartment)
+ else:
+ species_inp = simpleModel.getSpeciesByName(input)
if type(species_inp) is list:
raise ValueError('Multiple input species found in the model.')
ListOfSpecies.append(species_inp)
- for i in range(len(ListOfListOfAmounts)):
- if (type(ListOfListOfAmounts[i]) is not list) or (len(ListOfListOfAmounts[i]) != len(ListOfInputs)) :
- raise ValueError('For multiple inputs, all items of ListOfListOfAmounts attribute should be lists of length same as the number of inputs')
for j in range(len(ListOfListOfAmounts)):
+ if len(ListOfListOfAmounts[j]) != len(ListOfInputs):
+ raise ValueError('For multiple inputs, the length of each item in ListOfListOfAmounts must be same as the length of ListOfInputs')
for amount, species in zip(ListOfListOfAmounts[j], ListOfSpecies):
# Start simulating and create data
check(species.setInitialAmount(amount), 'setting initial amount to input species')
@@ -2049,6 +2127,8 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
if mode == 'continue':
for species in model.getListOfSpecies():
species.setInitialAmount(data[:,m.get_species_index(species.getId())][-1])
+ else:
+ raise SyntaxError('ListOfInputs argument must be a list of strings or a string')
pl = []
for s in range(len(species_list)):
@@ -2066,7 +2146,7 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
finalData.append(i)
finalTime = total_time
- if plotShow:
+ if plotShow == 'single':
for i in range(len(ListOfListOfAmounts)):
if mode == 'continue':
legend_str = species_name + ' for ' + str(ListOfListOfAmounts[i]) + ' ' + ylabel + ' of ' + str(ListOfInputs)
@@ -2079,13 +2159,38 @@ def simulateVariableInputsBioscrape(self, ListOfInputs, ListOfListOfAmounts, Lis
legend_str = species_name + ' for ' + str(ListOfListOfAmounts[i]) + ' ' + ylabel + ' of ' + str(ListOfInputs)
p1, = plt.plot(finalTime, finalData[t0:tn], label = legend_str, linewidth = lineWidth)
pl.append(p1)
-
- if plotShow:
+ elif plotShow == 'matrix':
+ for i in range(len(ListOfListOfAmounts)):
+ plt.subplot(np.ceil(len(ListOfListOfAmounts)/3),3,i+1)
+ if mode == 'continue':
+ legend_str = species_name + ' for ' + str(ListOfListOfAmounts[i]) + ' ' + ylabel + ' of ' + str(ListOfInputs)
+ p1, = plt.plot(finalTime, finalData, label = legend_str, linewidth = lineWidth)
+ plt.legend(prop = {'size':legendFontSize})
+ mpl.rc('xtick', labelsize= sizeOfXLabels)
+ mpl.rc('ytick', labelsize = sizeOfYLabels)
+ plt.xlabel(xlabel)
+ plt.ylabel(ylabel)
+ plt.title(title)
+ else:
+ t0 = i*len(finalTime)
+ tn = (i+1)*len(finalTime)
+ legend_str = species_name + ' for \n ' + str(ListOfListOfAmounts[i]) + ' ' + ylabel + ' of \n ' + str(ListOfInputs)
+ p1, = plt.plot(finalTime, finalData[t0:tn], label = legend_str, linewidth = lineWidth)
+ plt.legend(prop = {'size':legendFontSize})
+ mpl.rc('xtick', labelsize= sizeOfXLabels)
+ mpl.rc('ytick', labelsize = sizeOfYLabels)
+ plt.xlabel(xlabel)
+ plt.ylabel(ylabel)
+ plt.title(title)
+ plt.subplot_tool()
+ plt.show()
+ if plotShow == 'single':
plt.legend(prop = {'size':legendFontSize})
mpl.rc('xtick', labelsize= sizeOfXLabels)
mpl.rc('ytick', labelsize=sizeOfYLabels)
plt.xlabel(xlabel)
plt.ylabel(ylabel)
+ plt.title(title)
plt.show()
return finalData, finalTime, plt
diff --git a/subsbml/System.py b/subsbml/System.py
index f892b77..4c24581 100644
--- a/subsbml/System.py
+++ b/subsbml/System.py
@@ -225,8 +225,6 @@ def createSubsystem(self, filename, subsystemName = ''):
subsystem.setSystem(self)
if subsystem.getSBMLDocument().getLevel() != latestLevel or subsystem.getSBMLDocument().getVersion() != latestVersion:
warnings.warn('Subsystem SBML model is not the latest. Converting to latest SBML level and version')
- print(subsystem.getSBMLDocument().getVersion())
- print(subsystem.getSBMLDocument().getModel().getId())
subsystem.convertSubsystemLevelAndVersion(latestLevel,latestVersion)
subsystem.suffixAllElementIds(subsystemName)
if model.getNumCompartments() == 0:
diff --git a/tutorials/models/DP.xml b/tutorials/models/DP.xml
index f15a754..a8b0d48 100644
--- a/tutorials/models/DP.xml
+++ b/tutorials/models/DP.xml
@@ -14,18 +14,18 @@
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -42,7 +42,7 @@
-
+
@@ -87,7 +87,7 @@
-
+
@@ -114,7 +114,7 @@
-
+
@@ -132,7 +132,7 @@
-
+
@@ -159,7 +159,7 @@
-
+
@@ -177,7 +177,7 @@
-
+
@@ -204,7 +204,7 @@
-
+
diff --git a/tutorials/models/DP_IFFL_combined.xml b/tutorials/models/DP_IFFL_combined.xml
index f926cd2..b43488b 100644
--- a/tutorials/models/DP_IFFL_combined.xml
+++ b/tutorials/models/DP_IFFL_combined.xml
@@ -14,34 +14,34 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -73,7 +73,7 @@
-
+
@@ -118,7 +118,7 @@
-
+
@@ -145,7 +145,7 @@
-
+
@@ -163,7 +163,7 @@
-
+
@@ -190,7 +190,7 @@
-
+
@@ -208,7 +208,7 @@
-
+
@@ -235,7 +235,7 @@
-
+
diff --git a/tutorials/models/DP_IFFL_connected.xml b/tutorials/models/DP_IFFL_connected.xml
index 195f590..2981059 100644
--- a/tutorials/models/DP_IFFL_connected.xml
+++ b/tutorials/models/DP_IFFL_connected.xml
@@ -14,33 +14,33 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -72,7 +72,7 @@
-
+
@@ -117,7 +117,7 @@
-
+
@@ -144,7 +144,7 @@
-
+
@@ -162,7 +162,7 @@
-
+
@@ -189,7 +189,7 @@
-
+
@@ -207,7 +207,7 @@
-
+
@@ -234,7 +234,7 @@
-
+
@@ -252,7 +252,7 @@
-
+
@@ -270,7 +270,7 @@
-
+
diff --git a/tutorials/models/DP_IFFL_shared.xml b/tutorials/models/DP_IFFL_shared.xml
index 5d20291..dbe7701 100644
--- a/tutorials/models/DP_IFFL_shared.xml
+++ b/tutorials/models/DP_IFFL_shared.xml
@@ -14,41 +14,41 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -101,7 +101,7 @@
-
+
@@ -146,7 +146,7 @@
-
+
@@ -173,7 +173,7 @@
-
+
@@ -191,7 +191,7 @@
-
+
@@ -218,7 +218,7 @@
-
+
@@ -236,7 +236,7 @@
-
+
@@ -263,7 +263,7 @@
-
+
@@ -281,7 +281,7 @@
-
+
@@ -326,7 +326,7 @@
-
+
@@ -353,7 +353,7 @@
-
+
@@ -371,7 +371,7 @@
-
+
@@ -398,7 +398,7 @@
-
+
@@ -416,7 +416,7 @@
-
+
@@ -443,7 +443,7 @@
-
+
diff --git a/tutorials/models/DP_extended.xml b/tutorials/models/DP_extended.xml
index 072b6f6..8b46350 100644
--- a/tutorials/models/DP_extended.xml
+++ b/tutorials/models/DP_extended.xml
@@ -14,18 +14,18 @@
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -83,7 +83,7 @@
-
+
@@ -128,7 +128,7 @@
-
+
@@ -155,7 +155,7 @@
-
+
@@ -173,7 +173,7 @@
-
+
@@ -200,7 +200,7 @@
-
+
@@ -218,7 +218,7 @@
-
+
@@ -245,7 +245,7 @@
-
+
diff --git a/tutorials/models/IFFL.xml b/tutorials/models/IFFL.xml
index d4871dc..cdda479 100644
--- a/tutorials/models/IFFL.xml
+++ b/tutorials/models/IFFL.xml
@@ -14,25 +14,25 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+