Skip to content

Run bundle (schema 1.0)

Every TFOpt run writes a run bundle: one self-contained folder or zip with the results, the inputs, the resolved configuration and the provenance of the run. It follows the bundle conventions of phoskintime-vis and has the same layout as KinOpt's run bundle, with TFOpt's model: target mRNAs instead of phosphosites, TFs instead of kinases, and each TF's β split into a TF-level term (its input1 protein row, else its input3 mRNA, as the Beta Source column records) and its own phosphosites. This page is the reference for developers of readers.

  • Written by every run: tfopt run, tfopt-local and tfopt.api.run write <results>/<results folder name>.tfopt.zip (RunConfig(bundle=False) or tfopt run --no-bundle skip it).
  • From any results folder with a run_config.json: tfopt bundle <results_dir> [--out DIR] [--zip] [--max-input-mb N] (library: tfopt.bundle.make_bundle). The results folder's files are not changed.
  • Checked with tfopt bundle --check <bundle folder or zip> (library: tfopt.bundle.check_bundle): the manifest against the schema, every file's sha256 and size, unlisted or missing files, the core tables, every other table present or listed in manifest.missing, and every table's columns, dtypes and nullability against tables.json. Plain Python; reading Parquet needs PyArrow, a TFOpt dependency.
  • The contract is published in the repository as contracts/tfopt/1.0/manifest.schema.json (JSON Schema 2020-12) and contracts/tfopt/1.0/tables.json, in the same format as phoskintime-vis's and KinOpt's contracts. Both are generated by tools/build_contract.py, which also writes the packaged copy in tfopt/bundle/contract/1.0/ and the table reference below.

!!! warning "Inputs travel with the bundle" Inputs up to 50 MB are copied into provenance/inputs/; larger ones are recorded by sha256 only (tfopt bundle --max-input-mb). Do not share a bundle made from data that must stay private.

Layout

<run>.tfopt/                      (or <run>.tfopt.zip: the same folder, zipped)
├── manifest.json                 what is in the bundle, with sha256 of every file
├── provenance/
│   ├── tfopt_results.xlsx        the results workbook of the run
│   ├── run_config.json           resolved config, seeds, versions, git commit, input sha256, KKT verdict
│   ├── config_resolved.json      the resolved configuration alone
│   ├── diagnostics.json          the run's diagnostics (losses, KKT summary, fit metrics)
│   ├── logs/*.log                the run's log
│   └── inputs/input1.csv, input3.csv, input4.csv   (copied up to the size limit)
├── tables/<table>.parquet        the tables below
├── arrays/multistart_params.npy  parameter vectors of all starts
└── resim/                        what a viewer needs to recompute predictions (what-if)
    ├── tf_series.parquet
    └── model.json

A reader finds the bundle root by manifest.json (a folder, or the shortest path ending in manifest.json inside the zip).

manifest.json

Field Type Meaning
bundle_schema string "1.0": the version of this contract (a string, never a number)
bundle_id string tfopt- and 16 hex digits, from the configuration and the run's time
created_utc string when the bundle was written (YYYY-MM-DDTHH:MM:SSZ); run_created_utc: when the run finished
producer object tfopt_version, git_commit, git_branch, git_dirty (null outside a git clone), repository, doi (null: TFOpt has no archival DOI yet), bundle_writer_version
workflows array ["local"]
model object model_id (tfopt-local), variant (the prediction transform), description
config object the full resolved RunConfig (every setting, paths as strings, both time grids)
config_sha256, parameter_order_sha256 string sha256 of the configuration and of the parameter order (α per mRNA and TF slot, then β per TF)
seeds object start_seed (starting values), base_seed (the configuration's seed), starts (the seed of every start: seed + i)
selected_start integer the start written to the workbook
inputs array per input (input1, input3, input4): name, sha256, bytes, copied, path (if copied), description
files array every file except the manifest: path, sha256, bytes, kind (provenance, table, array, resim); tables also table, rows, columns (name, dtype, nullable); arrays array (dtype, shape, axes, starts)
missing, skipped array {item, reason}: what is absent and why (e.g. the analysis tables when input1 or input3 is no longer available or has changed since the run)
warnings array {code, message}, e.g. input_not_copied, analysis (warnings of the regulatory analysis)

Rules and versioning

  • Null means missing. A missing value is null, never 0 and never an empty string. For example, a TF's TF-level β row has component null, and an α has component null in multistart_parameters.
  • Dtypes are string, int64, float64 and bool (Parquet: string, int64, double, bool).
  • Within a minor version (1.x) columns and tables may be added; readers must ignore what they do not know. Removing, renaming or retyping a column, or changing its meaning, needs a new major version.
  • Core tables are always present; any other table may be absent only if manifest.missing lists it.
  • Every file is listed in the manifest; an unlisted file makes the bundle invalid.
  • Times are minutes on the run's RNA grid (config.time_points); TFOpt has no built-in grid.

Workbook, results files and analyses → bundle tables

Source in the results folder Bundle table
Alpha Values (mRNA, TF, Value) edge_weights
Beta Values (TF, PSite, Value, Source) regulator_weights (component null for the TF-level row)
Observed, Estimated, Residuals (mRNA, x1..xN) observed, estimated, residuals (tidy, time in minutes)
Optimization Results (Metric, Value) metrics
KKT Diagnostics, KKT Multipliers kkt_conditions (with the multiplier source from run_config.json), kkt_multipliers
Prediction Check prediction_check
multistart_summary.csv multistart, convergence
multistart_params.npz (X, fun, success, start_id) arrays/multistart_params.npy, multistart_parameters
input1/input3 series the fit used resim/tf_series, tf_activity, contributions, reconstruction

The data of the former dashboard figures (app/tfopt.py) and of the tfopt readout tables is computed by tfopt.analysis.network_readout and stored under the same table names, with lowercase columns (mRNA → mrna, TF → tf, PSite → psite, Value → beta, MSE → mse). A viewer redraws the figures from them.

Former figure or output Bundle table How to redraw
Regulatory load per TF (bar) regulatory_load bar of total_load_auc_abs per tf
Activating vs suppressing load regulatory_load activating_auc, suppressing_auc per tf
Early / middle / late load regulatory_load absolute_auc_early, absolute_auc_middle, absolute_auc_late
Dominant regulator per target target_dominant_regulators dominant_overall and its share, per window
TF removal (knockout) effects knockout_effects delta_auc per (mrna, tf); positive: removing the TF lowers the mRNA
Edge contributions edge_contributions signed / absolute AUC per edge, overall and per window
Protein vs phosphosite parts of a TF regulatory_effect_summary, protein_phosphosite_components AUC of the TF-level term and of each site
β at bounds beta_bound_pressure at_bound, outside_bounds per β
α summary, fit quality alpha_summary, fit_quality tables
TF activity over time tf_activity activity vs time per tf
Target reconstruction and contributions observed, estimated, contributions series vs time; contributions per tf
TF → mRNA network network_edges, network_nodes edge width from weight, colour from sign (+ green, − red, null grey)
Curve similarity curve_similarity Fréchet distance per mRNA
What-if (changed α or β) edge_weights, regulator_weights, resim/tf_series, resim/model.json recompute transform(Σ_TF α Σ_j β X(t))

!!! note "Sign of ΔAUC" knockout_effects.delta_auc is baseline − knockout, with the prediction transform applied in both (fixed parameters, no refitting), as tfopt.fitanalysis.regulatory computes it.

Tables

The reference below is generated from tables.json (pixi run -e dev python tools/build_contract.py).

tables/edge_weights.parquet (core)

Fitted TF weights α: one row per (mRNA, TF) edge used by the fit (the workbook's Alpha Values). α ∈ [0, 1] and Σ_TF α = 1 per mRNA.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
tf string no transcription factor (input4 Source)
alpha float64 no α of the edge

tables/regulator_weights.parquet (core)

Fitted TF-component weights β (the workbook's Beta Values): per TF one TF-level row (component null; its series is given by source) and one row per own phosphosite. Σ β = 1 per TF.

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
component string yes phosphosite of the TF; null = the TF-level term
source string yes series behind the row: protein, mrna or first_site for the TF-level term, site for a phosphosite; null for workbooks without the Source column
beta float64 no
lower float64 no lower bound of β
upper float64 no upper bound of β

tables/observed.parquet (core)

Observed mRNA series (the workbook's Observed sheet, input3 rows of the fitted targets), tidy.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
time float64 no min RNA time point (time_points)
value float64 yes

tables/estimated.parquet (core)

Estimated mRNA series of the selected start (prediction with the run's prediction_transform; the workbook's Estimated sheet), tidy.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
time float64 no min RNA time point (time_points)
value float64 yes

tables/residuals.parquet (core)

Residuals Observed − Estimated (the workbook's Residuals sheet), tidy.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
time float64 no min RNA time point (time_points)
value float64 yes

tables/multistart.parquet (core)

One row per start of the multistart.

Column dtype Nullable Unit Description
start int64 no
seed int64 no
objective float64 yes
success bool no the solver converged and the start is feasible
residual float64 yes constraint violation of the start (largest |Σα−1|, |Σβ−1| or bound violation)
accepted bool no success, residual <= acceptance_tol and the KKT verdict
selected bool no the start written to the workbook

tables/metrics.parquet (core)

The workbook's Optimization Results sheet: one row per metric (numeric value or text, e.g. Prediction transform and Method).

Column dtype Nullable Unit Description
metric string no
value float64 yes
text string yes

tables/multistart_parameters.parquet

Every start's α and β (long format); index is the position in the parameter vector (arrays/multistart_params.npy). Padding α slots (mRNAs with fewer TFs than the widest one) are not listed.

Column dtype Nullable Unit Description
start int64 no
index int64 no
parameter string no alpha or beta
mrna string yes target mRNA of α; null for β
tf string no transcription factor (input4 Source)
component string yes β component; null for α and for a TF's TF-level term
value float64 no

tables/convergence.parquet

Convergence of each start (from the multistart summary).

Column dtype Nullable Unit Description
start int64 no
rank int64 no
objective float64 yes
delta_from_best float64 yes
success bool no
constr_violation float64 yes
runtime_s float64 yes s
param_l2_norm float64 yes
nit int64 yes
final_error float64 yes
feasible bool no
kkt_passed bool yes
kkt_stationarity float64 yes
kkt_primal_feasibility float64 yes
kkt_dual_feasibility float64 yes
kkt_complementary_slackness float64 yes

tables/constraint_checks.parquet

Constraint check of the selected start: |Σα−1| per mRNA, |Σβ−1| per TF, and α or β bound violations (tolerance: the run's feasibility_tol).

Column dtype Nullable Unit Description
check string no alpha_sum, beta_sum, alpha_bound, beta_bound
label string no
residual float64 no
tolerance float64 no
passed bool no

tables/kkt_conditions.parquet

KKT diagnostics of the selected start: one row per condition (stationarity, primal feasibility, dual feasibility, complementary slackness).

Column dtype Nullable Unit Description
condition string no
residual float64 no
tolerance float64 no
passed bool no
source string yes multipliers from the solver or estimated

tables/kkt_multipliers.parquet

Lagrange multipliers: equality (one per sum-to-one constraint) and active lower/upper bounds.

Column dtype Nullable Unit Description
kind string no equality, lower or upper
index int64 no
label string no
value float64 no

tables/prediction_check.parquet

Per target mRNA: the smallest summed prediction sum_k alpha_ik * activity_k(t) (before the prediction transform; with the default "clip" Estimated shows its negative values as 0) and the RNA time points where it is negative. An mRNA level cannot be negative, so a flagged target should be inspected (the workbook's Prediction Check sheet).

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
min_prediction float64 yes
negative_points int64 no
negative bool no negative at any time point

tables/reconstruction.parquet

Check that Estimated is reproduced from input1/input3, α, β, the Beta Source column and the prediction transform.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
max_abs_error float64 yes
tolerance float64 no
reproduced bool no

tables/tf_activity.parquet

TF activity a_TF(t) = β_TF,0 · X_TF(t) + Σ_s β_TF,s · S_TF,s(t) on the RNA grid; null if a required series is unavailable.

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
time float64 no min
activity float64 yes

tables/contributions.parquet

Signed contribution α_i,TF · a_TF(t) of each TF to each mRNA (before the prediction transform).

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
tf string no transcription factor (input4 Source)
time float64 no min
contribution float64 yes

tables/regulatory_effect_summary.parquet

Per TF: protein (TF-level) and phosphosite parts of the activity, signed and absolute AUC and peak.

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
complete bool no
n_phosphosites int64 no
n_missing_signals int64 no
protein_signed_auc float64 yes
phosphosite_signed_auc float64 yes
effective_signed_auc float64 yes
effective_absolute_auc float64 yes
effective_peak_abs float64 yes

tables/protein_phosphosite_components.parquet

Per TF component: β, the series used, signed and absolute AUC of β · series.

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
psite string yes null = the TF-level term
component string no protein or phosphosite
beta float64 no
has_signal bool no
required_missing bool no
source string no where the series comes from
signed_auc float64 yes
absolute_auc float64 yes

tables/target_dominant_regulators.parquet

Per mRNA: reconstruction error and the dominant TF (largest share of integrated |contribution|) overall and per time window.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
complete bool no
n_regulators int64 no
reconstruction_max_error float64 yes
dominant_overall string yes
dominant_overall_share float64 yes
dominant_early string yes
dominant_early_share float64 yes
dominant_middle string yes
dominant_middle_share float64 yes
dominant_late string yes
dominant_late_share float64 yes

tables/regulatory_load.parquet

Per TF: number of targets, total, activating and suppressing contribution |AUC|, β at bounds and per-window load.

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
n_targets int64 no
n_complete_edges int64 no
complete bool no
total_load_auc_abs float64 yes
known_load_auc_abs float64 yes
activating_auc float64 yes
suppressing_auc float64 yes
frac_beta_at_bound float64 yes
absolute_auc_early float64 yes
absolute_auc_middle float64 yes
absolute_auc_late float64 yes

tables/knockout_effects.parquet

In-silico TF removal (fixed parameters, no refitting): one TF removed from one mRNA. delta_auc = baseline − knockout, after the prediction transform in both.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
tf string no transcription factor (input4 Source)
complete bool no
renormalize_alpha bool no
analysis string no
baseline_auc float64 yes
knockout_auc float64 yes
delta_auc float64 yes
delta_peak float64 yes
peak_effect float64 yes

tables/edge_contributions.parquet

Per (mRNA, TF) edge: α and the signed, absolute, activating and suppressing AUC of its contribution, overall and per window.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
tf string no transcription factor (input4 Source)
alpha float64 no
complete bool no
signed_auc float64 yes
absolute_auc float64 yes
activating_auc float64 yes
suppressing_auc float64 yes
absolute_auc_early float64 yes
signed_auc_early float64 yes
absolute_auc_middle float64 yes
signed_auc_middle float64 yes
absolute_auc_late float64 yes
signed_auc_late float64 yes

tables/beta_bound_pressure.parquet

Per β: at or outside the bounds.

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
psite string yes null = the TF-level term
beta float64 no
at_bound bool no
outside_bounds bool no

tables/alpha_summary.parquet

Per mRNA: number of TFs, Σα, zero α and largest α.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
n_regulators int64 no
alpha_sum float64 no
n_zero_alpha int64 no
alpha_max float64 yes

tables/fit_quality.parquet

Per mRNA: MSE, RMSE, MAE and observed and estimated AUC.

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
complete_fit_curve bool no
mse float64 yes
rmse float64 yes
mae float64 yes
observed_auc float64 yes
estimated_auc float64 yes

tables/network_edges.parquet

TF → mRNA network edges with α, signed contribution AUC, removal effect, sign and drawing weight (the former network views; sign from the signed contribution, weight |signed_auc|, else |α|).

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
mrna string no target mRNA (input3 GeneID)
alpha float64 no
signed_auc float64 yes
delta_auc float64 yes
sign float64 yes
weight float64 no

tables/network_nodes.parquet

Network nodes (TFs and mRNAs) with degree.

Column dtype Nullable Unit Description
node string no
kind string no TF or mRNA
label string no
degree int64 no

tables/curve_similarity.parquet

Discrete Fréchet distance between observed and estimated series per mRNA (time normalised to [0, 1]).

Column dtype Nullable Unit Description
mrna string no target mRNA (input3 GeneID)
valid bool no
has_missing_values bool no
frechet float64 yes
frechet_rank int64 yes

resim/tf_series.parquet

The series of every TF component the model used, on the RNA grid (input1 aligned by time, or input3 mRNA, as the Beta Source column says): X_TF(t) and S_TF,s(t).

Column dtype Nullable Unit Description
tf string no transcription factor (input4 Source)
component string yes null = the TF-level term
source string yes where the series comes from: input1 protein, input1 phosphosite, input3 mRNA fallback or input1 first phosphosite (legacy_first_site); null if unavailable
time float64 no min
value float64 yes

arrays/multistart_params.npy

Parameter vectors of all starts, shape (start, parameter), ordered by start; parameter order: α per mRNA (Observed order) and TF slot, padded to the widest mRNA, then β per TF (TF-level term, then its sites), as multistart_parameters.index. dtype float64, axes start, parameter.