aboutsummaryrefslogtreecommitdiff
path: root/kmer.py
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-02-02 00:41:09 -0500
committerCalvin Morrison <mutantturkey@gmail.com>2014-02-02 00:41:09 -0500
commit1e12e8802e1a2ad5f02c2d47ebea6226d4f871d2 (patch)
tree36288f14bf86967322f6b2e39e192dc4adf7c809 /kmer.py
parent18580d2bd0fc240d337b285e6e805104867e891a (diff)
nonworking commit of interface
Diffstat (limited to 'kmer.py')
-rw-r--r--kmer.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/kmer.py b/kmer.py
new file mode 100644
index 0000000..9326aab
--- /dev/null
+++ b/kmer.py
@@ -0,0 +1,32 @@
+'''
+
+ The kmer module provides an interface between the C-library
+ for quikr kmer counting in Python
+
+'''
+__author__ = "Calvin Morrison"
+__copyright__ = "Copyright 2013, EESI Laboratory"
+__credits__ = ["Calvin Morrison"]
+__license__ = "GPL"
+__version__ = "0.1.0"
+__maintainer__ = "Calvin Morrison"
+__email__ = "mutantturkey@gmail.com"
+__status__ = "development"
+
+import numpy as np
+import ctypes as c
+try:
+ libkmer = c.CDLL("libkmer.so");
+except:
+ raise Exception("Error: could not load libkmer.so")
+
+def load_kmer_counts_from_file(fh, kmer):
+ '''
+ '''
+ width = (kmer ** 4) + 1
+ libkmer.get_kmer_counts_from_file.restype = c.POINTER(c.c_ulonglong * width )
+
+ counts = libkmer.get_kmer_counts_from_filename(fh, kmer);
+
+ return counts
+