forked from lawrennd/gpsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpdisimGetDrosData.m
69 lines (60 loc) · 1.96 KB
/
gpdisimGetDrosData.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
function [y, yvar, gene, times, scale, rawExp, rawVar] = gpdisimGetDrosData(drosexp, genes),
% GPDISIMGETDROSDATA Get Drosophila data as processed by mmgMOS.
% FORMAT
% DESC loads in from the two Excel spread sheets
% (resultsMartino_exprs.xls and resultsMartino_se.xls) the data
% from the Barenco et al paper as processed by mmgMOS.
% RETURN y : the normalised expression levels.
% RETURN yvar : the variance of the normalised expression levels.
% RETURN gene : the gene names and Affymetrix array tags.
% RETURN times : the times of the expression measurements.
% RETURN scale : the scaling factor applied to normalise.
% RETURN rawExp : the raw gene expresion level.
% RETURN rawVar : the raw variance of the gene expression.
%
% SEEALSO : demBarenco1, demBarencoMap1
%
% COPYRIGHT : Neil D. Lawrence, 2006
% COPYRIGHT : Antti Honkela, 2007
% SHEFFIELDML
if iscell(genes),
genes = drosGetGeneinds(drosexp, genes);
end
N = length(genes);
gene = drosexp.genes(genes);
if size(gene, 1) < size(gene, 2),
gene = gene';
end
gene = [gene, gene];
rawExp = zeros(36, N);
rawVar = zeros(36, N);
yFull = zeros(36, N);
yFullVar = zeros(36, N);
rawExp = drosexp.mean(genes, :)';
rawVar = (drosexp.se(genes, :)').^2;
if isfield(drosexp, 'fitmean'),
yFull = drosexp.fitmean(genes, :)';
yFullVar = drosexp.fitvar(genes, :)';
else
for k=1:N,
prof = squeeze(drosexp.pctiles(genes(k), :, :));
for l=1:36,
t = distfit(exp(prof(l, :)), 'normal');
yFull(l, k) = t(1);
yFullVar(l, k) = t(2) .^ 2;
end
end
end
% Rescale so that average standard deviation of curves is 1.
scale = sqrt(var(yFull));
scaleMat = ones(size(yFull, 1), 1)*scale;
yFull = yFull./scaleMat;
yFullVar = yFullVar./(scaleMat.*scaleMat);
y{1} = yFull(1:12, :);
y{2} = yFull(13:24, :);
y{3} = yFull(25:36, :);
yvar{1} = yFullVar(1:12, :);
yvar{2} = yFullVar(13:24, :);
yvar{3} = yFullVar(25:36, :);
times = (1:12)';
%save('./data/barencoData.mat', 'y', 'yvar', 'gene', 'times', 'scale', 'rawVar', 'rawExp');