Skip to content

Plotting and Export Outputs

Plotting utilities in this repository live under the TFOpt packages rather than in a separate top-level plotting package. Figures use a headless Matplotlib backend; no display is needed.


Local Optimization Exports

tfopt.local.exporter writes the outputs of a run (tfopt run --no-plots skips the plots, --no-report the report and the LaTeX tables):

  • plotout.plot_estimated_vs_observed: per-target fit plots (<target>_model_fit_.png and an interactive Plotly .html), grouped into one folder per target.
  • plotout.plot_multistart_summary_runtime_overlay: multistart_fun_vs_rank_runtime.png.
  • sheetutils: the workbook tfopt_results.xlsx, multistart_summary.csv and multistart_params.npz.
  • latexit: tfopt_model_latex.tex (workbook tables and figure references; no TeX compiler is needed).
  • tfopt.local.utils.iodata.create_report: report.html, which collects the plots and tables.

Post-Fit Diagnostics

tfopt.fitanalysis (its Plotter) draws the fit-analysis figures after a run, or again with python -m tfopt.fitanalysis --conf config.toml: α distributions, β bar plots, absolute residual heatmap, goodness of fit, KLD, PCA, α and β box plots and CDFs, and time-wise residuals. tfopt.optimality adds the feasibility and KKT numbers to the workbook and diagnostics.json.


Readout figures, network and diagrams

These read a fitted results folder and never refit the model:

Command Output
tfopt figures RESULTS_DIR [--formats png svg pdf] [--dpi 300] [--top-n 25] TF regulatory-load rankings, dominance distribution, target sensitivity to TF removal, removal-effect distribution, activating and repressing contributions, fit quality (tfopt.fitanalysis.figures)
tfopt network RESULTS_DIR [--mode contribution\|alpha\|knockout] [--min-alpha A] The directed TF → mRNA network as a self-contained interactive HTML page (tfopt.fitanalysis.networks; needs gravis, in the viz environment). Filters affect the display only, not the reconstruction
tfopt diagram [--config PATH] [--psites 0,2] [--format png\|svg\|pdf] A generic model diagram (TF contributions) and a constraint diagram with the configured β bounds (tfopt.analysis.diagrams; needs Graphviz and pydot, in the viz environment)

A missing renderer (gravis, Graphviz) is reported as an error; nothing is drawn in its place.