comparison rDiff/src/genes_cell2struct.m @ 0:0f80a5141704

version 0.3 uploaded
author vipints
date Thu, 14 Feb 2013 23:38:36 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0f80a5141704
1 function genes_cell2struct(anno_fname)
2 % GENES_CELL2STRUCT Converts genes stored as a cell to struct.
3 %
4 % genes_cell2struct(anno_fname)
5 %
6 % -- input --
7 % anno_fname: name of file where genes as cell are stored
8 %
9 % -- output --
10 % genes as a struct
11 %
12 %
13 % This program is free software; you can redistribute it and/or modify
14 % it under the terms of the GNU General Public License as published by
15 % the Free Software Foundation; either version 3 of the License, or
16 % (at your option) any later version.
17 %
18 % Written (W) 2009-2011 Regina Bohnert, Gunnar Raetsch
19 % Copyright (C) 2009-2011 Max Planck Society
20 %
21
22 load(anno_fname, 'genes');
23 if iscell(genes)
24 genes_cell = genes;
25 clear genes;
26 for g = 1:length(genes_cell),
27 gene = genes_cell{g};
28 for e = 1:length(gene.exons)
29 gene.exons{e} = double(gene.exons{e});
30 end
31 gene.exons = reshape(gene.exons, 1, length(gene.exons));
32 gene.id = double(gene.id);
33 gene.start = double(gene.start);
34 gene.stop = double(gene.stop);
35 genes(g) = gene;
36 end
37 save(anno_fname, 'genes');
38 end