forked from lawrennd/gpsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpnddisimExtractParam.m
80 lines (64 loc) · 1.75 KB
/
gpnddisimExtractParam.m
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
function [param, names] = gpnddisimExtractParam(model)
% NDDISIMEXTRACTPARAM Extract the parameters of a NDDISIM model.
% FORMAT
% DESC extracts the model parameters from a structure containing
% the information about a Gaussian process for single input motif
% modelling.
% ARG model : the model structure containing the information about
% the model.
% RETURN params : a vector of parameters from the model.
%
% SEEALSO : gpdisimCreate, gpdisimExpandParam, modelExtractParam
%
% COPYRIGHT : Neil D. Lawrence, 2006
%
% COPYRIGHT : Antti Honkela, 2007
%
% COPYRIGHT : Jaakko Peltonen, 2011
% GPSIM
if nargout>1
[param, names] = kernExtractParam(model.kern);
% fprintf(1,'gpdisimExtractParam: parameters from kernels\n');
% param
% names
% model.mu
% length(model.mu)
%for i=1:length(model.mu),
for i=1:model.numGenes,
names{end+1}=['Basal transcription ' num2str(i)];
end
if model.numGenes>0,
if (model.use_disimstartmean==1),
for i=1:model.numGenes,
names{end+1}=['NDDISIM startmean ' num2str(i)];
end;
end;
end;
names{end+1}=['NDSIM mean ' num2str(i)];
else
param = kernExtractParam(model.kern);
end
%length(param)
%model.numGenes
%length(model.B)
if model.numGenes>0,
for k=1:model.numGenes,
param = [param doTransform(model.B(k), 'xtoa',model.bTransform(k))];
end;
end;
%length(param)
if model.numGenes>0,
if (model.use_disimstartmean==1),
for i=1:model.numGenes,
param = [param doTransform(model.disimStartMean(k),'xtoa',model.disimStartMeanTransform(k))];
end;
end;
end;
param = [param doTransform(model.simMean,'xtoa',model.simMeanTransform)];
if isfield(model, 'fix')
%model.fix
for i = 1:length(model.fix)
param(model.fix(i).index) = model.fix(i).value;
end
end
param = real(param);