annotate rDiff/src/genes_cell2struct.m @ 1:08d3a6143873

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