-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjldtomat.jl
70 lines (59 loc) · 1.42 KB
/
jldtomat.jl
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
using JLD
using MAT
function expectICD_to_mat(names,matfilename)
display("here0")
f=open(names)
display("here1")
matf=matopen(matfilename,"w")
display("here2")
for ln in eachline(f)
display("here3")
d=load(ln[1:length(ln)-1])
keys(d)
display("here4")
varname=ln[1:length(ln)-11];
varname=replace(varname,'-','_')
varname=varname*"ICD"
ICD=d["inter_chr_expect"];
write(matf,varname,ICD);
end
close(f)
close(matf)
end
function expect_to_mat(names,matfilename)
display("here0")
f=open(names)
display("here1")
matf=matopen(matfilename,"w")
display("here2")
for ln in eachline(f)
d=load(ln[1:length(ln)-1]);
varname=ln[1:length(ln)-5];
varname=replace(varname,'-','_')
expect_d=d["expect_d"];
write(matf,varname,expect_d);
end
close(f)
close(matf)
end
function GPC_to_mat(names,matfilename)
display("here0")
f=open(names)
display("here1")
matf=matopen(matfilename,"w")
display("here2")
for ln in eachline(f)
display("here3")
d=load(ln[1:leng);
display("here4")
varname=ln[1:length(ln)-5];
varname=replace(varname,'-','_')
GPC=d["GPC"];
write(matf,varname,GPC);
end
close(f)
close(matf)
end
# function dict_to_cellarr(dict) (unnecessary: just write loops w/key
#need to check if MAT can write multiple variables to file at one time
#need to check that varname is what I'd like it to be