Repository navigation
KinOpt 0.10.0
KinOpt 0.10.0
The first tagged release of KinOpt. It changes results: it fixes defect K1, which put β on the wrong kinase's
series, and it makes SciPy SLSQP with hard constraints the default solver. α and β from earlier KinOpt runs,
including the KinOpt code formerly inside PhosKinTime, should be recomputed.
Breaking changes
- Results change. The K1 fix (below) changes α and β, and with them the
Estimatedseries; recompute earlier
results. - New default solver settings in
config.toml:method = "scipy-slsqp"(SciPy SLSQP, hard constraints),
n_starts = 64,jitter_scale = 0.10,start_seed = 20260115. Runs take longer (about 20 minutes on a machine
with enough cores). The JAXopt methods remain available as approximate options. - Output layout: the workbook is
results_dir/kinopt_results.xlsx(before:results_dir/kinopt/…); the
multistart files (multistart_summary.csv,multistart_params.npz) and the analysis plots and tables are in
results_dir/General/; one folder per fitted gene. The workbook is no longer copied intodata/unless
--copy_to_ode_data_diris given. - Command line:
--methodaccepts exactly the supported methods (scipy-slsqp,projected-gradient,
lbfgsb,slsqp,non-negative,unconstrained, and their aliases), also for the value inconfig.toml;
trust-constris rejected with an error. Inpython -m config.cli,--mode,--confand theallcommand are
removed;kinoptpasses its options tokinopt.local.kinopt.local.config.constants.parse_args()returns a
ninth value (copy_to_ode_data_dir). - Module rename:
kinopt.optimality.KKTis nowkinopt.optimality.checks(the old name is a deprecated alias
until 0.11), and its functions and output files are renamed (see below). - Errors instead of silent fallbacks: unmappable inputs, and constraints a penalty method cannot apply, stop the
run with an error. - Preprocessing:
python -m processing.cleanupwrites only to[paths] data_dir; it no longer copies into
kinopt/data/andtfopt/data/. - Logging: the logger and log files are named
kinopt(before:phoskintime).
Fixed: β was applied to other kinases' series (K1)
KinOpt built each kinase's rows in the order the kinases first appear in input2, while the β offsets assumed
sorted kinase order. Unless input2 listed kinases in sorted order, a kinase's activity was built from other
proteins' series. On the PhosKinTime inputs, 24 of 27 kinases were affected, and the shipped Estimated sheet
reproduced from input1 only under that misassignment (1 of 36 sites from each kinase's own series). The kinase rows
and the β offsets now use one ordering, and a guard stops the run if they ever disagree. The objective, constraints
and bounds are unchanged.
Validation on the PhosKinTime inputs (same 64 seeded starts, SciPy SLSQP, all starts converged with constraint
residuals ≤ 1e-10), against a control run with the old indexing:
| old indexing (control) | 0.10.0 | |
|---|---|---|
| best objective (weighted loss) | 0.1807 | 0.1593 |
| R² | 0.655 | 0.696 |
Estimated reproduced from each kinase's own series |
2 of 36 sites | 36 of 36 (max error 1.8e-15) |
Across the two runs, α changes by 0.23 on average (up to 1) and β by 1.85 on average (up to 6.5); which α are exactly
zero changes for 31 edges.
Changed: default solver and multistart (approved for this release)
config.toml now uses:
method = "scipy-slsqp": SciPy SLSQP with Σα = 1 per site, Σβ = 1 per kinase and the bounds as hard
constraints (maxiter 20000).n_starts = 64andjitter_scale = 0.10: 64 seeded starts (start_seed = 20260115; start i uses seed
20260115 + i), the best converged start is kept.
These are the settings validated above. The JAX/JAXopt methods (projected-gradient, lbfgsb, non-negative,
unconstrained, and the compatibility name slsqp, which runs LBFGSB) remain available as
approximate options: they enforce the sum-to-one constraints with a penalty, so the sums hold only approximately
(about 1e-6), and runs may stop at the iteration cap without converging.
Run time: one SLSQP start takes several minutes, so a default run of 64 starts takes about 20 minutes on a
machine with enough cores (starts run in parallel).
Other changes
trust-constris rejected with a clear error. Before, it ran without any sum-to-one constraint (its
constraint object was skipped by the penalty). The penalty methods now refuse any constraint they cannot apply.- Constraint check renamed and corrected (
kinopt.optimality): it checks Σα = 1, Σβ = 1 and the bounds within a
tolerance (1e-10) instead of an exact!= 1, and its outputs are named for what they compute:
constraint_residuals.pngandobserved_range.pngreplaceconstraint_violations.pngandsensitivity.png, and
the log reports one "constraint check". The functionsprint_primal_feasibility_results,
print_sensitivity_and_active_constraints,plot_constraint_violationsandplot_sensitivity_analysisare
replaced bylog_constraint_check,plot_constraint_residualsandplot_observed_range. No KKT conditions or
sensitivities are computed. The module is renamedkinopt.optimality.checks;kinopt.optimality.KKTremains as
a deprecated alias (with aDeprecationWarning) until 0.11. - Output layout: the results workbook stays at the top of
paths.results_dir; per-gene plots go to one folder
per fitted gene, everything else toGeneral/. Before, any file named<word>_…got its own folder, so
kinopt/,multistart/and others were listed as genes in the report. python -m kinopt.fitanalysis(taskkinopt-fitanalysis) runs the fit analysis on an existing results
folder; before, it did nothing. The fit analysis also runs on small problems (t-SNE perplexity capped).- Logger name: KinOpt logs as
kinopt(log fileskinopt_<date>.log), no longer asphoskintime. The unused
PhosKinTime classesPhosKinConfigandload_config_tomlare removed fromconfig_loader. - Current Matplotlib: the exporter uses
matplotlib.colormapsinstead ofmatplotlib.cm.get_cmap, which recent
Matplotlib releases removed (apip install kinoptwith Matplotlib 3.11 failed at the first plot). - Preprocessing writes to one folder:
python -m processing.cleanupwrites its CSV files only to[paths] data_dir(or theout_dirgiven to each function). It no longer writes intoprocessing/and no longer copies
intokinopt/data/andtfopt/data/(PhosKinTime-era locations);move_processed_filesis removed. - Documentation: the background page on mass-spectrometry proteomics (
docs/assets/background/) and its figures
are removed from the repository and the documentation site. - Errors instead of silent fallbacks. A site in
input2without aninput1row, a site listed twice, or a
kinase without anyinput1series now stops the run with aValueError. Before, another series was silently
reused, or the rows were misaligned. - Multistart ranking. Among feasible starts, a converged start comes first, then the lowest objective. Before,
tiny differences in constraint violation could outrank the objective. - No copy into
data/by default. The results workbook is copied intopaths.ode_data_dironly with
--copy_to_ode_data_dir. Before, every run overwrotedata/kinopt_results.xlsx. - Seeded starting values through
[kinopt] start_seed. Before, they were unseeded and runs were not
reproducible. n_startsandjitter_scaleare[kinopt]settings (10 and 0.20 if the keys are absent).kinopt.local.config.constants.parse_args()returns a ninth value (copy_to_ode_data_dir). Code that
unpacks it must take nine values.- On PyPI:
pip install kinoptinstalls thekinoptpackage and thekinopt-localcommand. An installed
KinOpt looks forconfig.tomlabove the working directory (a clone still uses its ownconfig.toml), so run it
from a project folder with aconfig.toml; without one it stops with a clear error. - Removed: the Dockerfile and the
kinopt-evoltask (thekinopt.evolmodule was removed earlier). - Project: documentation corrected to the current code, with an API reference generated from the (rewritten)
docstrings of every module and the site configured inzensical.toml, and a License page (code BSD-3-Clause, documentation
CC BY 4.0;LICENSE,LICENSE-docs.md,THIRD_PARTY.md); a KinOpt logo and wordmark; a changelog generated with
git-cliff. Releases are published by a tag-triggered workflow: GitHub release, archived on Zenodo, and PyPI.
Tests, the import check and the docs build run on every push and pull request (test.yml).
Reproducibility and dependency versions
For exact reproduction of published results use pixi.lock; pip install gives compatible versions. The PyPI package
requires at least the versions this release was validated with (NumPy 2.4.6, SciPy 1.17.1, JAX/jaxlib 0.9.2, JAXopt
0.8.4, Matplotlib 3.10.9, pandas 3.0.3, scikit-learn 1.8.0, statsmodels 0.14.6, seaborn 0.13.2, Plotly 6.6.0,
openpyxl 3.1.5, adjustText 1.3.0, joblib 1.5.3), with upper bounds NumPy < 3, SciPy < 2, Matplotlib < 4 and
JAX/jaxlib < 0.13.
Check on a synthetic case (4 sites, 3 kinases, scipy-slsqp, 4 starts): the Pixi environment (NumPy 2.4.6,
SciPy 1.17.1, JAX 0.9.2, Matplotlib 3.10.9) and a clean pip install (NumPy 2.5.5, SciPy 1.18.1, JAX 0.12.1,
Matplotlib 3.11.2) reach best objectives that differ by 4.0e-14 (relative 1.1e-10). Over the 4 starts, objectives
differ by at most 2.6e-11, α by at most 8.5e-10, β by at most 4.0e-9.
Upgrading
- Re-run KinOpt on your inputs and replace earlier
kinopt_results.xlsxworkbooks; their α and β are affected by
K1. - Expect longer runs with the new defaults. For a quick exploratory run, set
n_startslower or choose an
approximate method inconfig.toml. - If you relied on the copy into
data/, add--copy_to_ode_data_dir.
Known issues
- The prediction is clipped at 0 inside the objective, so a site predicted below zero at every time point gets no
gradient (#4). Kept so that the objective is unchanged. - The
Summarysheet's "SSE" row holds the weighted objective, not a sum of squares
(#5). - SLSQP evaluates the equality constraints slowly; a NumPy evaluation would cut run time
(#6).