Mercurial > repos > vipints > deseq_hts
comparison deseq-hts_1.0/src/genes_cell2struct.m @ 0:94a108763d9e draft
deseq-hts version 1.0 wraps the DESeq 1.6.0
author | vipints |
---|---|
date | Wed, 09 May 2012 20:43:47 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:94a108763d9e |
---|---|
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 load(anno_fname, 'genes'); | |
13 if iscell(genes) | |
14 genes_cell = genes; | |
15 clear genes; | |
16 for g = 1:length(genes_cell), | |
17 gene = genes_cell{g}; | |
18 for e = 1:length(gene.exons) | |
19 gene.exons{e} = double(gene.exons{e}); | |
20 end | |
21 gene.exons = reshape(gene.exons, 1, length(gene.exons)); | |
22 gene.id = double(gene.id); | |
23 gene.start = double(gene.start); | |
24 gene.stop = double(gene.stop); | |
25 genes(g) = gene; | |
26 end | |
27 save(anno_fname, 'genes'); | |
28 end |