Mercurial > repos > vipints > deseq_hts
annotate deseq-hts_2.0/src/genes_cell2struct.m @ 11:cec4b4fb30be draft default tip
DEXSeq version 1.6 added
author | vipints <vipin@cbio.mskcc.org> |
---|---|
date | Tue, 08 Oct 2013 08:22:45 -0400 |
parents | 2fe512c7bfdf |
children |
rev | line source |
---|---|
10
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
1 function genes_cell2struct(anno_fname) |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
2 % GENES_CELL2STRUCT Converts genes stored as a cell to struct. |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
3 % |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
4 % genes_cell2struct(anno_fname) |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
5 % |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
6 % -- input -- |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
7 % anno_fname: name of file where genes as cell are stored |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
8 % |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
9 % -- output -- |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
10 % genes as a struct |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
11 |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
12 load(anno_fname, 'genes'); |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
13 if iscell(genes) |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
14 genes_cell = genes; |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
15 clear genes; |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
16 for g = 1:length(genes_cell), |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
17 gene = genes_cell{g}; |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
18 for e = 1:length(gene.exons) |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
19 gene.exons{e} = double(gene.exons{e}); |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
20 end |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
21 gene.exons = reshape(gene.exons, 1, length(gene.exons)); |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
22 gene.id = double(gene.id); |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
23 gene.start = double(gene.start); |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
24 gene.stop = double(gene.stop); |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
25 genes(g) = gene; |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
26 end |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
27 save(anno_fname, 'genes'); |
2fe512c7bfdf
DESeq2 version 1.0.19 added to the repo
vipints <vipin@cbio.mskcc.org>
parents:
diff
changeset
|
28 end |