| Title: | Retrieve Reaction Rate Dynamics from Metabolite Concentration Time Courses |
|---|---|
| Description: | Reaction rate dynamics can be retrieved from metabolite concentration time courses. User has to provide corresponding stoichiometric matrix but not a regulation model (Michaelis-Menten or similar). Instead of solving an ordinary differential equation (ODE) system describing the evolution of concentrations, we use B-splines to catch the concentration and rate dynamics then solve a least square problem on their coefficients with non-negativity (and optionally monotonicity) constraints. Constraints can be also set on initial values of concentration. The package 'dynafluxr' can be used as a library but also as an application with command line interface dynafluxr::cli("-h") or graphical user interface dynafluxr::gui(). |
| Authors: | Serguei Sokol [aut, cre] |
| Maintainer: | Serguei Sokol <[email protected]> |
| License: | GPL-2 |
| Version: | 1.0.1 |
| Built: | 2026-06-06 08:53:29 UTC |
| Source: | https://github.com/cran/dynafluxr |
Function to be called from shell command line
cli(args = commandArgs(trailingOnly = TRUE))cli(args = commandArgs(trailingOnly = TRUE))
args |
Character vector, command line parameters (default
|
run cli("-h") in R or Rscript -e 'dynafluxr::cli()' -h
in shell to get a help page with available option description
a list resulting from fdyn() call
fdyn
# from shell # $ Rscript --vanilla -e 'dynafluxr::cli()' -m data_kinetics.tsv -s glycolysis.txt # from R session ddir=system.file("dataglyco", package="dynafluxr") meas=file.path(ddir, "data.tsv") sto=file.path(ddir, "network.txt") res=cli(c("-m", meas, "-s", sto, "--skip", "24", "-o", "")) tp=res$tp np=length(tp) tpp=res$tpp # plot species matplot(tpp, res$msp(tpp), type="l") matpoints(tp, res$mf[,-1], pch=".", cex=0.5) legend("topright", legend=colnames(bsppar(res$msp)$qw), lty=1:5, col=1:6, cex=0.75) # plot rates dev.new() matplot(tpp, res$vsp(tpp), type="l") # plot residuals dev.new() matplot(tpp, res$risp(tpp), type="l") legend("topright", legend=colnames(bsppar(res$rsp)$qw), lty=1:5, col=1:6, cex=0.75)# from shell # $ Rscript --vanilla -e 'dynafluxr::cli()' -m data_kinetics.tsv -s glycolysis.txt # from R session ddir=system.file("dataglyco", package="dynafluxr") meas=file.path(ddir, "data.tsv") sto=file.path(ddir, "network.txt") res=cli(c("-m", meas, "-s", sto, "--skip", "24", "-o", "")) tp=res$tp np=length(tp) tpp=res$tpp # plot species matplot(tpp, res$msp(tpp), type="l") matpoints(tp, res$mf[,-1], pch=".", cex=0.5) legend("topright", legend=colnames(bsppar(res$msp)$qw), lty=1:5, col=1:6, cex=0.75) # plot rates dev.new() matplot(tpp, res$vsp(tpp), type="l") # plot residuals dev.new() matplot(tpp, res$risp(tpp), type="l") legend("topright", legend=colnames(bsppar(res$rsp)$qw), lty=1:5, col=1:6, cex=0.75)
Retrieve flux dynamics from metabolic kinetics
fdyn( mf, stofull, nsp = 4L, nki = 5L, lieq = NULL, monotone = 0, dls = FALSE, atomlen = NULL, npi = 300L, wsd = FALSE, nmsf = character(0L), sderr = NULL, tol = 1e-10, regular_grid = TRUE )fdyn( mf, stofull, nsp = 4L, nki = 5L, lieq = NULL, monotone = 0, dls = FALSE, atomlen = NULL, npi = 300L, wsd = FALSE, nmsf = character(0L), sderr = NULL, tol = 1e-10, regular_grid = TRUE )
mf |
Data-frame or matrix, specie kinetic measurements. Columns must be named with specie names and 'Time'. |
stofull |
Full stoichiometric matrix, |
nsp |
Integer, polynomial order of B-spline to use for species (default 4) |
nki |
Integer, number of internal knots for B-splines (default 5) |
lieq |
List, equality constraints on species (default NULL, i.e. no equality constraint) |
monotone |
Numeric scalar or vector, 1=species are monotonically increasing; -1=monotonically decreasing; 0=no constraint. If vector, each value constraints (or not) a corresponding data column in mf ('Time' column is excluded from counting) (default 0, i.e. no monotonicity constraint) |
dls |
Logical scalar, if TRUE, indicates that differential least squares should be resolved instead of integral least squares. (default FALSE, i.e. ILS will be used) |
atomlen |
Numerical named vector, indicates what is label length
of a given specie used a vector item name. If provided, results
will contain |
npi |
Integer scalar, indicates a number of plot intervals to produce smooth plots. (default 300) |
wsd |
Logical scalar, if TRUE, indicates that differential least squares should be resolved with residuals weighted by a factor of covariance matrix. (default FALSE, i.e. no weighting is used) |
nmsf |
Character vector, list of species for which scaling factor maust be estimated for –dls. |
sderr |
Numeric vector, use this SD of measured metabolites instead of automatically estimated. The name of each vector component is metabolite name, tha value is SD vale, e.g. |
tol |
Double scalar, tolerance for detecting singular matrices and solving linear systems |
regular_grid |
Logical scalar, use regular knot grid (default: TRUE) |
Each item in lieq corresponds to a specie and is a
2 column matrix (Time, Value). Each
row of this matrix indicates what 'Value' must take corresponding
specie at what 'Time'. Typically, it can be used to impose
starting values at Time=0 for some species.
All specie fits are constraint to have values >= 0.
List with following components:
specie data frame used for fitting
vector of time points for used measurements
vector of time points for plot (fine time resolution)
stoichiometric matrix used for fitting
stoichiometric matrix before a possible NA elimination
pseudo-inverse of sto
measured specie spline function
estimated rates spline function
estimated total flux (S*v) spline function
first derivative of measured spline function
integrated specie spline function
atom balance over msp spline function
atom balance over isp spline function
flux spline function
measured specie first derivative spline function
residual dM/dt - S%*%v spline function
integral residual M - \u222bS%*%v dt spline function
matrix of SD values for flux B-spline coefficients, of size (ncoef x nrate)
data-frame with chi2-test results
named scale factor vector
number of internal knots used for estimation of var_ref
Launch graphical user interface in web browser
gui()gui()
no returned value
Translate plain text file with reactions to stoichiometric matrix
txt2sto(fn)txt2sto(fn)
fn |
String, file name |
Matrix of size n_metab x n_reac