summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--test/entropy/Align2Ref.m24
-rw-r--r--test/entropy/CalculateEntropy.m15
-rw-r--r--test/entropy/CalculateProteinEntropy.m25
-rw-r--r--test/entropy/FastNWalign2.c94
-rw-r--r--test/entropy/GenomeAlignments.m31
-rw-r--r--test/entropy/GenomePairwiseDist.m98
-rw-r--r--test/entropy/RefineAlignments.m276
-rw-r--r--test/entropy/don_anal.m40
-rw-r--r--test/entropy/nwalign_mod.m637
9 files changed, 1240 insertions, 0 deletions
diff --git a/test/entropy/CalculateEntropy.m b/test/entropy/CalculateEntropy.m
new file mode 100644
index 0000000..18bfda5
--- a/dev/null
+++ b/test/entropy/CalculateEntropy.m
@@ -0,0 +1,15 @@
1function OUT_VEC = CalculateEntropy(ARRAY)
2% CalculateEntropy
3% Calculate the Informationational Entropy of each position in a
4% multialignment. In this function I remove all gap characters from
5% each column of the alignment before doing the calculation.
6%
7%
8%
9
10num_array = aa2int(ARRAY);
11bins = histc(num_array, 0:21, 1);
12
13probs=bsxfun(@rdivide, bins(2:end-1,:),sum(bins(2:end-1,:)));
14
15OUT_VEC = -nansum(log(probs).*double(probs~=0).*probs); \ No newline at end of file

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.