annotate rDiff/src/tools/read_utils/splicingsequence.m @ 0:0f80a5141704

version 0.3 uploaded
author vipints
date Thu, 14 Feb 2013 23:38:36 -0500
parents
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 [SPLICINGEVENTS, SEQUENCE, EXONSEQUENCE, IDENTIFICATIONLENGTH] = splicingsequence(GENE)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2 % This function generates all sequence of all splicesites
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 % SPLICINGEVENTS, a SEQUENCE marking which elements in
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4 % SPLICINGEVENTS are introns and exons and a sequence for each
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5 % transcript which indicates which Exons are in cluded in this transcript
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6 % SEQUENCE contains indices of SPLICINGEVENTS, containing 1, if the position right to the idx in the transcript
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 % are exonic, 0 otherwise
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9 EXONS = GENE.exons;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10 START = GENE.start;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11 STOP = GENE.stop;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 NB_OF_TRANSCR = size(EXONS,2);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
14
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
15 SPLICINGEVENTS = [];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
16 for i = 1:NB_OF_TRANSCR
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
17 SPLICINGEVENTS = [SPLICINGEVENTS, EXONS{i}(:,1)', EXONS{i}(:,2)' ];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
18 end
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
19 SPLICINGEVENTS = SPLICINGEVENTS - START + 1;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
20 SPLICINGEVENTS = unique(SPLICINGEVENTS);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
21
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
22 EXONSEQUENCE = zeros(NB_OF_TRANSCR, length(SPLICINGEVENTS) - 1);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
23
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
24 for i = 1:NB_OF_TRANSCR
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
25 %%% for every exon in transcript i
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
26 for j = 1:size(EXONS{i}, 1)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
27 POS_START = find(SPLICINGEVENTS == EXONS{i}(j,1) - START + 1, 1, 'first');
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
28 POS_STOP = find(SPLICINGEVENTS < EXONS{i}(j,2) - START + 1, 1, 'last');
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
29 %%% set splicing events active in transcript i to 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
30 EXONSEQUENCE(i, POS_START:POS_STOP) = 1;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
31 end
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
32 end
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
33
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
34 %%% merge active splicing events of all transcripts
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
35 SEQUENCE = max(EXONSEQUENCE, [], 1);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
36 IDENTIFICATIONLENGTH = [];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
37