From 6ae58c3a821490863f73b3b5fab895fa01258740 Mon Sep 17 00:00:00 2001 From: meganrm Date: Wed, 12 Aug 2026 10:46:03 -0700 Subject: [PATCH] Add KiDerivation modal so KiQuestion's failure message points to something real (MF1) Co-Authored-By: Claude Sonnet 5 --- src/components/modals/KiDerivation.tsx | 93 +++++++++++++++++++ src/components/modals/KiDerivationContent.tsx | 93 +++++++++++++++++++ src/content/Competitive.tsx | 5 + 3 files changed, 191 insertions(+) create mode 100644 src/components/modals/KiDerivation.tsx create mode 100644 src/components/modals/KiDerivationContent.tsx diff --git a/src/components/modals/KiDerivation.tsx b/src/components/modals/KiDerivation.tsx new file mode 100644 index 0000000..3e75b25 --- /dev/null +++ b/src/components/modals/KiDerivation.tsx @@ -0,0 +1,93 @@ +import React, { useState } from "react"; +import { Flex, Steps } from "antd"; + +import { AB, D } from "../agent-symbols"; + +import styles from "./kd-derivation.module.css"; +import { SecondaryButton } from "../shared/ButtonLibrary"; +import { + variables, + reactionSteps, + getEquationFromStep, +} from "./KiDerivationContent"; + +const KiDerivation: React.FC = () => { + const [current, setCurrent] = useState(0); + + const next = () => { + if (current >= reactionSteps.length - 1) { + return setCurrent(0); + } + setCurrent(current + 1); + }; + return ( + +
+

+ The inhibition constant {variables.ki} is analogous to{" "} + Kd, but for our competitive inhibitor . It + can be determined by finding the {variables.ic50} — the + concentration of at equilibrium where the amount of{" "} + formed is reduced by half. You can think of it as{" "} + + "how little do I need to cut formation in + half?" + {" "} +

+
    +
  • + high {variables.ki} ={" "} + low inhibitor potency +
  • +
  • + low {variables.ki} ={" "} + high inhibitor potency +
  • +
+

+ A reaction with a high {variables.ki}{" "} + means you need a lot of to cut formation in + half, so the inhibitor has low potency. A{" "} + low {variables.ki} means you don't need + very much , so the inhibitor has{" "} + high potency. +

+
+
+ +

+ Derivation of {variables.ki} +

+ + {variables.ki} ={" "} + {getEquationFromStep(current)} + + next()} + > + {current < reactionSteps.length - 1 + ? "Next" + : "Restart"} + +
+ ({ + title: step.title, + description: step.content, + }))} + > +
+
+ ); +}; + +export default KiDerivation; diff --git a/src/components/modals/KiDerivationContent.tsx b/src/components/modals/KiDerivationContent.tsx new file mode 100644 index 0000000..22a90e1 --- /dev/null +++ b/src/components/modals/KiDerivationContent.tsx @@ -0,0 +1,93 @@ +import { Flex } from "antd"; +import { AB, D } from "../agent-symbols"; +import Fraction from "../shared/Fraction"; +import { GRAY_COLOR } from "../plots/constants"; + +const unitStyle = { color: GRAY_COLOR }; + +const variables = { + ki: ( + <> + Ki + + ), + ic50: ( + <> + IC50 + + ), + abMax: ( + <> + []max + + ), +}; + +const units = { + constant: <>mM, +}; + +const reactionSteps = [ + { + title: ( + <> + First, run the experiment with no inhibitor present ([] = + 0) to measure {variables.abMax} — the maximum amount of{" "} + that can form + + ), + content: ( + <> + {variables.abMax} = []{" "} + + (at equilibrium, when [] = 0) + + + ), + }, + { + title: ( + <> + {variables.ki} (also called the {variables.ic50}) is the + concentration of at equilibrium where [] has + dropped to half of {variables.abMax} + + ), + content: ( + + []} bottom={variables.abMax} /> + = ½ + + ), + }, + { + title: ( + <> + Therefore, {variables.ki} equals the concentration of {" "} + (at equilibrium) that reduces the formation of by half + + ), + content: ( + + {variables.ki} = + + [] + + {units.constant} + + ), + }, +]; + +const getEquationFromStep = (step: number) => { + if (step < 2) { + return ?; + } + return ( + + [] + + ); +}; + +export { variables, units, reactionSteps, getEquationFromStep }; diff --git a/src/content/Competitive.tsx b/src/content/Competitive.tsx index 8353efa..2af0f3c 100644 --- a/src/content/Competitive.tsx +++ b/src/content/Competitive.tsx @@ -1,4 +1,5 @@ import { A, AB, AD, B, D } from "../components/agent-symbols"; +import KiDerivation from "../components/modals/KiDerivation"; import StartExperiment from "../components/StartExperiment"; import { PLAY_BUTTON_ID, @@ -180,6 +181,10 @@ export const competitiveArray: PageContent[] = [ where the amount of complex is reduced by half. ), + modal: { + title: "Learn how to derive Ki", + content: , + }, moreInfo: ( <> IC50 = [] (at equilibrium when [] is half