Skip to content

Commit f861989

Browse files
committed
clean up tutorials and remove sphinx formating/sectioning errors
1 parent dcf076b commit f861989

8 files changed

Lines changed: 299 additions & 557 deletions

docs/examples/2. Membrane Models.ipynb

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/tutorials.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ BioCRNpyler Tutorials
55
The following Jupyter notebooks provide a set of tutorial
66
introductions to BioCRNpyler functionality.
77

8-
.. note::
9-
10-
The tutorials here should probably eventually become independent
11-
chapters in the User Guide.
12-
138
.. toctree::
149
:maxdepth: 1
1510

@@ -28,7 +23,6 @@ In addition, the following specialized tutorials are available.
2823
:maxdepth: 1
2924

3025
examples/1. Combinatorial Promoters.ipynb
31-
examples/2. Membrane Models.ipynb
3226
examples/3. Multiple Occupancy in TX-TL.ipynb
3327
examples/4. Combinatorial Conformation Modeling.ipynb
3428
examples/5. TX-TL Toolbox.ipynb

examples/1. Building CRNs Directly.ipynb

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,34 @@
2727
"source": [
2828
"## Combining Species and Reactions into a CRN\n",
2929
"\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",
3131
"\n",
3232
" S = Species('name', material_type='material', attributes=[])\n",
3333
"\n",
34-
"The collowing code produces a reaction R\n",
34+
"The following code produces a mass action reaction R\n",
3535
" \n",
36-
" R = Reaction(Inputs, Outputs, k)\n",
36+
" R = Reaction.from_mass_action(inputs, outputs, k)\n",
3737
"\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",
3939
"\n",
40-
"### $\\rho(S) = k \\Pi_{s} s^{I_s}$\n",
40+
"$$\\rho(S) = k \\Pi_{s} s^{I_s}$$\n",
4141
"\n",
4242
"Note: for stochastic models mass action propensities are $\\rho(S) = k \\Pi_{s} s!/(s - I_s)!$.\n",
4343
"\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",
4545
"\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",
4747
"\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",
5249
"\n",
50+
" R = Reaction.from_mass_action(inputs, outputs, k)\n",
51+
" Rrev = Reaction.from_mass_action(outputs, inputs, krev)\n",
5352
"\n",
5453
"Finally, a CRN can be made by combining species and reactions:\n",
5554
"\n",
5655
" CRN = ChemicalReactionNetwork(species=species, reactions=reactions, initial_condition_dict={})\n",
5756
"\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",
5958
"\n",
6059
" initial_condition_dict = {Species: value}\n",
6160
"\n",
@@ -226,7 +225,7 @@
226225
"\n",
227226
"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",
228227
"\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`.*"
230229
]
231230
},
232231
{
@@ -287,14 +286,14 @@
287286
"metadata": {},
288287
"source": [
289288
"## 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:"
291290
]
292291
},
293292
{
294293
"cell_type": "markdown",
295294
"metadata": {},
296295
"source": [
297-
"## HillPositive: \n",
296+
"### HillPositive: \n",
298297
"$\\rho(s) = k \\frac{s_1^n}{K^n+s_1^n}$\n",
299298
"\n",
300299
"Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, and hill species $s_1$."
@@ -336,7 +335,7 @@
336335
"cell_type": "markdown",
337336
"metadata": {},
338337
"source": [
339-
"## HillNegative: \n",
338+
"### HillNegative: \n",
340339
"$\\rho(s) = k \\frac{1}{K^n+s_1^n}$\n",
341340
"\n",
342341
"Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, and Hill species $s_1$."
@@ -376,7 +375,7 @@
376375
"cell_type": "markdown",
377376
"metadata": {},
378377
"source": [
379-
"## ProportionalHillPositive: \n",
378+
"### ProportionalHillPositive: \n",
380379
"$\\rho(s, d) = k d \\frac{s_1^n}{K^n + s_1^n}$\n",
381380
"\n",
382381
"Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, Hill species $s_1$, and proportional species $d$."
@@ -418,7 +417,7 @@
418417
"cell_type": "markdown",
419418
"metadata": {},
420419
"source": [
421-
"## ProportionalHillNegative: \n",
420+
"### ProportionalHillNegative: \n",
422421
"$\\rho(s, d) = k d \\frac{1}{K^n + s_1^n}$\n",
423422
"\n",
424423
"Requried parameters: rate constant $k$, offset $K$, Hill coefficient $n$, Hill species $s_1$, and proportional species $d$."
@@ -460,8 +459,8 @@
460459
"cell_type": "markdown",
461460
"metadata": {},
462461
"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",
465464
"\n",
466465
"For general propensities, the function must be written out as a string with all species and parameters declared."
467466
]

examples/Specialized Tutorials/1. Combinatorial Promoters.ipynb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,39 @@
2121
"source": [
2222
"### Overview\n",
2323
"\n",
24-
"\n",
2524
"The CombinatorialPromoter is supposed to represent the general case where a promoter is transcribable when bound by a specific combination of regulators.\n",
2625
"\n",
2726
"In general, consider a set of $M$ regulators $R_1...R_M$ which bind to the promoter $P$ with cooperativities $n_1...n_M$ ie $n_i$ copies of $R_i$ bind to the promoter at once. The CombinatorialPromoter enumerates all possible bound Promoter-Regulator complexes which are returned as a list of ComplexSpecies using the Combinatorial_Cooperative_Binding Mechanism. These complexes will be default take the following form with the regulators in alphabetical order:\n",
27+
"$$\n",
28+
"\\begin{aligned}\n",
29+
" \\textrm{Species}=\\{&P, P:n_1\\textrm{x}R_1, &&..., P:n_M\\textrm{x}R_M, \\\\\n",
30+
" &P:n_1\\textrm{x}R_1:n_2\\textrm{x}R_2, &&..., P:n_{M-1}\\textrm{x}R_{M-1}:n_M\\textrm{x}R_M \\\\\n",
31+
" && \\vdots \\\\\n",
32+
" &P:n_1\\textrm{x}R_1:n_2\\textrm{x}R_2: &&...:n_{M-1}\\textrm{x}R_{M-1}:n_M\\textrm{x}R_M \\}\n",
33+
"\\end{aligned}\n",
34+
"$$\n",
2835
"\n",
29-
"\\begin{align}\n",
30-
"\\textrm{Species}=\\{&P, P:n_1\\textrm{x}R_1, &&..., P:n_M\\textrm{x}R_M, \\\\\n",
31-
"&P:n_1\\textrm{x}R_1:n_2\\textrm{x}R_2, &&..., P:n_{M-1}\\textrm{x}R_{M-1}:n_M\\textrm{x}R_M \\\\\n",
32-
"&&. \\\\\n",
33-
"&&. \\\\\n",
34-
"&&. \\\\\n",
35-
"&P:n_1\\textrm{x}R_1:n_2\\textrm{x}R_2: &&...:n_{M-1}\\textrm{x}R_{M-1}:n_M\\textrm{x}R_M \\}\n",
36-
"\\end{align}\n",
36+
"The Combinatorial_Cooperative_Binding Mechanism in Combinatorial Promoter returns all reactions where a Complex consisting of a promoter and a set of regulators bind to one additional regulator:\n",
3737
"\n",
38-
"The Combinatorial_Cooperative_Binding Mechanism in Combinatorial Promoter returns all reactions where a Complex consisting of a promoter and a set of regulators bind to one additional regulator.\n",
39-
"\\begin{align}\n",
38+
"$$\n",
39+
"\\begin{aligned}\n",
4040
"\\textrm{Reactions} = \n",
4141
"\\{&P + n_1 R_1 \\leftrightarrow P:n_1\\textrm{x}R_1, ...\\\\\n",
4242
" &..., P + n_M R_M \\leftrightarrow P:n_M\\textrm{x}R_M, ... \\\\\n",
4343
" &..., P:n_1\\textrm{x}R_1 + n_2 R_2 \\leftrightarrow P:n_1\\textrm{x}R_1:n_2\\textrm{x}R_2,... \\\\\n",
4444
" &..., P:n_{M-1}\\textrm{x}R_{M-1} + n_M R_M \\leftrightarrow P:n_{M-1}\\textrm{x}R_{M-1}:n_M\\textrm{x}R_M, ... \\\\\n",
45-
" &. \\\\\n",
46-
" &. \\\\\n",
47-
" &. \\\\\n",
45+
" & \\vdots \\\\\n",
4846
" &..., P:n_1\\textrm{x}R_1:n_2\\textrm{x}R_2:...:n_{M-1}\\textrm{x}R_{M-1} + n_M R_M\n",
4947
" \\leftrightarrow\n",
5048
" P:n_1\\textrm{x}R_1:n_2\\textrm{x}R_2:...:n_{M-1}\\textrm{x}R_{M-1}:n_M\\textrm{x}R_M\n",
51-
"\\end{align}\n",
49+
"\\end{aligned}\n",
50+
"$$\n",
5251
"\n",
53-
"Arbitrary combinations of these regulators can be defined as transcribable using:\n",
52+
"Arbitrary combinations of these regulators can be defined as transcribable using::\n",
5453
"\n",
5554
" CombinatorialPromoter(name, [Regulators], tx_capable_list = [[Transcribable Combination fo regulators 1], [Combination 2], ...]) \n",
5655
"\n",
57-
"Additionally, there is the option for leak reactions in which case the free promoter is transcribed at some leak rate.\n",
56+
"Additionally, there is the option for leak reactions in which case the free promoter is transcribed at some leak rate::\n",
5857
"\n",
5958
" CombinatorialPromoter(name, [Regulators], leak = True/False ) \n"
6059
]

examples/Specialized Tutorials/3. Multiple Occupancy in TX-TL.ipynb

Lines changed: 38 additions & 38 deletions
Large diffs are not rendered by default.

examples/Specialized Tutorials/6. Integrase Examples.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"## Introduction to Integrase Enumerator\n",
7+
"# Introduction to Integrase Enumerator\n",
88
"\n",
99
"In BioCRNpyler, `Integrase_Enumerator` is a way to modularly define DNA constructs that can be recombined into other forms using integrases. Integrases in general are proteins that bind to a specific sequence and then cause a recombination event between two such sequences. In the case of `Serine Integrases`, these sequences are called `attP` and `attB`. So one very simple way to express an integrase reaction (where Bxb1 is an integrase) would be like this:\n",
1010
"\n",
@@ -707,7 +707,7 @@
707707
"cell_type": "markdown",
708708
"metadata": {},
709709
"source": [
710-
"## Plot the CRN"
710+
"Plot the CRN"
711711
]
712712
},
713713
{

0 commit comments

Comments
 (0)