summaryrefslogtreecommitdiffstats
Side-by-side diff
-rw-r--r--src/Makefile.am2
-rw-r--r--src/controller/callbacks/reshape.c2
-rw-r--r--src/db/dbconnect.sqc12
-rw-r--r--src/model/data/base.sqc2
-rw-r--r--src/model/state/state.h3
-rw-r--r--src/util/check_error.c6
-rw-r--r--src/util/check_error_db.c13
-rw-r--r--src/util/check_error_db.h9
-rw-r--r--test/distance_sanity_check/gi_227977170_78032581.pngbin0 -> 51161 bytes
-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
18 files changed, 1280 insertions, 9 deletions
diff --git a/test/entropy/FastNWalign2.c b/test/entropy/FastNWalign2.c
new file mode 100644
index 0000000..33b286d
--- a/dev/null
+++ b/test/entropy/FastNWalign2.c
@@ -0,0 +1,94 @@
+#include "mex.h"
+#include "matrix.h"
+
+void simplegap(double scoredMatchMat[],
+const double gap, int n, int m, double output_F[], double output_P[])
+{
+ // Standard Needleman-Wunsch algorithm
+
+ double up, left, diagonal, best, pos;
+
+
+ int i,j;
+
+
+ for(i=0;i<m;i++)
+ {
+ output_F[i]=i*gap;
+ output_P[i]=2;
+ }
+
+
+ for(j=0; j<n; j++) //put initial values in
+ {
+ output_F[j*m]=j*gap;
+ output_P[j*m]=4;
+ }
+ output_P[0]=1;
+
+
+
+ for(j=1;j<n;j++) //cycle through columns
+ {
+ best=output_F[(j)*m];
+
+ for(i=1; i<m; i++) //cycle through the rows
+ {
+ up=best+gap;
+ left=output_F[i+(j-1)*m]+gap;
+ diagonal=output_F[i-1+(j-1)*m]+scoredMatchMat[i-1+(j-1)*m];
+
+ if (up>left)
+ {
+ best=up;
+ pos=2;
+ }
+ else
+ {
+ best=left;
+ pos=4;
+ }
+
+ if (diagonal>=best)
+ {
+ best=diagonal;
+ output_P[i+j*m]=1;
+ }
+ else
+ {
+ output_P[i+j*m]=pos;
+ }
+ output_F[i+j*m]=best;
+ }
+ }
+}
+
+void mexFunction(int nlhs, mxArray *plhs[],
+int nrhs, const mxArray *prhs[])
+{
+
+ double *gap, *output_F, *output_P;
+ double *scoredMatchMat;
+ int n, m;
+ mwSize i;
+
+ //double *F_col, *ptr_col;
+ m=mxGetM(prhs[0]);
+ n=mxGetN(prhs[0]);
+ gap=mxGetPr(prhs[1]);
+
+ plhs[0]=mxCreateDoubleMatrix(m,n,mxREAL);
+ plhs[1]=mxCreateDoubleMatrix(m,n,mxREAL);
+
+ output_F=mxGetPr(plhs[0]);
+ output_P=mxGetPr(plhs[1]);
+
+
+ scoredMatchMat=mxGetPr(prhs[0]);
+ //
+
+
+ simplegap(scoredMatchMat,*gap,n,m,output_F,output_P);
+
+}
+

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.