|
27 | 27 | "source": [ |
28 | 28 | "## Combining Species and Reactions into a CRN\n", |
29 | 29 | "\n", |
30 | | - "The following code defines a species called 'S' made out of material 'material'. Species can also have attributes to help identify them. Note that Species with the same name, but different materials or attributes are considered different species in terms of the reactions they participate in.\n", |
| 30 | + "The following code defines a species called 'S' made out of material 'material'. Species can also have attributes to help identify them. Note that species with the same name, but different materials or attributes are considered different species in terms of the reactions they participate in.\n", |
31 | 31 | "\n", |
32 | 32 | " S = Species('name', material_type='material', attributes=[])\n", |
33 | 33 | "\n", |
34 | | - "The collowing code produces a reaction R\n", |
| 34 | + "The following code produces a mass action reaction R\n", |
35 | 35 | " \n", |
36 | | - " R = Reaction(Inputs, Outputs, k)\n", |
| 36 | + " R = Reaction.from_mass_action(inputs, outputs, k)\n", |
37 | 37 | "\n", |
38 | | - "here `Inputs` and `Outputs` must both be a list of `Species`. The parameter `k` is the rate constant of the reaction. By default, propensities in BioCRNpyler are massa ction:\n", |
| 38 | + "where `inputs` and `outputs` must both be a list of `Species`. The parameter `k` is the rate constant of the reaction. By default, propensities in BioCRNpyler are mass action:\n", |
39 | 39 | "\n", |
40 | | - "### $\\rho(S) = k \\Pi_{s} s^{I_s}$\n", |
| 40 | + "$$\\rho(S) = k \\Pi_{s} s^{I_s}$$\n", |
41 | 41 | "\n", |
42 | 42 | "Note: for stochastic models mass action propensities are $\\rho(S) = k \\Pi_{s} s!/(s - I_s)!$.\n", |
43 | 43 | "\n", |
44 | | - "Mass action reactions can be made reversible with the `k_rev` keyword:\n", |
| 44 | + "Mass action reactions can be made reversible with the `k_reverse` keyword:\n", |
45 | 45 | "\n", |
46 | | - " R_reversible = Reaction(Inputs, Outputs, k, k_rev = krev)\n", |
| 46 | + " R_reversible = Reaction.from_mass_action(inputs, outputs, k, k_reverse=krev)\n", |
47 | 47 | "\n", |
48 | | - "is the same as two reactions:\n", |
49 | | - "\n", |
50 | | - " R = Reaction(Inputs, Outputs, k)\n", |
51 | | - " Rrev = Reaction(Outputs, Inputs, krev)\n", |
| 48 | + "This is the same as two reactions:\n", |
52 | 49 | "\n", |
| 50 | + " R = Reaction.from_mass_action(inputs, outputs, k)\n", |
| 51 | + " Rrev = Reaction.from_mass_action(outputs, inputs, krev)\n", |
53 | 52 | "\n", |
54 | 53 | "Finally, a CRN can be made by combining species and reactions:\n", |
55 | 54 | "\n", |
56 | 55 | " CRN = ChemicalReactionNetwork(species=species, reactions=reactions, initial_condition_dict={})\n", |
57 | 56 | "\n", |
58 | | - "Here, `initial_condition_dict` is an optional dictionary to store the initial values of different species. \n", |
| 57 | + "Here, `initial_condition_dict` is an optional dictionary to store the initial values of different species: \n", |
59 | 58 | "\n", |
60 | 59 | " initial_condition_dict = {Species: value}\n", |
61 | 60 | "\n", |
|
226 | 225 | "\n", |
227 | 226 | "This function returns the classes ComplexSpecies or OrderedComplexSpecies subclasses which contain information about the species inside of them. ComplexSpecies treats its internal species as an unordered multiset. OrderedComplexSpecies treats its internal species as an ordered list. It is recommended to always use the function Complex to create these types of Species for compatability reasons discussed in the OrderedPolymerSpecies example notebook.\n", |
228 | 227 | "\n", |
229 | | - "_Note: These objects do not automatically generate binding reactions. To do that, use the Component wrappers ChemicalComplex and OrderedChemicalComplex._" |
| 228 | + "*Note: These objects do not automatically generate binding reactions. To do that, use the Component wrappers `ChemicalComplex` and `OrderedChemicalComplex`.*" |
230 | 229 | ] |
231 | 230 | }, |
232 | 231 | { |
|
287 | 286 | "metadata": {}, |
288 | 287 | "source": [ |
289 | 288 | "## Non-mass action propensities in BioCRNpyler\n", |
290 | | - "By default, BioCRNpyler assumes that propensities are mass action with only one parameter, the rate constant $k_{forward}$ (and optional reverse rate $k_{reverse}$. However, additional propensity types are also supported. These reactions are created in two steps: first a `Propensity` of the appropriate type is made, then a `Reaction` is made using that `Propensity`. These reactions are always created irreversibly. Examples are shown below:" |
| 289 | + "By default, BioCRNpyler assumes that propensities are mass action with only one parameter, the rate constant $k_\\text{forward}$ (and optional reverse rate $k_\\text{reverse}$. However, additional propensity types are also supported. These reactions are created in two steps: first a `Propensity` of the appropriate type is made, then a `Reaction` is made using that `Propensity`. These reactions are always created irreversibly. Examples are shown below:" |
291 | 290 | ] |
292 | 291 | }, |
293 | 292 | { |
294 | 293 | "cell_type": "markdown", |
295 | 294 | "metadata": {}, |
296 | 295 | "source": [ |
297 | | - "## HillPositive: \n", |
| 296 | + "### HillPositive: \n", |
298 | 297 | "$\\rho(s) = k \\frac{s_1^n}{K^n+s_1^n}$\n", |
299 | 298 | "\n", |
300 | 299 | "Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, and hill species $s_1$." |
|
336 | 335 | "cell_type": "markdown", |
337 | 336 | "metadata": {}, |
338 | 337 | "source": [ |
339 | | - "## HillNegative: \n", |
| 338 | + "### HillNegative: \n", |
340 | 339 | "$\\rho(s) = k \\frac{1}{K^n+s_1^n}$\n", |
341 | 340 | "\n", |
342 | 341 | "Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, and Hill species $s_1$." |
|
376 | 375 | "cell_type": "markdown", |
377 | 376 | "metadata": {}, |
378 | 377 | "source": [ |
379 | | - "## ProportionalHillPositive: \n", |
| 378 | + "### ProportionalHillPositive: \n", |
380 | 379 | "$\\rho(s, d) = k d \\frac{s_1^n}{K^n + s_1^n}$\n", |
381 | 380 | "\n", |
382 | 381 | "Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, Hill species $s_1$, and proportional species $d$." |
|
418 | 417 | "cell_type": "markdown", |
419 | 418 | "metadata": {}, |
420 | 419 | "source": [ |
421 | | - "## ProportionalHillNegative: \n", |
| 420 | + "### ProportionalHillNegative: \n", |
422 | 421 | "$\\rho(s, d) = k d \\frac{1}{K^n + s_1^n}$\n", |
423 | 422 | "\n", |
424 | 423 | "Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, Hill species $s_1$, and proportional species $d$." |
|
460 | 459 | "cell_type": "markdown", |
461 | 460 | "metadata": {}, |
462 | 461 | "source": [ |
463 | | - "## General Propensity: \n", |
464 | | - "$\\rho(s) = $ function of your choice\n", |
| 462 | + "### General Propensity: \n", |
| 463 | + "$\\rho(s) = \\text{function of your choice}$\n", |
465 | 464 | "\n", |
466 | 465 | "For general propensities, the function must be written out as a string with all species and parameters declared." |
467 | 466 | ] |
|
0 commit comments