-
-
\ No newline at end of file
diff --git a/layouts/page.html b/layouts/page.html
deleted file mode 100644
index e151fef..0000000
--- a/layouts/page.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/index.html b/pages/index.html
deleted file mode 100644
index 182d0d7..0000000
--- a/pages/index.html
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-
-
for mere mortals
-
(albeit ones who know a bit of differential calculus)
-
-
DISCLAIMER: This is a school project. I would like to think that the CalTech course I've drawn from has made me somewhat knowledgeable on this topic, but please do not use this for medical advice, etc., etc. If you happen to know what you are doing, and you find a mistake on this website, please tell me about it. With that said:
-
-
- Biological circuit design is the science of abstracting natural biological processes by defining them
- as you would any synthetic circuit. It also allows us to create our own circuits out of natural components.
- As CalTech's open-source Biocircuits course states:
-
-
-
- Indeed, the marvelous progression of electronic circuit capabilities [...] could well describe biological circuits decades from now. Like electronics, we may will soon be able to program cellular “miracle devices” to create “little gadgets” that address serious environmental and medical applications.
-
-
-
That CalTech course will be the main source for this presentation. All diagrams are from it.
-
-
Let's dive in!
-
-
- 1. Concepts of Biocircuits
- 2. The Simplest Circuit
- 3. Repressors & Leaks
- 4. Activators
- 5. Ultrasensitivity & the Hill Function
- 6. Choosing Between Activators & Repressors
-
+EOF
+ }
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/views/nav_links.rb b/views/nav_links.rb
new file mode 100644
index 0000000..1973c30
--- /dev/null
+++ b/views/nav_links.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module BC
+ module Views
+ class NavLinks < ::Phlex::HTML
+ def initialize(back, fwd)
+ @back = back
+ @fwd = fwd
+ end
+
+ def view_template
+ nav class: 'nav-links' do
+ @back ? a(href: @back) { "BACK" } : div(style: "visibility: hidden") { "BACK" }
+ a(href: "/") { "HOME" }
+ @fwd ? a(href: @fwd) { "NEXT" } : div(style: "visibility: hidden") { "NEXT" }
+ end
+ end
+ end
+ end
+end
diff --git a/views/page_layout.rb b/views/page_layout.rb
new file mode 100644
index 0000000..bb6d5f9
--- /dev/null
+++ b/views/page_layout.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module BC
+ module Views
+ class PageLayout < ::Phlex::HTML
+ def initialize(title, back, fwd)
+ @title = title
+ @back = back
+ @fwd = fwd
+ end
+ def view_template
+ render(BaseLayout.new(@title)) do
+ p
+
+ p do
+ render(NavLinks.new(@back, @fwd))
+ end
+
+ yield
+
+ p do
+ render(NavLinks.new(@back, @fwd))
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/pages/activators-vs-repressors.md b/views/pages/activators-vs-repressors.md
similarity index 77%
rename from pages/activators-vs-repressors.md
rename to views/pages/activators-vs-repressors.md
index f85eb10..fd78984 100644
--- a/pages/activators-vs-repressors.md
+++ b/views/pages/activators-vs-repressors.md
@@ -23,12 +23,9 @@ At this point, we're pretty sure that, in the majority of cases, regulators are
You've reached the end, for now. I hope to expand this site in the future. If you have any questions, comments, or suggestions, please feel free to [tell me about them](https://github.com/aleksrutins/biocircuits/issues/new).
-
-[^1] Savageau, M. A. (1977). Design of molecular control mechanisms and the demand for gene expression. Proceedings of the National Academy of Sciences, 74(12), 5647–5651.
+[^1]: Savageau, M. A. (1977). Design of molecular control mechanisms and the demand for gene expression. Proceedings of the National Academy of Sciences, 74(12), 5647–5651.
-[^2] Shinar, G., Dekel, E., Tlusty, T., & Alon, U. (2006). Rules for biological regulation based on error minimization. Proceedings of the National Academy of Sciences, 103(11), 3999–4004.
+[^2]: Shinar, G., Dekel, E., Tlusty, T., & Alon, U. (2006). Rules for biological regulation based on error minimization. Proceedings of the National Academy of Sciences, 103(11), 3999–4004.
-[^3] Gerland, U., & Hwa, T. (2009). Evolutionary selection between alternative modes of gene regulation. Proceedings of the National Academy of Sciences, 106(22), 8841–8846.
-
-
\ No newline at end of file
+[^3]: Gerland, U., & Hwa, T. (2009). Evolutionary selection between alternative modes of gene regulation. Proceedings of the National Academy of Sciences, 106(22), 8841–8846.
diff --git a/pages/activators.md b/views/pages/activators.md
similarity index 100%
rename from pages/activators.md
rename to views/pages/activators.md
diff --git a/pages/concepts.md b/views/pages/concepts.md
similarity index 95%
rename from pages/concepts.md
rename to views/pages/concepts.md
index b28e0bb..450de0d 100644
--- a/pages/concepts.md
+++ b/views/pages/concepts.md
@@ -1,5 +1,3 @@
-
-
# Concepts of Biocircuits
Before we start designing circuits, we need to talk about **natural** (evolved) circuits and **synthetic** circuits.
diff --git a/pages/hill-functions.md b/views/pages/hill-functions.md
similarity index 100%
rename from pages/hill-functions.md
rename to views/pages/hill-functions.md
diff --git a/views/pages/index.rb b/views/pages/index.rb
new file mode 100644
index 0000000..ac9f30c
--- /dev/null
+++ b/views/pages/index.rb
@@ -0,0 +1,77 @@
+# frozen_string_literal: true
+
+module BC
+ module Views
+ module Pages
+ class Index < ::Phlex::HTML
+ def sections = {
+ "1. Concepts of Biocircuits" => "/concepts.html",
+ "2. The Simplest Circuit" => "/simplest-circuit.html",
+ "3. Repressors & Leaks" => "/repressors.html",
+ "4. Activators" => "/activators.html",
+ "5. Ultrasensitivity & the Hill Function" => "/hill-functions.html",
+ "6. Choosing Between Activators & Repressors" => "/activators-vs-repressors.html"
+ }
+
+ def view_template
+ render(::BC::Views::BaseLayout.new("Home")) do
+ section do
+ h1 class: "welcome" do
+ img src: "/assets/biocircuitslogo.svg", alt: "Biological Circuits"
+ end
+
+ p(class: "tagline") { "for mere mortals" }
+ p(class: "tagline") { "(albeit ones who know a bit of differential calculus)" }
+
+ p do
+ strong do
+ span { "DISCLAIMER: This is a school project. I would like to think that the CalTech course I've drawn from has made me somewhat knowledgeable on this topic, but please do not use this for medical advice, etc., etc. If you happen to know what you are doing, and you find a mistake on this website, please " }
+ a(href: "https://github.com/aleksrutins/biocircuits/issues/new") { "tell me about it." }
+ span { " With that said:" }
+ end
+ end
+
+ unsafe_raw(
+<
+ Biological circuit design is the science of abstracting natural biological processes by defining them
+ as you would any synthetic circuit. It also allows us to create our own circuits out of natural components.
+ As CalTech's open-source Biocircuits course states:
+
+
+
+ Indeed, the marvelous progression of electronic circuit capabilities [...] could well describe biological circuits decades from now. Like electronics, we may will soon be able to program cellular “miracle devices” to create “little gadgets” that address serious environmental and medical applications.
+
+
+
That CalTech course will be the main source for this presentation. All diagrams are from it.
+
+
Let's dive in!
+EOF
+ )
+
+ div class: "fade fade5" do
+ sections.each { |title, link|
+ render(SectionLink.new(link)) { title }
+ }
+ div class: "under-construction" do
+ "More Sections To Come"
+ end
+ end
+
+ script {
+ unsafe_raw("
+ addEventListener('DOMContentLoaded', () => {
+ if(localStorage.getItem('faded'))
+ document.querySelectorAll('.fade').forEach(it =>
+ it.classList.add('no-delay'));
+ localStorage.setItem('faded', true);
+ });
+ ")
+ }
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/views/pages/markdown_page.rb b/views/pages/markdown_page.rb
new file mode 100644
index 0000000..5b4b4b3
--- /dev/null
+++ b/views/pages/markdown_page.rb
@@ -0,0 +1,20 @@
+module BC
+ module Views
+ module Pages
+ class MarkdownPage < ::Phlex::HTML
+ def initialize(content, title, prev, fwd)
+ @content = content
+ @title = title
+ @prev = prev
+ @fwd = fwd
+ end
+
+ def view_template
+ render PageLayout.new(@title, @prev, @fwd) do
+ unsafe_raw Kramdown::Document.new(@content).to_html
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/pages/repressors.md b/views/pages/repressors.md
similarity index 100%
rename from pages/repressors.md
rename to views/pages/repressors.md
diff --git a/pages/simplest-circuit.md b/views/pages/simplest-circuit.md
similarity index 99%
rename from pages/simplest-circuit.md
rename to views/pages/simplest-circuit.md
index 7a427a5..a2f6baf 100644
--- a/pages/simplest-circuit.md
+++ b/views/pages/simplest-circuit.md
@@ -21,8 +21,10 @@ However, in real life, proteins aren't just made forever; they're also reduced,
There's a differential equation for this:
$$ \frac{dx}{dt} = \text{production} - (\text{degradation} + \text{dilution}) $$
+
Or:
$$ \frac{dx}{dt} = \beta - \gamma x $$
+
Since \\(\gamma\\) counts both degradation and dilution, we can say that:
$$ \gamma = \gamma_\text{degradation} + \gamma_\text{dilution} $$
@@ -31,8 +33,11 @@ Since we're getting into the math, a quick tip: if you (like me) forget what a v
To find the net production of the protein under steady state conditions, set the derivative to zero and solve for \\(x\\):
$$0 = \beta - \gamma x$$
+
$$-\beta = -\gamma x$$
+
$$\frac{-\beta}{-\gamma} = x$$
+
$$\frac\beta\gamma = x$$
And we find that **steady-state protein concentration is proportional to the ratio of production and removal rates**. This is another core concept that should be built as intuition.
@@ -65,11 +70,13 @@ Right now, we have protein synthesis as one process — no intermediate step
The reaction can now be described by two coupled differential equations:
$$\frac{dm}{dt} = \beta_m - \gamma_mm$$
+
$$\frac{dx}{dt} = \beta_pm - \gamma_px$$
Now, to find steady-state mRNA and protein concentrations, we set both derivatives to zero and solve, giving us:
$$m_{ss}=\frac{\beta_m}{\gamma_m}$$
+
$$x_{ss}=\frac{\beta_pm_{ss}}{\gamma_p}=\frac{\beta_p\beta_m}{\gamma_p\gamma_m}$$
This tells us that steady-state protein concentration, when we consider transcription and translation as separate steps, is proportional to the product of the two synthesis rates and inversely proportional to the product of the two degradation rates. Again, if you think about it, that's pretty intuitive.
diff --git a/views/section_link.rb b/views/section_link.rb
new file mode 100644
index 0000000..532cce1
--- /dev/null
+++ b/views/section_link.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module BC
+ module Views
+ class ChevronRightIcon < Phlex::SVG
+ def view_template
+ svg xmlns: 'http://www.w3.org/2000/svg', height: 24, width: 24, fill: "none", viewBox: "0 0 24 24", stroke_width: 1.5, stroke: "currentColor", class: "size-6" do
+ path font_weight: "bold", stroke_linecap: "round", stroke_linejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5"
+ end
+ end
+ end
+
+ class SectionLink < Phlex::HTML
+ def initialize(href)
+ @href = href
+ end
+
+ def view_template
+ a href: @href, class: "section-link" do
+ span do
+ yield
+ end
+
+ render ChevronRightIcon.new
+ end
+ end
+ end
+ end
+end