-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/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);
+
+}
+
|