aboutsummaryrefslogtreecommitdiff
path: root/R/endpoints.R
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2013-04-14 12:42:06 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2013-04-14 12:42:06 +0000
commit6168089ac43664c10ca2dc1281c8648fbf3b35a9 (patch)
tree1ac85698d15ccdf4b70c97fa8b88641c98f236c8 /R/endpoints.R
parent19537674a67c7b52ceb310bd47c0c2c04830ffb8 (diff)
- Update the TODO list, setting some requirements for version 1.0
- Check that initial values specified using parms.ini are actually needed for the model, stop otherwise - List all formation fractions in the same place in the summary, also if they were fitted in the model - Include an FOMC model coupled to two metabolites in the unit tests - Some updates needed because of the above - Update of static documentation including the vignettes - Update of the mkin vignettes in the vignettes directory git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@82 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
Diffstat (limited to 'R/endpoints.R')
-rw-r--r--R/endpoints.R14
1 files changed, 14 insertions, 0 deletions
diff --git a/R/endpoints.R b/R/endpoints.R
index 163dc8d4..c9a6a51f 100644
--- a/R/endpoints.R
+++ b/R/endpoints.R
@@ -11,6 +11,20 @@ endpoints <- function(fit, pseudoDT50 = FALSE) {
ep$SFORB <- vector()
for (obs_var in obs_vars) {
type = names(fit$mkinmod$map[[obs_var]])[1]
+
+ # Get formation fractions if directly fitted, and calculate remaining fraction to sink
+ f_names = grep(paste("f", obs_var, sep = "_"), names(parms.all), value=TRUE)
+ f_values = parms.all[f_names]
+ f_to_sink = 1 - sum(f_values)
+ names(f_to_sink) = ifelse(type == "SFORB",
+ paste(obs_var, "free", "sink", sep = "_"),
+ paste(obs_var, "sink", sep = "_"))
+ for (f_name in f_names) {
+ ep$ff[[sub("f_", "", sub("_to_", "_", f_name))]] = f_values[[f_name]]
+ }
+ ep$ff = append(ep$ff, f_to_sink)
+
+ # Get the rest
if (type == "SFO") {
k_names = grep(paste("k", obs_var, sep="_"), names(parms.all), value=TRUE)
k_tot = sum(parms.all[k_names])

Contact - Imprint