Toy dataset format
Download the notebook (executed for this page) · source
The deterministic seed-42 dataset has three TFs with zero, one and two additional phosphosites. Five genes have different regulator counts. Each TF's empty-Psite input1 row is its protein series; S_ rows are its phosphosites (T6). Source is TF, Target is mRNA; the known TF1 beta includes repression (-0.2).
from pathlib import Path
import os, sys
ROOT = next(p for p in [Path.cwd(), *Path.cwd().parents] if (p / 'pixi.toml').exists())
os.environ['TFOPT_CONFIG'] = str(ROOT / 'notebooks/data/toy.toml')
os.environ.setdefault('MPLBACKEND', 'Agg')
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
import tfopt
import numpy as np
import pandas as pd
from notebooks.tutorial import build_problem, optimize, OUTPUT
p = build_problem()
for filename in ['input1.csv','input3.csv','input4.csv']:
print(filename)
display(pd.read_csv(ROOT/'notebooks/data'/filename))
import json
display(json.loads((ROOT/'notebooks/data/truth.json').read_text()))
input1.csv
| GeneID | Psite | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | TF0 | NaN | 2.434890 | 1.597196 | 2.646495 | 2.243420 | 0.735443 | 2.939056 | 2.402849 | 2.465161 | 0.820284 |
| 1 | TF1 | NaN | 1.625965 | 1.426995 | 2.816912 | 2.109663 | 2.556904 | 1.608535 | 1.068097 | 1.886462 | 0.659543 |
| 2 | TF1 | S_1 | 2.569078 | 2.079161 | 2.395219 | 1.386315 | 2.926745 | 2.732803 | 2.445959 | 0.986597 | 1.666803 |
| 3 | TF2 | NaN | 0.609509 | 0.885724 | 2.207622 | 2.361905 | 2.918774 | 1.314563 | 1.426149 | 1.673890 | 0.973678 |
| 4 | TF2 | S_1 | 0.824804 | 1.689262 | 1.067273 | 2.174535 | 1.592880 | 2.581695 | 2.250663 | 1.280917 | 2.580650 |
| 5 | TF2 | S_2 | 2.511911 | 1.468696 | 1.220820 | 2.206239 | 0.849381 | 0.999771 | 0.518406 | 2.467311 | 2.162127 |
input3.csv
| GeneID | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | G0 | 2.434890 | 1.597196 | 2.646495 | 2.243420 | 0.735443 | 2.939056 | 2.402849 | 2.465161 | 0.820284 |
| 1 | G1 | 1.437342 | 1.296562 | 2.901251 | 2.254332 | 2.482936 | 1.383682 | 0.792524 | 2.066435 | 0.458091 |
| 2 | G2 | 1.625298 | 1.418271 | 1.372117 | 2.227861 | 1.486309 | 1.537307 | 1.219632 | 1.952708 | 2.049994 |
| 3 | G3 | 1.736607 | 1.386752 | 2.824824 | 2.251059 | 1.958688 | 1.850294 | 1.275622 | 2.186053 | 0.566749 |
| 4 | G4 | 1.730830 | 1.417543 | 2.085733 | 2.238914 | 1.635124 | 1.771569 | 1.328143 | 2.089317 | 1.326481 |
input4.csv
| Source | Target | |
|---|---|---|
| 0 | TF0 | G0 |
| 1 | TF1 | G1 |
| 2 | TF2 | G2 |
| 3 | TF0 | G3 |
| 4 | TF1 | G3 |
| 5 | TF0 | G4 |
| 6 | TF1 | G4 |
| 7 | TF2 | G4 |
{'alpha': {'G0': [1.0],
'G1': [1.0],
'G2': [1.0],
'G3': [0.3, 0.7],
'G4': [0.2, 0.3, 0.5]},
'beta': {'TF0': [1.0], 'TF1': [1.2, -0.2], 'TF2': [0.2, 0.3, 0.5]},
'seed': 42}
Interpretation
Check both fit and feasibility. For biological data, identifiability, scaling and regulatory coverage need domain review. Results and figures belong only in notebooks/outputs/.