-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/controller/callbacks/reshape.c | 2 | ||||
-rw-r--r-- | src/db/dbconnect.sqc | 12 | ||||
-rw-r--r-- | src/model/data/base.sqc | 2 | ||||
-rw-r--r-- | src/model/state/state.h | 3 | ||||
-rw-r--r-- | src/util/check_error.c | 6 | ||||
-rw-r--r-- | src/util/check_error_db.c | 13 | ||||
-rw-r--r-- | src/util/check_error_db.h | 9 | ||||
-rw-r--r-- | test/distance_sanity_check/gi_227977170_78032581.png | bin | 0 -> 51161 bytes | |||
-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 |
18 files changed, 1280 insertions, 9 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 @@ +function [ALIGN inds] = GenomeAlignments(IN_GENOMES, DIST_MAT)
+% GenomeAlignments
+% This will align all of the protein segments in the genome structure
+% and return a cell-array. Each cell is the alignment of one
+% protein. If the protein is missing then the distance is NaN.
+%
+
+[tree inds] = MakeTree(DIST_MAT);
+ALIGN = malign(tree, inds);
+
+ function align=malign(tree, inds)
+ seqs = arrayfun(@(x)(x.Sequence), IN_GENOMES(inds), 'uniformoutput', false);
+ align = multialign(seqs, tree);
+ end
+
+
+
+ function [tree_obj inds]=MakeTree(dist_mat)
+ % MakeTree
+ % Takes a distance matrix and returns a tree object and the indicies
+ % to the rows that are in the tree.
+ %
+
+ inds = find(~all(isnan(dist_mat)|isinf(dist_mat)|dist_mat==0));
+ dvec = squareform(dist_mat(inds, inds));
+ dvec(dvec <= 0) = rand(nnz(dvec <= 0),1)*min(dvec(dvec>0));
+ tree_obj = seqlinkage(dvec);
+
+ end
+
+end
\ No newline at end of file |