pycotools3.model.BuildAntimony¶
-
class
pycotools3.model.
BuildAntimony
(copasi_file: str)[source]¶ Build a copasi model using antimony
A context manager to create a copasi model copasi_file using the antimony language
Examples
working_directory = os.path.dirname(__file__) copasi_filename = os.path.join(working_directory, 'NegativeFeedbackModel.cps') with model.BuildAntimony(copasi_filename) as loader: negative_feedback = loader.load( ''' model negative_feedback() // define compartments compartment cell = 1.0 //define species var A in cell var B in cell //define some global parameter for use in reactions vAProd = 0.1 kADeg = 0.2 kBProd = 0.3 kBDeg = 0.4 //define initial conditions A = 0 B = 0 //define reactions AProd: => A; cell*vAProd ADeg: A =>; cell*kADeg*A*B BProd: => B; cell*kBProd*A BDeg: B => ; cell*kBDeg*B end ''' ) print(negative_feedback)
-
__init__
(copasi_file: str)[source]¶ Parameters: copasi_file (str) – Path to a valid location on disk to store the copasi file
Methods
__init__
(copasi_file)param copasi_file: Path to a valid location on disk to store the copasi file load
(antimony_str)Load the antimony string antimony_str
into acopasi_file
andModel
.-
load
(antimony_str)[source]¶ Load the antimony string
antimony_str
into acopasi_file
andModel
.- Args
- antimony_str (str): A valid antimony string encoding a model
- return
- model (
Model
) - A PyCoTools model containing the model defined in the :parameter:`antiomny_str`.
- model (
Parameters: antimony_str – Returns:
-