-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsaveSynthetic.R
More file actions
52 lines (38 loc) · 1.38 KB
/
saveSynthetic.R
File metadata and controls
52 lines (38 loc) · 1.38 KB
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
saveSolution <- function(xinit, bm, setNumber){
size = length(xinit)
solutionList = list(xinit, bm)
names(solutionList) = list(paste("xinit", setNumber, "size", size, sep=""), paste("bm", setNumber, "size", size, sep=""))
solutionList
save(solutionList, file=paste("size", size, "Synth", setNumber, "Solution", ".RData", sep=""))
}
saveSynthData <- function(syntheticDataSet, setNumber){
synth = syntheticDataSet
size = length(synth[,1])
synth = list(synth)
names(synth) = paste("Synthetic Network", setNumber, "Size", size)
labels(synth)
save(synth, file=paste("size", size, "Synth", setNumber, "Data", ".RData", sep=""))
}
openSynthData <- function(file){
load(file)
print(labels(synth))
return(synth[[1]])
}
openSolution <- function(file){
load(file)
return(solutionList)
}
# The function probeData prints information about the contents of a data set containing
# a regulatory network and its initial starting conditions, or a data set of synthetic
# gene expression values.
probeData <- function(file){
load(file)
# WARNING: BUGGY function
tryCatch(labels(synth), warning = function(e) labels(solutionList))
# try synthetic data set, if not a synthetic data set try a solutionlist.
}
saveExtract <- function(extract, setNumber){
size = length(extract[,1])
trajectory = extract
save(trajectory, file=paste("size", size, "Traj", setNumber, ".RData", sep=""))
}