summaryrefslogtreecommitdiffstats
path: root/test/entropy/don_anal.m (plain)
blob: 7d0a648c769001b3727f8e104827cd7fddb91c81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
d = fastaread('C:\dondata\FASTA2.fa');
lens = arrayfun(@(x)(numel(x.Sequence)), d);
d(lens < 300) = [];
rexp = '/Human/(\w*)/([\d\w]*)/(.*?)/(\d{4})/';
headers = cell(length(d), 1);
[headers{:}] = deal(d(:).Header);
groups = regexp(headers, rexp, 'tokens', 'once');
cgroups = cat(1,groups{:});
dates = unique(cgroups(:,end));

seqs = cell(length(d), 1);
[seqs{:}] = deal(d(:).Sequence);

ALIGN_CELL = cell(length(dates), 1);
INDS_CELL = cell(length(dates), 1);
PAIRWISE_CELL = cell(length(dates),1);
for i = 1:length(dates)
    display(dates{i})
    tf = strcmp(cgroups(:,end), dates{i});
    if isempty(PAIRWISE_CELL{i})
        pairwise_dists = GenomePairwiseDist(d(tf), dates{i});
        PAIRWISE_CELL{i} = pairwise_dists;
    else
        pairwise_dists = PAIRWISE_CELL{i};
    end
    if isempty(ALIGN_CELL{i}) || isempty(INDS_CELL{i})
        [ALIGN_CELL{i}, INDS_CELL{i}] = GenomeAlignments(d(tf), ...
                                        pairwise_dists);
        save restore_data PAIRWISE_CELL ALIGN_CELL INDS_CELL
    end
end

for i = 1:length(ALIGN_CELL)
    [ALIGN_CELL{i}, ~]= RefineAlignments(ALIGN_CELL{i});
end


ents = CalculateProteinEntropy(d(1), ALIGN_CELL);

dents = cat(1, ents{:});

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.