-rw-r--r-- | test/entropy/Align2Ref.m | 24 | ||||
-rw-r--r-- | test/entropy/CalculateEntropy.m | 15 | ||||
-rw-r--r-- | test/entropy/CalculateProteinEntropy.m | 25 | ||||
-rw-r--r-- | test/entropy/FastNWalign2.c | 94 | ||||
-rw-r--r-- | test/entropy/GenomeAlignments.m | 31 | ||||
-rw-r--r-- | test/entropy/GenomePairwiseDist.m | 98 | ||||
-rw-r--r-- | test/entropy/RefineAlignments.m | 276 | ||||
-rw-r--r-- | test/entropy/don_anal.m | 40 | ||||
-rw-r--r-- | test/entropy/nwalign_mod.m | 637 |
9 files changed, 1240 insertions, 0 deletions
diff --git a/test/entropy/GenomeAlignments.m b/test/entropy/GenomeAlignments.m new file mode 100644 index 0000000..be56570 --- a/dev/null +++ b/test/entropy/GenomeAlignments.m | |||
@@ -0,0 +1,31 @@ | |||
1 | function [ALIGN inds] = GenomeAlignments(IN_GENOMES, DIST_MAT) | ||
2 | % GenomeAlignments | ||
3 | % This will align all of the protein segments in the genome structure | ||
4 | % and return a cell-array. Each cell is the alignment of one | ||
5 | % protein. If the protein is missing then the distance is NaN. | ||
6 | % | ||
7 | |||
8 | [tree inds] = MakeTree(DIST_MAT); | ||
9 | ALIGN = malign(tree, inds); | ||
10 | |||
11 | function align=malign(tree, inds) | ||
12 | seqs = arrayfun(@(x)(x.Sequence), IN_GENOMES(inds), 'uniformoutput', false); | ||
13 | align = multialign(seqs, tree); | ||
14 | end | ||
15 | |||
16 | |||
17 | |||
18 | function [tree_obj inds]=MakeTree(dist_mat) | ||
19 | % MakeTree | ||
20 | % Takes a distance matrix and returns a tree object and the indicies | ||
21 | % to the rows that are in the tree. | ||
22 | % | ||
23 | |||
24 | inds = find(~all(isnan(dist_mat)|isinf(dist_mat)|dist_mat==0)); | ||
25 | dvec = squareform(dist_mat(inds, inds)); | ||
26 | dvec(dvec <= 0) = rand(nnz(dvec <= 0),1)*min(dvec(dvec>0)); | ||
27 | tree_obj = seqlinkage(dvec); | ||
28 | |||
29 | end | ||
30 | |||
31 | end \ No newline at end of file | ||