/
issues.Rmd
86 lines (66 loc) · 1.75 KB
/
issues.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
title: "Issues"
author: "Jonas Förster & Jürgen Pahle"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Issues}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 8,
fig.asp = 10/16,
out.width = "100%",
warning = FALSE,
message = FALSE
)
set.seed(1)
```
# Initial Setup
```{r setup}
library(CoRC)
loadExamples(1)
```
# Quicklist
Todo:
* Add more COPASI tasks
* (Internal) Code marked with 'TODO' for minor problems
* Consider only ever using setcompileflag instead of compiling
* getListOfPossibleFunctions only returns bare pointer
Issues:
* getwd() and copasi$getReferenceDirectory() are not in sync
* some S3 classes should have reconstruct functions (hadley/sloop)
# Saving .cps loses experimental data
I commonly want to save a .cps to a tmp folder but when I do that experimental data paths will fail.
```{r}
# Load example which has experimental data.
datamodel <- loadExamples(4)[[1]]
fitproblem <- as(datamodel$getTask("Parameter Estimation")$getProblem(), "_p_CFitProblem")
filenames <- fitproblem$getExperimentSet()$getFileNames()
```
The filenames are in the correct folder.
```{r}
filenames
file.exists(filenames)
```
Now I will save the model into a tmp folder.
```{r}
file <- tempfile(fileext = ".cps")
saveModel(file)
unloadModel()
datamodel <- loadModel(file)
fitproblem <- as(datamodel$getTask("Parameter Estimation")$getProblem(), "_p_CFitProblem")
filenames <- fitproblem$getExperimentSet()$getFileNames()
```
The filenames are now supposedly in the folder where the .cps was saved but there they don't exist.
```{r}
filenames
file.exists(filenames)
```
```{r}
unloadModel()
invisible(file.remove(file))
```