-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/Align2Ref.m b/test/entropy/Align2Ref.m new file mode 100644 index 0000000..3021d4a --- a/dev/null +++ b/test/entropy/Align2Ref.m | |||
@@ -0,0 +1,24 @@ | |||
1 | function NEW_INDS = Align2Ref(REF_SEQ, ALIGN, ALIGN_INDS, ALPHA) | ||
2 | % Align2Ref | ||
3 | % Uses a profile alignment to change a set of indicices in the | ||
4 | % "alignment space" to the "reference space". | ||
5 | % | ||
6 | % | ||
7 | % NEW_INDS = Align2Ref(REF_SEQ, ALIGN, ALIGN_INDS) | ||
8 | % | ||
9 | |||
10 | if nargin == 3 | ||
11 | ALPHA = 'aa'; | ||
12 | end | ||
13 | |||
14 | ref_prof = seqprofile(REF_SEQ, 'alphabet', ALPHA); | ||
15 | align_prof = seqprofile(ALIGN, 'alphabet', ALPHA); | ||
16 | |||
17 | [~, ind1, ind2] = profalign(ref_prof, align_prof); | ||
18 | |||
19 | ninds = ind2(ALIGN_INDS); | ||
20 | |||
21 | mask = sum(bsxfun(@le, ind1(:)', ninds(:)),2); | ||
22 | mask(mask == 0) = 1; | ||
23 | |||
24 | NEW_INDS = reshape(ind1(mask), size(ALIGN_INDS)); \ No newline at end of file | ||