In-silico experiments
Once a model is fitted, you can ask what it predicts under an intervention: a kinase inhibitor, a knockdown, a lost
interaction, a withdrawn stimulus. phoskintime.networkmodel.sim runs these on the run's SBML model, with sbmlsim, and no
fitting code. An experiment never defines a model of its own.
The three ways to run an experiment
=== "Command line"
```bash
phoskintime simulate run --model <run folder> --preset knockout --target MAPK1 --out ko.pke.zip
phoskintime simulate run --model <bundle.pkt.zip> --spec experiments.json --draws <run folder> --out x.pke.zip
phoskintime simulate show ko.pke.zip
```
=== "Library"
```python
from phoskintime.networkmodel import api, sim
model = sim.load("results/my_run") # run folder, run bundle, COMBINE archive or SBML file
result = api.simulate(model, preset="dose_response", target="MAPK1", out="dose.pke.zip")
result.trajectories # scenario, time, variable, value, fold_change
```
=== "App"
In the results of a finished run, the **Experiments** card offers the presets with the model's kinases and genes,
bands over the posterior when the run has draws, and the written bundles for download.
The model can be read from a run folder (model/model.xml), a run bundle, a COMBINE archive
(phoskintime export standards) or an SBML file.
What an experiment does to the model
| kind | acts on | biological meaning |
|---|---|---|
inhibit |
a kinase | its catalytic gain c_k is multiplied by 1 - fraction: a catalytic inhibitor. The kinase's measured abundance, and anything that follows it, is unchanged |
knockout |
a kinase | no catalytic activity (inhibit with fraction 1) |
knockdown |
a gene | its basal transcription A is multiplied by 1 - fraction, as an siRNA reduces synthesis |
remove_edge |
kinase + site, or tf + gene |
that regulator's term leaves the site's kinase inflow or the gene's TF input; the other weights stay |
set |
a parameter | sets it to a value |
pulse |
a kinase | the stimulus is withdrawn at t_off: the kinase drive relaxes back to the unstimulated fold change with time constant tau. The unperturbed model is the sustained stimulus |
inhibit, knockdown and set can act from t_on to t_off (a drug added and washed out). scan repeats an
experiment over several fractions (dose-response).
Presets
timecourse; d5 (design D5 of the experiment-design report: every kinase inhibited to 50 %, every gene's
transcription halved); inhibit, knockout, knockdown and pulse of one target; dose_response (0 to 100 %
inhibition of a kinase).
The specification file
{
"format": "phoskintime.experiment/1",
"name": "washout",
"times": [0, 5, 15, 30, 60, 120, 240],
"perturbations": [{"kind": "inhibit", "target": "MAPK1", "fraction": 0.8, "t_on": 15, "t_off": 120}]
}
A file may hold one experiment or a list.
Uncertainty
With --draws <run folder> (--source laplace or mcmc) every scenario is also simulated for each posterior draw,
with the perturbation applied to the draw's values. The result holds the quantiles (2.5, 50, 97.5 %) of the fold
changes, and the bundle records the source and the number of draws.
The experiment bundle
<name>.pke.zip (or a folder):
| file | content |
|---|---|
manifest.json |
format, lineage (model sha256, the parent run bundle's id and sha256, spec sha256), engine and versions, draws, file hashes |
spec.json |
the experiments |
model.xml |
the model they ran on |
results.parquet |
scenario, time, variable, value, fold change |
bands.parquet |
quantiles over the draws (with draws only) |
The browser engine
phoskintime simulate web --model <run folder> --out browser/ --check
compiles the model to WebAssembly with sbmlsim-core and writes the engine and its JavaScript host, so a page can run
the model offline. --check is the go/no-go test (needs Node.js): compiled size, time per simulation (limit 100 ms)
and agreement with local sbmlsim (limit 1e-6 relative). Showing it in a page is phoskintime-vis's part.
Conformance
phoskintime simulate conformance
runs golden experiments on small synthetic networks of every model family in libroadrunner (PhosKinTime's own engine), sbmlsim and the browser engine. Each must reproduce the golden trajectories within 1e-6 relative.