Skill Tracer
Skills › Scientific Agent Skills › tellurium › experiments.md

experiments.md

100 lines · skills/tellurium/references/experiments.md at 5f2bc03

Open on GitHub
1# Experiment semantics and reproducibility
2
3The JSON accepts exactly these keys:
4
5| Key | Meaning |
6| --- | --- |
7| `end_time` | Positive end of integration, in the model's time unit; initial and output start are zero |
8| `points` | Number of saved samples including both endpoints, integer >=2 |
9| `relative_tolerance` | Positive CVODE relative error-control setting |
10| `absolute_tolerance` | Positive RoadRunner scalar tolerance adjustment factor; see scaling below |
11| `species` | Nonempty JSON list of unique SBML IDs to report as concentrations |
12| `scenarios` | Named mappings of constant global parameter IDs to finite numeric values; includes `baseline: {}` |
14Scenario names must be SBML-style identifiers. Parameter changes are applied to independent cloned
15SBML documents before RoadRunner loads them, and the modified files become the archive models.
16The helper rejects nonexistent/nonconstant parameters and parameters with initial assignments,
17because setting a numeric field there would not necessarily implement the requested perturbation.
18A fresh model per condition avoids ambiguity between RoadRunner reset variants and persistent
19parameter changes. Duplicate JSON keys are rejected, including repeated scenario or parameter names,
20so parsing cannot silently discard a requested condition.
22The supplied two-condition first-order model is synthetic. Its units are explicit: time in seconds,
23volume in liters, species concentrations in mol/L and k in inverse seconds. Reaction flux is
24`k*A*cell` mol/s. Unit annotations describe dimensions; merely changing a unit label does not rescale
25a numeric initial value or kinetic constant. Check dimensional consistency and magnitudes together.
27For a closed constant-volume A→B model, the conserved amount is compartment volume times A+B.
28The example's volume is exactly 1 L, so its concentration sum also stays numerically one. In a
29variable-volume model, open system, synthesis/degradation model or chemostatted network, the same
30concentration-sum check would be invalid. Choose invariants from the actual stoichiometry and
31boundary conditions rather than treating total species sum as universally conserved.

Experiment semantics and reproducibility

The JSON accepts exactly these keys:

KeyMeaning
end_timePositive end of integration, in the model's time unit; initial and output start are zero
pointsNumber of saved samples including both endpoints, integer >=2
relative_tolerancePositive CVODE relative error-control setting
absolute_tolerancePositive RoadRunner scalar tolerance adjustment factor; see scaling below
speciesNonempty JSON list of unique SBML IDs to report as concentrations
scenariosNamed mappings of constant global parameter IDs to finite numeric values; includes baseline: {}

Scenario names must be SBML-style identifiers. Parameter changes are applied to independent cloned SBML documents before RoadRunner loads them, and the modified files become the archive models. The helper rejects nonexistent/nonconstant parameters and parameters with initial assignments, because setting a numeric field there would not necessarily implement the requested perturbation. A fresh model per condition avoids ambiguity between RoadRunner reset variants and persistent parameter changes. Duplicate JSON keys are rejected, including repeated scenario or parameter names, so parsing cannot silently discard a requested condition.

The supplied two-condition first-order model is synthetic. Its units are explicit: time in seconds, volume in liters, species concentrations in mol/L and k in inverse seconds. Reaction flux is k*A*cell mol/s. Unit annotations describe dimensions; merely changing a unit label does not rescale a numeric initial value or kinetic constant. Check dimensional consistency and magnitudes together.

For a closed constant-volume A→B model, the conserved amount is compartment volume times A+B. The example's volume is exactly 1 L, so its concentration sum also stays numerically one. In a variable-volume model, open system, synthesis/degradation model or chemostatted network, the same concentration-sum check would be invalid. Choose invariants from the actual stoichiometry and boundary conditions rather than treating total species sum as universally conserved.

Raw lines 1 to 32
33## SBML and solver checks
35libSBML parses the source and runs consistency checks before simulation. Errors/fatal diagnostics
36stop execution; warnings remain in the report for review. Missing units do not prevent numerical
37execution but prevent a claim of dimensional validation. Confirm the units of every reported
38concentration and parameter. The helper reports the minimum concentration per scenario rather than
39clipping negatives. Small negatives near zero may reflect tolerance; significant negatives require
40investigating the equations, initial state and solver behavior.
42CVODE uses stiff integration with explicit relative tolerance and absolute-tolerance scaling. Output samples are not
43internal integration steps. Repeat selected scientifically relevant cases at tighter tolerances and
44compare outputs, conservation residuals and event timing. For concentrations near zero, the absolute
45tolerance vector rather than relative tolerance dominates.
47In RoadRunner 2.10.0, a scalar `integrator.absolute_tolerance` multiplies nonzero state magnitudes.
48For a floating species at zero it uses the compartment size instead; non-species zero rate-rule
49states use the scalar directly. Internal species states are amounts. For example, A=2 mol/L and
50B=0 in a 5-L compartment give initial amount tolerances `[10*f, 5*f]` for scalar factor `f`.
51The report records the initial vector returned by `getAbsoluteToleranceVector()` with state IDs.
52It is an initial-state diagnostic: recomputation after state changes can return different values.
53This setting is neither a fixed concentration tolerance nor a bound on global trajectory error.
54Very different species scales may require an explicit amount-tolerance vector workflow beyond
55this helper. Retain the JSON key for compatibility, but preserve its adjustment-factor meaning.
57The helper rejects rate-rule models. In the tested 2.10.0 release, the scalar tolerance-vector
58constructor puts floating species before rate-rule variables, while the LLVM state vector puts
59rate-rule variables first. Mixing them can apply a tolerance to the wrong state; successful replay
60would reproduce the same defect. Such models need separate state-order and explicit-vector checks.
61See the released [CVODE tolerance constructor](https://github.com/sys-bio/roadrunner/blob/v2.10.0/source/CVODEIntegrator.cpp)
62and [LLVM state-vector implementation](https://github.com/sys-bio/roadrunner/blob/v2.10.0/source/llvm/LLVMExecutableModel.cpp).
63Zero-dimensional compartments are rejected for concentration outputs because concentration/density
64is not defined there.
66The script is scoped to deterministic concentration trajectories. Stochastic counts, amount-only
67species, event-rich models, delay equations, external SBML comp references and arbitrary package
68extensions require separate verification before extending these guarantees. No model or data is
69uploaded to an external solver.

SBML and solver checks

libSBML parses the source and runs consistency checks before simulation. Errors/fatal diagnostics stop execution; warnings remain in the report for review. Missing units do not prevent numerical execution but prevent a claim of dimensional validation. Confirm the units of every reported concentration and parameter. The helper reports the minimum concentration per scenario rather than clipping negatives. Small negatives near zero may reflect tolerance; significant negatives require investigating the equations, initial state and solver behavior.

CVODE uses stiff integration with explicit relative tolerance and absolute-tolerance scaling. Output samples are not internal integration steps. Repeat selected scientifically relevant cases at tighter tolerances and compare outputs, conservation residuals and event timing. For concentrations near zero, the absolute tolerance vector rather than relative tolerance dominates.

In RoadRunner 2.10.0, a scalar integrator.absolute_tolerance multiplies nonzero state magnitudes. For a floating species at zero it uses the compartment size instead; non-species zero rate-rule states use the scalar directly. Internal species states are amounts. For example, A=2 mol/L and B=0 in a 5-L compartment give initial amount tolerances [10*f, 5*f] for scalar factor f. The report records the initial vector returned by getAbsoluteToleranceVector() with state IDs. It is an initial-state diagnostic: recomputation after state changes can return different values. This setting is neither a fixed concentration tolerance nor a bound on global trajectory error. Very different species scales may require an explicit amount-tolerance vector workflow beyond this helper. Retain the JSON key for compatibility, but preserve its adjustment-factor meaning.

The helper rejects rate-rule models. In the tested 2.10.0 release, the scalar tolerance-vector constructor puts floating species before rate-rule variables, while the LLVM state vector puts rate-rule variables first. Mixing them can apply a tolerance to the wrong state; successful replay would reproduce the same defect. Such models need separate state-order and explicit-vector checks. See the released CVODE tolerance constructor and LLVM state-vector implementation. Zero-dimensional compartments are rejected for concentration outputs because concentration/density is not defined there.

The script is scoped to deterministic concentration trajectories. Stochastic counts, amount-only species, event-rich models, delay equations, external SBML comp references and arbitrary package extensions require separate verification before extending these guarantees. No model or data is uploaded to an external solver.

Raw lines 33 to 70
71## Archive experiment
73The helper writes SED-ML Level 1 Version 3 with one uniform simulation, one model/task per scenario,
74and a report with data generators for time and each selected species. It encodes CVODE as
75`KISAO:0000019`, relative tolerance as `KISAO:0000209`, and the absolute tolerance adjustment factor
76as `KISAO:0000571`. `KISAO:0000671=true` requests stiff integration. Tellurium maps
77`KISAO:0000656=false` to RoadRunner's `variable_step_size=false`, which requests uniform saved
78output; CVODE still adapts its internal integration steps. These settings are applied to both
79execution routes, with conserved-moiety reduction disabled to match Tellurium's uniform-course route.
80SED-ML `numberOfPoints` is **intervals**, so the script writes `points - 1` to retain exactly the
81number of samples requested by RoadRunner.
83COMBINE entries use local filenames and one master SED-ML. `executeCombineArchive` replays only
84this newly generated archive; the helper is not an arbitrary archive extraction interface. Every
85replayed data generator is compared to the corresponding direct trajectory before the run reports
86success. A baseline-only archive does not represent perturbations, so all condition-specific SBML
87files are included. The `sbml` prefix is declared using the source document's actual SBML namespace.
88Tellurium 2.2.13.1 resolves these species paths by string parsing, so its successful replay alone
89would not detect an undeclared XPath prefix; the tests additionally resolve targets as XML paths.
90Export/replay was verified without optional PhraSEDML.
92Replay tests reproducibility of the represented experiment on this runtime. It does not test
93biological plausibility, independent model calibration, cross-simulator numerical agreement or
94interoperability of unexercised SED-ML features. Preserve the source model, full config and report
95alongside the archive, including warnings and exact runtime versions.
97These are local Python/library interfaces. SBML/SED-ML namespace URLs, language URNs and COMBINE
98format identifiers are identifiers, not HTTP API endpoints to call. The helper uses no service
99authentication, pagination or remote model-download API. External model references remain outside
100the tested workflow; use self-contained local models.

Archive experiment

The helper writes SED-ML Level 1 Version 3 with one uniform simulation, one model/task per scenario, and a report with data generators for time and each selected species. It encodes CVODE as KISAO:0000019, relative tolerance as KISAO:0000209, and the absolute tolerance adjustment factor as KISAO:0000571. KISAO:0000671=true requests stiff integration. Tellurium maps KISAO:0000656=false to RoadRunner's variable_step_size=false, which requests uniform saved output; CVODE still adapts its internal integration steps. These settings are applied to both execution routes, with conserved-moiety reduction disabled to match Tellurium's uniform-course route. SED-ML numberOfPoints is intervals, so the script writes points - 1 to retain exactly the number of samples requested by RoadRunner.

COMBINE entries use local filenames and one master SED-ML. executeCombineArchive replays only this newly generated archive; the helper is not an arbitrary archive extraction interface. Every replayed data generator is compared to the corresponding direct trajectory before the run reports success. A baseline-only archive does not represent perturbations, so all condition-specific SBML files are included. The sbml prefix is declared using the source document's actual SBML namespace. Tellurium 2.2.13.1 resolves these species paths by string parsing, so its successful replay alone would not detect an undeclared XPath prefix; the tests additionally resolve targets as XML paths. Export/replay was verified without optional PhraSEDML.

Replay tests reproducibility of the represented experiment on this runtime. It does not test biological plausibility, independent model calibration, cross-simulator numerical agreement or interoperability of unexercised SED-ML features. Preserve the source model, full config and report alongside the archive, including warnings and exact runtime versions.

These are local Python/library interfaces. SBML/SED-ML namespace URLs, language URNs and COMBINE format identifiers are identifiers, not HTTP API endpoints to call. The helper uses no service authentication, pagination or remote model-download API. External model references remain outside the tested workflow; use self-contained local models.

Raw lines 71 to 100