{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# The `ParameterMapping`\n", "In a heterogeneous `Dataset` that contains many `Replicate`s, one often needs to share some parameters globally across replicates while keeping others local, or shared to a subset of replicates.\n", "With `murefi`, the rules for this mapping of parameters are defined in a `ParameterMapping`." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy\n", "import pandas\n", "\n", "import murefi" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating a `ParameterMapping`\n", "The `ParameterMapping` object is created from a `pandas.DataFrame`.\n", "This dataframe must be indexed by the replicate ID (`\"rid\"`) and have the generic model parameter names as column headers.\n", "\n", "The values in the `DataFrame` may be fixed to a specific value, or left variable by passing an arbitrary placeholder name.\n", "Names of placeholders may occur multiple times to share them across respective replicates, but they must only appear within the same column.\n", "In the following example, there are 6 free parameters ($substrate_c$, $P_0$, $v_{max,A/B/C}$ and $K_S$).\n", "Here, only $K_S$ is truly *global*, whereas all other parameters apply to only a subset of the replicates." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | S_0 | \n", "P_0 | \n", "v_max | \n", "K_S | \n", "
|---|---|---|---|---|
| rid | \n", "\n", " | \n", " | \n", " | \n", " |
| A | \n", "8.0 | \n", "P_0 | \n", "v_max_A | \n", "K_S | \n", "
| B | \n", "10.0 | \n", "P_0 | \n", "v_max_B | \n", "K_S | \n", "
| C | \n", "substrate_c | \n", "0 | \n", "v_max_C | \n", "K_S | \n", "