aboutsummaryrefslogtreecommitdiff
path: root/mer_generator.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-02-06 11:38:44 -0500
committerCalvin Morrison <mutantturkey@gmail.com>2014-02-06 11:38:44 -0500
commit9e992537d7ffd25711efb69c46b5719e7505656d (patch)
tree19781fdb90d62a20e3abaf0b7f290144a00f03cc /mer_generator.c
parentd28e932f6fd033fd85c3ed3324e46c82686b6b90 (diff)
holy hell it works
Diffstat (limited to 'mer_generator.c')
-rw-r--r--mer_generator.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/mer_generator.c b/mer_generator.c
new file mode 100644
index 0000000..a20c56f
--- /dev/null
+++ b/mer_generator.c
@@ -0,0 +1,28 @@
+#include "stdio.h"
+#include "limits.h"
+
+#include "kmer_utils.h"
+
+main() {
+
+ int i = 0;
+ int j = 0;
+ unsigned long out = 0;
+
+ for(j = 1; j < 32; j++) {
+ printf("unsigned long long mer_%d(const char *seq) { return ", j);
+ unsigned long multiply = 1;
+ for(i = j - 1; i >= 0; i--){
+ printf("(seq[%d] * %d) + ", i, multiply);
+ multiply = multiply << 2;
+ }
+ printf(" 0; }\n");
+ }
+
+ printf("int (*return_fn())(const char * )mer_ptr(int kmer) { switch(kmer) {");
+ for(j = 1; j < 32; j++)
+ printf("case %d: return mer_%d;", j, j);
+ printf("}");
+
+
+}